diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index dfc623ce55..04afc28ff9 100755 --- a/source/graphics/GameView.cpp +++ b/source/graphics/GameView.cpp @@ -57,8 +57,8 @@ CGameView::CGameView(CGame *pGame): m_ViewZoomSensitivity(256.0f), m_ViewZoomSmoothness(0.02f), m_ViewSnapSmoothness(0.02f), - m_CameraPivot(), m_CameraDelta(), + m_CameraPivot(), m_ZoomDelta(0) { SViewPort vp; @@ -626,12 +626,12 @@ Just commented out to make it more obvious it's not in use. if (g_mouse_y <= 3) m_Camera.m_Orientation.Translate(Up*-1); - /* - janwas: grr, plotted the zoom vector on paper twice, but it appears - to be completely wrong. sticking with the FOV hack for now. - if anyone sees what's wrong, or knows how to correctly implement zoom, - please put this code out of its misery :) - *//* + + // janwas: grr, plotted the zoom vector on paper twice, but it appears + // to be completely wrong. sticking with the FOV hack for now. + // if anyone sees what's wrong, or knows how to correctly implement zoom, + // please put this code out of its misery :) + // RC - added ScEd style zoom in and out (actually moving camera, rather than fudging fov) float dir=0; diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index e29984f77d..26b8f792c4 100755 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -127,7 +127,7 @@ int CMapReader::UnpackTerrain() // unpack map size unpacker.UnpackRaw(&m_MapSize, sizeof(m_MapSize)); - // unpack heightmap [600µs] + // unpack heightmap [600s] u32 verticesPerSide = m_MapSize*PATCH_SIZE+1; m_Heightmap.resize(SQR(verticesPerSide)); unpacker.UnpackRaw(&m_Heightmap[0], SQR(verticesPerSide)*sizeof(u16)); @@ -178,8 +178,8 @@ int CMapReader::ApplyData() STileDesc* tileptr = &m_Tiles[0]; for (u32 j=0; jGetPatch(i,j)->m_MiniPatches[m][k]; mp.Tex1 = m_TerrainTextures[tileptr->m_Tex1Index]; diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index bc670fd4ee..6adc0b5f6c 100755 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -79,8 +79,8 @@ void CMapWriter::EnumTerrainTextures(CTerrain *pTerrain, u32 mapsize=pTerrain->GetPatchesPerSide(); for (u32 j=0;jGetPatch(i,j)->m_MiniPatches[m][k]; u16 index=u16(GetHandleIndex(mp.Tex1,handles)); if (index==0xffff) { diff --git a/source/graphics/MaterialManager.cpp b/source/graphics/MaterialManager.cpp index 7703516fdd..625a5129dc 100755 --- a/source/graphics/MaterialManager.cpp +++ b/source/graphics/MaterialManager.cpp @@ -90,6 +90,7 @@ static bool ParseUsage(CStr temp) return false; } +#if 0 // unused static GLenum ParseAlphaFunc(CStr temp) { temp = temp.LCase().Trim(PS_TRIM_BOTH); @@ -147,6 +148,7 @@ static GLenum ParseBlendFunc(CStr temp) return GL_NONE; } +#endif CMaterialManager::CMaterialManager() { @@ -190,7 +192,7 @@ CMaterial &CMaterialManager::LoadMaterial(const char *file) AT(diffuse); AT(ambient); AT(specular); - AT(emissive); + //AT(emissive); AT(specularpower); EL(alpha); diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index f85880a272..e1cd6007f1 100755 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -27,7 +27,7 @@ // Constructor CModel::CModel() : m_Flags(0), m_Anim(0), m_AnimTime(0), - m_BoneMatrices(0), m_InvBoneMatrices(0), m_BoneMatricesValid(false), + m_BoneMatricesValid(false), m_BoneMatrices(0), m_InvBoneMatrices(0), m_ShadingColor(1,1,1,1) { } diff --git a/source/graphics/ModelDef.cpp b/source/graphics/ModelDef.cpp index 4ceca16358..67bce614c3 100755 --- a/source/graphics/ModelDef.cpp +++ b/source/graphics/ModelDef.cpp @@ -15,7 +15,7 @@ /////////////////////////////////////////////////////////////////////////////// // CModelDef Constructor CModelDef::CModelDef() - : m_pVertices(0), m_NumVertices(0), m_pFaces(0), m_NumFaces(0), m_Bones(0), m_NumBones(0), + : m_NumVertices(0), m_pVertices(0), m_NumFaces(0), m_pFaces(0), m_NumBones(0), m_Bones(0), m_NumPropPoints(0), m_PropPoints(0), m_RenderData(0) { } diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp index fa949c8e6d..8cbafbf17c 100644 --- a/source/graphics/ObjectBase.cpp +++ b/source/graphics/ObjectBase.cpp @@ -34,7 +34,7 @@ bool CObjectBase::Load(const char* filename) #define EL(x) int el_##x = XeroFile.getElementID(#x) #define AT(x) int at_##x = XeroFile.getAttributeID(#x) EL(actor); - EL(castshadow); + //EL(castshadow); EL(material); EL(group); EL(variant); diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp index 76805d1542..69309f3d98 100755 --- a/source/graphics/ObjectEntry.cpp +++ b/source/graphics/ObjectEntry.cpp @@ -22,8 +22,8 @@ #define LOG_CATEGORY "graphics" CObjectEntry::CObjectEntry(int type, CObjectBase* base) -: m_Model(NULL), m_Type(type), m_Base(base), m_Color(1.0f, 1.0f, 1.0f, 1.0f), - m_ProjectileModel(NULL), m_AmmunitionPoint(NULL), m_AmmunitionModel(NULL) +: m_Base(base), m_Color(1.0f, 1.0f, 1.0f, 1.0f), + m_ProjectileModel(NULL), m_AmmunitionModel(NULL), m_AmmunitionPoint(NULL), m_Model(NULL), m_Type(type) { } diff --git a/source/graphics/ObjectManager.cpp b/source/graphics/ObjectManager.cpp index 8cf872ace6..9f15f68c77 100755 --- a/source/graphics/ObjectManager.cpp +++ b/source/graphics/ObjectManager.cpp @@ -194,7 +194,7 @@ void CObjectManager::GetAllObjectNames(std::vector& names) struct CObjectThing_Entity : public CObjectThing { - CObjectThing_Entity(CBaseEntity* b) : base(b), obj(g_ObjMan.FindObject((CStr)b->m_actorName)), ent(NULL) {} + CObjectThing_Entity(CBaseEntity* b) : base(b), ent(NULL), obj(g_ObjMan.FindObject((CStr)b->m_actorName)) {} ~CObjectThing_Entity() {} CBaseEntity* base; CEntity* ent; diff --git a/source/graphics/SkeletonAnimDef.cpp b/source/graphics/SkeletonAnimDef.cpp index f4da92a155..b24359a82b 100755 --- a/source/graphics/SkeletonAnimDef.cpp +++ b/source/graphics/SkeletonAnimDef.cpp @@ -15,7 +15,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// // CSkeletonAnimDef constructor -CSkeletonAnimDef::CSkeletonAnimDef() : m_Keys(0), m_NumKeys(0), m_NumFrames(0), m_FrameTime(0) +CSkeletonAnimDef::CSkeletonAnimDef() : m_FrameTime(0), m_NumKeys(0), m_NumFrames(0), m_Keys(0) { } diff --git a/source/graphics/Terrain.cpp b/source/graphics/Terrain.cpp index b08775fc30..b76098cfb2 100755 --- a/source/graphics/Terrain.cpp +++ b/source/graphics/Terrain.cpp @@ -85,8 +85,13 @@ void CTerrain::CalcPosition(u32 i,u32 j,CVector3D& pos) // CalcFromPosition: calculate the vertex underneath the world space position void CTerrain::CalcFromPosition(CVector3D& pos, u32& i, u32& j) { - i = pos.X / CELL_SIZE; - j = pos.Z / CELL_SIZE; + float x = pos.X / CELL_SIZE; + float z = pos.Z / CELL_SIZE; + + debug_assert(x >= 0 && z >= 0); + + i = (u32)x; + j = (u32)z; } diff --git a/source/graphics/UnitManager.cpp b/source/graphics/UnitManager.cpp index d0e343385f..2c29fb31e2 100755 --- a/source/graphics/UnitManager.cpp +++ b/source/graphics/UnitManager.cpp @@ -122,4 +122,4 @@ CUnit* CUnitManager::CreateUnit(CStr& actorName, CEntity* entity) CUnit* unit = new CUnit(obj, obj->m_Model->Clone(), entity); AddUnit(unit); return unit; -} \ No newline at end of file +} diff --git a/source/gui/GUItext.h b/source/gui/GUItext.h index 6fb34f4945..bab0ac8d77 100755 --- a/source/gui/GUItext.h +++ b/source/gui/GUItext.h @@ -78,8 +78,9 @@ struct SGUIText struct STextCall { STextCall() : + m_UseCustomColor(false), m_Bold(false), m_Italic(false), m_Underlined(false), - m_UseCustomColor(false), m_pSpriteCall(NULL) {} + m_pSpriteCall(NULL) {} /** * Position diff --git a/source/lib/byte_order.cpp b/source/lib/byte_order.cpp index aefba257fa..aa4ba21e25 100644 --- a/source/lib/byte_order.cpp +++ b/source/lib/byte_order.cpp @@ -64,4 +64,4 @@ u64 read_be64(const void* p) #else return SDL_Swap64(*(u64*)p); #endif -} \ No newline at end of file +} diff --git a/source/lib/debug.h b/source/lib/debug.h index 92f0df6ff2..ff7489d5b9 100644 --- a/source/lib/debug.h +++ b/source/lib/debug.h @@ -119,6 +119,9 @@ STMT(\ case ER_SUPPRESS:\ suppress__ = 0xAA;\ break;\ + case ER_CONTINUE:\ + break;\ + default:\ case ER_BREAK:\ debug_break();\ break;\ @@ -219,7 +222,7 @@ const size_t DBG_FILE_LEN = 100; // retrieved and stored. // sym_name and file must hold at least the number of chars above; // file is the base name only, not path (see rationale in wdbg_sym). -// the PDB implementation is rather slow (~500µs). +// the PDB implementation is rather slow (~500s). extern int debug_resolve_symbol(void* ptr_of_interest, char* sym_name, char* file, int* line); // write a complete stack trace (including values of local variables) into diff --git a/source/lib/dyn_array.cpp b/source/lib/dyn_array.cpp index 16af03d16e..5134307ba0 100644 --- a/source/lib/dyn_array.cpp +++ b/source/lib/dyn_array.cpp @@ -246,4 +246,4 @@ static void self_test() RUN_SELF_TEST; } // namespace test -#endif // #if SELF_TEST_ENABLED \ No newline at end of file +#endif // #if SELF_TEST_ENABLED diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index 82599c8b3b..f626e8e710 100755 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.cpp @@ -476,4 +476,4 @@ static void CALL_CONV emulate_glCompressedTexImage2D( glTexImage2D(target_, level_, uc_int_fmt, w, h, 0, uc_fmt, GL_UNSIGNED_BYTE, uc_data); (void)tex_free(&t); -} \ No newline at end of file +} diff --git a/source/lib/res/graphics/ogl_tex.cpp b/source/lib/res/graphics/ogl_tex.cpp index 0fa6da3c65..8f9d228666 100755 --- a/source/lib/res/graphics/ogl_tex.cpp +++ b/source/lib/res/graphics/ogl_tex.cpp @@ -956,4 +956,4 @@ int ogl_tex_transform(Handle ht, uint transforms) CHECK_OGL_TEX(ot); int ret = tex_transform(&ot->t, transforms); return ret; -} \ No newline at end of file +} diff --git a/source/lib/res/graphics/tex.cpp b/source/lib/res/graphics/tex.cpp index d2f670d42a..e5f88633a4 100755 --- a/source/lib/res/graphics/tex.cpp +++ b/source/lib/res/graphics/tex.cpp @@ -280,7 +280,7 @@ int tex_codec_register(const TexCodecVTbl* c) { debug_assert(c != 0 && "tex_codec_register(0) - why?"); - for(int i = 0; i < MAX_CODECS; i++) + for(uint i = 0; i < MAX_CODECS; i++) { // slot available if(codecs[i] == 0) @@ -518,7 +518,7 @@ int tex_transform(Tex* t, uint transforms) CHECK_TEX(t); // find codec that understands the data, and transform - for(int i = 0; i < MAX_CODECS; i++) + for(uint i = 0; i < MAX_CODECS; i++) { // MAX_CODECS isn't a tight bound and we have hit a 0 entry if(!codecs[i]) diff --git a/source/lib/res/sound/snd.h b/source/lib/res/sound/snd.h index 0588f7bf00..6684507ffc 100755 --- a/source/lib/res/sound/snd.h +++ b/source/lib/res/sound/snd.h @@ -224,4 +224,4 @@ extern int snd_update(const float* pos, const float* dir, const float* up); // call before h_mgr_shutdown. extern void snd_shutdown(); -#endif // #ifndef SND_H__ \ No newline at end of file +#endif // #ifndef SND_H__ diff --git a/source/maths/scripting/JSInterface_Vector3D.cpp b/source/maths/scripting/JSInterface_Vector3D.cpp index a648dbe9c9..71559bb5b0 100755 --- a/source/maths/scripting/JSInterface_Vector3D.cpp +++ b/source/maths/scripting/JSInterface_Vector3D.cpp @@ -4,6 +4,11 @@ #include "scripting/JSConversions.h" #include "scripting/ScriptingHost.h" +namespace JSI_Vector3D +{ + static CVector3D* GetVector( JSContext* cx, JSObject* obj ); +} + JSClass JSI_Vector3D::JSI_class = { "Vector3D", JSCLASS_HAS_PRIVATE, JS_PropertyStub, JS_PropertyStub, diff --git a/source/maths/scripting/JSInterface_Vector3D.h b/source/maths/scripting/JSInterface_Vector3D.h index 4d0e2544de..5d6fac1900 100755 --- a/source/maths/scripting/JSInterface_Vector3D.h +++ b/source/maths/scripting/JSInterface_Vector3D.h @@ -21,7 +21,6 @@ namespace JSI_Vector3D component_y, component_z }; - static CVector3D* GetVector( JSContext* cx, JSObject* obj ); JSBool toString( JSContext* cx, JSObject* obj, uintN argc, jsval* argv, jsval* rval ); JSBool add( JSContext* cx, JSObject* obj, uintN argc, jsval* argv, jsval* rval ); JSBool subtract( JSContext* cx, JSObject* obj, uintN argc, jsval* argv, jsval* rval ); diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index c6df73e8a8..a1821a5a78 100755 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -574,10 +574,10 @@ void CConsole::LoadHistory() CStr bytes( (char*)buffer, buflen ); CStrW str( bytes.FromUTF8() ); size_t pos = 0; - while( pos != -1 ) + while( pos != CStrW::npos ) { pos = str.find( '\n' ); - if( pos != -1 ) + if( pos != CStrW::npos ) { if( pos > 0 ) m_deqBufHistory.push_front( str.Left( str[pos-1] == '\r' ? pos - 1 : pos ) ); diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp index d27e76f7c3..9f1a4a6506 100755 --- a/source/ps/Hotkey.cpp +++ b/source/ps/Hotkey.cpp @@ -429,7 +429,7 @@ int hotkeyInputHandler( const SDL_Event* ev ) { if( mouse_buttons[keyCode-SDLK_LAST] != rqdState ) accept = false; } - else if( keyCode-UNIFIED_SHIFT < ARRAY_SIZE(unified) ) + else if( (uint)(keyCode-UNIFIED_SHIFT) < ARRAY_SIZE(unified) ) { if( unified[keyCode-UNIFIED_SHIFT] != rqdState ) accept = false; } @@ -496,7 +496,7 @@ int hotkeyInputHandler( const SDL_Event* ev ) { if( mouse_buttons[keyCode-SDLK_LAST] != rqdState ) accept = false; } - else if( keyCode-UNIFIED_SHIFT < ARRAY_SIZE(unified) ) + else if( (uint)(keyCode-UNIFIED_SHIFT) < ARRAY_SIZE(unified) ) { if( unified[keyCode-UNIFIED_SHIFT] != rqdState ) accept = false; } diff --git a/source/ps/Interact.cpp b/source/ps/Interact.cpp index 5713707989..644ce50f0e 100755 --- a/source/ps/Interact.cpp +++ b/source/ps/Interact.cpp @@ -1173,4 +1173,4 @@ void CBuildingPlacer::render() glColor3f(1,1,1); glVertex3f(pos.X + 3*sin(m_angle), pos.Y, pos.Z + 3*cos(m_angle)); glEnd();*/ -} \ No newline at end of file +} diff --git a/source/ps/NPFont.h b/source/ps/NPFont.h index 7dfc475c42..e18090c358 100755 --- a/source/ps/NPFont.h +++ b/source/ps/NPFont.h @@ -44,7 +44,7 @@ public: // accessor for character data const CharData& chardata(char c) const { debug_assert( !(c&0x80) ); // only allow 7-bit ASCII - return _chars[c]; + return _chars[(unsigned char)c]; } void GetOutputStringSize(const char* str,int& sx,int& sy); diff --git a/source/ps/Network/Client.cpp b/source/ps/Network/Client.cpp index 2a15d8e10a..df7bc4b02f 100755 --- a/source/ps/Network/Client.cpp +++ b/source/ps/Network/Client.cpp @@ -318,9 +318,11 @@ bool CNetClient::PreGameHandler(CNetMessage *pMsg, CNetSession *pSession) } HANDLED(pMsg); } + default: + { + UNHANDLED(pMsg); + } } - - UNHANDLED(pMsg); } bool CNetClient::InGameHandler(CNetMessage *pMsg, CNetSession *pSession) @@ -340,6 +342,7 @@ bool CNetClient::InGameHandler(CNetMessage *pMsg, CNetSession *pSession) switch (msgType) { case NMT_EndCommandBatch: + { CEndCommandBatch *msg=(CEndCommandBatch *)pMsg; pClient->SetTurnLength(1, msg->m_TurnLength); @@ -356,8 +359,10 @@ bool CNetClient::InGameHandler(CNetMessage *pMsg, CNetSession *pSession) HANDLED(pMsg); } - - UNHANDLED(pMsg); + + default: + UNHANDLED(pMsg); + } } bool CNetClient::ChatHandler(CNetMessage *pMsg, CNetSession *pSession) diff --git a/source/ps/Network/NetLog.cpp b/source/ps/Network/NetLog.cpp index abd45569de..ccebdf074f 100644 --- a/source/ps/Network/NetLog.cpp +++ b/source/ps/Network/NetLog.cpp @@ -14,8 +14,8 @@ CNetLog g_NetLog; #define LOG_ARGS_SUFFIX CNetLog::CNetLog(): - m_Initialized(false), m_Flush(true), + m_Initialized(false), m_pFile(NULL) {} diff --git a/source/ps/Network/Server.h b/source/ps/Network/Server.h index 8fcb36a541..8cca447d02 100755 --- a/source/ps/Network/Server.h +++ b/source/ps/Network/Server.h @@ -49,14 +49,14 @@ private: */ std::vector m_Observers; - uint m_MaxObservers; - int m_LastSessionID; - ENetServerState m_ServerState; CGame *m_pGame; CGameAttributes *m_pGameAttributes; + uint m_MaxObservers; + int m_LastSessionID; + CPlayer *m_pServerPlayer; CStrW m_Password; diff --git a/source/ps/Network/ServerSession.cpp b/source/ps/Network/ServerSession.cpp index ec319d7715..12f9bcbc3f 100644 --- a/source/ps/Network/ServerSession.cpp +++ b/source/ps/Network/ServerSession.cpp @@ -53,8 +53,10 @@ bool CNetServerSession::BaseHandler(CNetMessage *pMsg, CNetSession *pNetSession) LOG(WARNING, LOG_CAT_NET, "CNetServerSession::BaseHandler(): NMT_ERROR: %s", msg->GetString().c_str()); HANDLED(pMsg); } + + default: + UNHANDLED(pMsg); } - UNHANDLED(pMsg); } bool CNetServerSession::HandshakeHandler(CNetMessage *pMsg, CNetSession *pNetSession) @@ -83,8 +85,10 @@ bool CNetServerSession::HandshakeHandler(CNetMessage *pMsg, CNetSession *pNetSes HANDLED(pMsg); } + + default: + return BaseHandler(pMsg, pNetSession); } - return BaseHandler(pMsg, pNetSession); } bool CNetServerSession::AuthenticateHandler(CNetMessage *pMsg, CNetSession *pNetSession) diff --git a/source/ps/Network/SocketBase.cpp b/source/ps/Network/SocketBase.cpp index b661b886ff..087b07c567 100755 --- a/source/ps/Network/SocketBase.cpp +++ b/source/ps/Network/SocketBase.cpp @@ -74,6 +74,8 @@ CSocketAddress::CSocketAddress(int port, ESocketProtocol proto) memcpy(&m_Union.m_IPv6.sin6_addr, &in6addr_any, sizeof(in6addr_any)); m_Union.m_IPv6.sin6_port=htons(port); break; + default: + debug_warn("CSocketAddress::CSocketAddress: Bad proto"); } } @@ -92,6 +94,8 @@ CSocketAddress CSocketAddress::Loopback(int port, ESocketProtocol proto) memcpy(&ret.m_Union.m_IPv6.sin6_addr, &in6addr_loopback, sizeof(in6addr_loopback)); ret.m_Union.m_IPv6.sin6_port=htons(port); break; + default: + debug_warn("CSocketAddress::CSocketAddress: Bad proto"); } return ret; } diff --git a/source/ps/Overlay.cpp b/source/ps/Overlay.cpp index fb4389f63c..16413d7bba 100755 --- a/source/ps/Overlay.cpp +++ b/source/ps/Overlay.cpp @@ -47,14 +47,14 @@ bool CColor::ParseString(const CStr& Value, float DefaultAlpha) } COverlay::COverlay() - : m_Rect(CRect(0.f,0.f,0.f,0.f)), m_Z(0), m_Color(CColor(0,0,0,0)), m_Texture(""), m_HasBorder(false), m_BorderColor(CColor(0,0,0,0)) + : m_Rect(CRect(0.f,0.f,0.f,0.f)), m_Z(0), m_Texture(""), m_Color(CColor(0,0,0,0)), m_HasBorder(false), m_BorderColor(CColor(0,0,0,0)) { } COverlay::COverlay(const CRect& rect,int z,const CColor& color,const char* texturename, bool hasBorder,const CColor& bordercolor) - : m_Rect(rect), m_Z(z), m_Color(color), m_Texture(texturename), m_HasBorder(hasBorder), m_BorderColor(bordercolor) + : m_Rect(rect), m_Z(z), m_Texture(texturename), m_Color(color), m_HasBorder(hasBorder), m_BorderColor(bordercolor) { } diff --git a/source/ps/OverlayText.cpp b/source/ps/OverlayText.cpp index fcfd9b358b..a46efcb003 100755 --- a/source/ps/OverlayText.cpp +++ b/source/ps/OverlayText.cpp @@ -17,7 +17,7 @@ COverlayText::COverlayText() COverlayText::COverlayText(float x,float y,int z,const char* fontname,const char* string,const CColor& color) - : m_X(x), m_Y(y), m_Z(z), m_String(string), m_Color(color) + : m_X(x), m_Y(y), m_Z(z), m_Color(color), m_String(string) { m_Font=NPFontManager::instance().add(fontname); } diff --git a/source/ps/Parser.cpp b/source/ps/Parser.cpp index b36e053d86..bbd42190bb 100755 --- a/source/ps/Parser.cpp +++ b/source/ps/Parser.cpp @@ -4,7 +4,10 @@ #include "lib.h" #include "self_test.h" +#if MSC_VERSION #pragma warning(disable:4786) +#endif + using namespace std; //------------------------------------------------- @@ -833,7 +836,7 @@ bool CParser::InputTaskType(const string& strName, const string& strSyntax) // Loop through the string and construct nodes in the binary tree // when applicable - for (i=0; i<(int)strSyntax.size(); ++i) + for (i=0; im_Owner->Bind(); + u8* base=m_VBBase->m_Owner->Bind(); //TODO: this makes no sense, get rid of it UNUSED2(base); glBegin(GL_LINES); diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 161b7b5f30..eb77310b1a 100755 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -219,6 +219,12 @@ void CRenderer::SetOptionBool(enum Option opt,bool value) case OPT_SHADOWS: m_Options.m_Shadows=value; break; + case OPT_NOPBUFFER: + // NOT IMPLEMENTED + break; + default: + debug_warn("CRenderer::SetOptionBool: unknown option"); + break; } } @@ -231,6 +237,9 @@ bool CRenderer::GetOptionBool(enum Option opt) const return m_Options.m_NoVBO; case OPT_SHADOWS: return m_Options.m_Shadows; + default: + debug_warn("CRenderer::GetOptionBool: unknown option"); + break; } return false; @@ -244,6 +253,9 @@ void CRenderer::SetOptionColor(enum Option opt,const RGBAColor& value) case OPT_SHADOWCOLOR: m_Options.m_ShadowColor=value; break; + default: + debug_warn("CRenderer::SetOptionColor: unknown option"); + break; } } @@ -254,6 +266,9 @@ void CRenderer::SetOptionFloat(enum Option opt, float val) case OPT_LODBIAS: m_Options.m_LodBias = val; break; + default: + debug_warn("CRenderer::SetOptionFloat: unknown option"); + break; } } @@ -266,6 +281,9 @@ const RGBAColor& CRenderer::GetOptionColor(enum Option opt) const switch (opt) { case OPT_SHADOWCOLOR: return m_Options.m_ShadowColor; + default: + debug_warn("CRenderer::GetOptionColor: unknown option"); + break; } return defaultColor; diff --git a/source/renderer/VertexBuffer.cpp b/source/renderer/VertexBuffer.cpp index 95fd0140e2..837d751d49 100755 --- a/source/renderer/VertexBuffer.cpp +++ b/source/renderer/VertexBuffer.cpp @@ -31,7 +31,7 @@ void CVertexBuffer::Shutdown() /////////////////////////////////////////////////////////////////////////////// // CVertexBuffer constructor CVertexBuffer::CVertexBuffer(size_t vertexSize,bool dynamic) - : m_VertexSize(vertexSize), m_Dynamic(dynamic), m_SysMem(0), m_Handle(0) + : m_VertexSize(vertexSize), m_Handle(0), m_SysMem(0), m_Dynamic(dynamic) { size_t size = MAX_VB_SIZE_BYTES; diff --git a/source/scripting/DOMEvent.h b/source/scripting/DOMEvent.h index 0bbd6cf021..d3276d618e 100755 --- a/source/scripting/DOMEvent.h +++ b/source/scripting/DOMEvent.h @@ -40,7 +40,7 @@ public: before = NULL; after = NULL; } - ~IEventTarget(); + virtual ~IEventTarget(); // Set target that will receive each event after it is processed. // unused inline void SetPriorObject( IEventTarget* obj ) diff --git a/source/scripting/EventTypes.h b/source/scripting/EventTypes.h index 8e98447605..09329e4cdf 100644 --- a/source/scripting/EventTypes.h +++ b/source/scripting/EventTypes.h @@ -32,7 +32,7 @@ enum EEventType }; // Only used for entity events... (adds them as a property) -static const wchar_t* EventNames[EVENT_LAST] = +static const wchar_t* const EventNames[EVENT_LAST] = { /* EVENT_INITIALIZE */ L"onInitialize", /* EVENT_TICK */ L"onTick", diff --git a/source/scripting/ScriptableComplex.h b/source/scripting/ScriptableComplex.h index af46c6a195..acebb4fcf3 100644 --- a/source/scripting/ScriptableComplex.h +++ b/source/scripting/ScriptableComplex.h @@ -72,6 +72,9 @@ public: // Objects that inherit from this InheritorsList m_Inheritors; + // Destructor + virtual ~IJSComplex() { } + // Set the base, and rebuild void SetBase( IJSComplex* m_Parent ); diff --git a/source/scripting/ScriptableObject.h b/source/scripting/ScriptableObject.h index 61d543e09b..2a18a81f5b 100755 --- a/source/scripting/ScriptableObject.h +++ b/source/scripting/ScriptableObject.h @@ -13,8 +13,6 @@ #define ALLOW_NONSHARED_NATIVES -static int pcount = 0; - class IJSObject; class IJSProperty diff --git a/source/scripting/SynchedJSObject.h b/source/scripting/SynchedJSObject.h index 2727a6ddbf..83ef802a67 100644 --- a/source/scripting/SynchedJSObject.h +++ b/source/scripting/SynchedJSObject.h @@ -122,6 +122,8 @@ struct CSynchedJSObjectBase SynchedPropertyTable m_SynchedProperties; protected: + virtual ~CSynchedJSObjectBase() { } + // Called every time a property changes. // This is where the individual callbacks are dispatched from. virtual void Update(CStrW name, ISynchedJSProperty *prop)=0; diff --git a/source/simulation/TurnManager.h b/source/simulation/TurnManager.h index 82d8b135cf..9531aa407f 100755 --- a/source/simulation/TurnManager.h +++ b/source/simulation/TurnManager.h @@ -91,6 +91,7 @@ protected: public: CTurnManager(); + virtual ~CTurnManager() { } void Initialize(size_t numClients); diff --git a/source/sound/CMusicPlayer.h b/source/sound/CMusicPlayer.h index df345b3f0f..daa92a7c5f 100755 --- a/source/sound/CMusicPlayer.h +++ b/source/sound/CMusicPlayer.h @@ -51,7 +51,7 @@ private: SOggFile memFile; Handle hf; -/* + struct IOSlot { ALuint al_buffer; diff --git a/source/tools/atlas/GameInterface/MessagesSetup.h b/source/tools/atlas/GameInterface/MessagesSetup.h index 8c9b8d609d..18f3872b52 100644 --- a/source/tools/atlas/GameInterface/MessagesSetup.h +++ b/source/tools/atlas/GameInterface/MessagesSetup.h @@ -137,4 +137,4 @@ const bool NOMERGE = false; } -#endif \ No newline at end of file +#endif