From cc3c84b819e6802351cedc16fdcbeddf12925c29 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 30 Jan 2026 13:46:59 +1100 Subject: [PATCH 1/3] fix: Fix uninitialized debris shadow name to avoid a crash --- .../Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp | 2 ++ .../Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp index f7b57d4fa4c..1180b257817 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp @@ -128,6 +128,8 @@ void W3DDebrisDraw::setModelName(AsciiString name, Color color, ShadowType t) if (t != SHADOW_NONE) { Shadow::ShadowTypeInfo shadowInfo; + // TheSuperHackers @fix Stubbjax 30/01/2026 Resolve crash by initializing shadow name to an empty string. + shadowInfo.m_ShadowName[0] = '\0'; shadowInfo.m_type = t; shadowInfo.m_sizeX=0; shadowInfo.m_sizeY=0; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp index bf641e4407b..f1bdd964a62 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp @@ -128,6 +128,8 @@ void W3DDebrisDraw::setModelName(AsciiString name, Color color, ShadowType t) if (t != SHADOW_NONE) { Shadow::ShadowTypeInfo shadowInfo; + // TheSuperHackers @fix Stubbjax 30/01/2026 Resolve crash by initializing shadow name to an empty string. + shadowInfo.m_ShadowName[0] = '\0'; shadowInfo.m_type = t; shadowInfo.m_sizeX=0; shadowInfo.m_sizeY=0; From 44d10cc2f933cc5b0e74b116b0457e92627a6ca3 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 30 Jan 2026 13:59:55 +1100 Subject: [PATCH 2/3] fix: Apply fix to the test asset pathway --- .../W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp | 2 ++ .../W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp index e199b6b0500..7a85175a1d3 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp @@ -61,6 +61,8 @@ W3DDefaultDraw::W3DDefaultDraw(Thing *thing, const ModuleData* moduleData) : Dra m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(getDrawable()->getTemplate()->getLTAName().str(), getDrawable()->getScale(), 0); Shadow::ShadowTypeInfo shadowInfo; + // TheSuperHackers @fix Stubbjax 30/01/2026 Allocate less memory in the W3DProjectedShadowManager by initializing shadow name to an empty string. + shadowInfo.m_ShadowName[0] = '\0'; shadowInfo.m_type=(ShadowType)SHADOW_VOLUME; shadowInfo.m_sizeX=0; //use defaults shadowInfo.m_sizeY=0; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp index c6b30a4fdf5..5fc7b304f84 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp @@ -61,6 +61,8 @@ W3DDefaultDraw::W3DDefaultDraw(Thing *thing, const ModuleData* moduleData) : Dra m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(getDrawable()->getTemplate()->getLTAName().str(), getDrawable()->getScale(), 0); Shadow::ShadowTypeInfo shadowInfo; + // TheSuperHackers @fix Stubbjax 30/01/2026 Allocate less memory in the W3DProjectedShadowManager by initializing shadow name to an empty string. + shadowInfo.m_ShadowName[0] = '\0'; shadowInfo.m_type=(ShadowType)SHADOW_VOLUME; shadowInfo.m_sizeX=0; //use defaults shadowInfo.m_sizeY=0; From cabd14120db288707e1b0e22c3378e93da420adc Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 30 Jan 2026 16:06:47 +1100 Subject: [PATCH 3/3] refactor: Implement cleaner solution --- .../Source/W3DDevice/GameClient/W3DTreeBuffer.cpp | 2 +- .../Code/GameEngine/Include/GameClient/Shadow.h | 13 +++++++++++++ .../GameEngine/Source/GameClient/RadiusDecal.cpp | 2 +- .../GameClient/Drawable/Draw/W3DDebrisDraw.cpp | 6 +----- .../GameClient/Drawable/Draw/W3DDefaultDraw.cpp | 8 +------- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 6 +++--- Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp | 4 ++-- .../Code/GameEngine/Include/GameClient/Shadow.h | 13 +++++++++++++ .../GameEngine/Source/GameClient/RadiusDecal.cpp | 2 +- .../GameClient/Drawable/Draw/W3DDebrisDraw.cpp | 6 +----- .../GameClient/Drawable/Draw/W3DDefaultDraw.cpp | 8 +------- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 6 +++--- GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp | 4 ++-- 13 files changed, 43 insertions(+), 37 deletions(-) diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp index 204b14ec293..cd6929440e8 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp @@ -696,7 +696,7 @@ void W3DTreeBuffer::loadTreesInVertexAndIndexBuffers(RefRenderObjListIterator *p } if (m_shadow == nullptr && TheW3DProjectedShadowManager) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.m_ShadowName[0] = 0; shadowInfo.allowUpdates=FALSE; //shadow image will never update shadowInfo.allowWorldAlign=TRUE; //shadow image will wrap around world objects diff --git a/Generals/Code/GameEngine/Include/GameClient/Shadow.h b/Generals/Code/GameEngine/Include/GameClient/Shadow.h index 2e40ea7ae3a..2b6901815f7 100644 --- a/Generals/Code/GameEngine/Include/GameClient/Shadow.h +++ b/Generals/Code/GameEngine/Include/GameClient/Shadow.h @@ -73,6 +73,19 @@ class Shadow struct ShadowTypeInfo { + // TheSuperHackers @fix Stubbjax 30/01/2026 Initialize all members in the constructor to avoid garbage data and potential crashes. + ShadowTypeInfo() + { + m_ShadowName[0] = '\0'; + m_type = SHADOW_NONE; + allowUpdates = false; + allowWorldAlign = false; + m_sizeX = 0.0f; + m_sizeY = 0.0f; + m_offsetX = 0.0f; + m_offsetY = 0.0f; + } + char m_ShadowName[64]; //when set, overrides the default model shadow (used mostly for Decals). ShadowType m_type; //type of shadow Bool allowUpdates; //whether to update the shadow image when object/light moves. diff --git a/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp b/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp index 645c8845b47..1b7ce359fcb 100644 --- a/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp @@ -69,7 +69,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con if (!m_onlyVisibleToOwningPlayer || owningPlayer->getPlayerIndex() == ThePlayerList->getLocalPlayer()->getPlayerIndex()) { - Shadow::ShadowTypeInfo decalInfo; + Shadow::ShadowTypeInfo decalInfo = Shadow::ShadowTypeInfo(); decalInfo.allowUpdates = FALSE; // shadow texture will never update decalInfo.allowWorldAlign = TRUE; // shadow image will wrap around world objects decalInfo.m_type = m_shadowType; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp index 1180b257817..5f23021f74b 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp @@ -127,12 +127,8 @@ void W3DDebrisDraw::setModelName(AsciiString name, Color color, ShadowType t) if (t != SHADOW_NONE) { - Shadow::ShadowTypeInfo shadowInfo; - // TheSuperHackers @fix Stubbjax 30/01/2026 Resolve crash by initializing shadow name to an empty string. - shadowInfo.m_ShadowName[0] = '\0'; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.m_type = t; - shadowInfo.m_sizeX=0; - shadowInfo.m_sizeY=0; m_shadow = TheW3DShadowManager->addShadow(m_renderObject, &shadowInfo); } else diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp index 7a85175a1d3..7afb99f9e1b 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp @@ -60,14 +60,8 @@ W3DDefaultDraw::W3DDefaultDraw(Thing *thing, const ModuleData* moduleData) : Dra { m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(getDrawable()->getTemplate()->getLTAName().str(), getDrawable()->getScale(), 0); - Shadow::ShadowTypeInfo shadowInfo; - // TheSuperHackers @fix Stubbjax 30/01/2026 Allocate less memory in the W3DProjectedShadowManager by initializing shadow name to an empty string. - shadowInfo.m_ShadowName[0] = '\0'; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.m_type=(ShadowType)SHADOW_VOLUME; - shadowInfo.m_sizeX=0; //use defaults - shadowInfo.m_sizeY=0; - shadowInfo.m_offsetX=0; - shadowInfo.m_offsetY=0; m_shadow = TheW3DShadowManager->addShadow(m_renderObject, &shadowInfo); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 7afabdada40..d8da016d14c 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -1825,7 +1825,7 @@ void W3DModelDraw::allocateShadows(void) //Check if we don't already have a shadow but need one for this type of model. if (m_shadow == nullptr && m_renderObject && TheW3DShadowManager && tmplate->getShadowType() != SHADOW_NONE) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); strlcpy(shadowInfo.m_ShadowName, tmplate->getShadowTextureName().str(), ARRAY_SIZE(shadowInfo.m_ShadowName)); DEBUG_ASSERTCRASH(shadowInfo.m_ShadowName[0] != '\0', ("this should be validated in ThingTemplate now")); shadowInfo.allowUpdates = FALSE; //shadow image will never update @@ -2693,7 +2693,7 @@ void W3DModelDraw::setTerrainDecal(TerrainDecalType type) const ThingTemplate *tmplate=getDrawable()->getTemplate(); //create a new terrain decal - Shadow::ShadowTypeInfo decalInfo; + Shadow::ShadowTypeInfo decalInfo = Shadow::ShadowTypeInfo(); decalInfo.allowUpdates = FALSE; //shadow image will never update decalInfo.allowWorldAlign = TRUE; //shadow image will wrap around world objects decalInfo.m_type = SHADOW_ALPHA_DECAL; @@ -3015,7 +3015,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) // set up shadows if (m_renderObject && TheW3DShadowManager && tmplate->getShadowType() != SHADOW_NONE) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); strlcpy(shadowInfo.m_ShadowName, tmplate->getShadowTextureName().str(), ARRAY_SIZE(shadowInfo.m_ShadowName)); DEBUG_ASSERTCRASH(shadowInfo.m_ShadowName[0] != '\0', ("this should be validated in ThingTemplate now")); shadowInfo.allowUpdates = FALSE; //shadow image will never update diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index 7508a17af66..dd3cd8c6a76 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -1135,7 +1135,7 @@ void WbView3d::invalBuildListItemInView(BuildListInfo *pBuildToInval) if( m_showShadows && tTemplate->getShadowType() != SHADOW_NONE) { //add correct type of shadow - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.allowUpdates=FALSE; //shadow image will never update shadowInfo.allowWorldAlign=TRUE; //shadow image will wrap around world objects strlcpy(shadowInfo.m_ShadowName, tTemplate->getShadowTextureName().str(), ARRAY_SIZE(shadowInfo.m_ShadowName)); @@ -1402,7 +1402,7 @@ void WbView3d::invalObjectInView(MapObject *pMapObjIn) renderObj = m_assetManager->Create_Render_Obj( modelName.str(), scale, playerColor); if( m_showShadows ) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.allowUpdates=FALSE; //shadow image will never update shadowInfo.allowWorldAlign=TRUE; //shadow image will wrap around world objects const ThingTemplate *tTemplate = pMapObj->getThingTemplate(); diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Shadow.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Shadow.h index 01e02d09dbe..cc04cd03a05 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Shadow.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Shadow.h @@ -73,6 +73,19 @@ class Shadow struct ShadowTypeInfo { + // TheSuperHackers @fix Stubbjax 30/01/2026 Initialize all members in the constructor to avoid garbage data and potential crashes. + ShadowTypeInfo() + { + m_ShadowName[0] = '\0'; + m_type = SHADOW_NONE; + allowUpdates = false; + allowWorldAlign = false; + m_sizeX = 0.0f; + m_sizeY = 0.0f; + m_offsetX = 0.0f; + m_offsetY = 0.0f; + } + char m_ShadowName[64]; //when set, overrides the default model shadow (used mostly for Decals). ShadowType m_type; //type of shadow Bool allowUpdates; //whether to update the shadow image when object/light moves. diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp index c7863220aaf..4dd6a8a48ba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp @@ -69,7 +69,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con if (!m_onlyVisibleToOwningPlayer || owningPlayer->getPlayerIndex() == ThePlayerList->getLocalPlayer()->getPlayerIndex()) { - Shadow::ShadowTypeInfo decalInfo; + Shadow::ShadowTypeInfo decalInfo = Shadow::ShadowTypeInfo(); decalInfo.allowUpdates = FALSE; // shadow texture will never update decalInfo.allowWorldAlign = TRUE; // shadow image will wrap around world objects decalInfo.m_type = m_shadowType; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp index f1bdd964a62..129269769a1 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp @@ -127,12 +127,8 @@ void W3DDebrisDraw::setModelName(AsciiString name, Color color, ShadowType t) if (t != SHADOW_NONE) { - Shadow::ShadowTypeInfo shadowInfo; - // TheSuperHackers @fix Stubbjax 30/01/2026 Resolve crash by initializing shadow name to an empty string. - shadowInfo.m_ShadowName[0] = '\0'; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.m_type = t; - shadowInfo.m_sizeX=0; - shadowInfo.m_sizeY=0; m_shadow = TheW3DShadowManager->addShadow(m_renderObject, &shadowInfo); } else diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp index 5fc7b304f84..24f25ce9c85 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp @@ -60,14 +60,8 @@ W3DDefaultDraw::W3DDefaultDraw(Thing *thing, const ModuleData* moduleData) : Dra { m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(getDrawable()->getTemplate()->getLTAName().str(), getDrawable()->getScale(), 0); - Shadow::ShadowTypeInfo shadowInfo; - // TheSuperHackers @fix Stubbjax 30/01/2026 Allocate less memory in the W3DProjectedShadowManager by initializing shadow name to an empty string. - shadowInfo.m_ShadowName[0] = '\0'; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.m_type=(ShadowType)SHADOW_VOLUME; - shadowInfo.m_sizeX=0; //use defaults - shadowInfo.m_sizeY=0; - shadowInfo.m_offsetX=0; - shadowInfo.m_offsetY=0; m_shadow = TheW3DShadowManager->addShadow(m_renderObject, &shadowInfo); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 5908a041a8d..e8d52d9e598 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -1860,7 +1860,7 @@ void W3DModelDraw::allocateShadows(void) //Check if we don't already have a shadow but need one for this type of model. if (m_shadow == nullptr && m_renderObject && TheW3DShadowManager && tmplate->getShadowType() != SHADOW_NONE) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); strlcpy(shadowInfo.m_ShadowName, tmplate->getShadowTextureName().str(), ARRAY_SIZE(shadowInfo.m_ShadowName)); DEBUG_ASSERTCRASH(shadowInfo.m_ShadowName[0] != '\0', ("this should be validated in ThingTemplate now")); shadowInfo.allowUpdates = FALSE; //shadow image will never update @@ -2745,7 +2745,7 @@ void W3DModelDraw::setTerrainDecal(TerrainDecalType type) const ThingTemplate *tmplate=getDrawable()->getTemplate(); //create a new terrain decal - Shadow::ShadowTypeInfo decalInfo; + Shadow::ShadowTypeInfo decalInfo = Shadow::ShadowTypeInfo(); decalInfo.allowUpdates = FALSE; //shadow image will never update decalInfo.allowWorldAlign = TRUE; //shadow image will wrap around world objects decalInfo.m_type = SHADOW_ALPHA_DECAL; @@ -3070,7 +3070,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) // set up shadows if (m_renderObject && TheW3DShadowManager && tmplate->getShadowType() != SHADOW_NONE) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); strlcpy(shadowInfo.m_ShadowName, tmplate->getShadowTextureName().str(), ARRAY_SIZE(shadowInfo.m_ShadowName)); DEBUG_ASSERTCRASH(shadowInfo.m_ShadowName[0] != '\0', ("this should be validated in ThingTemplate now")); shadowInfo.allowUpdates = FALSE; //shadow image will never update diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp index 91d6c315ec0..05edb642efe 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -1193,7 +1193,7 @@ void WbView3d::invalBuildListItemInView(BuildListInfo *pBuildToInval) if( m_showShadows && tTemplate->getShadowType() != SHADOW_NONE) { //add correct type of shadow - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.allowUpdates=FALSE; //shadow image will never update shadowInfo.allowWorldAlign=TRUE; //shadow image will wrap around world objects strlcpy(shadowInfo.m_ShadowName, tTemplate->getShadowTextureName().str(), ARRAY_SIZE(shadowInfo.m_ShadowName)); @@ -1469,7 +1469,7 @@ void WbView3d::invalObjectInView(MapObject *pMapObjIn) renderObj = m_assetManager->Create_Render_Obj( modelName.str(), scale, playerColor); if( m_showShadows ) { - Shadow::ShadowTypeInfo shadowInfo; + Shadow::ShadowTypeInfo shadowInfo = Shadow::ShadowTypeInfo(); shadowInfo.allowUpdates=FALSE; //shadow image will never update shadowInfo.allowWorldAlign=TRUE; //shadow image will wrap around world objects if (tTemplate && tTemplate->getShadowType() != SHADOW_NONE && !(pMapObj->getFlags() & FLAG_DONT_RENDER))