diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 39ab5f773..65d1e031c 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -112,11 +112,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") # TODO fix these warnings add_compile_options(-Wno-sign-compare) add_compile_options(-Wno-switch) + add_compile_options(-Wno-char-subscripts) add_compile_options(-Wno-unknown-pragmas) add_compile_options(-Wno-unused-variable) add_compile_options(-Wno-unused-value) - add_compile_options(-Wno-reorder) - add_compile_options(-Wno-unused-but-set-variable) add_compile_options(-Wno-parentheses) MESSAGE(WARNING, "re-enable some of the warnings some day!") @@ -125,6 +124,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options(-Wno-tautological-undefined-compare) add_compile_options(-Wno-c++11-compat-deprecated-writable-strings) add_compile_options(-Wno-logical-op-parentheses) # FIXME: this too should be re-enabled + else() + add_compile_options(-Wno-unused-but-set-variable) # my clang doesn't know this endif() if(MACOSX) diff --git a/Sources/Engine/Brushes/BrushSector.cpp b/Sources/Engine/Brushes/BrushSector.cpp index 3abc42b10..09d9f9015 100644 --- a/Sources/Engine/Brushes/BrushSector.cpp +++ b/Sources/Engine/Brushes/BrushSector.cpp @@ -53,8 +53,8 @@ CBrushSector::CBrushSector(void) , bsc_ulFlags2(0) , bsc_ulTempFlags(0) , bsc_ulVisFlags(0) -, bsc_strName("") , bsc_bspBSPTree(*new DOUBLEbsptree3D) +, bsc_strName("") { }; @@ -622,9 +622,9 @@ void CBrushSector::TriangularizeMarkedPolygons( void) bpoNew.bpo_abpePolygonEdges[2].bpe_pbedEdge = &abedEdgesNew[iEdge+2]; bpoNew.bpo_abpePolygonEdges[2].bpe_bReverse = FALSE; - CBrushEdge &edg0 = *bpoNew.bpo_abpePolygonEdges[0].bpe_pbedEdge; - CBrushEdge &edg1 = *bpoNew.bpo_abpePolygonEdges[1].bpe_pbedEdge; - CBrushEdge &edg2 = *bpoNew.bpo_abpePolygonEdges[2].bpe_pbedEdge; + //CBrushEdge &edg0 = *bpoNew.bpo_abpePolygonEdges[0].bpe_pbedEdge; + //CBrushEdge &edg1 = *bpoNew.bpo_abpePolygonEdges[1].bpe_pbedEdge; + //CBrushEdge &edg2 = *bpoNew.bpo_abpePolygonEdges[2].bpe_pbedEdge; // set brush vertex ptrs bpoNew.bpo_apbvxTriangleVertices.New(3); diff --git a/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp b/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp index 574bc9eb2..4bf398f30 100644 --- a/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp +++ b/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp @@ -89,13 +89,16 @@ void *CGfxLibrary::OGL_GetProcAddress(const char *procname) // prepares pixel format for OpenGL context BOOL CGfxLibrary::SetupPixelFormat_OGL( HDC hdc, BOOL bReport/*=FALSE*/) { - SDL_Window *window = (SDL_Window *) hdc; + //SDL_Window *window = (SDL_Window *) hdc; const DisplayDepth dd = gl_dmCurrentDisplayMode.dm_ddDepth; // clamp depth/stencil values extern INDEX gap_iDepthBits; extern INDEX gap_iStencilBits; - if( gap_iDepthBits <12) gap_iDepthBits = 0; + if( gap_iDepthBits <12) { + ASSERT(gap_iDepthBits >= 12 && "Using gap_iDepthBits=0, that's probably bad?!"); + gap_iDepthBits = 0; + } else if( gap_iDepthBits <22) gap_iDepthBits = 16; else if( gap_iDepthBits <28) gap_iDepthBits = 24; else gap_iDepthBits = 32; diff --git a/Sources/Engine/Math/ObjectSector.cpp b/Sources/Engine/Math/ObjectSector.cpp index 9b695428e..ab678fc56 100644 --- a/Sources/Engine/Math/ObjectSector.cpp +++ b/Sources/Engine/Math/ObjectSector.cpp @@ -254,7 +254,7 @@ void CObjectPolygonEdge::GetVertices(CObjectVertex *&povxStart, CObjectVertex *& * Default constructor. */ CObjectSector::CObjectSector(void) : - osc_colAmbient(0), osc_colColor(0), osc_strName("") + osc_colColor(0), osc_colAmbient(0), osc_strName("") { osc_ulFlags[0] = 0; osc_ulFlags[1] = 0; diff --git a/Sources/Engine/Network/CommunicationInterface.cpp b/Sources/Engine/Network/CommunicationInterface.cpp index 6f35a9225..a8f79323c 100644 --- a/Sources/Engine/Network/CommunicationInterface.cpp +++ b/Sources/Engine/Network/CommunicationInterface.cpp @@ -629,7 +629,7 @@ void CCommunicationInterface::Broadcast_Update_t() { BOOL bIsAlready; BOOL bFoundEmpty; ULONG iClient; - UBYTE ubDummy=65; + //UBYTE ubDummy=65; // while there is a connection request packet in the input buffer @@ -1080,7 +1080,8 @@ void CCommunicationInterface::Client_OpenNet_t(ULONG ulServerAddress) if (cm_ciLocalClient.ci_pbReliableInputBuffer.pb_ulNumOfPackets > 0) { ppaReadPacket = cm_ciLocalClient.ci_pbReliableInputBuffer.GetFirstPacket(); // and it is a connection confirmation - if (ppaReadPacket->pa_ubReliable && UDP_PACKET_CONNECT_RESPONSE) { + // DG: replaced && with & as done everywhere else, hope this doesn't rely on being buggy. + if (ppaReadPacket->pa_ubReliable & UDP_PACKET_CONNECT_RESPONSE) { // the client has succedeed to connect, so read the uwID from the packet cm_ciLocalClient.ci_adrAddress.adr_ulAddress = ulServerAddress; cm_ciLocalClient.ci_adrAddress.adr_uwPort = net_iPort; diff --git a/Sources/Engine/Network/Network.cpp b/Sources/Engine/Network/Network.cpp index 2ec22f060..e6e2b43b1 100644 --- a/Sources/Engine/Network/Network.cpp +++ b/Sources/Engine/Network/Network.cpp @@ -676,11 +676,11 @@ void CNetworkTimerHandler::HandleTimer(void) */ CNetworkLibrary::CNetworkLibrary(void) : ga_IsServer(FALSE), // is not server + ga_srvServer(*new CServer), + ga_sesSessionState(*new CSessionState), ga_bDemoRec(FALSE), // not recording demo ga_bDemoPlay(FALSE), // not playing demo - ga_bDemoPlayFinished(FALSE), // demo not finished - ga_srvServer(*new CServer), - ga_sesSessionState(*new CSessionState) + ga_bDemoPlayFinished(FALSE) // demo not finished { ga_aplsPlayers.New(NET_MAXLOCALPLAYERS); diff --git a/Sources/Engine/Templates/BSP.cpp b/Sources/Engine/Templates/BSP.cpp index 16a2b86f8..17f4c6017 100644 --- a/Sources/Engine/Templates/BSP.cpp +++ b/Sources/Engine/Templates/BSP.cpp @@ -416,9 +416,9 @@ template BSPNode::BSPNode(const Plane &plSplitPlane, size_t ulPlaneTag, BSPNode &bnFront, BSPNode &bnBack) : Plane(plSplitPlane) + , bn_bnlLocation(BNL_BRANCH) , bn_pbnFront(&bnFront) , bn_pbnBack(&bnBack) - , bn_bnlLocation(BNL_BRANCH) , bn_ulPlaneTag(ulPlaneTag) { } diff --git a/Sources/Engine/World/World.cpp b/Sources/Engine/World/World.cpp index 6acb7048f..50e35bc51 100644 --- a/Sources/Engine/World/World.cpp +++ b/Sources/Engine/World/World.cpp @@ -84,12 +84,12 @@ CTextureBlending::CTextureBlending(void) * Constructor. */ CWorld::CWorld(void) - : wo_colBackground(C_lGRAY) // clear background color - , wo_pecWorldBaseClass(NULL) // worldbase class must be obtained before using the world - , wo_bPortalLinksUpToDate(FALSE) // portal-sector links must be updated + : wo_pecWorldBaseClass(NULL) // worldbase class must be obtained before using the world , wo_baBrushes(*new CBrushArchive) , wo_taTerrains(*new CTerrainArchive) + , wo_colBackground(C_lGRAY) // clear background color , wo_ulSpawnFlags(0) + , wo_bPortalLinksUpToDate(FALSE) // portal-sector links must be updated { wo_baBrushes.ba_pwoWorld = this; wo_taTerrains.ta_pwoWorld = this; diff --git a/Sources/EntitiesMP/AirElemental.es b/Sources/EntitiesMP/AirElemental.es index d3c66e25c..7817f02d3 100755 --- a/Sources/EntitiesMP/AirElemental.es +++ b/Sources/EntitiesMP/AirElemental.es @@ -273,7 +273,7 @@ functions: // triggers if (fHealth<=fOldHealth && fHealth>fNewHealth) { - if (&*penTrigger[i]) { + if (penTrigger[i].ep_pen != NULL) { SendToTarget(&*penTrigger[i], EET_TRIGGER, FixupCausedToPlayer(this, m_penEnemy)); } } diff --git a/Sources/EntitiesMP/Elemental.es b/Sources/EntitiesMP/Elemental.es index 13fc6f707..6083641db 100644 --- a/Sources/EntitiesMP/Elemental.es +++ b/Sources/EntitiesMP/Elemental.es @@ -469,6 +469,7 @@ functions: default: iAnim = ELEMENTALLAVA_ANIM_WOUND03; break; } } else { + iAnim=0; // DG: not sure this makes sense, but at least it has a deterministic value /* switch (IRnd()%3) { case 0: iAnim = STONEMAN_ANIM_WOUND01; break; case 1: iAnim = STONEMAN_ANIM_WOUND02; break; @@ -538,6 +539,7 @@ functions: if (m_EetType == ELT_LAVA) { iAnim = ELEMENTALLAVA_ANIM_DEATH03; } else { + iAnim = 0; // DG: set to deterministic value // iAnim = STONEMAN_ANIM_DEATH03; } StartModelAnim(iAnim, 0); @@ -1265,6 +1267,7 @@ procedures: if (m_EetType == ELT_LAVA) { iAnim = ELEMENTALLAVA_ANIM_MELTUP; } else { + iAnim = 0; // DG: initialize to deterministic value // iAnim = STONEMAN_ANIM_MORPHPLANEUP; } StartModelAnim(iAnim, 0); diff --git a/Sources/EntitiesMP/Projectile.es b/Sources/EntitiesMP/Projectile.es index f68ca19a3..6fb502ace 100755 --- a/Sources/EntitiesMP/Projectile.es +++ b/Sources/EntitiesMP/Projectile.es @@ -3531,7 +3531,7 @@ procedures: // ignore twister bHit &= !IsOfClass(epass.penOther, "Twister"); if (epass.penOther!=m_penLauncher) { - bHit = bHit ; + // bHit = bHit ; // FIXME: DG: what was this supposed to achieve? } if (bHit) { ProjectileTouch(epass.penOther); diff --git a/Sources/EntitiesMP/Summoner.es b/Sources/EntitiesMP/Summoner.es index c4246312b..1c5469c65 100755 --- a/Sources/EntitiesMP/Summoner.es +++ b/Sources/EntitiesMP/Summoner.es @@ -619,6 +619,7 @@ functions: iCount = IRnd()%m_iGroup03Count+1; } else { ASSERT("Invalid group!"); + iCount = 0; // DG: this should have a deterministic value in case this happens after all! } ASSERT(iCount>0); diff --git a/Sources/GameMP/Map.cpp b/Sources/GameMP/Map.cpp index 62f45b2a1..dee606973 100644 --- a/Sources/GameMP/Map.cpp +++ b/Sources/GameMP/Map.cpp @@ -687,6 +687,12 @@ void RenderMap( CDrawPort *pdp, ULONG ulLevelMask, CProgressHookInfo *pphi) colText = 0xc87832ff; } } + else // DG: make sure iPosX/Y is initialized + { + // no idea if 0 makes sense, but at least it's deterministic + iPosX = 0; + iPosY = 0; + } PIX pixhtcx = (PIX) (pixC1S+iPosX*fStretch); PIX pixhtcy = (PIX) (pixR1S+iPosY*fStretch);