From a778a657b9e23b228e80ebd334d20ef8c4a56cd6 Mon Sep 17 00:00:00 2001 From: SpaceViking Date: Tue, 17 Jul 2007 03:07:12 +0000 Subject: [PATCH] Fixes for more structures not being initialized. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1065 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface.cpp | 8 +++++++- Utils/message.cpp | 3 +++ gamescreen.cpp | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp index b063cda4..eba801c4 100644 --- a/Tactical/Interface.cpp +++ b/Tactical/Interface.cpp @@ -1863,7 +1863,10 @@ void BeginOverlayMessage( UINT32 uiFont, STR16 pFontString, ... ) if ( giPopupSlideMessageOverlay == -1 ) { - // Set Overlay + // WDS - bug fix: VideoOverlayDesc must be initialized! - 07/16/2007 + memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) ); + + // Set Overlay VideoOverlayDesc.sLeft = ( SCREEN_WIDTH - gusOverlayPopupBoxWidth ) / 2; VideoOverlayDesc.sTop = 100; VideoOverlayDesc.sRight = VideoOverlayDesc.sLeft + gusOverlayPopupBoxWidth; @@ -2856,6 +2859,9 @@ void BeginMapUIMessage( UINT8 ubPosition, STR16 pFontString, ... ) if ( giUIMessageOverlay == -1 ) { + // WDS - bug fix: VideoOverlayDesc must be initialized! - 07/16/2007 + memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) ); + // Set Overlay VideoOverlayDesc.sLeft = 20 + MAP_VIEW_START_X + ( MAP_VIEW_WIDTH - gusUIMessageWidth ) / 2; diff --git a/Utils/message.cpp b/Utils/message.cpp index 1ac13664..fe37ce07 100644 --- a/Utils/message.cpp +++ b/Utils/message.cpp @@ -226,6 +226,9 @@ BOOLEAN CreateStringVideoOverlay( ScrollStringStPtr pStringSt, UINT16 usX, UINT1 { VIDEO_OVERLAY_DESC VideoOverlayDesc; + // WDS - bug fix: VideoOverlayDesc must be initialized! - 07/16/2007 + memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) ); + // SET VIDEO OVERLAY VideoOverlayDesc.sLeft = usX; VideoOverlayDesc.sTop = usY; diff --git a/gamescreen.cpp b/gamescreen.cpp index dbf9f521..d425a628 100644 --- a/gamescreen.cpp +++ b/gamescreen.cpp @@ -164,6 +164,9 @@ UINT32 MainGameScreenInit(void) SetRenderFlags(RENDER_FLAG_FULL); + // WDS - bug fix: VideoOverlayDesc must be initialized! - 07/16/2007 + memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) ); + // Init Video Overlays // FIRST, FRAMERATE VideoOverlayDesc.sLeft = 0;