diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index eaf88e5438a..e3179bbb93c 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -178,29 +178,29 @@ set(GAMEENGINE_SRC
# Include/GameClient/GadgetTabControl.h
# Include/GameClient/GadgetTextEntry.h
# Include/GameClient/GameClient.h
-# Include/GameClient/GameFont.h
+ Include/GameClient/GameFont.h
# Include/GameClient/GameInfoWindow.h
# Include/GameClient/GameText.h
-# Include/GameClient/GameWindow.h
-# Include/GameClient/GameWindowGlobal.h
+ Include/GameClient/GameWindow.h
+ Include/GameClient/GameWindowGlobal.h
# Include/GameClient/GameWindowID.h
# Include/GameClient/GameWindowManager.h
-# Include/GameClient/GameWindowTransitions.h
+ Include/GameClient/GameWindowTransitions.h
# Include/GameClient/GlobalLanguage.h
# Include/GameClient/GraphDraw.h
# Include/GameClient/GUICallbacks.h
# Include/GameClient/GUICommandTranslator.h
-# Include/GameClient/HeaderTemplate.h
+ Include/GameClient/HeaderTemplate.h
# Include/GameClient/HintSpy.h
# Include/GameClient/HotKey.h
# Include/GameClient/Image.h
-# Include/GameClient/IMEManager.h
+ Include/GameClient/IMEManager.h
# Include/GameClient/InGameUI.h
Include/GameClient/Keyboard.h
# Include/GameClient/KeyDefs.h
# Include/GameClient/LanguageFilter.h
# Include/GameClient/Line2D.h
-# Include/GameClient/LoadScreen.h
+ Include/GameClient/LoadScreen.h
# Include/GameClient/LookAtXlat.h
Include/GameClient/MapUtil.h
# Include/GameClient/MessageBox.h
@@ -212,7 +212,7 @@ set(GAMEENGINE_SRC
Include/GameClient/ParabolicEase.h
Include/GameClient/ParticleSys.h
# Include/GameClient/PlaceEventTranslator.h
-# Include/GameClient/ProcessAnimateWindow.h
+ Include/GameClient/ProcessAnimateWindow.h
# Include/GameClient/RadiusDecal.h
# Include/GameClient/RayEffect.h
# Include/GameClient/SelectionInfo.h
@@ -229,10 +229,10 @@ set(GAMEENGINE_SRC
Include/GameClient/VideoPlayer.h
Include/GameClient/View.h
Include/GameClient/Water.h
-# Include/GameClient/WindowLayout.h
+ Include/GameClient/WindowLayout.h
Include/GameClient/WindowVideoManager.h
# Include/GameClient/WindowXlat.h
-# Include/GameClient/WinInstanceData.h
+ Include/GameClient/WinInstanceData.h
# Include/GameLogic/AI.h
# Include/GameLogic/AIDock.h
# Include/GameLogic/AIGuard.h
@@ -733,12 +733,12 @@ set(GAMEENGINE_SRC
# Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
# Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
# Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
-# Source/GameClient/GUI/GameFont.cpp
-# Source/GameClient/GUI/GameWindow.cpp
-# Source/GameClient/GUI/GameWindowGlobal.cpp
+ Source/GameClient/GUI/GameFont.cpp
+ Source/GameClient/GUI/GameWindow.cpp
+ Source/GameClient/GUI/GameWindowGlobal.cpp
# Source/GameClient/GUI/GameWindowManager.cpp
# Source/GameClient/GUI/GameWindowManagerScript.cpp
-# Source/GameClient/GUI/GameWindowTransitions.cpp
+ Source/GameClient/GUI/GameWindowTransitions.cpp
# Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
# Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
# Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
@@ -791,15 +791,15 @@ set(GAMEENGINE_SRC
# Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp
# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
# Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
-# Source/GameClient/GUI/HeaderTemplate.cpp
-# Source/GameClient/GUI/IMEManager.cpp
-# Source/GameClient/GUI/LoadScreen.cpp
-# Source/GameClient/GUI/ProcessAnimateWindow.cpp
+ Source/GameClient/GUI/HeaderTemplate.cpp
+ Source/GameClient/GUI/IMEManager.cpp
+ Source/GameClient/GUI/LoadScreen.cpp
+ Source/GameClient/GUI/ProcessAnimateWindow.cpp
# Source/GameClient/GUI/Shell/Shell.cpp
# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
-# Source/GameClient/GUI/WindowLayout.cpp
+ Source/GameClient/GUI/WindowLayout.cpp
Source/GameClient/GUI/WindowVideoManager.cpp
-# Source/GameClient/GUI/WinInstanceData.cpp
+ Source/GameClient/GUI/WinInstanceData.cpp
# Source/GameClient/InGameUI.cpp
Source/GameClient/Input/Keyboard.cpp
Source/GameClient/Input/Mouse.cpp
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameFont.h b/Core/GameEngine/Include/GameClient/GameFont.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameFont.h
rename to Core/GameEngine/Include/GameClient/GameFont.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameWindow.h b/Core/GameEngine/Include/GameClient/GameWindow.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameWindow.h
rename to Core/GameEngine/Include/GameClient/GameWindow.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowGlobal.h b/Core/GameEngine/Include/GameClient/GameWindowGlobal.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowGlobal.h
rename to Core/GameEngine/Include/GameClient/GameWindowGlobal.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowTransitions.h b/Core/GameEngine/Include/GameClient/GameWindowTransitions.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowTransitions.h
rename to Core/GameEngine/Include/GameClient/GameWindowTransitions.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/HeaderTemplate.h b/Core/GameEngine/Include/GameClient/HeaderTemplate.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/HeaderTemplate.h
rename to Core/GameEngine/Include/GameClient/HeaderTemplate.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h b/Core/GameEngine/Include/GameClient/IMEManager.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h
rename to Core/GameEngine/Include/GameClient/IMEManager.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/Core/GameEngine/Include/GameClient/LoadScreen.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h
rename to Core/GameEngine/Include/GameClient/LoadScreen.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h b/Core/GameEngine/Include/GameClient/ProcessAnimateWindow.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h
rename to Core/GameEngine/Include/GameClient/ProcessAnimateWindow.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/WinInstanceData.h b/Core/GameEngine/Include/GameClient/WinInstanceData.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/WinInstanceData.h
rename to Core/GameEngine/Include/GameClient/WinInstanceData.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/WindowLayout.h b/Core/GameEngine/Include/GameClient/WindowLayout.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/WindowLayout.h
rename to Core/GameEngine/Include/GameClient/WindowLayout.h
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/Core/GameEngine/Source/GameClient/GUI/GameFont.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GameFont.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp b/Core/GameEngine/Source/GameClient/GUI/GameWindow.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GameWindow.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp b/Core/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp b/Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp b/Core/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp
rename to Core/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp
rename to Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Core/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
similarity index 95%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
rename to Core/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
index f0234729cb5..59154f13f45 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
+++ b/Core/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
@@ -150,11 +150,8 @@ LoadScreen::LoadScreen( void )
LoadScreen::~LoadScreen( void )
{
- //if(m_loadScreen)
- // delete (m_loadScreen);
if(m_loadScreen)
TheWindowManager->winDestroy( m_loadScreen );
- m_loadScreen = nullptr;
}
void LoadScreen::update( Int percent )
@@ -192,24 +189,14 @@ SinglePlayerLoadScreen::SinglePlayerLoadScreen( void )
SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void )
{
- m_progressBar = nullptr;
- m_percent = nullptr;
- m_objectiveWin = nullptr;
- for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i)
- m_objectiveLines[i] = nullptr;
-
delete m_videoBuffer;
- m_videoBuffer = nullptr;
if ( m_videoStream )
{
m_videoStream->close();
- m_videoStream = nullptr;
}
TheAudio->removeAudioEvent( m_ambientLoopHandle );
- m_ambientLoopHandle = 0;
-
}
void SinglePlayerLoadScreen::moveWindows( Int frame )
@@ -509,18 +496,36 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
GameWindow *backgroundWin = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:ParentSinglePlayerLoadScreen" ));
if (campaignName.compareNoCase("USA") == 0)
{
- backgroundWin->winSetEnabledImage( 0, TheMappedImageCollection->findImageByName("MissionLoad_USA") );
- m_progressBar->winSetEnabledImage( 6, TheMappedImageCollection->findImageByName("LoadingBar_ProgressCenter2") );
+ if (const Image *image = TheMappedImageCollection->findImageByName("MissionLoad_USA"))
+ {
+ backgroundWin->winSetEnabledImage( 0, image);
+ }
+ if (const Image *image = TheMappedImageCollection->findImageByName("LoadingBar_ProgressCenter2"))
+ {
+ m_progressBar->winSetEnabledImage( 6, image );
+ }
}
else if (campaignName.compareNoCase("GLA") == 0)
{
- backgroundWin->winSetEnabledImage( 0, TheMappedImageCollection->findImageByName("MissionLoad_GLA") );
- m_progressBar->winSetEnabledImage( 6, TheMappedImageCollection->findImageByName("LoadingBar_ProgressCenter3") );
+ if (const Image *image = TheMappedImageCollection->findImageByName("MissionLoad_GLA"))
+ {
+ backgroundWin->winSetEnabledImage( 0, image );
+ }
+ if (const Image *image = TheMappedImageCollection->findImageByName("LoadingBar_ProgressCenter3"))
+ {
+ m_progressBar->winSetEnabledImage( 6, image );
+ }
}
else if (campaignName.compareNoCase("China") == 0)
{
- backgroundWin->winSetEnabledImage( 0, TheMappedImageCollection->findImageByName("MissionLoad_China") );
- m_progressBar->winSetEnabledImage( 6, TheMappedImageCollection->findImageByName("LoadingBar_ProgressCenter1") );
+ if (const Image *image = TheMappedImageCollection->findImageByName("MissionLoad_China"))
+ {
+ backgroundWin->winSetEnabledImage( 0, image );
+ }
+ if (const Image *image = TheMappedImageCollection->findImageByName("LoadingBar_ProgressCenter1"))
+ {
+ m_progressBar->winSetEnabledImage( 6, image );
+ }
}
// else leave the default background screen
@@ -557,8 +562,9 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
m_videoStream->frameDecompress();
m_videoStream->frameRender(m_videoBuffer);
-// PULLED FROM THE MISSION DISK
-// moveWindows( m_videoStream->frameIndex());
+#if RTS_GENERALS
+ moveWindows( m_videoStream->frameIndex());
+#endif
m_videoStream->frameNext();
@@ -583,15 +589,41 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
TheDisplay->draw();
}
+#if !RTS_GENERALS
// let the background image show through
m_videoStream->close();
m_videoStream = nullptr;
m_loadScreen->winGetInstanceData()->setVideoBuffer( nullptr );
TheDisplay->draw();
+#endif
}
else
{
+#if RTS_GENERALS
+ // if we're min speced
+ m_videoStream->frameGoto(m_videoStream->frameCount()); // zero based
+ while(!m_videoStream->isFrameReady())
+ Sleep(1);
+ m_videoStream->frameDecompress();
+ m_videoStream->frameRender(m_videoBuffer);
+ if(m_videoBuffer)
+ m_loadScreen->winGetInstanceData()->setVideoBuffer(m_videoBuffer);
+
+ m_objectiveWin->winHide(FALSE);
+ for(i = 0; i < MAX_DISPLAYED_UNITS; ++i)
+ m_unitDesc[i]->winHide(FALSE);
+ m_location->winHide(FALSE);
+
+ // Audio was choppy so, I chopped it out!
+ TheAudio->friend_forcePlayAudioEventRTS(&TheCampaignManager->getCurrentMission()->m_briefingVoice);
+
+ for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i)
+ {
+ GadgetStaticTextSetText(m_objectiveLines[i], m_unicodeObjectiveLines[i]);
+ }
+#else
// if we're min spec'ed don't play a movie
+#endif
Int delay = mission->m_voiceLength * 1000;
Int begin = timeGetTime();
@@ -687,54 +719,16 @@ ChallengeLoadScreen::ChallengeLoadScreen( void )
ChallengeLoadScreen::~ChallengeLoadScreen( void )
{
- m_progressBar = nullptr;
-
delete m_videoBuffer;
- m_videoBuffer = nullptr;
if ( m_videoStream )
{
m_videoStream->close();
- m_videoStream = nullptr;
}
- m_bioNameLeft = nullptr;
- m_bioAgeLeft = nullptr;
- m_bioBirthplaceLeft = nullptr;
- m_bioStrategyLeft = nullptr;
- m_bioBigNameEntryLeft = nullptr;
- m_bioNameEntryLeft = nullptr;
- m_bioAgeEntryLeft = nullptr;
- m_bioBirthplaceEntryLeft = nullptr;
- m_bioStrategyEntryLeft = nullptr;
- m_bioBigNameEntryRight = nullptr;
- m_bioNameRight = nullptr;
- m_bioAgeRight = nullptr;
- m_bioBirthplaceRight = nullptr;
- m_bioStrategyRight = nullptr;
- m_bioNameEntryRight = nullptr;
- m_bioAgeEntryRight = nullptr;
- m_bioBirthplaceEntryRight = nullptr;
- m_bioStrategyEntryRight = nullptr;
-
- m_portraitLeft = nullptr;
- m_portraitRight = nullptr;
- m_portraitMovieLeft = nullptr;
- m_portraitMovieRight = nullptr;
-
-// m_overlayReticleCrosshairs = nullptr;
-// m_overlayReticleCircleLineOuter = nullptr;
-// m_overlayReticleCircleLineInner = nullptr;
- m_overlayReticleCircleAlphaOuter = nullptr;
- m_overlayReticleCircleAlphaInner = nullptr;
- m_overlayVsBackdrop = nullptr;
- m_overlayVs = nullptr;
-
delete m_wndVideoManager;
- m_wndVideoManager = nullptr;
TheAudio->removeAudioEvent( m_ambientLoopHandle );
- m_ambientLoopHandle = 0;
}
// accepts the number of chars to advance, the window we're concerned with, the total text for final display, and the current position of the readout
@@ -1184,8 +1178,6 @@ ShellGameLoadScreen::ShellGameLoadScreen( void )
ShellGameLoadScreen::~ShellGameLoadScreen( void )
{
-
- m_progressBar = nullptr;
}
void ShellGameLoadScreen::init( GameInfo *game )
@@ -1238,6 +1230,9 @@ void ShellGameLoadScreen::update( Int percent )
MultiPlayerLoadScreen::MultiPlayerLoadScreen( void )
{
m_mapPreview = nullptr;
+ m_portraitLocalGeneral = nullptr;
+ m_featuresLocalGeneral = nullptr;
+ m_nameLocalGeneral = nullptr;
for(Int i = 0; i < MAX_SLOTS; ++i)
{
@@ -1256,18 +1251,6 @@ MultiPlayerLoadScreen::~MultiPlayerLoadScreen( void )
m_mapPreview->winSetUserData(nullptr);
}
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- m_playerLookup[i] = -1;
- }
-
- m_portraitLocalGeneral = nullptr;
- m_featuresLocalGeneral = nullptr;
- m_nameLocalGeneral = nullptr;
-
TheAudio->removeAudioEvent( AHSV_StopTheMusicFade );
// TheAudio->stopAudio( AudioAffect_Music );
}
@@ -1286,8 +1269,12 @@ void MultiPlayerLoadScreen::init( GameInfo *game )
pt = ThePlayerTemplateStore->getNthPlayerTemplate(lSlot->getPlayerTemplate());
else
pt = ThePlayerTemplateStore->findPlayerTemplate( TheNameKeyGenerator->nameToKey("FactionObserver") );
-// const Image *loadScreenImage = TheMappedImageCollection->findImageByName(pt->getLoadScreen());
+#if RTS_GENERALS
+ const Image *loadScreenImage = TheMappedImageCollection->findImageByName(pt->getLoadScreen());
+ if(loadScreenImage)
+ m_loadScreen->winSetEnabledImage(0, loadScreenImage);
+#else
// add portrait, features, and name for the local player's general
const GeneralPersona *localGeneral = TheChallengeGenerals->getGeneralByTemplateName( pt->getName() );
const Image *portrait = nullptr;
@@ -1319,6 +1306,7 @@ void MultiPlayerLoadScreen::init( GameInfo *game )
GadgetStaticTextSetText( m_featuresLocalGeneral, TheGameText->fetch( features.isEmpty() ? "GUI:PlayerObserver" : pt->getGeneralFeatures() ) );
m_nameLocalGeneral = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "MultiplayerLoadScreen.wnd:LocalGeneralName"));
GadgetStaticTextSetText( m_nameLocalGeneral, localName );
+#endif
AsciiString musicName = pt->getLoadScreenMusic();
if ( ! musicName.isEmpty() )
@@ -1332,9 +1320,6 @@ void MultiPlayerLoadScreen::init( GameInfo *game )
}
-
-// if(loadScreenImage)
-// m_loadScreen->winSetEnabledImage(0, loadScreenImage);
//DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!"));
//DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers()));
@@ -1382,7 +1367,9 @@ void MultiPlayerLoadScreen::init( GameInfo *game )
continue;
Color houseColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor();
-
+#if RTS_GENERALS
+ GadgetProgressBarSetEnabledBarColor(m_progressBars[netSlot],houseColor );
+#else
// format the progress bar to house colors
AsciiString imageName;
imageName.format("LoadingBar_ProgressCenter%d", slot->getApparentColor());
@@ -1390,6 +1377,7 @@ void MultiPlayerLoadScreen::init( GameInfo *game )
if (! houseImage)
houseImage = TheMappedImageCollection->findImageByName("LoadingBar_Progress");
m_progressBars[netSlot]->winSetEnabledImage( 6, houseImage );
+#endif
UnicodeString name = slot->getName();
GadgetStaticTextSetText(m_playerNames[netSlot], name );
@@ -1498,6 +1486,9 @@ GameSpyLoadScreen::GameSpyLoadScreen( void )
{
m_mapPreview = nullptr;
+ m_portraitLocalGeneral = nullptr;
+ m_featuresLocalGeneral = nullptr;
+ m_nameLocalGeneral = nullptr;
for(Int i = 0; i < MAX_SLOTS; ++i)
{
@@ -1523,18 +1514,6 @@ GameSpyLoadScreen::~GameSpyLoadScreen( void )
{
m_mapPreview->winSetUserData(nullptr);
}
-
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- m_playerLookup[i] = -1;
- m_playerFavoriteFactions[i]= nullptr;
- m_playerTotalDisconnects[i]= nullptr;
- m_playerWin[i]= nullptr;
- m_playerWinLosses[i]= nullptr;
- }
}
extern Int GetAdditionalDisconnectsFromUserFile(Int playerID);
@@ -1555,10 +1534,12 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum());
pt = ThePlayerTemplateStore->getNthPlayerTemplate(lSlot->getPlayerTemplate());
else
pt = ThePlayerTemplateStore->findPlayerTemplate( TheNameKeyGenerator->nameToKey("FactionObserver") );
-// const Image *loadScreenImage = TheMappedImageCollection->findImageByName(pt->getLoadScreen());
-// if(loadScreenImage)
-// m_loadScreen->winSetEnabledImage(0, loadScreenImage);
+#if RTS_GENERALS
+ const Image *loadScreenImage = TheMappedImageCollection->findImageByName(pt->getLoadScreen());
+ if(loadScreenImage)
+ m_loadScreen->winSetEnabledImage(0, loadScreenImage);
+#else
// add portrait, features, and name for the local player's general
const GeneralPersona *localGeneral = TheChallengeGenerals->getGeneralByTemplateName( pt->getName() );
const Image *portrait = nullptr;
@@ -1590,6 +1571,7 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum());
GadgetStaticTextSetText( m_featuresLocalGeneral, TheGameText->fetch( features.isEmpty() ? "GUI:PlayerObserver" : pt->getGeneralFeatures() ) );
m_nameLocalGeneral = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "GameSpyLoadScreen.wnd:LocalGeneralName"));
GadgetStaticTextSetText( m_nameLocalGeneral, localName );
+#endif
GameWindow *teamWin[MAX_SLOTS];
Int i = 0;
@@ -1665,7 +1647,9 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum());
continue;
Color houseColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor();
-
+#if RTS_GENERALS
+ GadgetProgressBarSetEnabledBarColor(m_progressBars[netSlot],houseColor );
+#else
// format the progress bar to house colors
AsciiString imageName;
imageName.format("LoadingBar_ProgressCenter%d", slot->getApparentColor());
@@ -1673,6 +1657,7 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum());
if (! houseImage)
houseImage = TheMappedImageCollection->findImageByName("LoadingBar_Progress");
m_progressBars[netSlot]->winSetEnabledImage( 6, houseImage );
+#endif
UnicodeString name = slot->getName();
GadgetStaticTextSetText(m_playerNames[netSlot], name );
@@ -1873,16 +1858,6 @@ MapTransferLoadScreen::MapTransferLoadScreen( void )
MapTransferLoadScreen::~MapTransferLoadScreen( void )
{
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_progressText[i]= nullptr;
- m_playerLookup[i] = -1;
- m_oldProgress[i] = -1;
- }
- m_fileNameText = nullptr;
- m_timeoutText = nullptr;
}
void MapTransferLoadScreen::init( GameInfo *game )
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp b/Core/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp b/Core/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp
rename to Core/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp b/Core/GameEngine/Source/GameClient/GUI/WindowLayout.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp
rename to Core/GameEngine/Source/GameClient/GUI/WindowLayout.cpp
diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt
index addfdafc4f0..e6720304e31 100644
--- a/Generals/Code/GameEngine/CMakeLists.txt
+++ b/Generals/Code/GameEngine/CMakeLists.txt
@@ -167,29 +167,29 @@ set(GAMEENGINE_SRC
Include/GameClient/GadgetTabControl.h
Include/GameClient/GadgetTextEntry.h
Include/GameClient/GameClient.h
- Include/GameClient/GameFont.h
+# Include/GameClient/GameFont.h
Include/GameClient/GameInfoWindow.h
Include/GameClient/GameText.h
- Include/GameClient/GameWindow.h
- Include/GameClient/GameWindowGlobal.h
+# Include/GameClient/GameWindow.h
+# Include/GameClient/GameWindowGlobal.h
Include/GameClient/GameWindowID.h
Include/GameClient/GameWindowManager.h
- Include/GameClient/GameWindowTransitions.h
+# Include/GameClient/GameWindowTransitions.h
Include/GameClient/GlobalLanguage.h
Include/GameClient/GraphDraw.h
Include/GameClient/GUICallbacks.h
Include/GameClient/GUICommandTranslator.h
- Include/GameClient/HeaderTemplate.h
+# Include/GameClient/HeaderTemplate.h
Include/GameClient/HintSpy.h
Include/GameClient/HotKey.h
Include/GameClient/Image.h
- Include/GameClient/IMEManager.h
+# Include/GameClient/IMEManager.h
Include/GameClient/InGameUI.h
# Include/GameClient/Keyboard.h
Include/GameClient/KeyDefs.h
Include/GameClient/LanguageFilter.h
Include/GameClient/Line2D.h
- Include/GameClient/LoadScreen.h
+# Include/GameClient/LoadScreen.h
Include/GameClient/LookAtXlat.h
# Include/GameClient/MapUtil.h
Include/GameClient/MessageBox.h
@@ -200,7 +200,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/Mouse.h
# Include/GameClient/ParticleSys.h
Include/GameClient/PlaceEventTranslator.h
- Include/GameClient/ProcessAnimateWindow.h
+# Include/GameClient/ProcessAnimateWindow.h
Include/GameClient/RadiusDecal.h
Include/GameClient/RayEffect.h
Include/GameClient/SelectionInfo.h
@@ -215,10 +215,10 @@ set(GAMEENGINE_SRC
# Include/GameClient/VideoPlayer.h
# Include/GameClient/View.h
# Include/GameClient/Water.h
- Include/GameClient/WindowLayout.h
+# Include/GameClient/WindowLayout.h
# Include/GameClient/WindowVideoManager.h
Include/GameClient/WindowXlat.h
- Include/GameClient/WinInstanceData.h
+# Include/GameClient/WinInstanceData.h
Include/GameLogic/AI.h
Include/GameLogic/AIDock.h
Include/GameLogic/AIGuard.h
@@ -681,12 +681,12 @@ set(GAMEENGINE_SRC
Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
- Source/GameClient/GUI/GameFont.cpp
- Source/GameClient/GUI/GameWindow.cpp
- Source/GameClient/GUI/GameWindowGlobal.cpp
+# Source/GameClient/GUI/GameFont.cpp
+# Source/GameClient/GUI/GameWindow.cpp
+# Source/GameClient/GUI/GameWindowGlobal.cpp
Source/GameClient/GUI/GameWindowManager.cpp
Source/GameClient/GUI/GameWindowManagerScript.cpp
- Source/GameClient/GUI/GameWindowTransitions.cpp
+# Source/GameClient/GUI/GameWindowTransitions.cpp
Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
@@ -738,15 +738,15 @@ set(GAMEENGINE_SRC
Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp
Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
- Source/GameClient/GUI/HeaderTemplate.cpp
- Source/GameClient/GUI/IMEManager.cpp
- Source/GameClient/GUI/LoadScreen.cpp
- Source/GameClient/GUI/ProcessAnimateWindow.cpp
+# Source/GameClient/GUI/HeaderTemplate.cpp
+# Source/GameClient/GUI/IMEManager.cpp
+# Source/GameClient/GUI/LoadScreen.cpp
+# Source/GameClient/GUI/ProcessAnimateWindow.cpp
Source/GameClient/GUI/Shell/Shell.cpp
Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
- Source/GameClient/GUI/WindowLayout.cpp
+# Source/GameClient/GUI/WindowLayout.cpp
# Source/GameClient/GUI/WindowVideoManager.cpp
- Source/GameClient/GUI/WinInstanceData.cpp
+# Source/GameClient/GUI/WinInstanceData.cpp
Source/GameClient/InGameUI.cpp
# Source/GameClient/Input/Keyboard.cpp
# Source/GameClient/Input/Mouse.cpp
diff --git a/Generals/Code/GameEngine/Include/GameClient/CampaignManager.h b/Generals/Code/GameEngine/Include/GameClient/CampaignManager.h
index 77b4fe19875..da034d5ee98 100644
--- a/Generals/Code/GameEngine/Include/GameClient/CampaignManager.h
+++ b/Generals/Code/GameEngine/Include/GameClient/CampaignManager.h
@@ -82,6 +82,7 @@ class Mission : public MemoryPoolObject
AsciiString m_locationNameLabel;
AsciiString m_unitNames[MAX_DISPLAYED_UNITS];
Int m_voiceLength;
+ AsciiString m_generalName;
};
class Campaign : public MemoryPoolObject
diff --git a/Generals/Code/GameEngine/Include/GameClient/GameFont.h b/Generals/Code/GameEngine/Include/GameClient/GameFont.h
deleted file mode 100644
index 0119bcf2d8a..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GameFont.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameFont.h ///////////////////////////////////////////////////////////////////////////////
-// Created: Colin Day, June 2001
-// Desc: Game representations for fonts
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "Common/SubsystemInterface.h"
-#include "Lib/BaseType.h"
-#include "Common/AsciiString.h"
-#include "Common/GameMemory.h"
-
-//-------------------------------------------------------------------------------------------------
-/** A font for use in the device independent game */
-//-------------------------------------------------------------------------------------------------
-class GameFont : public MemoryPoolObject
-{
- MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(GameFont, "GameFont")
-public:
- GameFont* next; ///< for library use
- AsciiString nameString;
- Int pointSize; ///< point size of font
- Int height; ///< pixel height of font
- void* fontData; ///< font data to be filled out for device specific font
- Bool bold; ///< is this font bold
-};
-EMPTY_DTOR(GameFont)
-
-//-------------------------------------------------------------------------------------------------
-/** Interface to access fonts for the system */
-//-------------------------------------------------------------------------------------------------
-class FontLibrary : public SubsystemInterface
-{
-
-public:
-
-
-public:
-
- FontLibrary( void );
- virtual ~FontLibrary( void );
-
- virtual void init( void );
- virtual void reset( void );
- virtual void update( void ) { }
-
- GameFont *getFont( AsciiString name, Int pointSize, Bool bold ); ///< get a font pointer
-
- GameFont *firstFont( void ); ///< return first font
- GameFont *nextFont( GameFont *font ); ///< get next font in library
-
- Int getCount( void ); ///< return how many fonts are loaded in this lib
-
-protected:
-
- void deleteAllFonts( void ); ///< delete all fonts in this library
- void linkFont( GameFont *font ); ///< add to font list
- void unlinkFont( GameFont *font ); ///< remove font from list
-
- /// load the font data pointer based on everything else we already have set
- virtual Bool loadFontData( GameFont *font ) = 0;
- /// release the font data pointer
- virtual void releaseFontData( GameFont *font ) { };
-
- GameFont *m_fontList; ///< list of fonts we have loaded
- Int m_count; ///< number of unique fonts loaded in this lib
-
-};
-
-// INLINING ///////////////////////////////////////////////////////////////////////////////////////
-inline Int FontLibrary::getCount( void ) { return m_count; }
-inline GameFont *FontLibrary::firstFont( void ) { return m_fontList; }
-inline GameFont *FontLibrary::nextFont( GameFont *font )
-{
- if( font )
- return font->next;
- return nullptr;
-}
-
-// EXTERNALS //////////////////////////////////////////////////////////////////////////////////////
-extern FontLibrary *TheFontLibrary; ///< font library external
diff --git a/Generals/Code/GameEngine/Include/GameClient/GameWindow.h b/Generals/Code/GameEngine/Include/GameClient/GameWindow.h
deleted file mode 100644
index faed99452bf..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GameWindow.h
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindow.h /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GameWindow.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Header for game windowing system for generic windows and GUI
-// elements
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Lib/BaseType.h"
-#include "Common/GameMemory.h"
-#include "GameClient/Image.h"
-#include "GameClient/DisplayString.h"
-#include "GameClient/WinInstanceData.h"
-#include "GameClient/Color.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-class GameWindow;
-class WindowLayout;
-class GameFont;
-class TransitionWindow;
-struct GameWindowEditData;
-
-///////////////////////////////////////////////////////////////////////////////
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-enum { WIN_COLOR_UNDEFINED = GAME_COLOR_UNDEFINED };
-
-// WindowMsgData --------------------------------------------------------------
-//-----------------------------------------------------------------------------
-typedef UnsignedInt WindowMsgData;
-
-//-----------------------------------------------------------------------------
-enum WindowMsgHandledType CPP_11(: Int) { MSG_IGNORED, MSG_HANDLED };
-
-// callback types -------------------------------------------------------------
-typedef void (*GameWinMsgBoxFunc)( void ); //used for the Message box callbacks.
-typedef void (*GameWinDrawFunc)( GameWindow *,
- WinInstanceData * );
-typedef void (*GameWinTooltipFunc)( GameWindow *,
- WinInstanceData *,
- UnsignedInt );
-typedef WindowMsgHandledType (*GameWinInputFunc)( GameWindow *,
- UnsignedInt,
- WindowMsgData,
- WindowMsgData );
-typedef WindowMsgHandledType (*GameWinSystemFunc)( GameWindow *,
- UnsignedInt,
- WindowMsgData,
- WindowMsgData );
-
-enum
-{
-
- WIN_MAX_WINDOWS = 576,
- CURSOR_MOVE_TOL_SQ = 4,
- TOOLTIP_DELAY = 10,
- WIN_TOOLTIP_LEN = 64, // max length of tooltip text
-
-};
-
-// macros for easier conversion -----------------------------------------------
-#define SHORTTOLONG(a, b) ((UnsignedShort)(a) | ((UnsignedShort)(b) << 16))
-#define LOLONGTOSHORT(a) ((a) & 0x0000FFFF)
-#define HILONGTOSHORT(b) (((b) & 0xFFFF0000) >> 16)
-
-// Game window messages -------------------------------------------------------
-//-----------------------------------------------------------------------------
-enum GameWindowMessage CPP_11(: Int)
-{
-
- GWM_NONE = 0,
-
- GWM_CREATE, GWM_DESTROY,
- GWM_ACTIVATE, GWM_ENABLE,
- GWM_LEFT_DOWN, GWM_LEFT_UP,
- GWM_LEFT_DOUBLE_CLICK, GWM_LEFT_DRAG,
- GWM_MIDDLE_DOWN, GWM_MIDDLE_UP,
- GWM_MIDDLE_DOUBLE_CLICK, GWM_MIDDLE_DRAG,
- GWM_RIGHT_DOWN, GWM_RIGHT_UP,
- GWM_RIGHT_DOUBLE_CLICK, GWM_RIGHT_DRAG,
- GWM_MOUSE_ENTERING, GWM_MOUSE_LEAVING,
- GWM_WHEEL_UP, GWM_WHEEL_DOWN,
- GWM_CHAR, GWM_SCRIPT_CREATE,
- // note that GWM_MOUSE_POS is only actually propagated to windows if the static
- // sendMousePosMessages is set to true in the window manager file. See the
- // comment on the static declaration for additional info
- GWM_INPUT_FOCUS, GWM_MOUSE_POS,
- GWM_IME_CHAR, GWM_IME_STRING
-
-};
-
-// WinInputReturnCode ------------------------------------------------------
-/** These return codes are returned when after processing events through
- * the window system */
-//-----------------------------------------------------------------------------
-enum WinInputReturnCode CPP_11(: Int)
-{
- WIN_INPUT_NOT_USED = 0,
- WIN_INPUT_USED,
-};
-
-
-#define GWM_USER 32768
-
-// Window status flags --------------------------------------------------------
-//-----------------------------------------------------------------------------
-enum
-{
-
- // when you edit this, remember to edit WindowStatusNames[]
- WIN_STATUS_NONE = 0x00000000, // No status bits set at all
- WIN_STATUS_ACTIVE = 0x00000001, // At the top of the window list
- WIN_STATUS_TOGGLE = 0x00000002, // If set, click to toggle
- WIN_STATUS_DRAGGABLE = 0x00000004, // Window can be dragged
- WIN_STATUS_ENABLED = 0x00000008, // Window can receive input
- WIN_STATUS_HIDDEN = 0x00000010, // Window is hidden, no input
- WIN_STATUS_ABOVE = 0x00000020, // Window is always above others
- WIN_STATUS_BELOW = 0x00000040, // Window is always below others
- WIN_STATUS_IMAGE = 0x00000080, // Window is drawn with images
- WIN_STATUS_TAB_STOP = 0x00000100, // Window is a tab stop
- WIN_STATUS_NO_INPUT = 0x00000200, // Window does not take input
- WIN_STATUS_NO_FOCUS = 0x00000400, // Window does not take focus
- WIN_STATUS_DESTROYED = 0x00000800, // Window has been destroyed
- WIN_STATUS_BORDER = 0x00001000, // Window will be drawn with Borders & Corners
- WIN_STATUS_SMOOTH_TEXT = 0x00002000, // Window text will be drawn with smoothing
- WIN_STATUS_ONE_LINE = 0x00004000, // Window text will be drawn on only one line
- WIN_STATUS_NO_FLUSH = 0x00008000, // Window images will not be unloaded when window is hidden
- WIN_STATUS_SEE_THRU = 0x00010000, // Will not draw, but it NOT hidden ... does not apply to children
- WIN_STATUS_RIGHT_CLICK = 0x00020000, // Window pays attention to right clicks
- WIN_STATUS_WRAP_CENTERED = 0x00040000, // Text will be centered on each word wrap or \n
- WIN_STATUS_CHECK_LIKE = 0x00080000, // Make push buttons "check-like" with dual state
- WIN_STATUS_HOTKEY_TEXT = 0x00100000, // Make push buttons "check-like" with dual state
- WIN_STATUS_USE_OVERLAY_STATES = 0x00200000, // Push buttons will use the global automatic rendering overlay for disabled, hilited, and pushed.
- WIN_STATUS_NOT_READY = 0x00400000, // A disabled button that is available -- but not yet (power charge, fire delay).
- WIN_STATUS_FLASHING = 0x00800000, // Used for buttons that do cameo flashes.
- WIN_STATUS_ALWAYS_COLOR = 0x01000000, // Never render these buttons using greyscale renderer when button disabled.
- // when you edit this, remember to edit WindowStatusNames[]
-
-};
-
-
-// Message Box Button flags --------------------------------------------------------
-//-----------------------------------------------------------------------------
-enum
-{
- MSG_BOX_YES = 0x01, //Display the yes button
- MSG_BOX_NO = 0x02, //Display the No button
- MSG_BOX_OK = 0x08, //Display the Ok button
- MSG_BOX_CANCEL = 0x04, //Display the Cancel button
-};
-
-
-// WindowMessageBoxData ---------------------------------------------------------
-/** Data attached to each Message box window */
-//-----------------------------------------------------------------------------
-struct WindowMessageBoxData
-{
- GameWinMsgBoxFunc yesCallback; /// m_transitionWindows;
-
-};
-
-// TheSuperHackers @feature helmutbuhler 24/04/2025
-// GameWindow that does nothing. Used for Headless Mode.
-class GameWindowDummy : public GameWindow
-{
- MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(GameWindowDummy, "GameWindowDummy")
-public:
- virtual void winDrawBorder() {}
- virtual void* winGetUserData(void) { return nullptr; }
-};
-
-// ModalWindow ----------------------------------------------------------------
-//-----------------------------------------------------------------------------
-class ModalWindow : public MemoryPoolObject
-{
- MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ModalWindow, "ModalWindow" )
-public:
- GameWindow *window; // Pointer to Modal Window
- ModalWindow *next; // Next Window Pointer
-
-};
-EMPTY_DTOR(ModalWindow)
-
-// Errors returned by window functions
-enum
-{
-
- WIN_ERR_OK = 0, // No Error
- WIN_ERR_GENERAL_FAILURE = -1, // General library failure
- WIN_ERR_INVALID_WINDOW = -2, // Window parameter was invalid
- WIN_ERR_INVALID_PARAMETER = -3, // Parameter was invalid
- WIN_ERR_MOUSE_CAPTURED = -4, // Mouse already captured
- WIN_ERR_KEYBOARD_CAPTURED = -5, // Keyboard already captured
- WIN_ERR_OUT_OF_WINDOWS = -6 // Too many windows have been created
-
-};
-
-// Input capture/release flags
-enum
-{
-
- WIN_CAPTURE_MOUSE = 0x00000001, // capture mouse
- WIN_CAPTURE_KEYBOARD = 0x00000002, // capture keyboard
- WIN_CAPTURE_ALL = 0xFFFFFFFF, // capture keyboard and mouse
-
-};
-
-// INLINING ///////////////////////////////////////////////////////////////////
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
-extern void GameWinDefaultDraw( GameWindow *window,
- WinInstanceData *instData );
-extern WindowMsgHandledType GameWinDefaultSystem( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 );
-extern WindowMsgHandledType GameWinDefaultInput( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 );
-extern WindowMsgHandledType GameWinBlockInput( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 );
-extern void GameWinDefaultTooltip( GameWindow *window,
- WinInstanceData *instData,
- UnsignedInt mouse );
-
-extern const char *const WindowStatusNames[];
-extern const char *const WindowStyleNames[];
diff --git a/Generals/Code/GameEngine/Include/GameClient/GameWindowGlobal.h b/Generals/Code/GameEngine/Include/GameClient/GameWindowGlobal.h
deleted file mode 100644
index d27d107b9e7..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GameWindowGlobal.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowGlobal.h ///////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GameWindowGlobal.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: These are some global functions that every game using this
-// window system must implement for their current technology
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Lib/BaseType.h"
-#include "GameClient/Image.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-// INLINING ///////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// EXTERNALS //////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GameWindowTransitions.h b/Generals/Code/GameEngine/Include/GameClient/GameWindowTransitions.h
deleted file mode 100644
index fdff9dbaf48..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GameWindowTransitions.h
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowTransitions.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Dec 2002
-//
-// Filename: GameWindowTransitions.h
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "Common/GameCommon.h"
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class GameWindow;
-class Image;
-class DisplayString;
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-enum
-{
-TRANSITION_FLASH = 0,
-BUTTON_TRANSITION_FLASH,
-WIN_FADE_TRANSITION,
-WIN_SCALE_UP_TRANSITION,
-MAINMENU_SCALE_UP_TRANSITION,
-TEXT_TYPE_TRANSITION,
-SCREEN_FADE_TRANSITION,
-COUNT_UP_TRANSITION,
-FULL_FADE_TRANSITION,
-TEXT_ON_FRAME_TRANSITION,
-MAINMENU_MEDIUM_SCALE_UP_TRANSITION,
-MAINMENU_SMALL_SCALE_DOWN_TRANSITION,
-CONTROL_BAR_ARROW_TRANSITION,
-SCORE_SCALE_UP_TRANSITION,
-REVERSE_SOUND_TRANSITION,
-
-MAX_TRANSITION_WINDOW_STYLES
-};
-
-static const LookupListRec TransitionStyleNames[] =
-{
- { "FLASH", TRANSITION_FLASH },
- { "BUTTONFLASH", BUTTON_TRANSITION_FLASH },
- { "WINFADE", WIN_FADE_TRANSITION },
- { "WINSCALEUP", WIN_SCALE_UP_TRANSITION },
- { "MAINMENUSCALEUP", MAINMENU_SCALE_UP_TRANSITION },
- { "TYPETEXT", TEXT_TYPE_TRANSITION },
- { "SCREENFADE", SCREEN_FADE_TRANSITION },
- { "COUNTUP", COUNT_UP_TRANSITION },
- { "FULLFADE", FULL_FADE_TRANSITION },
- { "TEXTONFRAME", TEXT_ON_FRAME_TRANSITION },
- { "MAINMENUMEDIUMSCALEUP", MAINMENU_MEDIUM_SCALE_UP_TRANSITION },
- { "MAINMENUSMALLSCALEDOWN", MAINMENU_SMALL_SCALE_DOWN_TRANSITION },
- { "CONTROLBARARROW", CONTROL_BAR_ARROW_TRANSITION },
- { "SCORESCALEUP", SCORE_SCALE_UP_TRANSITION },
- { "REVERSESOUND", REVERSE_SOUND_TRANSITION },
- { nullptr, 0 }
-};
-static_assert(ARRAY_SIZE(TransitionStyleNames) == MAX_TRANSITION_WINDOW_STYLES + 1, "Incorrect array size");
-
-// base class for the transitions
-// inherit off of this adding in all the values
-class Transition
-{
-public:
- Transition ( void );
- virtual ~Transition( void );
-
- virtual void init( GameWindow *win ) = 0;
- virtual void update( Int frame ) = 0;
- virtual void reverse( void ) = 0;
- virtual void draw( void ) = 0;
-
- virtual void skip( void ) = 0;
-
- void unlinkGameWindow(GameWindow* win) { if ( m_win == win ) m_win = nullptr; }
- Bool isFinished( void ) { return m_isFinished; }
- Int getFrameLength( void ){ return m_frameLength; }
-protected:
-
- Int m_frameLength; // how many frames does this thing take.
- Bool m_isFinished; // when we finish we set this
- Bool m_isForward;
- Bool m_isReversed; // when we reverse we set this
- GameWindow *m_win;
-};
-
-//-----------------------------------------------------------------------------
-class TextOnFrameTransition : public Transition
-{
-public:
- TextOnFrameTransition ( void );
- virtual ~TextOnFrameTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- TEXTONFRAMETRANSITION_START = 0,
- TEXTONFRAMETRANSITION_END = 1 // Max text type we'll allow.
- };
-
-};
-
-//-----------------------------------------------------------------------------
-class ReverseSoundTransition : public Transition
-{
-public:
- ReverseSoundTransition ( void );
- virtual ~ReverseSoundTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- REVERSESOUNDTRANSITION_START = 0,
- REVERSESOUNDTRANSITION_FIRESOUND = 1,
- REVERSESOUNDTRANSITION_END = 2 // Max text type we'll allow.
- };
-
-};
-
-//-----------------------------------------------------------------------------
-class FullFadeTransition : public Transition
-{
-public:
- FullFadeTransition ( void );
- virtual ~FullFadeTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- FULLFADETRANSITION_START = 0,
- FULLFADETRANSITION_END = 10 // Max text type we'll allow.
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Real m_percent;
- Int m_drawState;
-
-};
-//-----------------------------------------------------------------------------
-class ControlBarArrowTransition : public Transition
-{
-public:
- ControlBarArrowTransition ( void );
- virtual ~ControlBarArrowTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- CONTROLBARARROWTRANSITION_START = 0,
- CONTROLBARARROWTRANSITION_BEGIN_FADE = 16,
- CONTROLBARARROWTRANSITION_END = 22 // Max text type we'll allow.
- };
- ICoord2D m_pos;
- ICoord2D m_incrementPos;
- ICoord2D m_size;
- Real m_percent;
- Real m_fadePercent;
- Int m_drawState;
- const Image* m_arrowImage;
-
-};
-//-----------------------------------------------------------------------------
-class ScreenFadeTransition : public Transition
-{
-public:
- ScreenFadeTransition ( void );
- virtual ~ScreenFadeTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- SCREENFADETRANSITION_START = 0,
- SCREENFADETRANSITION_END = 30 // Max text type we'll allow.
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Real m_percent;
- Int m_drawState;
-
-};
-//-----------------------------------------------------------------------------
-class CountUpTransition : public Transition
-{
-public:
- CountUpTransition ( void );
- virtual ~CountUpTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- COUNTUPTRANSITION_START = 0,
- COUNTUPTRANSITION_END = 30 // Max text type we'll allow.
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- UnicodeString m_fullText;
- UnicodeString m_partialText;
- Int m_intValue;
- Int m_currentValue;
- enum{
- COUNT_ONES = 1,
- COUNT_100S = 100,
- COUNT_1000S = 1000
- };
- Int m_countState;
-};
-
-//-----------------------------------------------------------------------------
-class TextTypeTransition : public Transition
-{
-public:
- TextTypeTransition ( void );
- virtual ~TextTypeTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- TEXTTYPETRANSITION_START = 0,
- TEXTTYPETRANSITION_END = 30 // Max text type we'll allow.
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- UnicodeString m_fullText;
- UnicodeString m_partialText;
- DisplayString *m_dStr;
-};
-
-//-----------------------------------------------------------------------------
-class MainMenuScaleUpTransition : public Transition
-{
-public:
- MainMenuScaleUpTransition ( void );
- virtual ~MainMenuScaleUpTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- MAINMENUSCALEUPTRANSITION_START = 0,
- MAINMENUSCALEUPTRANSITION_END = 5
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- ICoord2D m_growPos;
- ICoord2D m_growSize;
- ICoord2D m_incrementPos;
- ICoord2D m_incrementSize;
- GameWindow *m_growWin;
-};
-
-
-//-----------------------------------------------------------------------------
-class MainMenuMediumScaleUpTransition : public Transition
-{
-public:
- MainMenuMediumScaleUpTransition ( void );
- virtual ~MainMenuMediumScaleUpTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- MAINMENUMEDIUMSCALEUPTRANSITION_START = 0,
- MAINMENUMEDIUMSCALEUPTRANSITION_END = 3
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- ICoord2D m_growPos;
- ICoord2D m_growSize;
- ICoord2D m_incrementSize;
- GameWindow *m_growWin;
-};
-
-//-----------------------------------------------------------------------------
-class MainMenuSmallScaleDownTransition : public Transition
-{
-public:
- MainMenuSmallScaleDownTransition ( void );
- virtual ~MainMenuSmallScaleDownTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- MAINMENUSMALLSCALEDOWNTRANSITION_START = 0,
- MAINMENUSMALLSCALEDOWNTRANSITION_1 = 1,
- MAINMENUSMALLSCALEDOWNTRANSITION_2 = 2,
- MAINMENUSMALLSCALEDOWNTRANSITION_3 = 3,
- MAINMENUSMALLSCALEDOWNTRANSITION_4 = 4,
- MAINMENUSMALLSCALEDOWNTRANSITION_5 = 5,
- MAINMENUSMALLSCALEDOWNTRANSITION_END
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- ICoord2D m_growPos;
- ICoord2D m_growSize;
- ICoord2D m_incrementSize;
- GameWindow *m_growWin;
-};
-
-//-----------------------------------------------------------------------------
-class ScaleUpTransition : public Transition
-{
-public:
- ScaleUpTransition ( void );
- virtual ~ScaleUpTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- SCALEUPTRANSITION_START = 0,
- SCALEUPTRANSITION_1 = 1,
- SCALEUPTRANSITION_2 = 2,
- SCALEUPTRANSITION_3 = 3,
- SCALEUPTRANSITION_4 = 4,
- SCALEUPTRANSITION_5 = 5,
-// SCALEUPTRANSITION_6 = 6,
-// SCALEUPTRANSITION_7 = 7,
-// SCALEUPTRANSITION_8 = 8,
-// SCALEUPTRANSITION_9 = 9,
-// SCALEUPTRANSITION_10 = 10,
-// SCALEUPTRANSITION_11 = 11,
-// SCALEUPTRANSITION_12 = 12,
-// SCALEUPTRANSITION_13 = 13,
-// SCALEUPTRANSITION_14 = 14,
-// SCALEUPTRANSITION_15 = 15,
-// SCALEUPTRANSITION_16 = 16,
-// SCALEUPTRANSITION_17 = 17,
-// SCALEUPTRANSITION_18 = 18,
-// SCALEUPTRANSITION_19 = 19,
- SCALEUPTRANSITION_END
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- ICoord2D m_centerPos;
- ICoord2D m_incrementSize;
-};
-
-//-----------------------------------------------------------------------------
-class ScoreScaleUpTransition : public Transition
-{
-public:
- ScoreScaleUpTransition ( void );
- virtual ~ScoreScaleUpTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- SCORESCALEUPTRANSITION_START = 0,
- SCORESCALEUPTRANSITION_1 = 1,
- SCORESCALEUPTRANSITION_2 = 2,
- SCORESCALEUPTRANSITION_3 = 3,
- SCORESCALEUPTRANSITION_4 = 4,
- SCORESCALEUPTRANSITION_5 = 5,
-
- SCORESCALEUPTRANSITION_END
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- ICoord2D m_centerPos;
- ICoord2D m_incrementSize;
-};
-
-//-----------------------------------------------------------------------------
-
-
-class FadeTransition : public Transition
-{
-public:
- FadeTransition ( void );
- virtual ~FadeTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- FADETRANSITION_START = 0,
- FADETRANSITION_FADE_IN_1 = 1,
- FADETRANSITION_FADE_IN_2 = 2,
- FADETRANSITION_FADE_IN_3 = 3,
- FADETRANSITION_FADE_IN_4 = 4,
- FADETRANSITION_FADE_IN_5 = 5,
- FADETRANSITION_FADE_IN_6 = 6,
- FADETRANSITION_FADE_IN_7 = 7,
- FADETRANSITION_FADE_IN_8 = 8,
- FADETRANSITION_FADE_IN_9 = 9,
- FADETRANSITION_END
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
-};
-
-
-//-----------------------------------------------------------------------------
-
-class FlashTransition : public Transition
-{
-public:
- FlashTransition ( void );
- virtual ~FlashTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- FLASHTRANSITION_START = 0,
- FLASHTRANSITION_FADE_IN_1 = 1,
- FLASHTRANSITION_FADE_IN_2 = 2,
- FLASHTRANSITION_FADE_IN_3 = 3,
- FLASHTRANSITION_FADE_TO_BACKGROUND_1 = 4,
- FLASHTRANSITION_FADE_TO_BACKGROUND_2 = 5,
- FLASHTRANSITION_FADE_TO_BACKGROUND_3 = 6,
- FLASHTRANSITION_FADE_TO_BACKGROUND_4 = 7,
- FLASHTRANSITION_END
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
-};
-
-//-----------------------------------------------------------------------------
-class ButtonFlashTransition : public Transition
-{
-public:
- ButtonFlashTransition ( void );
- virtual ~ButtonFlashTransition( void );
-
- virtual void init( GameWindow *win );
- virtual void update( Int frame );
- virtual void reverse( void );
- virtual void draw( void );
-
- virtual void skip( void );
-
-protected:
- enum{
- BUTTONFLASHTRANSITION_START = 0,
- BUTTONFLASHTRANSITION_FADE_IN_1 = 1,
- BUTTONFLASHTRANSITION_FADE_IN_2 = 2,
- BUTTONFLASHTRANSITION_FADE_IN_3 = 3,
- BUTTONFLASHTRANSITION_FADE_TO_BACKGROUND_1 =4,
- BUTTONFLASHTRANSITION_FADE_TO_BACKGROUND_2 = 5,
- BUTTONFLASHTRANSITION_FADE_TO_BACKGROUND_3 = 6,
- BUTTONFLASHTRANSITION_FADE_TO_BACKGROUND_4 = 7,
- BUTTONFLASHTRANSITION_FADE_TO_GRADE_IN_1 = 11,
- BUTTONFLASHTRANSITION_FADE_TO_GRADE_IN_2 = BUTTONFLASHTRANSITION_FADE_TO_GRADE_IN_1 +1,
- BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_1 = BUTTONFLASHTRANSITION_FADE_TO_GRADE_IN_2 +1,
- BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_2 = BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_1 +1,
- BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_3 = BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_2 +1,
- BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_4 = BUTTONFLASHTRANSITION_FADE_TO_GRADE_OUT_3 + 1,
- BUTTONFLASHTRANSITION_END, // this is the end of the sequence, we need some special defines... well put them below here
- BUTTONFLASHTRANSITION_SHOW_BACKGROUND
- };
- ICoord2D m_pos;
- ICoord2D m_size;
- Int m_drawState;
- Image *m_gradient;
-};
-
-//-----------------------------------------------------------------------------
-class TransitionWindow
-{
-public:
- TransitionWindow( void );
- ~TransitionWindow( void );
-
- Bool init( void );
- void update( Int frame );
- Bool isFinished( void );
- void reverse( Int totalFrames );
- Int getTotalFrames( void );
- void skip( void );
- void draw( void );
-
- void unlinkGameWindow( GameWindow* win );
-
-// INI parsed vars
- AsciiString m_winName;
- Int m_frameDelay; // what frame number we start on
- Int m_style; // the style we'll be using
-
-// standard vars
- NameKeyType m_winID;
- GameWindow *m_win;
- Transition *m_transition; // each window is allowed one trasition
- Int m_currentFrameDelay; // this will change based on if we're going forward or backwards
-};
-
-//-----------------------------------------------------------------------------
-class TransitionGroup
-{
-public:
- TransitionGroup( void );
- ~TransitionGroup( void );
-
- void init( void );
- void update( void );
- Bool isFinished( void );
- void reverse( void );
- void draw( void );
-
- void skip ( void );
- AsciiString getName( void ) { return m_name; }
- void setName( AsciiString name){ m_name = name; }
- void addWindow( TransitionWindow *transWin );
- Bool isReversed( void );
- Bool isFireOnce( void ) { return m_fireOnce; }
- Bool m_fireOnce;
-private:
- typedef std::list TransitionWindowList;
- TransitionWindowList m_transitionWindowList;
- Int m_directionMultiplier;
- Int m_currentFrame; ///< maintain how long we've spent on this transition;
- AsciiString m_name;
-};
-
-//-----------------------------------------------------------------------------
-class GameWindowTransitionsHandler: public SubsystemInterface
-{
-public:
- GameWindowTransitionsHandler(void);
- ~GameWindowTransitionsHandler( void );
-
- void init(void );
- void load(void );
- void reset( void );
- void update( void );
- void draw( void );
- Bool isFinished( void );
- const FieldParse *getFieldParse() const { return m_gameWindowTransitionsFieldParseTable; } ///< returns the parsing fields
- static const FieldParse m_gameWindowTransitionsFieldParseTable[]; ///< the parse table
- static void parseWindow( INI* ini, void *instance, void *store, const void *userData );
-
- void setGroup(AsciiString groupName, Bool immediate = FALSE); // THis will be the next group to fire off.
- void reverse( AsciiString groupName );// reverse the animations for the current group.
- void remove( AsciiString groupName, Bool skipPending = FALSE );// remove the animation from the current or pending groups.
- TransitionGroup *getNewGroup( AsciiString name );
-private:
- TransitionGroup *findGroup( AsciiString groupName );
- typedef std::list TransitionGroupList;
- TransitionGroupList m_transitionGroupList;
- TransitionGroup *m_currentGroup;
- TransitionGroup *m_pendingGroup;
- TransitionGroup *m_drawGroup;
- TransitionGroup *m_secondaryDrawGroup; // needed to draw the last frame of the previvous draw group once more.
-};
-
-void PushButtonImageDrawThree(GameWindow *window, Int alpha );
-
-
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-extern GameWindowTransitionsHandler *TheTransitionHandler;
diff --git a/Generals/Code/GameEngine/Include/GameClient/HeaderTemplate.h b/Generals/Code/GameEngine/Include/GameClient/HeaderTemplate.h
deleted file mode 100644
index edeec5a3c45..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/HeaderTemplate.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: HeaderTemplate.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Aug 2002
-//
-// Filename: HeaderTemplate.h
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Common/STLTypedefs.h"
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Common/AsciiString.h"
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class GameFont;
-struct FieldParse;
-class INI;
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class HeaderTemplate
-{
-public:
- HeaderTemplate( void );
- ~HeaderTemplate( void );
-
- GameFont *m_font;
- AsciiString m_name;
- AsciiString m_fontName;
- Int m_point;
- Bool m_bold;
-
-};
-
-class HeaderTemplateManager
-{
-public:
- HeaderTemplateManager( void );
- ~HeaderTemplateManager( void );
-
- void init( void );
-
- const FieldParse *getFieldParse( void ) const { return m_headerFieldParseTable; } ///< Return the field parse info
- static const FieldParse m_headerFieldParseTable[];
-
- HeaderTemplate *findHeaderTemplate( AsciiString name );
- HeaderTemplate *newHeaderTemplate( AsciiString name );
-
- GameFont *getFontFromTemplate( AsciiString name );
- HeaderTemplate *getFirstHeader( void );
- HeaderTemplate *getNextHeader( HeaderTemplate *ht );
-
- void onResolutionChanged(void);
-
-private:
- void populateGameFonts( void );
- typedef std::list< HeaderTemplate* > HeaderTemplateList;
- typedef HeaderTemplateList::iterator HeaderTemplateListIt;
- HeaderTemplateList m_headerTemplateList;
-
-};
-
-
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-extern HeaderTemplateManager *TheHeaderTemplateManager;
diff --git a/Generals/Code/GameEngine/Include/GameClient/IMEManager.h b/Generals/Code/GameEngine/Include/GameClient/IMEManager.h
deleted file mode 100644
index 4b304ed2953..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/IMEManager.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//----------------------------------------------------------------------------
-//
-// Project: Generals
-//
-// Module: IME
-//
-// File name: GameClient/IMEManager.h
-//
-// Created: 11/14/01 TR
-//
-//----------------------------------------------------------------------------
-
-#pragma once
-
-//----------------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------------
-
-#include "Lib/BaseType.h"
-#include "Common/SubsystemInterface.h"
-#include "Common/UnicodeString.h"
-
-//----------------------------------------------------------------------------
-// Forward References
-//----------------------------------------------------------------------------
-
-class GameWindow;
-class UnicodeString;
-
-//----------------------------------------------------------------------------
-// Type Defines
-//----------------------------------------------------------------------------
-
-
-//===============================
-// IMEManagerInterface
-//===============================
-
-class IMEManagerInterface : public SubsystemInterface
-{
-
- public:
-
- virtual ~IMEManagerInterface() {};
-
- virtual void attach( GameWindow *window ) = 0; ///< attach IME to specified window
- virtual void detach( void ) = 0; ///< detach IME from current window
- virtual void enable( void ) = 0; ///< Enable IME
- virtual void disable( void ) = 0; ///< Disable IME
- virtual Bool isEnabled( void ) = 0; ///< Is IME enabled
- virtual Bool isAttachedTo( GameWindow *window ) = 0; ///< Is the manager currently attached to the window
- virtual GameWindow* getWindow( void ) = 0; ///< Returns the window we are currently attached to
- virtual Bool isComposing( void ) = 0; ///< Manager is currently composing new input string
- virtual void getCompositionString( UnicodeString &string ) = 0; ///< Return the current composition string
- virtual Int getCompositionCursorPosition( void ) =0; ///< Returns the composition cursor position
- virtual Int getIndexBase( void ) = 0; ///< Get index base for candidate list
-
-
- virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates
- virtual const UnicodeString* getCandidate( Int index ) = 0; ///< Returns the candidate string
- virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate
- virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list
- virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate
-
-
-
- /// Checks for and service IME messages. Returns TRUE if message serviced
- virtual Bool serviceIMEMessage( void *windowsHandle,
- UnsignedInt message,
- Int wParam,
- Int lParam ) = 0;
- virtual Int result( void ) = 0; ///< result return value of last serviced IME message
-};
-
-
-extern IMEManagerInterface *TheIMEManager;
-extern IMEManagerInterface *CreateIMEManagerInterface( void );
-
-
-//----------------------------------------------------------------------------
-// Inlining
-//----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h
deleted file mode 100644
index f0f2ac53fe8..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: LoadScreen.h /////////////////////////////////////////////////////////////////////////////////
-// Author: Chris Huybregts, March 2002
-// Desc: The file will hold the LoadScreen Base class and it's derived classes
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Lib/BaseType.h"
-#include "Common/SubsystemInterface.h"
-#include "GameClient/GameWindow.h"
-#include "GameNetwork/GameInfo.h"
-#include "GameClient/CampaignManager.h"
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-class VideoBuffer;
-class VideoStreamInterface;
-
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Class LoadScreen is the parent class for each other kind of load screen
-///////////////////////////////////////////////////////////////////////////////////////////////////
-class LoadScreen
-{
-public:
- LoadScreen( void );
- virtual ~LoadScreen( void );
-
- virtual void init( GameInfo *game ) = 0; ///< Init the loadscreen
- virtual void reset( void ) = 0; ///< Reset the system
- virtual void update( void ) = 0; ///< Update the state of the slider bars
- virtual void update( Int percent ); ///< Update the state of the slider bars
- virtual void processProgress(Int playerId, Int percentage) = 0;
- virtual void setProgressRange( Int min, Int max ) = 0;
-protected:
- void setLoadScreen( GameWindow *g ) { m_loadScreen = g; }
- GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen
-
-private:
-
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// class SinglePlayerLoadScreen is to be used only when we're loading a single player mission
-///////////////////////////////////////////////////////////////////////////////////////////////////
-class SinglePlayerLoadScreen : public LoadScreen
-{
-public:
- SinglePlayerLoadScreen( void );
- virtual ~SinglePlayerLoadScreen( void );
-
- virtual void init( GameInfo *game ); ///< Init the loadscreen
- virtual void reset( void ); ///< Reset the system
- virtual void update( void )
- {
- DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
- };
- virtual void update(Int percent); ///< Update the state of the progress bar
- virtual void processProgress(Int playerId, Int percentage)
- {
- DEBUG_CRASH(("We Got to a single player load screen throw the Network..."));
- }
-
- virtual void setProgressRange( Int min, Int max );
-
-private:
- GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window
- GameWindow *m_percent;
-
- GameWindow *m_objectiveWin;
- GameWindow *m_objectiveLines[MAX_OBJECTIVE_LINES];
- GameWindow *m_unitDesc[MAX_DISPLAYED_UNITS];
- GameWindow *m_location;
-
- Int m_currentObjectiveLine;
- Int m_currentObjectiveLineCharacter;
- Int m_currentObjectiveWidthOffset;
- Bool m_finishedObjectiveText;
-
- UnicodeString m_unicodeObjectiveLines[MAX_OBJECTIVE_LINES];
-
- VideoBuffer *m_videoBuffer;
- VideoStreamInterface *m_videoStream;
-
- void moveWindows( Int frame );
-
- AudioEventRTS m_ambientLoop;
- AudioHandle m_ambientLoopHandle;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// class ShellGameLoadScreen is to be used for the Shell Game loadscreen
-//// ///////////////////////////////////////////////////////////////////////////////////////////////
-class ShellGameLoadScreen : public LoadScreen
-{
-public:
- ShellGameLoadScreen( void );
- virtual ~ShellGameLoadScreen( void );
-
- virtual void init( GameInfo *game ); ///< Init the loadscreen
- virtual void reset( void ); ///< Reset the system
- virtual void update( void )
- {
- DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
- };
- virtual void update(Int percent); ///< Update the state of the progress bar
- virtual void processProgress(Int playerId, Int percentage)
- {
- DEBUG_CRASH(("We Got to a single player load screen throw the Network..."));
- }
- virtual void setProgressRange( Int min, Int max ) { }
-
-private:
- GameWindow *m_progressBar ; ///< Pointer to the Progress Bar on the window
-
-};
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// class MultiPlayerLoadScreen is to be used for multiplayer communication on the loadscreens
-//// ///////////////////////////////////////////////////////////////////////////////////////////////
-class MultiPlayerLoadScreen : public LoadScreen
-{
-public:
- MultiPlayerLoadScreen( void );
- virtual ~MultiPlayerLoadScreen( void );
-
- virtual void init( GameInfo *game ); ///< Init the loadscreen
- virtual void reset( void ); ///< Reset the system
- virtual void update( void )
- {
- DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
- };
- virtual void update(Int percent); ///< Update the state of the progress bar
- void processProgress(Int playerId, Int percentage);
- virtual void setProgressRange( Int min, Int max ) { }
-private:
- GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window
- GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window
- GameWindow *m_playerSide[MAX_SLOTS]; ///< pointer array to all the static text player sides
- Int m_playerLookup[MAX_SLOTS]; ///< lookup table to translate network slot info screen slot (to account for holes in the slot list)
- GameWindow *m_mapPreview;
- GameWindow *m_buttonMapStartPosition[MAX_SLOTS];
-
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// class MultiPlayerLoadScreen is to be used for multiplayer communication on the loadscreens
-//// ///////////////////////////////////////////////////////////////////////////////////////////////
-class GameSpyLoadScreen : public LoadScreen
-{
-public:
- GameSpyLoadScreen( void );
- virtual ~GameSpyLoadScreen( void );
-
- virtual void init( GameInfo *game ); ///< Init the loadscreen
- virtual void reset( void ); ///< Reset the system
- virtual void update( void )
- {
- DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
- };
- virtual void update(Int percent); ///< Update the state of the progress bar
- void processProgress(Int playerId, Int percentage);
- virtual void setProgressRange( Int min, Int max ) { }
-private:
- GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window
- GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window
- GameWindow *m_playerSide[MAX_SLOTS]; ///< pointer array to all the static text player sides
- GameWindow *m_playerFavoriteFactions[MAX_SLOTS]; ///< pointer array to all the static text player sides
- GameWindow *m_playerTotalDisconnects[MAX_SLOTS]; ///< pointer array to all the static text player sides
- GameWindow *m_playerWin[MAX_SLOTS]; ///< pointer array to all the static text player sides
- GameWindow *m_playerWinLosses[MAX_SLOTS]; ///< pointer array to all the static text player sides
- GameWindow *m_playerRank[MAX_SLOTS]; ///< pointer array to all the static text player sides
- GameWindow *m_playerOfficerMedal[MAX_SLOTS]; ///< pointer array to all the static text player munkees
- GameWindow *m_mapPreview;
- GameWindow *m_buttonMapStartPosition[MAX_SLOTS];
-
- Int m_playerLookup[MAX_SLOTS]; ///< lookup table to translate network slot info screen slot (to account for holes in the slot list)
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// class MapTransferLoadScreen is to be used for map transfers before multiplayer game load screens
-//// ///////////////////////////////////////////////////////////////////////////////////////////////
-class MapTransferLoadScreen : public LoadScreen
-{
-public:
- MapTransferLoadScreen( void );
- virtual ~MapTransferLoadScreen( void );
-
- virtual void init( GameInfo *game ); ///< Init the loadscreen
- virtual void reset( void ); ///< Reset the system
- virtual void update( void )
- {
- DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
- };
- virtual void update(Int percent); ///< Update the state of the progress bar
- virtual void processProgress(Int playerId, Int percentage)
- {
- DEBUG_CRASH(("Call processProgress(Int, Int, AsciiString) instead."));
- }
- void processProgress(Int playerId, Int percentage, AsciiString stateStr);
- virtual void setProgressRange( Int min, Int max ) { }
- void processTimeout(Int secondsLeft);
- void setCurrentFilename(AsciiString filename);
-private:
- GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window
- GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window
- GameWindow *m_progressText[MAX_SLOTS]; ///< pointer array to all the static text player sides
- Int m_playerLookup[MAX_SLOTS]; ///< lookup table to translate network slot info screen slot (to account for holes in the slot list)
- Int m_oldProgress[MAX_SLOTS]; ///< old vals, so we can call processProgress() every frame and not touch the GUI
- GameWindow *m_fileNameText;
- GameWindow *m_timeoutText;
- Int m_oldTimeout; ///< old val, so we can call processTimeout() every frame and not touch the GUI
-};
diff --git a/Generals/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h b/Generals/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h
deleted file mode 100644
index befd4d57c39..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ProcessAnimateWindow.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Mar 2002
-//
-// Filename: ProcessAnimateWindow.h
-//
-// author: Chris Huybregts
-//
-// purpose: If a new animation is wanted to be added for the windows, All you
-// have to do is create a new class derived from ProcessAnimateWindow.
-// Then setup each of the virtual classes to process an AnimateWindow
-// class. The Update and reverse functions get called every frame
-// by the shell and will continue to process the AdminWin until the
-// isFinished flag on the adminWin is set to true.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Lib/BaseType.h"
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-namespace wnd
-{
-class AnimateWindow;
-}
-class GameWindow;
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-class ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindow( void ){};
- virtual ~ProcessAnimateWindow( void ){};
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin ) = 0;
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ) = 0;
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ) = 0;
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ) = 0;
- virtual void setMaxDuration(UnsignedInt maxDuration) { }
-};
-
-//-----------------------------------------------------------------------------
-
-class ProcessAnimateWindowSlideFromRight : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromRight( void );
- virtual ~ProcessAnimateWindowSlideFromRight( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
-Coord2D m_maxVel; // top speed windows travel in x and y
-Int m_slowDownThreshold; // when windows get this close to their resting
- // positions they start to slow down
-Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
-Real m_speedUpRatio; // how fast the windows speed up
-
-};
-
-
-//-----------------------------------------------------------------------------
-
-class ProcessAnimateWindowSlideFromLeft : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromLeft( void );
- virtual ~ProcessAnimateWindowSlideFromLeft( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
-Coord2D m_maxVel; // top speed windows travel in x and y
-Int m_slowDownThreshold; // when windows get this close to their resting
- // positions they start to slow down
-Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
-Real m_speedUpRatio; // how fast the windows speed up
-
-};
-
-
-//-----------------------------------------------------------------------------
-
-class ProcessAnimateWindowSlideFromTop : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromTop( void );
- virtual ~ProcessAnimateWindowSlideFromTop( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
-Coord2D m_maxVel; // top speed windows travel in x and y
-Int m_slowDownThreshold; // when windows get this close to their resting
- // positions they start to slow down
-Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
-Real m_speedUpRatio; // how fast the windows speed up
-
-};
-
-//-----------------------------------------------------------------------------
-class ProcessAnimateWindowSlideFromTopFast : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromTopFast( void );
- virtual ~ProcessAnimateWindowSlideFromTopFast( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
-Coord2D m_maxVel; // top speed windows travel in x and y
-Int m_slowDownThreshold; // when windows get this close to their resting
- // positions they start to slow down
-Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
-Real m_speedUpRatio; // how fast the windows speed up
-
-};
-
-
-//-----------------------------------------------------------------------------
-
-class ProcessAnimateWindowSlideFromBottom : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromBottom( void );
- virtual ~ProcessAnimateWindowSlideFromBottom( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
-Coord2D m_maxVel; // top speed windows travel in x and y
-Int m_slowDownThreshold; // when windows get this close to their resting
- // positions they start to slow down
-Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
-Real m_speedUpRatio; // how fast the windows speed up
-
-};
-
-//-----------------------------------------------------------------------------
-
-class ProcessAnimateWindowSpiral : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSpiral( void );
- virtual ~ProcessAnimateWindowSpiral( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
- Real m_deltaTheta;
- Int m_maxR;
-};
-
-//-----------------------------------------------------------------------------
-
-class ProcessAnimateWindowSlideFromBottomTimed : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromBottomTimed( void );
- virtual ~ProcessAnimateWindowSlideFromBottomTimed( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void setMaxDuration(UnsignedInt maxDuration) { m_maxDuration = maxDuration; }
-
-private:
- UnsignedInt m_maxDuration;
-
-};
-
-class ProcessAnimateWindowSlideFromRightFast : public ProcessAnimateWindow
-{
-public:
-
- ProcessAnimateWindowSlideFromRightFast( void );
- virtual ~ProcessAnimateWindowSlideFromRightFast( void );
-
- virtual void initAnimateWindow( wnd::AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin );
-private:
-Coord2D m_maxVel; // top speed windows travel in x and y
-Int m_slowDownThreshold; // when windows get this close to their resting
- // positions they start to slow down
-Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
-Real m_speedUpRatio; // how fast the windows speed up
-
-};
-
-
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Include/GameClient/WinInstanceData.h b/Generals/Code/GameEngine/Include/GameClient/WinInstanceData.h
deleted file mode 100644
index 1beaf34f9a6..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/WinInstanceData.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: WinInstanceData.h ////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: WinInstanceData.h
-//
-// Created: Colin Day, July 2001
-//
-// Desc: The game window instance dat
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/DisplayString.h"
-#include "GameClient/GameFont.h"
-#include "GameClient/Image.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-class GameWindow;
-class VideoBuffer;
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-#define WIN_STATE_HILITED 0x00000002 // Mouse is over window or has focus
-#define WIN_STATE_SELECTED 0x00000004 // Window has been selected
-
-enum
-{
- MAX_WINDOW_NAME_LEN = 64,
- /** how many elements there are for each of the draw states for the inst
- * data of a window, note if you increase this you must update the parsing
- * tables make sure you can parse the new fields from the window scrip
- * files */
- MAX_DRAW_DATA = 9,
- MAX_TEXT_LABEL = 128 ///< max length of text label
-};
-
-// WinDrawData ----------------------------------------------------------------
-//-----------------------------------------------------------------------------
-struct WinDrawData
-{
-
- const Image *image;
- Color color;
- Color borderColor;
-
-};
-
-// TextDrawData ---------------------------------------------------------------
-//-----------------------------------------------------------------------------
-struct TextDrawData
-{
- Color color; ///< the text color
- Color borderColor; ///< outline color
-};
-
-// WinInstanceData ------------------------------------------------------------
-// NOTE if you add data to this make sure you update winSetInstanceData()
-// NOTE if you add data to this make sure you update winSetInstanceData()
-// NOTE if you add data to this make sure you update winSetInstanceData()
-//-----------------------------------------------------------------------------
-class WinInstanceData
-{
-
-public:
-
- WinInstanceData( void ); ///< constructor automatically runs init()
- virtual ~WinInstanceData( void );
-
- void init( void ); ///< initialize default values if desired
-
-
- // setting text
- void setTooltipText( UnicodeString tip ); ///< set tooltip text
- void setText( UnicodeString text ); ///< set instance text text
-
- // a couple of nice access methods
- UnicodeString getTooltipText( void ); ///< get tooltip text
- UnicodeString getText( void ); ///< get instance text
- Int getTextLength( void ); ///< get number of chars in instance text
- Int getTooltipTextLength( void ); ///< get number of chars in tooltip text
- UnsignedInt getStyle( void ); ///< return window style
- UnsignedInt getStatus( void ); ///< return window status
- UnsignedInt getState( void ); ///< return window state
- GameWindow *getOwner( void ); ///< return window owner
- GameFont *getFont( void ); ///< return window font
-
- DisplayString *getTextDisplayString( void ); ///< return the text display string
- DisplayString *getTooltipDisplayString( void ); ///< return the tooltip display string
-
- void setVideoBuffer( VideoBuffer * videoBuffer ); ///< set the videobuffer to display a video frame
-
-// NOTE if you add data to this make sure you update winSetInstanceData()
-// NOTE if you add data to this make sure you update winSetInstanceData()
-// NOTE if you add data to this make sure you update winSetInstanceData()
-
- /** @todo you may want to make these data members protected, they are public
- because of the legacy of porting all this code in from Nox, but they
- really should be protected and have the rest of the code use access
- functions to edit them */
-
- Int m_id; // Id of the window (used mainly for scripts)
- Int m_state; // Flags indicating state of window
- UnsignedInt m_style; // Flags indicating style of window
- UnsignedInt m_status; // Status bits for this window (mirrored in GameWindow)
- GameWindow *m_owner;
-
- WinDrawData m_enabledDrawData[ MAX_DRAW_DATA ]; ///< image/color info for enabled state
- WinDrawData m_disabledDrawData[ MAX_DRAW_DATA ]; ///< image/color info for disabled state
- WinDrawData m_hiliteDrawData[ MAX_DRAW_DATA ]; ///< image/color info for hilite state
-
- TextDrawData m_enabledText; ///< enabled text colors
- TextDrawData m_disabledText; ///< disabled text colors
- TextDrawData m_hiliteText; ///< hilite text colors
- TextDrawData m_imeCompositeText;///< IME composite text colors
-
- ICoord2D m_imageOffset; // dx, dy for blitting bkgnd images
-
- GameFont *m_font; // font which this window should use
-
- AsciiString m_textLabelString; ///< text label from window file if present
- AsciiString m_decoratedNameString; ///< window text name from GUIEdit
- AsciiString m_tooltipString; ///< tooltip Label from window file if present
-
- AsciiString m_headerTemplateName; ///< name of the template we're going to base our font off of.
-
- Int m_tooltipDelay; ///< desired delay before showing tooltip
-
- DisplayString *m_text; ///< generic text for any window to display
- DisplayString *m_tooltip; ///< tooltip for display
-
- //NOTE Video Buffer cannot be transferred to another window.
- VideoBuffer *m_videoBuffer; ///< Each window can be made to play a video in it.
-
-// NOTE if you add data to this make sure you update winSetInstanceData()
-// NOTE if you add data to this make sure you update winSetInstanceData()
-// NOTE if you add data to this make sure you update winSetInstanceData()
-
-protected:
-
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-inline UnsignedInt WinInstanceData::getStyle( void ) { return m_style; }
-inline UnsignedInt WinInstanceData::getStatus( void ) { return m_status; }
-inline UnsignedInt WinInstanceData::getState( void ) { return m_state; }
-inline GameWindow *WinInstanceData::getOwner( void ) { return m_owner; }
-inline GameFont *WinInstanceData::getFont( void ) { return m_font; }
-inline DisplayString *WinInstanceData::getTextDisplayString( void ) { return m_text; }
-inline DisplayString *WinInstanceData::getTooltipDisplayString( void ) { return m_tooltip; }
-inline UnicodeString WinInstanceData::getTooltipText( void )
-{
- if( m_tooltip )
- return m_tooltip->getText();
- return UnicodeString::TheEmptyString;
-
-}
-inline UnicodeString WinInstanceData::getText( void )
-{
- if( m_text )
- return m_text->getText();
- return UnicodeString::TheEmptyString;
-}
-inline Int WinInstanceData::getTextLength( void )
-{
- if( m_text )
- return m_text->getTextLength();
- return 0;
-}
-inline Int WinInstanceData::getTooltipTextLength( void )
-{
- if( m_tooltip )
- return m_tooltip->getTextLength();
- return 0;
-}
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/WindowLayout.h b/Generals/Code/GameEngine/Include/GameClient/WindowLayout.h
deleted file mode 100644
index 97362825638..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/WindowLayout.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: WindowLayout.h ///////////////////////////////////////////////////////////////////////////
-// Created: Colin Day, September 2001
-// Desc: Encapsulation of all windows loaded from a .wnd file for
-// purposes of a "shell" layout screen
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "Common/GameMemory.h"
-#include "GameClient/GameWindow.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
-class GameWindow;
-class WindowLayout;
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////////////////////////
-typedef void (*WindowLayoutInitFunc)( WindowLayout *layout, void *userData );
-typedef void (*WindowLayoutUpdateFunc)( WindowLayout *layout, void *userData );
-typedef void (*WindowLayoutShutdownFunc)( WindowLayout *layout, void *userData );
-
-//-------------------------------------------------------------------------------------------------
-/** The representation of a screen layout loaded from a .wnd layout
- * script file */
-//-------------------------------------------------------------------------------------------------
-class WindowLayout : public MemoryPoolObject
-{
-
- // memory pool for screen layouts
- MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( WindowLayout, "WindowLayoutPool" );
-
-public:
-
- WindowLayout( void );
- // ~WindowLayout( void ); ///< defined by memory pool glue
-
- // manipulating screen properties ---------------------------------------------------------------
- AsciiString getFilename( void ) const; ///< return source window filename
- Bool load( AsciiString filename ); ///< create windows and load from .wnd file
- void hide( Bool hide ); ///< hide/show all windows on this screen
- Bool isHidden( void ) const; ///< return visible state of screen
- void bringForward( void ); ///< bring all windows in this screen forward
-
- // manipulating window lists --------------------------------------------------------------------
- void addWindow( GameWindow *window ); ///< add window to screen
- void removeWindow( GameWindow *window ); ///< remove window from screen
- void destroyWindows( void ); ///< destroy all windows in this screen
- GameWindow *getFirstWindow( void ) const; ///< get first window in list for screen
-
- // accessing layout callbacks ------------------------------------------------------------------
- void runInit( void *userData = nullptr ); ///< run the init method if available
- void runUpdate( void *userData = nullptr ); ///< run the update method if available
- void runShutdown( void *userData = nullptr ); ///< run the shutdown method if available
- void setInit( WindowLayoutInitFunc init ); ///< set the init callback
- void setUpdate( WindowLayoutUpdateFunc update ); ///< set the update callback
- void setShutdown( WindowLayoutShutdownFunc shutdown); ///< set the shutdown callback
-
-protected:
-
- // internal helpers -----------------------------------------------------------------------------
- GameWindow *findWindow( GameWindow *window ); ///< find window in this layout
-
- //===============================================================================================
- // protected data ===============================================================================
- //===============================================================================================
-
- AsciiString m_filenameString; ///< layout filename
- GameWindow *m_windowList; ///< list of windows in this layout
- GameWindow *m_windowTail; ///< end of m_windowList
- Int m_windowCount; ///< how man windows are in the list
- Bool m_hidden; ///< visible state of this screen
-
- //
- // These are callbacks you can attach to a "layout file" ... they are not
- // automatically called when using the WindowManager to load and create
- // the layout. You can incorporate when and where init, shutdown and update should
- // be called for any system or code that is uses these window layouts
- //
- WindowLayoutInitFunc m_init; ///< init callback
- WindowLayoutUpdateFunc m_update; ///< update callback
- WindowLayoutShutdownFunc m_shutdown; ///< shutdown callback
-
-};
-
-// INLINING ///////////////////////////////////////////////////////////////////////////////////////
-inline AsciiString WindowLayout::getFilename( void ) const { return m_filenameString; }
-inline GameWindow *WindowLayout::getFirstWindow( void ) const { return m_windowList; }
-inline Bool WindowLayout::isHidden( void ) const { return m_hidden; }
-
-inline void WindowLayout::runInit( void *userData ) { if( m_init ) m_init( this, userData ); }
-inline void WindowLayout::runUpdate( void *userData ) { if( m_update ) m_update( this, userData ); }
-inline void WindowLayout::runShutdown( void *userData ) { if( m_shutdown ) m_shutdown( this, userData ); }
-
-inline void WindowLayout::setInit( WindowLayoutInitFunc init ) { m_init = init; }
-inline void WindowLayout::setUpdate( WindowLayoutUpdateFunc update ) { m_update = update; }
-inline void WindowLayout::setShutdown( WindowLayoutShutdownFunc shutdown ) {m_shutdown = shutdown;}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp
deleted file mode 100644
index b05a0a4ce9b..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameFont.cpp /////////////////////////////////////////////////////////////////////////////
-// Created: Colin Day, June 2001
-// Desc: Access to our representation for fonts
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/GameFont.h"
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////////////////////////
-FontLibrary *TheFontLibrary = nullptr;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------------------------------
-/** Link a font to the font list */
-//-------------------------------------------------------------------------------------------------
-void FontLibrary::linkFont( GameFont *font )
-{
-
- // sanity
- if( font == nullptr )
- return;
-
- // link it
- font->next = m_fontList;
- m_fontList = font;
-
- // increment linked count
- m_count++;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Unlink a font from the font list */
-//-------------------------------------------------------------------------------------------------
-void FontLibrary::unlinkFont( GameFont *font )
-{
- GameFont *other = nullptr;
-
- // sanity
- if( font == nullptr )
- return;
-
- // sanity check and make sure this font is actually in this library
- for( other = m_fontList; other; other = other->next )
- if( other == font )
- break;
- if( other == nullptr )
- {
-
- DEBUG_CRASH(( "Font '%s' not found in library", font->nameString.str() ));
- return;
-
- }
-
- // scan for the font pointing to the one we're going to unlink
- for( other = m_fontList; other; other = other->next )
- if( other->next == font )
- break;
-
- //
- // if nothing was fount this was at the head of the list, otherwise
- // remove from chain
- //
- if( other == nullptr )
- m_fontList = font->next;
- else
- other->next = font->next;
-
- // clean up this font we just unlinked just to be cool!
- font->next = nullptr;
-
- // we now have one less font on the list
- m_count--;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Delete all font data, DO NOT throw an exception ... the destructor uses this */
-//-------------------------------------------------------------------------------------------------
-void FontLibrary::deleteAllFonts( void )
-{
- GameFont *font;
-
- // release all the fonts
- while( m_fontList )
- {
-
- // get temp pointer to this font
- font = m_fontList;
-
- // remove font from the list, this will change m_fontList
- unlinkFont( font );
-
- // release font data
- releaseFontData( font );
-
- // delete the font list element
- deleteInstance(font);
-
- }
-
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-FontLibrary::FontLibrary( void )
-{
-
- m_fontList = nullptr;
- m_count = 0;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-FontLibrary::~FontLibrary( void )
-{
-
- // delete all font data
- deleteAllFonts();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize what we need to in the font library */
-//-------------------------------------------------------------------------------------------------
-void FontLibrary::init( void )
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Reset the fonts for this font library */
-//-------------------------------------------------------------------------------------------------
-void FontLibrary::reset( void )
-{
-
- // delete all font data
- deleteAllFonts();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Get a font from our list, if we don't have that font loaded we will
- * attempt to load it */
-//-------------------------------------------------------------------------------------------------
-GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold )
-{
- // sanity check the size - anything over 100 is probably wrong. -MW
- // TheSuperHackers @fix Now also no longer creates fonts with zero size.
- if (pointSize < 1 || pointSize > 100)
- {
- return nullptr;
- }
-
- GameFont *font;
-
- // search for font in list
- for( font = m_fontList; font; font = font->next )
- {
-
- if( font->pointSize == pointSize &&
- font->bold == bold &&
- font->nameString == name
- )
- return font; // found
-
- }
-
- // font not found, allocate a new font element
- font = newInstance(GameFont);
- if( font == nullptr )
- {
-
- DEBUG_CRASH(( "getFont: Unable to allocate new font list element" ));
- return nullptr;
-
- }
-
- // copy font data over to new element
- font->nameString = name;
- font->pointSize = pointSize;
- font->bold = bold;
- font->fontData = nullptr;
-
- //DEBUG_LOG(("Font: Loading font '%s' %d point", font->nameString.str(), font->pointSize));
- // load the device specific data pointer
- if( loadFontData( font ) == FALSE )
- {
-
- DEBUG_CRASH(( "getFont: Unable to load font data pointer '%s'", name.str() ));
- deleteInstance(font);
- return nullptr;
-
- }
-
- // tie font into list
- linkFont( font );
-
- // all is done and loaded
- return font;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp
deleted file mode 100644
index 11b5174d18d..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp
+++ /dev/null
@@ -1,1837 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindow.cpp ///////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GameWindow.cpp
-//
-// Created: Dean Iverson, March 1998
-// Colin Day, June 2001
-//
-// Desc: Game window implementation
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/AudioEventRTS.h"
-#include "Common/Language.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/DisplayStringManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetComboBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/SelectionXlat.h"
-#include "GameClient/GameWindowTransitions.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-
-// GameWindow::GameWindow =====================================================
-//=============================================================================
-GameWindow::GameWindow( void )
-{
- m_status = WIN_STATUS_NONE;
-
- m_size.x = 0;
- m_size.y = 0;
-
- m_region.lo.x = 0;
- m_region.lo.y = 0;
- m_region.hi.x = 0;
- m_region.hi.y = 0;
-
- m_cursorX = 0;
- m_cursorY = 0;
-
- m_userData = nullptr;
-
- m_inputData = nullptr;
-
- winSetDrawFunc( TheWindowManager->getDefaultDraw() );
- winSetInputFunc( TheWindowManager->getDefaultInput() );
- winSetSystemFunc( TheWindowManager->getDefaultSystem() );
- // We use to set the default tooltip func to TheWindowManager->getDefaultTooltip()
- // but I removed this so that we can set in GUI edit a text string that will be the
- // default tool tip for a control.
- winSetTooltipFunc( nullptr );
-
- m_next = nullptr;
- m_prev = nullptr;
- m_parent = nullptr;
- m_child = nullptr;
-
- m_nextLayout = nullptr;
- m_prevLayout = nullptr;
- m_layout = nullptr;
-
- m_editData = nullptr;
-
-}
-
-// GameWindow::~GameWindow ====================================================
-//=============================================================================
-GameWindow::~GameWindow( void )
-{
-
- delete m_inputData;
- m_inputData = nullptr;
-
- delete m_editData;
- m_editData = nullptr;
-
- unlinkFromTransitionWindows();
-
-}
-
-// GameWindow::linkTransitionWindow ============================================
-//=============================================================================
-void GameWindow::linkTransitionWindow( TransitionWindow* transitionWindow )
-{
-
- m_transitionWindows.push_back(transitionWindow);
-
-}
-
-// GameWindow::unlinkTransitionWindow =========================================
-//=============================================================================
-void GameWindow::unlinkTransitionWindow( TransitionWindow* transitionWindow )
-{
-
- std::vector::iterator it = m_transitionWindows.begin();
- while ( it != m_transitionWindows.end() )
- {
- if ( *it == transitionWindow )
- {
- *it = m_transitionWindows.back();
- m_transitionWindows.pop_back();
- return;
- }
- ++it;
- }
-
-}
-
-// GameWindow::unlinkFromTransitionWindows =========================================
-//=============================================================================
-void GameWindow::unlinkFromTransitionWindows( void )
-{
-
- while ( !m_transitionWindows.empty() )
- {
- m_transitionWindows.back()->unlinkGameWindow(this);
- m_transitionWindows.pop_back();
- }
-
-}
-
-// GameWindow::normalizeWindowRegion ==========================================
-/** Puts the upper left corner in the window's region.lo field */
-//=============================================================================
-void GameWindow::normalizeWindowRegion( void )
-{
- Int temp;
-
- if( m_region.lo.x > m_region.hi.x)
- {
-
- temp = m_region.lo.x;
- m_region.lo.x = m_region.hi.x;
- m_region.hi.x = temp;
-
- }
-
- if( m_region.lo.y > m_region.hi.y )
- {
-
- temp = m_region.lo.y;
- m_region.lo.y = m_region.hi.y;
- m_region.hi.y = temp;
-
- }
-
-}
-
-// GameWindow::findFirstLeaf ==================================================
-/** Returns the first leaf of the branch */
-//=============================================================================
-GameWindow *GameWindow::findFirstLeaf( void )
-{
- GameWindow *leaf = this;
-
- // Find the root of this branch
- while( leaf->m_parent )
- leaf = leaf->m_parent;
-
- // Find the first leaf
- while( leaf->m_child )
- leaf = leaf->m_child;
-
- return leaf;
-
-}
-
-// GameWindow::findLastLeaf ===================================================
-/** Returns the last leaf of the branch */
-//=============================================================================
-GameWindow *GameWindow::findLastLeaf( void )
-{
- GameWindow *leaf = this;
-
- // Find the root of this branch
- while( leaf->m_parent )
- leaf = leaf->m_parent;
-
- // Find the last leaf
- while( leaf->m_child )
- {
-
- leaf = leaf->m_child;
-
- while( leaf->m_next )
- leaf = leaf->m_next;
-
- }
-
- return leaf;
-
-}
-
-// GameWindow::findPrevLeaf ===================================================
-/** Returns the prev leaf of the tree */
-//=============================================================================
-GameWindow *GameWindow::findPrevLeaf( void )
-{
- GameWindow *leaf = this;
-
- if( leaf->m_prev )
- {
-
- leaf = leaf->m_prev;
-
- while( leaf->m_child &&
- BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) == FALSE )
- {
-
- leaf = leaf->m_child;
-
- while( leaf->m_next )
- leaf = leaf->m_next;
-
- }
-
- return leaf;
-
- }
- else
- {
-
- while( leaf->m_parent )
- {
-
- leaf = leaf->m_parent;
-
- if( leaf->m_parent && leaf->m_prev )
- {
-
- leaf = leaf->m_prev;
-
- while( leaf->m_child &&
- BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) == FALSE )
- {
-
- leaf = leaf->m_child;
-
- while( leaf->m_next )
- leaf = leaf->m_next;
-
- }
-
- return leaf;
-
- }
-
- }
-
- if( leaf )
- return leaf->findLastLeaf();
- else
- return nullptr;
-
- }
-
- return nullptr;
-
-}
-
-// GameWindow::findNextLeaf ===================================================
-/** Returns the next leaf of the tree */
-//=============================================================================
-GameWindow *GameWindow::findNextLeaf( void )
-{
- GameWindow *leaf = this;
-
- if( leaf->m_next )
- {
-
- if( leaf->m_next->m_status & WIN_STATUS_TAB_STOP )
- return leaf->m_next;
-
- for( leaf = leaf->m_next; leaf; leaf = leaf->m_child )
- if( leaf->m_child == nullptr || BitIsSet( leaf->m_status,
- WIN_STATUS_TAB_STOP ) )
- return leaf;
-
- }
- else
- {
-
- while( leaf->m_parent )
- {
-
- leaf = leaf->m_parent;
-
- if( leaf->m_parent && leaf->m_next )
- {
-
- for( leaf = leaf->m_next; leaf; leaf = leaf->m_child )
- if( leaf->m_child == nullptr ||
- BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) )
- return leaf;
-
- }
-
- }
-
- if( leaf )
- return leaf->findFirstLeaf();
- else
- return nullptr;
-
- }
-
- return nullptr;
-
-}
-
-// GameWindow::winNextTab =====================================================
-/** Go to next window in tab chain */
-//=============================================================================
-Int GameWindow::winNextTab( void )
-{
-/*
- GameWindow *newTab = this;
- Bool firstTry = TRUE;
-
- // Un-hilite the current window
- m_instData.m_state &= ~WIN_STATE_HILITED;
-
- do
- {
-
- if( m_parent == nullptr && firstTry )
- {
-
- newTab = findLastLeaf( newTab );
- firstTry = FALSE;
-
- }
- else
- newTab = findPrevLeaf( newTab );
- } while( ( isEnabled( newTab ) == FALSE ) ||
- ( isHidden( newTab ) ) );
-
- newTab->instData.state |= WIN_STATE_HILITED;
- WinSetFocus( newTab );
-
-*/
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winPrevTab =====================================================
-/** Go to previous window in tab chain */
-//=============================================================================
-Int GameWindow::winPrevTab( void )
-{
-/*
- GameWindow *newTab = this;
- Bool firstTry = TRUE;
-
- // Un-hilite the current window
- m_instData.m_state &= ~WIN_STATE_HILITED;
-
- do
- {
-
- if( m_parent == nullptr && firstTry )
- {
-
- newTab = findFirstLeaf( newTab );
- firstTry = FALSE;
-
- }
- else
- newTab = findNextLeaf( newTab );
-
- } while( ( isEnabled( newTab ) == FALSE ) ||
- ( isHidden( newTab ) ) );
-
- newTab->instData.state |= WIN_STATE_HILITED;
- WinSetFocus( newTab );
-
-*/
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winBringToTop ==================================================
-/** Bring this window to the top of the window list, if we have a parent
- * we will go to the top of the child list for that parent */
-//=============================================================================
-Int GameWindow::winBringToTop( void )
-{
- GameWindow *current;
- GameWindow *parent = winGetParent();
-
- if( parent )
- {
-
- TheWindowManager->unlinkChildWindow( this );
- TheWindowManager->addWindowToParent( this, parent );
-// TheWindowManager->addWindowToParentAtEnd( this, parent );
-
- }
- else
- {
-
- // sanity, make sure this window is in the window list
- for( current = TheWindowManager->winGetWindowList();
- current != this;
- current = current->m_next)
- if (current == nullptr)
- return WIN_ERR_INVALID_PARAMETER;
-
- // move to head of windowList
- TheWindowManager->unlinkWindow( this );
- TheWindowManager->linkWindow( this );
-
- }
-
- //
- // if the window is part of a screen layout, move it to the top
- // of the screen layout to reflect the new position of the window
- // in the real window list (it's all about draw order :) )
- //
- if( m_layout )
- {
- WindowLayout *saveLayout = m_layout;
-
- //
- // note we must use saveScreen because removing the window from the
- // screen will clear the m_screen member (as it should for removing
- // a window from a screen)
- //
- saveLayout->removeWindow( this );
- saveLayout->addWindow( this );
-
- }
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winActivate ====================================================
-/** Pop window to top of window list AND activate it */
-//=============================================================================
-Int GameWindow::winActivate( void )
-{
- Int returnCode;
-
- // bring window to top
- returnCode = winBringToTop();
- if( returnCode != WIN_ERR_OK )
- return returnCode;
-
- // activate it and unhide
- BitSet( m_status, WIN_STATUS_ACTIVE );
- winHide( FALSE );
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetPosition =================================================
-/** Set the window's position */
-//=============================================================================
-Int GameWindow::winSetPosition( Int x, Int y )
-{
-
- m_region.lo.x = x;
- m_region.lo.y = y;
-
- m_region.hi.x = x + m_size.x;
- m_region.hi.y = y + m_size.y;
-
- normalizeWindowRegion();
-
- return WIN_ERR_OK;
-
-}
-
-// WinGetPosition =============================================================
-/** Get the window's position */
-//=============================================================================
-Int GameWindow::winGetPosition( Int *x, Int *y )
-{
-
- // sanity
- if( x == nullptr || y == nullptr )
- return WIN_ERR_INVALID_PARAMETER;
-
- *x = m_region.lo.x;
- *y = m_region.lo.y;
-
- return WIN_ERR_OK;
-
-}
-
-// WinSetCursorPosition =============================================================
-/** Set the window's cursor position */
-//=============================================================================
-Int GameWindow::winSetCursorPosition( Int x, Int y )
-{
- m_cursorX = x;
- m_cursorY = y;
-
- return WIN_ERR_OK;
-
-}
-
-// WinGetCursorPosition =============================================================
-/** Get the window's cursor position */
-//=============================================================================
-Int GameWindow::winGetCursorPosition( Int *x, Int *y )
-{
- if ( x )
- {
- *x = m_cursorX;
- }
-
- if ( y )
- {
- *y = m_cursorY;
- }
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetScreenPosition ===========================================
-/** Get the window's position in screen coordinates */
-//=============================================================================
-Int GameWindow::winGetScreenPosition( Int *x, Int *y )
-{
- GameWindow *parent = m_parent;
-
- *x = m_region.lo.x;
- *y = m_region.lo.y;
-
- while( parent )
- {
-
- *x += parent->m_region.lo.x;
- *y += parent->m_region.lo.y;
- parent = parent->m_parent;
-
- }
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetRegion ===================================================
-/** Get the window region */
-//=============================================================================
-Int GameWindow::winGetRegion( IRegion2D *region )
-{
-
- if( region )
- *region = m_region;
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winPointInWindow ===============================================
-/** Check to see if the given point is inside the window. Will
- * still return true if the point is actually in a child. */
-//=============================================================================
-Bool GameWindow::winPointInWindow( Int x, Int y )
-{
- Int winX, winY, width, height;
-
- winGetScreenPosition( &winX, &winY );
- winGetSize( &width, &height );
-
- if (x >= winX && x <= winX + width &&
- y >= winY && y <= winY + height)
- return TRUE;
-
- return FALSE;
-
-}
-
-// GameWindow::winSetSize =====================================================
-/** Set the window's size */
-//=============================================================================
-Int GameWindow::winSetSize( Int width, Int height )
-{
-
- m_size.x = width;
- m_size.y = height;
- m_region.hi.x = m_region.lo.x + width;
- m_region.hi.y = m_region.lo.y + height;
-
- TheWindowManager->winSendSystemMsg( this,
- GGM_RESIZED,
- (WindowMsgData)width,
- (WindowMsgData)height );
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetSize =====================================================
-/** Get the window's size */
-//=============================================================================
-Int GameWindow::winGetSize( Int *width, Int *height )
-{
-
- // sanity
- if( width == nullptr || height == nullptr )
- return WIN_ERR_INVALID_PARAMETER;
-
- *width = m_size.x;
- *height = m_size.y;
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winEnable ======================================================
-/** Enable or disable a window based on the enable parameter.
- * A disabled window can be seen but accepts no input. */
-//=============================================================================
-Int GameWindow::winEnable( Bool enable )
-{
- GameWindow *child;
-
- if( enable )
- BitSet( m_status, WIN_STATUS_ENABLED );
- else
- BitClear( m_status, WIN_STATUS_ENABLED );
-
- if( m_child )
- {
-
- for( child = m_child; child; child = child->m_next)
- child->winEnable( enable );
-
- }
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetEnabled ======================================================
-/** Enable or disable a window based on the enable parameter.
- * A disabled window can be seen but accepts no input. */
-//=============================================================================
-Bool GameWindow::winGetEnabled( void )
-{
- return BitIsSet( m_status, WIN_STATUS_ENABLED );
-
-}
-
-// GameWindow::winHide ========================================================
-/** Hide or show a window based on the hide parameter.
- * A hidden window can't be seen and accepts no input. */
-//=============================================================================
-Int GameWindow::winHide( Bool hide )
-{
-
- if( hide )
- {
-
- //
- // if we're running in small game window mode and this window becomes
- // invisible then there's a good chance that the black border around
- // the game window needs redrawing
- //
- if( !BitIsSet( m_status, WIN_STATUS_NO_FLUSH ) )
- freeImages();
-
- BitSet( m_status, WIN_STATUS_HIDDEN );
-
- // notify the window manger we are hiding
- TheWindowManager->windowHiding( this );
-
- }
- else
- {
-
- BitClear( m_status, WIN_STATUS_HIDDEN );
-
- }
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winIsHidden ====================================================
-/** Am I hidden? */
-//=============================================================================
-Bool GameWindow::winIsHidden( void )
-{
-
- return BitIsSet( m_status, WIN_STATUS_HIDDEN );
-
-}
-
-// GameWindow::winSetStatus ===================================================
-/** Allows the user to directly set a window's status flags. */
-//=============================================================================
-UnsignedInt GameWindow::winSetStatus( UnsignedInt status )
-{
- UnsignedInt oldStatus;
-
- oldStatus = m_status;
- BitSet( m_status, status );
-// m_status = status;
-
- return oldStatus;
-
-}
-
-// GameWindow::winClearStatus =================================================
-/** Allows the user to directly clear a window's status flags. */
-//=============================================================================
-UnsignedInt GameWindow::winClearStatus( UnsignedInt status )
-{
- UnsignedInt oldStatus;
-
- oldStatus = m_status;
- BitClear( m_status, status );
-
- return oldStatus;
-
-}
-
-// GameWindow::winGetStatus ===================================================
-/** Returns a window's status flags. */
-//=============================================================================
-UnsignedInt GameWindow::winGetStatus( void )
-{
-
- return m_status;
-
-}
-
-// GameWindow::winGetStyle ====================================================
-/** Returns a window's style flags. */
-//=============================================================================
-UnsignedInt GameWindow::winGetStyle( void )
-{
-
- return m_instData.m_style;
-
-}
-
-// GameWindow::winSetHiliteState ==============================================
-/** Set whether window is highlighted or not */
-//=============================================================================
-void GameWindow::winSetHiliteState( Bool state )
-{
-
- if( state )
- BitSet( m_instData.m_state, WIN_STATE_HILITED );
- else
- BitClear( m_instData.m_state, WIN_STATE_HILITED );
-
-}
-
-// GameWindow::winSetDrawOffset ===============================================
-/** Set offset for drawing images */
-//=============================================================================
-void GameWindow::winSetDrawOffset( Int x, Int y )
-{
-
- m_instData.m_imageOffset.x = x;
- m_instData.m_imageOffset.y = y;
-
-}
-
-// GameWindow::winGetDrawOffset ===============================================
-/** Get offset for drawing images */
-//=============================================================================
-void GameWindow::winGetDrawOffset( Int *x, Int *y )
-{
-
- // sanity
- if( x == nullptr || y == nullptr )
- return;
-
- *x = m_instData.m_imageOffset.x;
- *y = m_instData.m_imageOffset.y;
-
-}
-
-// GameWindow::winSetText =====================================================
-/** Sets the text in a window */
-//=============================================================================
-Int GameWindow::winSetText( UnicodeString newText )
-{
- // copy text over
- m_instData.setText( newText );
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetText =====================================================
-/** Get text from a window ... this works for static text windows and
- * edit boxes */
-//=============================================================================
-UnicodeString GameWindow::winGetText( void )
-{
- // return the contents of our text field
- return m_instData.getText();
-
-}
-
-// GameWindow::winGetTextLength =====================================================
-//=============================================================================
-Int GameWindow::winGetTextLength()
-{
- // return the contents of our text field
- return m_instData.getTextLength();
-
-}
-
-// GameWindow::winGetFont =====================================================
-/** Get the font being used by this window */
-//=============================================================================
-GameFont *GameWindow::winGetFont( void )
-{
-
- return m_instData.getFont();
-
-}
-
-// GameWindow::winSetFont =====================================================
-/** Set font for text in this window */
-//=============================================================================
-void GameWindow::winSetFont( GameFont *font )
-{
-
- // set font in window member
- m_instData.m_font = font;
-
- // set font for other display strings in special gadget window controls
- if( BitIsSet( m_instData.getStyle(), GWS_SCROLL_LISTBOX ) )
- GadgetListBoxSetFont( this, font );
- else if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) )
- GadgetComboBoxSetFont( this, font );
- else if( BitIsSet( m_instData.getStyle(), GWS_ENTRY_FIELD ) )
- GadgetTextEntrySetFont( this, font );
- else if( BitIsSet( m_instData.getStyle(), GWS_STATIC_TEXT ) )
- GadgetStaticTextSetFont( this, font );
- else
- {
- DisplayString *dString;
-
- // set the font for the display strings all windows have
- dString = m_instData.getTextDisplayString();
- if( dString )
- dString->setFont( font );
- dString = m_instData.getTooltipDisplayString();
- if( dString )
- dString->setFont( font );
-
- }
-
-}
-
-// GameWindow::winSetEnabledTextColors ========================================
-/** Set the text colors for the enabled state */
-//=============================================================================
-void GameWindow::winSetEnabledTextColors( Color color, Color borderColor )
-{
- m_instData.m_enabledText.color = color;
- m_instData.m_enabledText.borderColor = borderColor;
-
- if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) )
- GadgetComboBoxSetEnabledTextColors(this, color, borderColor );
-
-
-}
-
-// GameWindow::winSetDisabledTextColors =======================================
-/** Set the text colors for the disabled state */
-//=============================================================================
-void GameWindow::winSetDisabledTextColors( Color color, Color borderColor )
-{
-
- m_instData.m_disabledText.color = color;
- m_instData.m_disabledText.borderColor = borderColor;
-
- if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) )
- GadgetComboBoxSetDisabledTextColors( this, color, borderColor );
-
-}
-
-// GameWindow::winSetHiliteTextColors =========================================
-/** Set the text colors for the Hilite state */
-//=============================================================================
-void GameWindow::winSetHiliteTextColors( Color color, Color borderColor )
-{
-
- m_instData.m_hiliteText.color = color;
- m_instData.m_hiliteText.borderColor = borderColor;
-
- if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) )
- GadgetComboBoxSetHiliteTextColors( this, color, borderColor );
-
-}
-
-// GameWindow::winSetIMECompositeTextColors =========================================
-/** Set the text colors for the IME Composite state */
-//=============================================================================
-void GameWindow::winSetIMECompositeTextColors( Color color, Color borderColor )
-{
-
- m_instData.m_imeCompositeText.color = color;
- m_instData.m_imeCompositeText.borderColor = borderColor;
-
- if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) )
- GadgetComboBoxSetIMECompositeTextColors( this, color, borderColor );
-}
-
-// GameWindow::winGetEnabledTextColor =========================================
-/** Get the enabled text color */
-//=============================================================================
-Color GameWindow::winGetEnabledTextColor( void )
-{
-
- return m_instData.m_enabledText.color;
-
-}
-
-// GameWindow::winGetEnabledTextBorderColor ===================================
-/** Get the enabled text color */
-//=============================================================================
-Color GameWindow::winGetEnabledTextBorderColor( void )
-{
-
- return m_instData.m_enabledText.borderColor;
-
-}
-
-// GameWindow::winGetDisabledTextColor ========================================
-/** Get the disabled text color */
-//=============================================================================
-Color GameWindow::winGetDisabledTextColor( void )
-{
-
- return m_instData.m_disabledText.color;
-
-}
-
-// GameWindow::winGetDisabledTextBorderColor ==================================
-/** Get the disabled text color */
-//=============================================================================
-Color GameWindow::winGetDisabledTextBorderColor( void )
-{
-
- return m_instData.m_disabledText.borderColor;
-
-}
-
-// GameWindow::winGetIMECompositeTextColor ==========================================
-/** Get the IME composite text color */
-//=============================================================================
-Color GameWindow::winGetIMECompositeTextColor( void )
-{
-
- return m_instData.m_imeCompositeText.color;
-
-}
-
-// GameWindow::winGetIMECompositeBorderColor ==========================================
-/** Get the IME composite border color */
-//=============================================================================
-Color GameWindow::winGetIMECompositeBorderColor( void )
-{
-
- return m_instData.m_imeCompositeText.borderColor;
-
-}
-
-// GameWindow::winGetHiliteTextColor ==========================================
-/** Get the hilite text color */
-//=============================================================================
-Color GameWindow::winGetHiliteTextColor( void )
-{
-
- return m_instData.m_hiliteText.color;
-
-}
-
-// GameWindow::winGetHiliteTextBorderColor ====================================
-/** Get the hilite text color */
-//=============================================================================
-Color GameWindow::winGetHiliteTextBorderColor( void )
-{
-
- return m_instData.m_hiliteText.borderColor;
-
-}
-
-// GameWindow::winSetInstanceData =============================================
-/** Sets the window's instance data which includes parameters
- * such as background color. */
-//=============================================================================
-Int GameWindow::winSetInstanceData( WinInstanceData *data )
-{
- DisplayString *text, *tooltipText;
-
- // save our own instance of text and tooltip text display strings
- text = m_instData.m_text;
- tooltipText = m_instData.m_tooltip;
-
- // copy over all values from the inst data passed in
- // using memcpy is VERY VERY bad here, since the strings
- // must be copied 'correctly' or bad things will ensue
- m_instData = *data;
-
- // put our text instance pointers back
- m_instData.m_text = text;
- m_instData.m_tooltip = tooltipText;
-
- // make sure we didn't try to copy over a video buffer.
- m_instData.m_videoBuffer = nullptr;
-
- // set our text display instance text if present
- if( data->getTextLength() )
- m_instData.setText( data->getText() );
- if( data->getTooltipTextLength() )
- m_instData.setTooltipText( data->getTooltipText() );
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetInstanceData =============================================
-/** Return pointer to the instance data for this window */
-//=============================================================================
-WinInstanceData *GameWindow::winGetInstanceData( void )
-{
-
- return &m_instData;
-
-}
-
-// GameWindow::winGetUserData =================================================
-/** Return the user data stored */
-//=============================================================================
-void *GameWindow::winGetUserData( void )
-{
-
- return m_userData;
-
-}
-
-// GameWindow::winSetUserData =================================================
-/** Set the user data stored */
-//=============================================================================
-void GameWindow::winSetUserData( void *data )
-{
-
- m_userData = data;
-
-}
-
-// GameWindow::winSetTooltip ==================================================
-/** Sets the window's tooltip text */
-//=============================================================================
-void GameWindow::winSetTooltip( UnicodeString tip )
-{
-
- m_instData.setTooltipText( tip );
-
-}
-
-// GameWindow::winSetWindowId =================================================
-/** Sets the window's id */
-//=============================================================================
-Int GameWindow::winSetWindowId( Int id )
-{
-
- m_instData.m_id = id;
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetWindowId =================================================
-/** Gets the window's id */
-//=============================================================================
-Int GameWindow::winGetWindowId( void )
-{
-
- return m_instData.m_id;
-
-}
-
-// GameWindow::winSetParent ===================================================
-/** Sets this window's parent */
-//=============================================================================
-Int GameWindow::winSetParent( GameWindow *parent )
-{
-
- if( m_parent == nullptr)
- {
- // Top level window so unlink it
- TheWindowManager->unlinkWindow( this );
- }
- else
- {
- // A child window
- TheWindowManager->unlinkChildWindow( this );
- }
-
- if( parent == nullptr )
- {
-
- // Want to make it a top level window so add to window list
- TheWindowManager->linkWindow( this );
- m_parent = nullptr;
-
- }
- else
- {
-
- // Set it's new parent
- TheWindowManager->addWindowToParent( this, parent );
-
- }
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetParent ===================================================
-/** Gets the window's parent */
-//=============================================================================
-GameWindow *GameWindow::winGetParent( void )
-{
-
- return m_parent;
-
-}
-
-// GameWindow::winIsChild =====================================================
-/** Determines if a window is a child/grand-child of a parent */
-//=============================================================================
-Bool GameWindow::winIsChild( GameWindow *child )
-{
-
- while( child )
- {
-
- if( this == child->m_parent )
- return TRUE;
-
- // set up tree
- child = child->m_parent;
-
- }
-
- return FALSE;
-
-}
-
-// GameWindow::winGetChild ====================================================
-/** Get the child window of this window */
-//=============================================================================
-GameWindow *GameWindow::winGetChild( void )
-{
-
- return m_child;
-
-}
-
-// GameWindow::winSetOwner ====================================================
-/** Sets the window's owner */
-//=============================================================================
-Int GameWindow::winSetOwner( GameWindow *owner )
-{
-
- if( owner == nullptr )
- m_instData.m_owner = this;
- else
- m_instData.m_owner = owner;
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetOwner ====================================================
-/** Gets the window's owner */
-//=============================================================================
-GameWindow *GameWindow::winGetOwner( void )
-{
-
- return m_instData.getOwner();
-
-}
-
-// GameWindow::winSetNext =====================================================
-/** Set next pointer */
-//=============================================================================
-void GameWindow::winSetNext( GameWindow *next )
-{
-
- m_next = next;
-
-}
-
-// GameWindow::winGetNext =====================================================
-/** Gets the next window */
-//=============================================================================
-GameWindow *GameWindow::winGetNext( void )
-{
-
- return m_next;
-
-}
-
-// GameWindow::winSetPrev =====================================================
-/** Set prev pointer */
-//=============================================================================
-void GameWindow::winSetPrev( GameWindow *prev )
-{
-
- m_prev = prev;
-
-}
-
-// GameWindow::winGetPrev =====================================================
-/** Get the previous window */
-//=============================================================================
-GameWindow *GameWindow::winGetPrev( void )
-{
-
- return m_prev;
-
-}
-
-// GameWindow::winSetNextInLayout =============================================
-/** Set next window in layout */
-//=============================================================================
-void GameWindow::winSetNextInLayout( GameWindow *next )
-{
- m_nextLayout = next;
-}
-
-// GameWindow::winSetPrevInLayout =============================================
-/** Set previous window in layout pointer */
-//=============================================================================
-void GameWindow::winSetPrevInLayout( GameWindow *prev )
-{
- m_prevLayout = prev;
-}
-
-// GameWindow::winSetLayout ===================================================
-/** Set this window as belonging to layout 'layout' */
-//=============================================================================
-void GameWindow::winSetLayout( WindowLayout *layout )
-{
- m_layout = layout;
-}
-
-// GameWindow::winGetLayout ===================================================
-/** Get layout this window is a part of, if any */
-//=============================================================================
-WindowLayout *GameWindow::winGetLayout( void )
-{
- return m_layout;
-}
-
-// GameWindow::winGetNextInLayout =============================================
-/** Get next window in layout list if any */
-//=============================================================================
-GameWindow *GameWindow::winGetNextInLayout( void )
-{
- return m_nextLayout;
-}
-
-// GameWindow::winGetPrevInLayout =============================================
-/** Get prev window in layout list if any */
-//=============================================================================
-GameWindow *GameWindow::winGetPrevInLayout( void )
-{
- return m_prevLayout;
-}
-
-// GameWindow::winSetSystemFunc ===============================================
-/** Sets the window's input, system, and redraw callback functions. */
-//=============================================================================
-Int GameWindow::winSetSystemFunc( GameWinSystemFunc system )
-{
- if( system )
- m_system = system;
- else
- m_system = TheWindowManager->getDefaultSystem();
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetInputFunc ================================================
-/** Sets the window's input callback functions. */
-//=============================================================================
-Int GameWindow::winSetInputFunc( GameWinInputFunc input )
-{
-
- if( input )
- m_input = input;
- else
- m_input = TheWindowManager->getDefaultInput();
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetDrawFunc =================================================
-/** Sets the window's redraw callback functions. */
-//=============================================================================
-Int GameWindow::winSetDrawFunc( GameWinDrawFunc draw )
-{
-
- if( draw )
- m_draw = draw;
- else
- m_draw = TheWindowManager->getDefaultDraw();
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetTooltipFunc ==============================================
-/** Sets a window's tooltip callback */
-//=============================================================================
-Int GameWindow::winSetTooltipFunc( GameWinTooltipFunc tooltip )
-{
-
- m_tooltip = tooltip;
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetCallbacks ================================================
-/** Sets the window's input, tooltip, and redraw callback functions. */
-//=============================================================================
-Int GameWindow::winSetCallbacks( GameWinInputFunc input,
- GameWinDrawFunc draw,
- GameWinTooltipFunc tooltip )
-{
-
- winSetInputFunc( input );
- winSetDrawFunc( draw );
- winSetTooltipFunc( tooltip );
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winDrawWindow ==================================================
-/** Draws the default background for the specified window. */
-//=============================================================================
-Int GameWindow::winDrawWindow( void )
-{
-
- if( BitIsSet( m_status, WIN_STATUS_HIDDEN ) == FALSE && m_draw )
- m_draw( this, &m_instData );
-
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winPointInChild ================================================
-/** Given a window and the mouse coordinates, return the child
- * window which contains the mouse pointer. Child windows are
- * relative to their parents */
-//=============================================================================
-GameWindow *GameWindow::winPointInChild( Int x, Int y, Bool ignoreEnableCheck, Bool playDisabledSound )
-{
- GameWindow *parent;
- GameWindow *child;
- ICoord2D origin;
-
- for( child = m_child; child; child = child->m_next )
- {
-
- origin = child->m_region.lo;
- parent = child->winGetParent();
-
- while( parent )
- {
-
- origin.x += parent->m_region.lo.x;
- origin.y += parent->m_region.lo.y;
- parent = parent->m_parent;
-
- }
-
- if( x >= origin.x && x <= origin.x + child->m_size.x &&
- y >= origin.y && y <= origin.y + child->m_size.y )
- {
- Bool enabled = ignoreEnableCheck || BitIsSet( child->m_status, WIN_STATUS_ENABLED );
- Bool hidden = BitIsSet( child->m_status, WIN_STATUS_HIDDEN );
- if( !hidden )
- {
- if( enabled )
- {
- return child->winPointInChild( x, y, ignoreEnableCheck, playDisabledSound );
- }
- else if( playDisabledSound )
- {
- AudioEventRTS disabledClick( "GUIClickDisabled" );
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &disabledClick );
- }
- }
- }
- }
-
- }
-
- // not in any children, must be in parent
- return this;
-
-}
-
-// GameWindow::winPointInAnyChild =============================================
-/** Find the child in which the cursor resides; regardless of
- * whether or not the window is actually enabled */
-//=============================================================================
-GameWindow *GameWindow::winPointInAnyChild( Int x, Int y, Bool ignoreHidden, Bool ignoreEnableCheck )
-{
- GameWindow *parent;
- GameWindow *child;
- ICoord2D origin;
-
- for( child = m_child; child; child = child->m_next )
- {
-
- origin = child->m_region.lo;
- parent = child->m_parent;
-
- while( parent )
- {
-
- origin.x += parent->m_region.lo.x;
- origin.y += parent->m_region.lo.y;
- parent = parent->m_parent;
-
- }
-
- if( x >= origin.x && x <= origin.x + child->m_size.x &&
- y >= origin.y && y <= origin.y + child->m_size.y )
- {
-
- if( !(ignoreHidden == TRUE && BitIsSet( child->m_status, WIN_STATUS_HIDDEN )) )
- return child->winPointInChild( x, y, ignoreEnableCheck );
-
- }
-
- }
-
- // not in any children, must be in parent
- return this;
-
-}
-
-//
-// In release builds the default input and system functions are optimized
-// to the same address since they take the same input and have the same
-// body. Rather than fill them with bogus code we just want to make
-// sure that different functions are actually created. If you change the
-// body of one but not the other so they are different, please remove
-// the dummy code
-//
-
-// GameWinDefaultInput ========================================================
-/** The default input callback. Currently does nothing. */
-//=============================================================================
-WindowMsgHandledType GameWinDefaultInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- return MSG_IGNORED;
-
-}
-
-///< Input that blocks all (mouse) input like a wall, instead of passing like it wasn't there
-WindowMsgHandledType GameWinBlockInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- if (msg == GWM_CHAR || msg == GWM_MOUSE_POS)
- return MSG_IGNORED;
-
- if (msg == GWM_LEFT_UP )//|| msg == GWM_LEFT_DRAG)
- {
- //stop drag selecting
-
- TheSelectionTranslator->setLeftMouseButton(FALSE);
- TheSelectionTranslator->setDragSelecting(FALSE);
-
- TheTacticalView->setMouseLock( FALSE );
- TheInGameUI->setSelecting( FALSE );
- TheInGameUI->endAreaSelectHint(nullptr);
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GameWinDefaultSystem =======================================================
-/** The default system callback. Currently does nothing. */
-//=============================================================================
-WindowMsgHandledType GameWinDefaultSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- return MSG_IGNORED;
-
-}
-
-// GameWinDefaultTooltip ======================================================
-/** Default tooltip callback */
-//=============================================================================
-void GameWinDefaultTooltip( GameWindow *window,
- WinInstanceData *instData,
- UnsignedInt mouse )
-{
- return;
-
-}
-
-// GameWinDefaultDraw =========================================================
-/** Default draw, does nothing */
-//=============================================================================
-void GameWinDefaultDraw( GameWindow *window, WinInstanceData *instData )
-{
-
- return;
-
-}
-
-// GameWindow::winSetEnabledImage =============================================
-/** Set an enabled image into the draw data for the enabled state */
-//=============================================================================
-Int GameWindow::winSetEnabledImage( Int index, const Image *image )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set enabled image, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_enabledDrawData[ index ].image = image;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetEnabledColor =============================================
-/** set color for enabled state at index */
-//=============================================================================
-Int GameWindow::winSetEnabledColor( Int index, Color color )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set enabled color, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_enabledDrawData[ index ].color = color;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetEnabledBorderColor =======================================
-/** set border color for state at this index */
-//=============================================================================
-Int GameWindow::winSetEnabledBorderColor( Int index, Color color )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set enabled border color, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_enabledDrawData[ index ].borderColor = color;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetDisabledImage ============================================
-/** Set an disabled image into the draw data for the disabled state */
-//=============================================================================
-Int GameWindow::winSetDisabledImage( Int index, const Image *image )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set disabled image, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_disabledDrawData[ index ].image = image;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetDisabledColor ============================================
-/** set color for disabled state at index */
-//=============================================================================
-Int GameWindow::winSetDisabledColor( Int index, Color color )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set disabled color, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_disabledDrawData[ index ].color = color;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetDisabledBorderColor ======================================
-/** set border color for state at this index */
-//=============================================================================
-Int GameWindow::winSetDisabledBorderColor( Int index, Color color )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set disabled border color, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_disabledDrawData[ index ].borderColor = color;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetHiliteImage ==============================================
-/** Set an hilite image into the draw data for the hilite state */
-//=============================================================================
-Int GameWindow::winSetHiliteImage( Int index, const Image *image )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set hilite image, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_hiliteDrawData[ index ].image = image;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetHiliteColor ==============================================
-/** set color for hilite state at index */
-//=============================================================================
-Int GameWindow::winSetHiliteColor( Int index, Color color )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set hilite color, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_hiliteDrawData[ index ].color = color;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winSetHiliteBorderColor ========================================
-/** set border color for state at this index */
-//=============================================================================
-Int GameWindow::winSetHiliteBorderColor( Int index, Color color )
-{
-
- // sanity
- if( index < 0 || index >= MAX_DRAW_DATA )
- {
-
- DEBUG_LOG(( "set hilite border color, index out of range '%d'", index ));
- assert( 0 );
- return WIN_ERR_INVALID_PARAMETER;
-
- }
-
- m_instData.m_hiliteDrawData[ index ].borderColor = color;
- return WIN_ERR_OK;
-
-}
-
-// GameWindow::winGetInputFunc ================================================
-//=============================================================================
-GameWinInputFunc GameWindow::winGetInputFunc( void )
-{
-
- return m_input;
-
-}
-
-// GameWindow::winGetSystemFunc ===============================================
-//=============================================================================
-GameWinSystemFunc GameWindow::winGetSystemFunc( void )
-{
-
- return m_system;
-
-}
-
-// GameWindow::winGetTooltipFunc ==============================================
-//=============================================================================
-GameWinTooltipFunc GameWindow::winGetTooltipFunc( void )
-{
-
- return m_tooltip;
-
-}
-
-// GameWindow::winGetDrawFunc =================================================
-//=============================================================================
-GameWinDrawFunc GameWindow::winGetDrawFunc( void )
-{
-
- return m_draw;
-
-}
-
-// GameWindow::winSetEditData =================================================
-//=============================================================================
-void GameWindow::winSetEditData( GameWindowEditData *editData )
-{
-
- m_editData = editData;
-
-}
-
-// GameWindow::winGetEditData =================================================
-//=============================================================================
-GameWindowEditData *GameWindow::winGetEditData( void )
-{
-
- return m_editData;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp
deleted file mode 100644
index 88ca944604e..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowGlobal.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GameWindowGlobal.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: These are some global functions that every game using this
-// window system must implement for their current technology
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/Image.h"
-#include "GameClient/Display.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GameFont.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GameWindowManager::winDrawImage ============================================
-/** draw image, coord are in screen and should be kepth within
- * that box specified */
-//=============================================================================
-void GameWindowManager::winDrawImage( const Image *image, Int startX, Int startY,
- Int endX, Int endY, Color color )
-{
-
- TheDisplay->drawImage( image, startX, startY, endX, endY, color );
-
-}
-
-// GameWindowManager::winFillRect =============================================
-/** draw filled rect, coords are absolute screen coords */
-//=============================================================================
-void GameWindowManager::winFillRect( Color color, Real width,
- Int startX, Int startY,
- Int endX, Int endY )
-{
-
- TheDisplay->drawFillRect( startX, startY,
- endX - startX, endY - startY,
- color );
-
-}
-
-// GameWindowManager::winOpenRect =============================================
-/** draw rect outline, coords are absolute screen coords */
-//=============================================================================
-void GameWindowManager::winOpenRect( Color color, Real width,
- Int startX, Int startY,
- Int endX, Int endY )
-{
-
- TheDisplay->drawOpenRect( startX, startY,
- endX - startX, endY - startY,
- width, color );
-
-}
-
-// GameWindowManager::winDrawLine =============================================
-/** draw line, coords are absolute screen coords */
-//=============================================================================
-void GameWindowManager::winDrawLine( Color color, Real width,
- Int startX, Int startY,
- Int endX, Int endY )
-{
-
- TheDisplay->drawLine( startX, startY, endX, endY, width, color );
-
-}
-
-// GameWindowManager::winFindImage ============================================
-/** Given an image name, return an image loc to that image information.
- * You may reorganize the image loc structure however you like to suit
- * your individual project */
-//=============================================================================
-const Image *GameWindowManager::winFindImage( const char *name )
-{
-
- assert( TheMappedImageCollection );
- if( TheMappedImageCollection )
- return TheMappedImageCollection->findImageByName( name );
-
- return nullptr;
-
-}
-
-// GameWindowManager::winMakeColor ============================================
-/** Given RGBA, make a color, you can change color representation for your
- * individual project needs */
-//=============================================================================
-Color GameWindowManager::winMakeColor( UnsignedByte red,
- UnsignedByte green,
- UnsignedByte blue,
- UnsignedByte alpha )
-{
-
- return GameMakeColor( red, green, blue, alpha );
-
-}
-
-// GameWindowManager::winFormatText ===========================================
-/** draw text to the screen */
-//=============================================================================
-void GameWindowManager::winFormatText( GameFont *font, UnicodeString text, Color color,
- Int x, Int y, Int width, Int height )
-{
-
- /// @todo make all display string rendering go through here!
-
-}
-
-// GameWindowManager::winGetTextSize ==========================================
-/** get the extent size of text */
-//=============================================================================
-void GameWindowManager::winGetTextSize( GameFont *font, UnicodeString text,
- Int *width, Int *height, Int maxWidth )
-{
-
- /// @todo make display string size stuff go through here
-
- if( width )
- *width = 0;
-
- if( height )
- *height = 0;
-
-}
-
-// GameWindowManager::winFontHeight ===========================================
-/** Return the font height in pixels */
-//=============================================================================
-Int GameWindowManager::winFontHeight( GameFont *font )
-{
-
- if (font == nullptr)
- return 0;
-
- return font->height;
-
-}
-
-// GameWindowManager::winIsDigit ==============================================
-/** You implementation of whether or not character is a digit */
-//=============================================================================
-Int GameWindowManager::winIsDigit( Int c )
-{
-
- return iswdigit( c );
-
-}
-
-// GameWindowManager::winIsAscii ==============================================
-/** You implementation of whether or not character is ascii */
-//=============================================================================
-Int GameWindowManager::winIsAscii( Int c )
-{
-
- return iswascii( c );
-
-}
-
-// GameWindowManager::winIsAlNum ==============================================
-/** Your implementation of whether or not character is alpha numeric */
-//=============================================================================
-Int GameWindowManager::winIsAlNum( Int c )
-{
-
- return iswalnum( c );
-
-}
-
-// GameWindowManager::winFindFont =============================================
-/** Get a font */
-//=============================================================================
-GameFont *GameWindowManager::winFindFont( AsciiString fontName,
- Int pointSize,
- Bool bold )
-{
-
- assert( TheFontLibrary );
- if( TheFontLibrary )
- return TheFontLibrary->getFont( fontName, pointSize, bold );
-
- return nullptr;
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp
deleted file mode 100644
index 21a677c459c..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowTransitions.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Dec 2002
-//
-// Filename: GameWindowTransitions.cpp
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "GameLogic/GameLogic.h"
-#include "GameClient/GameWindowTransitions.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-GameWindowTransitionsHandler *TheTransitionHandler = nullptr;
-const FieldParse GameWindowTransitionsHandler::m_gameWindowTransitionsFieldParseTable[] =
-{
-
- { "Window", GameWindowTransitionsHandler::parseWindow, nullptr, 0 },
- { "FireOnce", INI::parseBool, nullptr, offsetof( TransitionGroup, m_fireOnce) },
-
- { nullptr, nullptr, nullptr, 0 }
-
-};
-
-void INI::parseWindowTransitions( INI* ini )
-{
- AsciiString name;
- TransitionGroup *g;
-
- // read the name
- const char* c = ini->getNextToken();
- name.set( c );
-
- // find existing item if present
-
- DEBUG_ASSERTCRASH( TheTransitionHandler, ("parseWindowTransitions: TheTransitionHandler doesn't exist yet") );
- if( !TheTransitionHandler )
- return;
-
- // If we have a previously allocated control bar, this will return a cleared out pointer to it so we
- // can overwrite it
- g = TheTransitionHandler->getNewGroup( name );
-
- // sanity
- DEBUG_ASSERTCRASH( g, ("parseWindowTransitions: Unable to allocate group '%s'", name.str()) );
-
- // parse the ini definition
- ini->initFromINI( g, TheTransitionHandler->getFieldParse() );
-
-
-}
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-Transition *getTransitionForStyle( Int style )
-{
- switch (style) {
- case TRANSITION_FLASH:
- return NEW FlashTransition;
- case BUTTON_TRANSITION_FLASH:
- return NEW ButtonFlashTransition;
- case WIN_FADE_TRANSITION:
- return NEW FadeTransition;
- case WIN_SCALE_UP_TRANSITION:
- return NEW ScaleUpTransition;
- case MAINMENU_SCALE_UP_TRANSITION:
- return NEW MainMenuScaleUpTransition;
- case TEXT_TYPE_TRANSITION:
- return NEW TextTypeTransition;
- case SCREEN_FADE_TRANSITION:
- return NEW ScreenFadeTransition;
- case COUNT_UP_TRANSITION:
- return NEW CountUpTransition;
- case FULL_FADE_TRANSITION:
- return NEW FullFadeTransition;
- case TEXT_ON_FRAME_TRANSITION:
- return NEW TextOnFrameTransition;
- case REVERSE_SOUND_TRANSITION:
- return NEW ReverseSoundTransition;
-
- case MAINMENU_MEDIUM_SCALE_UP_TRANSITION:
- return NEW MainMenuMediumScaleUpTransition;
- case MAINMENU_SMALL_SCALE_DOWN_TRANSITION:
- return NEW MainMenuSmallScaleDownTransition;
- case CONTROL_BAR_ARROW_TRANSITION:
- return NEW ControlBarArrowTransition;
- case SCORE_SCALE_UP_TRANSITION:
- return NEW ScoreScaleUpTransition;
-
- default:
- DEBUG_ASSERTCRASH(FALSE, ("getTransitionForStyle:: An invalid style was passed in. Style = %d", style));
- return nullptr;
- }
- return nullptr;
-}
-
-TransitionWindow::TransitionWindow( void )
-{
- m_currentFrameDelay = m_frameDelay = 0;
- m_style = 0;
-
- m_winID = NAMEKEY_INVALID;
- m_win = nullptr;
- m_transition = nullptr;
-}
-
-TransitionWindow::~TransitionWindow( void )
-{
- if (m_win)
- m_win->unlinkTransitionWindow(this);
-
- m_win = nullptr;
-
- delete m_transition;
- m_transition = nullptr;
-}
-
-Bool TransitionWindow::init( void )
-{
- m_winID = TheNameKeyGenerator->nameToKey(m_winName);
- m_win = TheWindowManager->winGetWindowFromId(nullptr, m_winID);
- m_currentFrameDelay = m_frameDelay;
-// DEBUG_ASSERTCRASH( m_win, ("TransitionWindow::init Failed to find window %s", m_winName.str()));
-// if( !m_win )
-// return FALSE;
-
- delete m_transition;
- m_transition = getTransitionForStyle( m_style );
- m_transition->init(m_win);
-
- // TheSuperHackers @fix Mauller 15/05/2025 Link TransitionWindow to the GameWindow so the GameWindow can unlink itself when it is destroyed
- if(m_win)
- m_win->linkTransitionWindow(this);
-
- return TRUE;
-}
-
-void TransitionWindow::update( Int frame )
-{
- if(frame < m_currentFrameDelay || frame > (m_currentFrameDelay + m_transition->getFrameLength()))
- return;
-
- if(m_transition)
- m_transition->update( frame - m_currentFrameDelay);
-}
-
-Bool TransitionWindow::isFinished( void )
-{
- if(m_transition)
- return m_transition->isFinished();
- return TRUE;
-}
-
-void TransitionWindow::reverse( Int totalFrames )
-{
- //m_currentFrameDelay = totalFrames - (m_transition->getFrameLength() + m_frameDelay);
- if(m_transition)
- m_transition->reverse();
-}
-
-void TransitionWindow::skip( void )
-{
- if(m_transition)
- m_transition->skip();
-}
-
-void TransitionWindow::draw( void )
-{
- if(m_transition)
- m_transition->draw();
-}
-
-void TransitionWindow::unlinkGameWindow(GameWindow* win)
-{
- if (m_win != win)
- return;
-
- m_transition->unlinkGameWindow(win);
- m_win = nullptr;
-}
-
-Int TransitionWindow::getTotalFrames( void )
-{
- if(m_transition)
- {
- return m_frameDelay + m_transition->getFrameLength();
- }
-
- return m_frameDelay;
-}
-
-//-----------------------------------------------------------------------------
-TransitionGroup::TransitionGroup( void )
-{
- m_currentFrame = 0;
- m_fireOnce = FALSE;
-}
-
-TransitionGroup::~TransitionGroup( void )
-{
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- delete tWin;
- it = m_transitionWindowList.erase(it);
- }
-}
-
-void TransitionGroup::init( void )
-{
- m_currentFrame = 0;
- m_directionMultiplier = 1;
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- tWin->init();
- it++;
- }
-
-}
-
-void TransitionGroup::update( void )
-{
- m_currentFrame += m_directionMultiplier; // we go forward or backwards depending.
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- tWin->update(m_currentFrame);
- it++;
- }
-}
-
-Bool TransitionGroup::isFinished( void )
-{
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- if(tWin->isFinished() == FALSE)
- return FALSE;
- it++;
- }
-
- return TRUE;
-}
-
-void TransitionGroup::reverse( void )
-{
- Int totalFrames =0;
- m_directionMultiplier = -1;
-
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- Int winFrames = tWin->getTotalFrames();
- if(winFrames > totalFrames)
- totalFrames = winFrames;
- it++;
- }
- it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- tWin->reverse(totalFrames);
- it++;
- }
- m_currentFrame = totalFrames;
-// m_currentFrame ++;
-}
-
-Bool TransitionGroup::isReversed( void )
-{
- if(m_directionMultiplier < 0)
- return TRUE;
- return FALSE;
-}
-
-void TransitionGroup::skip ( void )
-{
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- tWin->skip();
- it++;
- }
-}
-
-void TransitionGroup::draw ( void )
-{
- TransitionWindowList::iterator it = m_transitionWindowList.begin();
- while (it != m_transitionWindowList.end())
- {
- TransitionWindow *tWin = *it;
- tWin->draw();
- it++;
- }
-}
-
-void TransitionGroup::addWindow( TransitionWindow *transWin )
-{
- if(!transWin)
- return;
- m_transitionWindowList.push_back(transWin);
-}
-
-//-----------------------------------------------------------------------------
-
-GameWindowTransitionsHandler::GameWindowTransitionsHandler(void)
-{
- m_currentGroup = nullptr;
- m_pendingGroup = nullptr;
- m_drawGroup = nullptr;
- m_secondaryDrawGroup = nullptr;
-
-}
-
-GameWindowTransitionsHandler::~GameWindowTransitionsHandler( void )
-{
- m_currentGroup = nullptr;
- m_pendingGroup = nullptr;
- m_drawGroup = nullptr;
- m_secondaryDrawGroup = nullptr;
-
- TransitionGroupList::iterator it = m_transitionGroupList.begin();
- while( it != m_transitionGroupList.end() )
- {
- TransitionGroup *g = *it;
- delete g;
- it = m_transitionGroupList.erase(it);
- }
-}
-
-void GameWindowTransitionsHandler::init(void )
-{
- m_currentGroup = nullptr;
- m_pendingGroup = nullptr;
- m_drawGroup = nullptr;
- m_secondaryDrawGroup = nullptr;
-}
-
-void GameWindowTransitionsHandler::load(void )
-{
- INI ini;
- // Read from INI all the ControlBarSchemes
- ini.loadFileDirectory( "Data\\INI\\WindowTransitions", INI_LOAD_OVERWRITE, nullptr );
-
-}
-
-void GameWindowTransitionsHandler::reset( void )
-{
- m_currentGroup = nullptr;
- m_pendingGroup = nullptr;
- m_drawGroup = nullptr;
- m_secondaryDrawGroup = nullptr;
-
-}
-
-void GameWindowTransitionsHandler::update( void )
-{
- if(m_drawGroup != m_currentGroup)
- m_secondaryDrawGroup = m_drawGroup;
- else
- m_secondaryDrawGroup = nullptr;
-
- m_drawGroup = m_currentGroup;
- if(m_currentGroup && !m_currentGroup->isFinished())
- m_currentGroup->update();
-
- if(m_currentGroup && m_currentGroup->isFinished() && m_currentGroup->isFireOnce())
- {
- m_currentGroup = nullptr;
- }
-
- if(m_currentGroup && m_pendingGroup && m_currentGroup->isFinished())
- {
- m_currentGroup = m_pendingGroup;
- m_pendingGroup = nullptr;
- }
-
- if(!m_currentGroup && m_pendingGroup)
- {
- m_currentGroup = m_pendingGroup;
- m_pendingGroup = nullptr;
- }
-
- if(m_currentGroup && m_currentGroup->isFinished() && m_currentGroup->isReversed())
- m_currentGroup = nullptr;
-}
-
-
-void GameWindowTransitionsHandler::draw( void )
-{
-// if( TheGameLogic->getFrame() > 0 )//if( areTransitionsEnabled() ) //KRIS
- if(m_drawGroup)
- m_drawGroup->draw();
- if(m_secondaryDrawGroup)
- m_secondaryDrawGroup->draw();
-}
-
-void GameWindowTransitionsHandler::setGroup(AsciiString groupName, Bool immediate )
-{
- if(groupName.isEmpty() && immediate)
- m_currentGroup = nullptr;
- if(immediate && m_currentGroup)
- {
- m_currentGroup->skip();
- m_currentGroup = findGroup(groupName);
- if(m_currentGroup)
- m_currentGroup->init();
- return;
- }
-
- if(m_currentGroup)
- {
- if(!m_currentGroup->isFireOnce() && !m_currentGroup->isReversed())
- m_currentGroup->reverse();
- m_pendingGroup = findGroup(groupName);
- if(m_pendingGroup)
- m_pendingGroup->init();
- return;
- }
-
- m_currentGroup = findGroup(groupName);
- if(m_currentGroup)
- m_currentGroup->init();
-
-
-
-}
-
-void GameWindowTransitionsHandler::reverse( AsciiString groupName )
-{
- TransitionGroup *g = findGroup(groupName);
- if( m_currentGroup == g )
- {
- m_currentGroup->reverse();
- return;
- }
- if( m_pendingGroup == g)
- {
- m_pendingGroup = nullptr;
- return;
- }
- if(m_currentGroup)
- m_currentGroup->skip();
- if(m_pendingGroup)
- m_pendingGroup->skip();
-
- m_currentGroup = g;
- m_currentGroup->init();
- m_currentGroup->skip();
- m_currentGroup->reverse();
- m_pendingGroup = nullptr;
-}
-
-void GameWindowTransitionsHandler::remove( AsciiString groupName, Bool skipPending )
-{
- TransitionGroup *g = findGroup(groupName);
- if(m_pendingGroup == g)
- {
- if(skipPending)
- m_pendingGroup->skip();
-
- m_pendingGroup = nullptr;
- }
- if(m_currentGroup == g)
- {
- m_currentGroup->skip();
- m_currentGroup = nullptr;
- if(m_pendingGroup)
- m_currentGroup = m_pendingGroup;
- }
-}
-
-TransitionGroup *GameWindowTransitionsHandler::getNewGroup( AsciiString name )
-{
- if(name.isEmpty())
- return nullptr;
-
- // test to see if we're trying to add an already existing group.
- if(findGroup(name))
- {
- DEBUG_ASSERTCRASH(FALSE, ("GameWindowTransitionsHandler::getNewGroup - We already have a group %s", name.str()));
- return nullptr;
- }
- TransitionGroup *g = NEW TransitionGroup;
- g->setName(name);
- m_transitionGroupList.push_back(g);
- return g;
-}
-
-Bool GameWindowTransitionsHandler::isFinished( void )
-{
- if(m_currentGroup)
- return m_currentGroup->isFinished();
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-TransitionGroup *GameWindowTransitionsHandler::findGroup( AsciiString groupName )
-{
- if(groupName.isEmpty())
- return nullptr;
-
- TransitionGroupList::iterator it = m_transitionGroupList.begin();
- while( it != m_transitionGroupList.end() )
- {
- TransitionGroup *g = *it;
- if(groupName.compareNoCase(g->getName()) == 0)
- return g;
- it++;
- }
- return nullptr;
-}
-
-void GameWindowTransitionsHandler::parseWindow( INI* ini, void *instance, void *store, const void *userData )
-{
- static const FieldParse myFieldParse[] =
- {
- { "WinName", INI::parseAsciiString, nullptr, offsetof( TransitionWindow, m_winName ) },
- { "Style", INI::parseLookupList, TransitionStyleNames, offsetof( TransitionWindow, m_style ) },
- { "FrameDelay", INI::parseInt, nullptr, offsetof( TransitionWindow, m_frameDelay ) },
- { nullptr, nullptr, nullptr, 0 }
- };
- TransitionWindow *transWin = NEW TransitionWindow;
- ini->initFromINI(transWin, myFieldParse);
- ((TransitionGroup*)instance)->addWindow(transWin);
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp
deleted file mode 100644
index dc8a0bcb812..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: HeaderTemplate.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Aug 2002
-//
-// Filename: HeaderTemplate.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: The header template system is used to maintain a unified look across
-// windows. It also allows Localization to customize the looks based
-// on language fonts.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h"
-
-#include "Common/INI.h"
-#include "Common/FileSystem.h"
-#include "Common/Registry.h"
-#include "GameClient/HeaderTemplate.h"
-#include "GameClient/GameFont.h"
-#include "GameClient/GlobalLanguage.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-const FieldParse HeaderTemplateManager::m_headerFieldParseTable[] =
-{
- { "Font", INI::parseQuotedAsciiString, nullptr, offsetof( HeaderTemplate, m_fontName ) },
- { "Point", INI::parseInt, nullptr, offsetof( HeaderTemplate, m_point) },
- { "Bold", INI::parseBool, nullptr, offsetof( HeaderTemplate, m_bold ) },
- { nullptr, nullptr, nullptr, 0 },
-};
-
-HeaderTemplateManager *TheHeaderTemplateManager = nullptr;
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-void INI::parseHeaderTemplateDefinition( INI *ini )
-{
- AsciiString name;
- HeaderTemplate *hTemplate;
-
- // read the name
- const char* c = ini->getNextToken();
- name.set( c );
-
- // find existing item if present
- hTemplate = TheHeaderTemplateManager->findHeaderTemplate( name );
- if( hTemplate == nullptr )
- {
-
- // allocate a new item
- hTemplate = TheHeaderTemplateManager->newHeaderTemplate( name );
-
- }
- else
- {
- DEBUG_CRASH(( "[LINE: %d in '%s'] Duplicate header Template %s found!", ini->getLineNum(), ini->getFilename().str(), name.str() ));
- }
- // parse the ini definition
- ini->initFromINI( hTemplate, TheHeaderTemplateManager->getFieldParse() );
-
-}
-
-HeaderTemplate::HeaderTemplate( void ) :
-m_font(nullptr),
-m_point(0),
-m_bold(FALSE)
-{
- m_fontName.clear();
- m_name.clear();
-}
-
-HeaderTemplate::~HeaderTemplate( void ){}
-
-HeaderTemplateManager::HeaderTemplateManager( void )
-{}
-
-HeaderTemplateManager::~HeaderTemplateManager( void )
-{
- HeaderTemplateListIt it = m_headerTemplateList.begin();
- while(it != m_headerTemplateList.end())
- {
- HeaderTemplate *hTemplate = *it;
- delete hTemplate;
- it = m_headerTemplateList.erase(it);
-
- }
-}
-
-void HeaderTemplateManager::init( void )
-{
- {
- AsciiString fname;
- fname.format("Data\\%s\\HeaderTemplate", GetRegistryLanguage().str());
-
- INI ini;
- ini.loadFileDirectory( fname, INI_LOAD_OVERWRITE, nullptr );
- }
-
- populateGameFonts();
-}
-
-HeaderTemplate *HeaderTemplateManager::findHeaderTemplate( AsciiString name )
-{
- HeaderTemplateListIt it = m_headerTemplateList.begin();
- while(it != m_headerTemplateList.end())
- {
- HeaderTemplate *hTemplate = *it;
- if(hTemplate->m_name.compare(name) == 0)
- return hTemplate;
- ++it;
- }
- return nullptr;
-}
-
-HeaderTemplate *HeaderTemplateManager::newHeaderTemplate( AsciiString name )
-{
- HeaderTemplate *newHTemplate = NEW HeaderTemplate;
- DEBUG_ASSERTCRASH(newHTemplate, ("Unable to create a new Header Template in HeaderTemplateManager::newHeaderTemplate"));
- if(!newHTemplate)
- return nullptr;
-
- newHTemplate->m_name = name;
- m_headerTemplateList.push_front(newHTemplate);
- return newHTemplate;
-
-}
-
-GameFont *HeaderTemplateManager::getFontFromTemplate( AsciiString name )
-{
- HeaderTemplate *ht = findHeaderTemplate( name );
- if(!ht)
- {
- //DEBUG_LOG(("HeaderTemplateManager::getFontFromTemplate - Could not find header %s", name.str()));
- return nullptr;
- }
-
- return ht->m_font;
-}
-
-HeaderTemplate *HeaderTemplateManager::getFirstHeader( void )
-{
- HeaderTemplateListIt it = m_headerTemplateList.begin();
- if( it == m_headerTemplateList.end())
- return nullptr;
-
- return *it;
-}
-
-HeaderTemplate *HeaderTemplateManager::getNextHeader( HeaderTemplate *ht )
-{
- HeaderTemplateListIt it = m_headerTemplateList.begin();
- while(it != m_headerTemplateList.end())
- {
- if(*it == ht)
- {
- ++it;
- if( it == m_headerTemplateList.end())
- return nullptr;
- return *it;
- }
- ++it;
- }
- return nullptr;
-
-}
-
-void HeaderTemplateManager::onResolutionChanged( void )
-{
- populateGameFonts();
-}
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-void HeaderTemplateManager::populateGameFonts( void )
-{
- HeaderTemplateListIt it = m_headerTemplateList.begin();
- while(it != m_headerTemplateList.end())
- {
- HeaderTemplate *hTemplate = *it;
- Real pointSize = TheGlobalLanguageData->adjustFontSize(hTemplate->m_point);
- GameFont *font = TheFontLibrary->getFont(hTemplate->m_fontName, pointSize,hTemplate->m_bold);
- DEBUG_ASSERTCRASH(font,("HeaderTemplateManager::populateGameFonts - Could not find font %s %d",hTemplate->m_fontName.str(), hTemplate->m_point));
-
- hTemplate->m_font = font;
-
- ++it;
- }
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp
deleted file mode 100644
index d267b84ee4a..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp
+++ /dev/null
@@ -1,1600 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//----------------------------------------------------------------------------
-//
-// Project: Ganerals
-//
-// Module: IME
-//
-// File name: IMEManager.cpp
-//
-// Created: 11/14/01 TR
-//
-//----------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------------
-
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "mbstring.h"
-
-#include "Common/Debug.h"
-#include "Common/Language.h"
-#include "Common/UnicodeString.h"
-#include "GameClient/Display.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/IMEManager.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/Color.h"
-#include "Common/NameKeyGenerator.h"
-
-
-//----------------------------------------------------------------------------
-// Externals
-//----------------------------------------------------------------------------
-
-extern HWND ApplicationHWnd; ///< our application window handle
-extern Int IMECandidateWindowLineSpacing;
-
-//----------------------------------------------------------------------------
-// Defines
-//----------------------------------------------------------------------------
-
-
-//#define DEBUG_IME
-
-//----------------------------------------------------------------------------
-// Private Types
-//----------------------------------------------------------------------------
-
-//===============================
-// IMEManager
-//===============================
-
-class IMEManager : public IMEManagerInterface
-{
-
- public:
-
- IMEManager();
- ~IMEManager();
-
- virtual void init( void );
- virtual void reset( void );
- virtual void update( void );
-
- virtual void attach( GameWindow *window ); ///< attach IME to specified window
- virtual void detach( void ); ///< detach IME from current window
- virtual void enable( void ); ///< Enable IME
- virtual void disable( void ); ///< Disable IME
- virtual Bool isEnabled( void ); ///< Is IME enabled
- virtual Bool isAttachedTo( GameWindow *window ); ///< Is the manager attached toa window
- virtual GameWindow* getWindow( void ); ///< Returns the window we are currently attached to
- virtual Bool isComposing( void ); ///< Manager is currently composing new input string
- virtual void getCompositionString( UnicodeString &string ); ///< Return the current composition string
- virtual Int getCompositionCursorPosition( void ); ///< Returns the composition cursor position
- virtual Int getIndexBase( void ); ///< Get index base for candidate list
-
- virtual Int getCandidateCount(); ///< Returns the total number of candidates
- virtual const UnicodeString* getCandidate( Int index ); ///< Returns the candidate string
- virtual Int getSelectedCandidateIndex(); ///< Returns the indexed of the currently selected candidate
- virtual Int getCandidatePageSize(); ///< Returns the page size for the candidates list
- virtual Int getCandidatePageStart(); ///< Returns the index of the first visibel candidate
-
-
-
- /// Checks for and services IME messages. Returns TRUE if message serviced
- virtual Bool serviceIMEMessage( void *windowsHandle,
- UnsignedInt message,
- Int wParam,
- Int lParam );
- virtual Int result( void ); ///< result return value of last serviced IME message
-
- protected:
-
- enum
- {
- MAX_COMPSTRINGLEN = 2*1024
- };
-
- struct MessageInfo
- {
- Char *name;
- Int value;
- };
-
- Int m_result; ///< last IME message's winProc return code
- GameWindow *m_window; ///< window we are accepting input for
- HIMC m_context; ///< Imput Manager Context
- HIMC m_oldContext; ///< Previous IME comtext
- Int m_disabled; ///< IME disable count 0 = enabled
- Bool m_composing; ///< Are we currently composing a new string
- WideChar m_compositionString[MAX_COMPSTRINGLEN+1];
- WideChar m_resultsString[MAX_COMPSTRINGLEN+1];
- Int m_compositionCursorPos;
- Int m_compositionStringLength;
- Int m_indexBase;
-
- Int m_pageStart; ///< index of first visible candidate
- Int m_pageSize; ///< Number of candidate per page
- Int m_selectedIndex; ///< Index of the currently selected candidate
- Int m_candidateCount; ///< Total number of candidate strings
- UnicodeString *m_candidateString; ///< table of canidate strings
- Bool m_unicodeIME; ///< Is this an unicode IME
- Int m_compositionCharsDisplayed; ///< number of temporary composition characters displayed that need to be replaced with result string.
-
- WideChar convertCharToWide( WPARAM mbchar ); ///< Convert multibyte character to wide
- void updateCompositionString( void ); ///< Update the context of the composition string from the IMM
- void getResultsString( void ); ///< Get the final composition string result
- void updateProperties( void ); ///< Read the current IME properties
- void openCandidateList( Int candidateFlags ); ///< open candidate window
- void closeCandidateList( Int candidateFlags ); ///< Close candidate window
- void updateCandidateList( Int candidateFlags ); ///< Update candidate window
- void updateListBox( CANDIDATELIST *candidateList ); ///< Update candidate list box gadget
- void convertToUnicode( Char *mbcs, UnicodeString &unicode );
- void resizeCandidateWindow( Int pageSize );
-
- void openStatusWindow( void );
- void closeStatusWindow( void );
- void updateStatusWindow( void );
-
- GameWindow *m_candidateWindow; ///< IME candidate window interface
- GameWindow *m_statusWindow; ///< IME status window interface
- GameWindow *m_candidateTextArea; ///< list box area
- GameWindow *m_candidateUpArrow; ///< up arrow
- GameWindow *m_candidateDownArrow; ///< down arrow
-
-
-
- #ifdef DEBUG_IME
- static MessageInfo m_mainMessageInfo[];
- static MessageInfo m_notifyInfo[];
- static MessageInfo m_requestInfo[];
- static MessageInfo m_controlInfo[];
- static MessageInfo m_setContextInfo[];
- static MessageInfo m_setCmodeInfo[];
- static MessageInfo m_setSmodeInfo[];
- Char* getMessageName( MessageInfo *msgTable, Int value );
- void buildFlagsString( IMEManager::MessageInfo *msgTable, Int value, AsciiString &string );
- void printMessageInfo( Int message, Int wParam, Int lParam );
- void printConversionStatus( void );
- void printSentenceStatus( void );
- #endif
-};
-
-
-
-
-//----------------------------------------------------------------------------
-// Private Data
-//----------------------------------------------------------------------------
-#ifdef DEBUG_IME
-
-IMEManager::MessageInfo IMEManager::m_mainMessageInfo[] =
-{
- { "WM_IME_SETCONTEXT" , WM_IME_SETCONTEXT },
- { "WM_IME_NOTIFY" , WM_IME_NOTIFY },
- { "WM_IME_CONTROL" , WM_IME_CONTROL },
- { "WM_IME_COMPOSITIONFULL" , WM_IME_COMPOSITIONFULL },
- { "WM_IME_SELECT" , WM_IME_SELECT },
- { "WM_IME_CHAR" , WM_IME_CHAR },
-#ifdef WM_IME_REQUST
- { "WM_IME_REQUEST" , WM_IME_REQUEST },
-#endif
- { "WM_IME_KEYDOWN" , WM_IME_KEYDOWN },
- { "WM_IME_KEYUP" , WM_IME_KEYUP },
- { "WM_IME_STARTCOMPOSITION" , WM_IME_STARTCOMPOSITION},
- { "WM_IME_ENDCOMPOSITION" , WM_IME_ENDCOMPOSITION },
- { "WM_IME_COMPOSITION" , WM_IME_COMPOSITION },
- { "WM_IME_KEYLAST" , WM_IME_KEYLAST },
- { nullptr, 0 }
-};
-
-IMEManager::MessageInfo IMEManager::m_notifyInfo[] =
-{
- { "IMN_CLOSESTATUSWINDOW" , IMN_CLOSESTATUSWINDOW },
- { "IMN_OPENSTATUSWINDOW" , IMN_OPENSTATUSWINDOW },
- { "IMN_CHANGECANDIDATE" , IMN_CHANGECANDIDATE },
- { "IMN_CLOSECANDIDATE" , IMN_CLOSECANDIDATE },
- { "IMN_OPENCANDIDATE" , IMN_OPENCANDIDATE },
- { "IMN_SETCONVERSIONMODE" , IMN_SETCONVERSIONMODE },
- { "IMN_SETSENTENCEMODE" , IMN_SETSENTENCEMODE },
- { "IMN_SETOPENSTATUS" , IMN_SETOPENSTATUS },
- { "IMN_SETCANDIDATEPOS" , IMN_SETCANDIDATEPOS },
- { "IMN_SETCOMPOSITIONFONT" , IMN_SETCOMPOSITIONFONT },
- { "IMN_SETCOMPOSITIONWINDOW" , IMN_SETCOMPOSITIONWINDOW},
- { "IMN_SETSTATUSWINDOWPOS" , IMN_SETSTATUSWINDOWPOS },
- { "IMN_GUIDELINE" , IMN_GUIDELINE },
- { "IMN_PRIVATE" , IMN_PRIVATE },
- { nullptr, 0 }
-};
-
-IMEManager::MessageInfo IMEManager::m_requestInfo[] =
-{
-#ifdef WM_IME_REQUST
- { "IMR_COMPOSITIONWINDOW" , IMR_COMPOSITIONWINDOW },
- { "IMR_CANDIDATEWINDOW" , IMR_CANDIDATEWINDOW },
- { "IMR_COMPOSITIONFONT" , IMR_COMPOSITIONFONT },
- { "IMR_RECONVERTSTRING" , IMR_RECONVERTSTRING },
- { "IMR_CONFIRMRECONVERTSTRING" , IMR_CONFIRMRECONVERTSTRING},
-#endif
- { nullptr, 0 }
-};
-
-
-IMEManager::MessageInfo IMEManager::m_controlInfo[] =
-{
- { "IMC_GETCANDIDATEPOS" , IMC_GETCANDIDATEPOS },
- { "IMC_SETCANDIDATEPOS " , IMC_SETCANDIDATEPOS },
- { "IMC_GETCOMPOSITIONFONT" , IMC_GETCOMPOSITIONFONT },
- { "IMC_SETCOMPOSITIONFONT" , IMC_SETCOMPOSITIONFONT },
- { "IMC_GETCOMPOSITIONWINDOW" , IMC_GETCOMPOSITIONWINDOW},
- { "IMC_SETCOMPOSITIONWINDOW" , IMC_SETCOMPOSITIONWINDOW},
- { "IMC_GETSTATUSWINDOWPOS" , IMC_GETSTATUSWINDOWPOS },
- { "IMC_SETSTATUSWINDOWPOS" , IMC_SETSTATUSWINDOWPOS },
- { "IMC_CLOSESTATUSWINDOW" , IMC_CLOSESTATUSWINDOW },
- { "IMC_OPENSTATUSWINDOW" , IMC_OPENSTATUSWINDOW },
- { nullptr, 0 }
-};
-
-IMEManager::MessageInfo IMEManager::m_setContextInfo[] =
-{
- { "CANDIDATEWINDOW1" , ISC_SHOWUICANDIDATEWINDOW },
- { "CANDIDATEWINDOW2" , ISC_SHOWUICANDIDATEWINDOW<<1 },
- { "CANDIDATEWINDOW3" , ISC_SHOWUICANDIDATEWINDOW<<2 },
- { "CANDIDATEWINDOW4" , ISC_SHOWUICANDIDATEWINDOW<<3 },
- { "COMPOSITIONWINDOW" , ISC_SHOWUICOMPOSITIONWINDOW },
- { "GUIDELINE" , ISC_SHOWUIGUIDELINE },
- { nullptr, 0 }
-};
-
-IMEManager::MessageInfo IMEManager::m_setCmodeInfo[] =
-{
- { "ALPHANUMERIC" , IME_CMODE_ALPHANUMERIC},
- { "NATIVE" , IME_CMODE_NATIVE },
- { "KATAKANA" , IME_CMODE_KATAKANA },
- { "LANGUAGE" , IME_CMODE_LANGUAGE },
- { "FULLSHAPE" , IME_CMODE_FULLSHAPE },
- { "ROMAN" , IME_CMODE_ROMAN },
- { "CHARCODE" , IME_CMODE_CHARCODE },
- { "HANJACONVERT" , IME_CMODE_HANJACONVERT},
- { "SOFTKBD" , IME_CMODE_SOFTKBD },
- { "NOCONVERSION" , IME_CMODE_NOCONVERSION},
- { "EUDC" , IME_CMODE_EUDC },
- { "SYMBOL" , IME_CMODE_SYMBOL },
- { "FIXED" , IME_CMODE_FIXED },
- { nullptr, 0 }
-};
-
-IMEManager::MessageInfo IMEManager::m_setSmodeInfo[] =
-{
- { "NONE" , IME_SMODE_NONE },
- { "PLAURALCLAUSE" , IME_SMODE_PLAURALCLAUSE},
- { "SINGLECONVERT" , IME_SMODE_SINGLECONVERT},
- { "AUTOMATIC" , IME_SMODE_AUTOMATIC },
- { "PHRASEPREDICT" , IME_SMODE_PHRASEPREDICT},
- { "CONVERSATION" , IME_SMODE_CONVERSATION },
- { nullptr, 0 }
-};
-
-#endif
-
-//----------------------------------------------------------------------------
-// Public Data
-//----------------------------------------------------------------------------
-
-IMEManagerInterface *TheIMEManager = nullptr;
-
-
-//----------------------------------------------------------------------------
-// Private Prototypes
-//----------------------------------------------------------------------------
-
-
-
-//----------------------------------------------------------------------------
-// Private Functions
-//----------------------------------------------------------------------------
-
-#ifdef DEBUG_IME
-
-//============================================================================
-// IMEManager::getMessageName
-//============================================================================
-
-Char* IMEManager::getMessageName( IMEManager::MessageInfo *msgTable, Int value )
-{
- Char *name = nullptr;
-
- if ( msgTable )
- {
- while ( msgTable->name )
- {
- if ( msgTable->value == value )
- {
- name = msgTable->name;
- break;
- }
- msgTable++;
- }
- }
-
- return name;
-}
-
-//============================================================================
-// IMEManager::buildFlagsString
-//============================================================================
-
-void IMEManager::buildFlagsString( IMEManager::MessageInfo *msgTable, Int value, AsciiString &string )
-{
- string.clear();
- Bool first = TRUE;
-
- if ( msgTable )
- {
- while ( msgTable->name )
- {
- if ( msgTable->value & value )
- {
- if ( !first )
- {
- string.concat( "|" );
- first = FALSE;
- }
- string.concat( msgTable->name );
- }
- msgTable++;
- }
- }
-}
-
-//============================================================================
-// IMEManager::printMessageInfo
-//============================================================================
-
-void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam )
-{
- Char *messageText = getMessageName( m_mainMessageInfo, message);
-
- switch( message )
- {
- case WM_IME_NOTIFY:
- {
- Char *notifyName = getMessageName( m_notifyInfo, wParam );
- if ( notifyName == nullptr ) notifyName = "unknown";
- DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, notifyName, wParam, lParam ));
- break;
- }
- case WM_IME_CONTROL:
- {
- Char *controlName = getMessageName( m_controlInfo, wParam );
- if ( controlName == nullptr ) controlName = "unknown";
-
- DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, controlName, wParam, lParam ));
- break;
- }
- #ifdef WM_IME_REQUEST
- case WM_IME_REQUEST:
- {
- Char *requestName = getMessageName( m_requestInfo, wParam );
- if ( requestName == nullptr ) requestName = "unknown";
-
- DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, requestName, wParam, lParam ));
- break;
- }
- #endif
- case WM_IME_SETCONTEXT:
- {
- AsciiString flags;
-
- buildFlagsString( m_setContextInfo, lParam, flags );
-
- DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - %s(0x%04x)", messageText, message, wParam, flags.str(), lParam ));
- break;
- }
- default:
- if ( messageText )
- {
- DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - 0x%08x", messageText, message, wParam, lParam ));
- }
- break;
- }
-}
-
-//============================================================================
-// IMEManager::printConversionStatus
-//============================================================================
-
-void IMEManager::printConversionStatus( void )
-{
- DWORD mode;
- if ( m_context )
- {
- ImmGetConversionStatus( m_context, &mode, nullptr );
-
- AsciiString flags;
-
- buildFlagsString( m_setCmodeInfo, mode, flags );
-
- DEBUG_LOG(( "IMM: Conversion mode = (%s)", flags.str()));
- }
-}
-
-//============================================================================
-// IMEManager::printSentenceStatus
-//============================================================================
-
-void IMEManager::printSentenceStatus( void )
-{
- DWORD mode;
- if ( m_context )
- {
- ImmGetConversionStatus( m_context, nullptr, &mode );
-
- AsciiString flags;
-
- buildFlagsString( m_setSmodeInfo, mode, flags );
-
- DEBUG_LOG(( "IMM: Sentence mode = (%s)", flags.str()));
- }
-}
-#endif // DEBUG_IME
-
-
-//----------------------------------------------------------------------------
-// Public Functions
-//----------------------------------------------------------------------------
-
-//============================================================================
-// *CreateIMEManagerInterface
-//============================================================================
-
-IMEManagerInterface *CreateIMEManagerInterface( void )
-{
- return NEW IMEManager;
-}
-
-
-//============================================================================
-// IMEManager::IMEManager
-//============================================================================
-
-IMEManager::IMEManager()
-: m_window(nullptr),
- m_context(nullptr),
- m_candidateWindow(nullptr),
- m_statusWindow(nullptr),
- m_candidateCount(0),
- m_candidateString(nullptr),
- m_compositionStringLength(0),
- m_composing(FALSE),
- m_disabled(0),
- m_result(0),
- m_indexBase(1),
-
- m_compositionCharsDisplayed(0),
- m_candidateDownArrow(nullptr),
- m_candidateTextArea(nullptr),
- m_candidateUpArrow(nullptr),
- m_compositionCursorPos(0),
- m_pageSize(0),
- m_pageStart(0),
- m_selectedIndex(0),
- m_unicodeIME(FALSE)
-{
-}
-
-//============================================================================
-// IMEManager::~IMEManager
-//============================================================================
-
-IMEManager::~IMEManager()
-{
- if ( m_candidateWindow )
- {
- m_candidateWindow->winSetUserData( nullptr );
- m_candidateTextArea->winSetUserData( nullptr );
-
- TheWindowManager->winDestroy( m_candidateWindow );
- }
-
- if ( m_statusWindow )
- {
- TheWindowManager->winDestroy( m_statusWindow );
- }
-
- delete [] m_candidateString;
-
- detach();
- ImmAssociateContext( ApplicationHWnd, m_oldContext );
- ImmReleaseContext( ApplicationHWnd, m_oldContext );
- if ( m_context )
- {
- ImmDestroyContext( m_context );
- }
-}
-
-//============================================================================
-// IMEManager::init
-//============================================================================
-
-void IMEManager::init( void )
-{
- //HWND ImeWindow = ImmGetDefaultIMEWnd(ApplicationHWnd);
- // if(ImeWindow)
- // {
- // DestroyWindow(ImeWindow);
- // }
-
- m_context = ImmCreateContext();
- m_oldContext = ImmGetContext( ApplicationHWnd );
- m_disabled = 0;
- m_candidateWindow = TheWindowManager->winCreateFromScript( "IMECandidateWindow.wnd");
- m_candidateWindow->winSetStatus(WIN_STATUS_ABOVE);
-
- if ( m_candidateWindow )
- {
- m_candidateWindow->winHide( TRUE );
-
- // find text area window
- NameKeyType id = TheNameKeyGenerator->nameToKey( "IMECandidateWindow.wnd:TextArea" );
- m_candidateTextArea = TheWindowManager->winGetWindowFromId(m_candidateWindow, id);
-
- // find arrows
- id = TheNameKeyGenerator->nameToKey( "IMECandidateWindow.wnd:UpArrow" );
- m_candidateUpArrow = TheWindowManager->winGetWindowFromId(m_candidateWindow, id);
-
- id = TheNameKeyGenerator->nameToKey( "IMECandidateWindow.wnd:DownArrow" );
- m_candidateDownArrow = TheWindowManager->winGetWindowFromId(m_candidateWindow, id);
-
-
-
- if ( m_candidateTextArea == nullptr )
- {
- TheWindowManager->winDestroy( m_candidateWindow );
- m_candidateWindow = nullptr;
- }
- }
-
- m_statusWindow = TheWindowManager->winCreateFromScript( "IMEStatusWindow.wnd");
-
- if ( m_statusWindow )
- {
- m_statusWindow->winHide( TRUE );
- }
-
- // attach IMEManager to each window
- if ( m_candidateWindow != nullptr )
- {
- m_candidateWindow->winSetUserData( TheIMEManager );
- m_candidateTextArea->winSetUserData( TheIMEManager );
- }
-
- detach();
- enable();
-}
-
-//============================================================================
-// IMEManager::reset
-//============================================================================
-
-void IMEManager::reset( void )
-{
-
-}
-
-//============================================================================
-// IMEManager::update
-//============================================================================
-
-void IMEManager::update( void )
-{
-
-}
-
-//============================================================================
-// IMEManager::attach
-//============================================================================
-
-void IMEManager::attach( GameWindow *window )
-{
- if ( m_window != window )
- {
- detach();
- if ( m_disabled == 0 )
- {
- ImmAssociateContext( ApplicationHWnd, m_context );
- updateStatusWindow();
- //openStatusWindow();
- }
- m_window = window;
- }
-}
-
-//============================================================================
-// IMEManager::detach
-//============================================================================
-
-void IMEManager::detach( void )
-{
- //ImmAssociateContext( ApplicationHWnd, nullptr );
- m_window = nullptr;
-
-}
-
-//============================================================================
-// IMEManager::serviceIMEMessage
-//============================================================================
-
-Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, Int wParam, Int lParam )
-{
-
- DEBUG_ASSERTCRASH( windowsHandle == ApplicationHWnd, ("Unexpected window handle for IMEManager") );
- #ifdef DEBUG_IME
- printMessageInfo( message, wParam, lParam );
- #endif
-
- switch(message){
-
- // --------------------------------------------------------------------
- case WM_IME_CHAR:
- {
- WideChar wchar = convertCharToWide(wParam);
- #ifdef DEBUG_IME
- DEBUG_LOG(("IMM: WM_IME_CHAR - '%hc'0x%04x", wchar, wchar ));
- #endif
-
- if ( m_window && (wchar > 32 || wchar == VK_RETURN ))
- {
- TheWindowManager->winSendInputMsg( m_window, GWM_IME_CHAR, (wParam & 0xffff), lParam );
- m_result = 0;
- return TRUE;
- }
- return FALSE;
- }
-
- // --------------------------------------------------------------------
- case WM_CHAR:
- {
- WideChar wchar = (WideChar) (wParam & 0xffff);
-
- #ifdef DEBUG_IME
- DEBUG_LOG(("IMM: WM_CHAR - '%hc'0x%04x", wchar, wchar ));
- #endif
-
- if ( m_window && (wchar >= 32 || wchar == VK_RETURN) )
- {
- TheWindowManager->winSendInputMsg( m_window, GWM_IME_CHAR, (wParam & 0xffff), lParam );
- m_result = 0;
- return TRUE;
- }
- return FALSE;
- }
-
- // --------------------------------------------------------------------
- case WM_IME_SELECT:
- DEBUG_LOG(("IMM: WM_IME_SELECT"));
- return FALSE;
- case WM_IME_STARTCOMPOSITION:
- //The WM_IME_STARTCOMPOSITION message is sent immediately before an
- //IME generates a composition string as a result of a user's keystroke.
- //
- m_composing = TRUE;
- m_compositionCharsDisplayed = 0;
- updateCompositionString();
- m_result = 1;
- return TRUE;
- // --------------------------------------------------------------------
- case WM_IME_ENDCOMPOSITION:
- {
- //First remove the composition characters
- m_composing = FALSE;
- while (m_compositionCharsDisplayed > 0)
- { //if cursor has moved since start of composition, we need to move it back using backspace message
- TheWindowManager->winSendInputMsg( m_window, GWM_CHAR, KEY_BACKSPACE, KEY_STATE_DOWN);
- m_compositionCharsDisplayed--;
- }
- closeCandidateList(0);
- return TRUE;
- // I removed the rest of this message handler because we update
- // the strings real time inside WM_IME_COMPOSITION
- // instead of waiting for user to enter separator. -MW
-
- //IMEs send this message to the application when the IMEs' composition
- //windows have closed. Applications that display their own composition
- //characters should process this message. Other applications should
- //send the message to the application IME window or to DefWindowProc,
- //which will pass the message to the default IME window.
- //
-
- m_composing = FALSE; // reset this flag before calling GWM_IME_CHAR
-
- if ( m_window )
- {
- WideChar *ch = m_resultsString;
- getResultsString();
- while ( *ch )
- {
- TheWindowManager->winSendInputMsg( m_window, GWM_IME_CHAR, *ch, 0 );
- ch++;
- }
- }
- m_result = 1;
- return TRUE;
- }
- // --------------------------------------------------------------------
- case WM_IME_COMPOSITION:
- {
- //IMEs send this message to the application when they change composition
- //status in response to a keystroke. Applications that display their own
- //composition characters should process this message by calling
- //ImmGetCompositionString. Other applications should send the message to
- //the application IME window or to DefWindowProc, which will pass the
- //message to the default IME window.
- //
- //The WM_IME_COMPOSITION message is sent to an application when the IME
- //changes composition status as a result of a keystroke. An application
- //should process this message if it displays composition characters itself.
- //Otherwise, it should send the message to the IME window. This message
- //has no return value. wParam = DBCS character. lParam = change indicator.
- //
-
- if (lParam & GCS_RESULTSTR) //added to show instant updates as soon as a character is translated. -MW
- {
- if ( m_window )
- {
- m_composing = FALSE; // reset this flag before calling GWM_IME_CHAR
-
- while (m_compositionCharsDisplayed > 0)
- { //if cursor has moved since start of composition, we need to move it back using backspace message
- TheWindowManager->winSendInputMsg( m_window, GWM_CHAR, KEY_BACKSPACE, KEY_STATE_DOWN);
- m_compositionCharsDisplayed--;
- }
-
- WideChar *ch = m_resultsString;
- getResultsString();
- while ( *ch )
- {
- TheWindowManager->winSendInputMsg( m_window, GWM_IME_CHAR, *ch, 0 );
- ch++;
- }
- }
- m_compositionCharsDisplayed = 0;
- }
- else
- if (lParam & CS_INSERTCHAR && lParam & CS_NOMOVECARET)
- { //we are supposed to display the composition character without moving the cursor. (it's a candidate).
- if (m_window)
- {
- m_composing = FALSE; // reset this flag before calling GWM_IME_CHAR
-
- while (m_compositionCharsDisplayed > 0)
- { //if cursor has moved since start of composition, we need to move it back using backspace message
- TheWindowManager->winSendInputMsg( m_window, GWM_CHAR, KEY_BACKSPACE, KEY_STATE_DOWN);
- m_compositionCharsDisplayed--;
- }
-
- WideChar *ch = m_compositionString;
- updateCompositionString();
- while (*ch)
- {
- TheWindowManager->winSendInputMsg(m_window, GWM_IME_CHAR, *ch, 0 );
- ch++;
- m_compositionCharsDisplayed++;
- }
- m_composing = TRUE; // reset this flag before calling GWM_IME_CHAR
- }
- }
- else
- if (lParam & GCS_COMPSTR)
- { //we are supposed to display the composition character without moving the cursor. (it's a candidate).
- if (m_window)
- {
- m_composing = FALSE; // reset this flag before calling GWM_IME_CHAR
-
- while (m_compositionCharsDisplayed > 0)
- { //if cursor has moved since start of composition, we need to move it back using backspace message
- TheWindowManager->winSendInputMsg( m_window, GWM_CHAR, KEY_BACKSPACE, KEY_STATE_DOWN);
- m_compositionCharsDisplayed--;
- }
-
- WideChar *ch = m_compositionString;
- updateCompositionString();
- while (*ch)
- {
- TheWindowManager->winSendInputMsg(m_window, GWM_IME_CHAR, *ch, 0 );
- ch++;
- m_compositionCharsDisplayed++;
- }
- m_composing = TRUE; // reset this flag before calling GWM_IME_CHAR
- }
- }
-
- m_result = 1;
- return TRUE;
- }
- // --------------------------------------------------------------------
- case WM_IME_SETCONTEXT:
- {
- //The system sends this message to an application when one of the
- //application's windows is activated. Applications should respond by
- //calling ImmGetContext.
- //
- updateProperties();
- //ignore for now
- m_result = 0;
- return FALSE;
- }
-
-
- // --------------------------------------------------------------------
- case WM_IME_NOTIFY:
- {
- //IMEs generate this message to notify the application or the IME window
- //that the IME status has changed. The wParam value is a submessage that
- //specifies the nature of the change.
- //
- switch(wParam)
- {
- case IMN_OPENCANDIDATE:
- {
- //This message is sent to the application when an IME is about to
- //open the candidate window. An application should process this
- //message if it displays candidates. The application can retrieve
- //a list of candidates to display by using theImmGetCandidateList
- //function. The application receives this notification message through
- //the WM_IME_NOTIFY message.
- //
-
- // open candidate window
- openCandidateList( lParam );
- m_result = 1;
- return TRUE;
- }
- case IMN_CLOSECANDIDATE:
- {
- //This message is sent to the application when an IME is about to
- //close the candidate window. An application should process this
- //message if it displays candidates. The application receives this
- //notification message through the WM_IME_NOTIFY message.
- //
- closeCandidateList( lParam );
- m_result = 1;
- return TRUE;
- }
-
- case IMN_CHANGECANDIDATE:
- {
- //This message is sent to the application when an IME is about to
- //change the content of the candidate window. An application should
- //process this notification message if it displays candidates itself.
- //The application receives this notification message through the
- //WM_IME_NOTIFY message.
- //
- updateCandidateList( lParam );
- m_result = 1;
- return TRUE;
- }
- case IMN_GUIDELINE: //This message is sent when an IME is about to show an error message or other data.
- {
- // display error message
- m_result = 1;
- return FALSE;
- }
-
- case IMN_SETCONVERSIONMODE: //This message is sent when the conversion mode of the input context is updated.
- {
- #ifdef DEBUG_IME
- printConversionStatus();
- #endif
- return FALSE;
- }
-
- case IMN_SETSENTENCEMODE: //This message is sent when the sentence mode of the input context is updated.
- {
- #ifdef DEBUG_IME
- printSentenceStatus();
- #endif
- return FALSE;
- }
-/*
- // pass the reset on through to the installed IME
- case IMN_SETCANDIDATEPOS: //This message is sent when the IME is about to move the candidate window.
- case IMN_SETSTATUSWINDOWPOS: //This message is sent when the status window position in the input context is updated.
- return FALSE;
- case IMN_OPENSTATUSWINDOW: //This message is sent when an IME is about to create the status window.
- DEBUG_LOG(("Open Status Window"));
- return FALSE;
- case IMN_CLOSESTATUSWINDOW: //This message is sent to the application when an input method editor (IME) is about to close the status window.
- DEBUG_LOG(("Close Status Window"));
- return FALSE;
- case IMN_SETOPENSTATUS: //This message is sent when the open status of the input context is updated.
- case IMN_SETCOMPOSITIONFONT: //This message is sent when the font of the input context is updated.
- case IMN_SETCOMPOSITIONWINDOW: //This message is sent when the style or position of the composition window is updated.
- case IMN_PRIVATE: //This message is for your own use, it seems.
-*/ default:
- m_result = 1;
- return TRUE;
- }
- break;
- }
-
- // --------------------------------------------------------------------
- case WM_IME_COMPOSITIONFULL:
- {
- //IMEs send this message to the application when they are unable to
- //extend the composition window to accommodate any more characters.
- //Applications should tell IMEs how to display the composition window
- //using the IMC_SETCOMPOSITIONWINDOW message.
- //
- //I'm not sure what to do here.
- m_result = 1;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-//============================================================================
-// IMEManager::result
-//============================================================================
-
-Int IMEManager::result( void )
-{
- return m_result;
-}
-
-//============================================================================
-// IMEManager::enable
-//============================================================================
-
-void IMEManager::enable( void )
-{
- if ( --m_disabled <= 0 )
- {
- m_disabled = 0;
- ImmAssociateContext( ApplicationHWnd, m_context );
- }
-}
-
-//============================================================================
-// IMEManager::disable
-//============================================================================
-
-void IMEManager::disable( void )
-{
- m_disabled++;
- ImmAssociateContext( ApplicationHWnd, nullptr );
-}
-
-//============================================================================
-// IMEManager::isEnabled
-//============================================================================
-
-Bool IMEManager::isEnabled( void )
-{
- return m_context != nullptr && m_disabled == 0;
-}
-
-//============================================================================
-// IMEManager::isAttached
-//============================================================================
-
-Bool IMEManager::isAttachedTo( GameWindow *window )
-{
- return m_window == window;
-}
-
-//============================================================================
-// IMEManager::getWindow
-//============================================================================
-
-GameWindow* IMEManager::getWindow( void )
-{
- return m_window;
-}
-
-
-//============================================================================
-// IMEManager::convertChartoWide
-//============================================================================
-
-WideChar IMEManager::convertCharToWide( WPARAM wParam )
-{
- char dcbsString[3];
-
- if ( wParam&0xff00 )
- {
- dcbsString[0] = (wParam>>8)&0xff;
- dcbsString[1] = wParam&0xff;
- dcbsString[2] = 0;
- }
- else
- {
- dcbsString[0] = wParam&0xff;
- dcbsString[1] = 0;
- }
-
-
- WideChar uniString[2];
-
- if ( MultiByteToWideChar( CP_ACP, 0, dcbsString, strlen( dcbsString ), uniString, 1 ) == 1 )
- {
- return uniString[0];
- }
-
- return 0;
-}
-
-//============================================================================
-// IMEManager::isComposing
-//============================================================================
-
-Bool IMEManager::isComposing( void )
-{
- return m_composing;
-}
-
-
-void IMEManager::getCompositionString ( UnicodeString &string )
-{
- string.set(m_compositionString);
-}
-
-//============================================================================
-// IMEManager::getCompositionCursorPosition
-//============================================================================
-
-Int IMEManager::getCompositionCursorPosition( void )
-{
- return 0;//m_compositionCursorPos;
-}
-
-//============================================================================
-// IMEManager::updateCompositionString
-//============================================================================
-
-void IMEManager::updateCompositionString( void )
-{
- char tempBuf[ (MAX_COMPSTRINGLEN+1)*2];
-
- m_compositionCursorPos = 0;
- m_compositionString[0] = 0;
- m_compositionStringLength = 0;
-
- if ( m_context )
- {
- // try reading unicode directly
- LONG result = ImmGetCompositionStringW( m_context, GCS_COMPSTR, m_compositionString, MAX_COMPSTRINGLEN );
-
- if ( result >= 0 )
- {
- m_compositionStringLength = result/2;
- m_compositionCursorPos = (ImmGetCompositionStringW( m_context, GCS_CURSORPOS, nullptr, 0) & 0xffff );
- }
- else
- {
-
- // read MBCS instead
- result = ImmGetCompositionStringA( m_context, GCS_COMPSTR, tempBuf, MAX_COMPSTRINGLEN*2);
-
- if ( result > 0 )
- {
- tempBuf[ result ] = '\0';
-
- int convRes = MultiByteToWideChar( CP_ACP, 0, tempBuf, -1, m_compositionString, MAX_COMPSTRINGLEN );
- GameArrayEnd(m_compositionString);
-
- if ( convRes < 0)
- {
- convRes = 0;
- }
- else
- {
- m_compositionCursorPos = (ImmGetCompositionString( m_context, GCS_CURSORPOS, nullptr, 0) & 0xffff );
- convRes = wcslen( m_compositionString );
- }
-
- // m_compositionCursorPos is in DBCS characters, need to convert it to Wide characters
-
- //msg_assert ( (int)strlen(tempBuf) >= convRes ,("bad DBCS string: DBCS = %d chars, Wide = %d chars", strlen(tempBuf), convRes));
- m_compositionCursorPos = _mbsnccnt ( (unsigned char *) tempBuf, m_compositionCursorPos );
-
- m_compositionString[convRes] = 0;
- m_compositionStringLength = convRes;
- if ( m_compositionCursorPos > convRes )
- {
- m_compositionCursorPos = convRes;
- }
- else if ( m_compositionCursorPos < 0 )
- {
- m_compositionCursorPos = 0;
- }
- }
- }
- }
-
- DEBUG_ASSERTCRASH( m_compositionStringLength < MAX_COMPSTRINGLEN, ("composition string too large"));
- m_compositionString[m_compositionStringLength] = 0;
- GameArrayEnd(m_compositionString);
-}
-
-//============================================================================
-// IMEManager::getResultsString
-//============================================================================
-
-void IMEManager::getResultsString ( void )
-{
- Int stringLen = 0;
- m_resultsString[0] = 0;
-
- if ( m_context )
- {
- // try reading unicode directly
- LONG result = ImmGetCompositionStringW( m_context, GCS_RESULTSTR, m_resultsString, MAX_COMPSTRINGLEN );
-
- if ( result >= 0 )
- {
- stringLen = result/2;
- }
- else
- {
- char tempBuf[ (MAX_COMPSTRINGLEN+1)*2];
-
- // read MBCS instead
- result = ImmGetCompositionStringA( m_context, GCS_RESULTSTR, tempBuf, MAX_COMPSTRINGLEN*2);
-
- if ( result > 0 )
- {
- tempBuf[ result ] = '\0';
-
- int convRes = MultiByteToWideChar( CP_ACP, 0, tempBuf, strlen(tempBuf), m_resultsString, MAX_COMPSTRINGLEN );
-
- if ( convRes < 0)
- {
- convRes = 0;
- }
- stringLen = convRes;
- }
- }
- }
-
- DEBUG_ASSERTCRASH( stringLen < MAX_COMPSTRINGLEN, ("results string too large"));
- m_resultsString[stringLen] = 0;
- GameArrayEnd(m_resultsString);
-}
-
-//============================================================================
-// IMEManager::convertToUnicode
-//============================================================================
-
-void IMEManager::convertToUnicode ( Char *mbcs, UnicodeString &unicode )
-{
- int size = MultiByteToWideChar( CP_ACP, 0, mbcs, strlen(mbcs), nullptr, 0 );
-
- unicode.clear();
-
- if ( size <= 0 )
- {
- return;
- }
-
- WideChar *buffer = NEW WideChar[ size + 1 ];
-
- if ( buffer )
- {
- size = MultiByteToWideChar( CP_ACP, 0, mbcs, strlen(mbcs), buffer, size );
-
- if ( size <= 0 )
- {
- unicode.clear();
- }
- else
- {
- buffer[size] = 0;
- unicode = buffer;
- }
-
- delete [] buffer;
- }
-}
-
-//============================================================================
-// IMEManager::openCandidateList
-//============================================================================
-
-void IMEManager::openCandidateList( Int candidateFlags )
-{
- if ( m_candidateWindow == nullptr )
- {
- return;
- }
- // first get latest candidate list info
- updateCandidateList( candidateFlags );
- resizeCandidateWindow( m_pageSize );
-
- m_candidateWindow->winHide( FALSE );
- m_candidateWindow->winBringToTop();
- TheWindowManager->winSetModal( m_candidateWindow );
-
- Int wx, wy, wwidth, wheight, wcursorx, wcursory;
- Int cx, cy, cwidth, cheight;
- Int textHeight = 20;
-
-
- if ( m_window )
- {
- m_window->winGetScreenPosition( &wx, &wy);
- m_window->winGetSize( &wwidth, &wheight );
- m_window->winGetCursorPosition( &wcursorx, &wcursory );
- GameFont *font = m_window->winGetFont();
- if ( font )
- {
- textHeight = font->height;
- }
- }
- else
- {
- wx = wy = 0;
- wwidth = 10;
- wheight = 10;
- wcursorx = 0;
- wcursory = 0;
- }
-
- m_candidateWindow->winGetSize( &cwidth, &cheight );
-
-// // try putting the candidate list above the text
-// cx = wx + wcursorx;
-// cy = wy - cheight;
-//
-// if ( cx + cwidth > (Int) TheDisplay->getWidth())
-// {
-// cx = cx - cwidth;
-// }
-// if( cx < 0 )
-// cx = 0;
-// if ( cy < 0 )
-// {
-// // place list below text
-// cy = wy + textHeight + textHeight/2;
-// }
-// if( cy + cheight > TheDisplay->getHeight())
-// cy = 0;
- cx = TheDisplay->getWidth() - cwidth;
- cy = 0;
- updateProperties();
- m_candidateWindow->winSetPosition( cx, cy );
-
-}
-
-//============================================================================
-// IMEManager::closeCandidateList
-//============================================================================
-
-void IMEManager::closeCandidateList( Int candidateFlags )
-{
- if ( m_candidateWindow != nullptr )
- {
- m_candidateWindow->winHide( TRUE );
- TheWindowManager->winUnsetModal( m_candidateWindow );
- }
-
- delete [] m_candidateString;
- m_candidateString = nullptr;
-
- m_candidateCount = 0;
-
-}
-
-//============================================================================
-// IMEManager::updateCandidateList
-//============================================================================
-
-void IMEManager::updateCandidateList( Int candidateFlags )
-{
-
- delete [] m_candidateString;
- m_candidateString = nullptr;
-
- m_pageSize = 10;
- m_candidateCount = 0;
- m_pageStart = 0;
- m_selectedIndex = 0;
-
- if ( m_candidateWindow == nullptr ||
- m_context == nullptr ||
- candidateFlags == 0)
- {
- return;
- }
-
- for( Int i = 0, candidate = 1; i < 32; i++, candidate = candidate << 1 )
- {
- if ( candidateFlags & candidate )
- {
- Bool unicode = TRUE;
- unsigned long listCount = 0;
-
- Int size = ImmGetCandidateListCountW( m_context, &listCount );
-
- if ( size <= 0 )
- {
- unicode = FALSE;
- size = ImmGetCandidateListCountA( m_context, &listCount );
- if ( size <= 0 )
- {
- return;
- }
- }
-
- // create a temporary buffer for reading the candidate list
- Char *buffer = NEW Char[size];
-
- if ( buffer == nullptr )
- {
- return;
- }
-
- memset( buffer, 0, size );
-
- CANDIDATELIST *clist = (CANDIDATELIST*) buffer;
-
- Bool ok = TRUE ;
- Int bytesCopied;
-
- if ( unicode )
- {
- bytesCopied = ImmGetCandidateListW( m_context, i, (CANDIDATELIST*) clist, size );
- }
- else
- {
- bytesCopied = ImmGetCandidateListA( m_context, i, (CANDIDATELIST*) clist, size );
- }
-
- if ( bytesCopied == 0 || bytesCopied > size )
- {
- DEBUG_ASSERTCRASH(bytesCopied < size,("IME candidate buffer overrun"));
- ok = FALSE;
- }
-
- if ( ok && clist->dwStyle != IME_CAND_UNKNOWN && clist->dwStyle != IME_CAND_CODE )
- {
- //Apparently there is an "IME98 bug" (IME bug under Windows 98?) that
- //causes you to have to execute the following code.
- if(( clist->dwPageStart > clist->dwSelection) ||
- (clist->dwSelection >= clist->dwPageStart + clist->dwPageSize))
- {
- clist->dwPageStart = (clist->dwSelection / clist->dwPageSize) * clist->dwPageSize;
- }
-
- m_pageSize = clist->dwPageSize;
- m_candidateCount = clist->dwCount;
- m_pageStart = clist->dwPageStart;
- m_selectedIndex = clist->dwSelection;
-
- #ifdef DEBUG_IME
- DEBUG_LOG(("IME: Candidate Update: Candidates = %d, pageSize = %d pageStart = %d, selected = %d", m_candidateCount, m_pageStart, m_pageSize, m_selectedIndex ));
- #endif
-
- if ( m_candidateUpArrow )
- {
- m_candidateUpArrow->winHide( m_pageStart == 0 );
- }
-
- if ( m_candidateDownArrow )
- {
- m_candidateDownArrow->winHide( m_candidateCount - m_pageStart <= m_pageSize );
- }
-
- if ( m_candidateCount > 0 )
- {
- m_candidateString = NEW UnicodeString[m_candidateCount];
- if ( m_candidateString )
- {
- Int i;
-
- for( i=0; i < m_candidateCount; i++ )
- {
- Char *string = (Char*) ((UnsignedInt) clist + (UnsignedInt) clist->dwOffset[i]);
- if ( unicode )
- {
- m_candidateString[i].set( (WideChar *) string);
- }
- else
- {
- convertToUnicode( string, m_candidateString[i] );
- }
- }
- }
- }
-
- }
- delete [] buffer;
- return;
- }
- }
-}
-
-//============================================================================
-// IMEManager::updateProperties
-//============================================================================
-
-void IMEManager::updateProperties( void )
-{
- HKL kb = GetKeyboardLayout( 0 );
- Int prop = ImmGetProperty( kb, IGP_PROPERTY );
- m_indexBase = prop & IME_PROP_CANDLIST_START_FROM_1 ? 1 : 0 ;
- m_unicodeIME = (prop & IME_PROP_UNICODE) != 0 ;
-}
-
-//============================================================================
-// IMEManager::getIndexBase
-//============================================================================
-
-Int IMEManager::getIndexBase( void )
-{
- return m_indexBase;
-}
-
-//============================================================================
-// IMEManager::resizeCandidateWindow
-//============================================================================
-
-void IMEManager::resizeCandidateWindow( Int pageSize )
-{
- if ( m_candidateWindow == nullptr )
- {
- return;
- }
-
- GameFont *font = m_candidateTextArea->winGetFont();
-
- if ( font == nullptr )
- {
- return;
- }
-
- Int newh = pageSize * (font->height + IMECandidateWindowLineSpacing);
- Int w, h;
- m_candidateTextArea->winGetSize( &w, &h );
-
- Int dif = newh - h;
-
- m_candidateTextArea->winSetSize( w, newh );
-
- m_candidateWindow->winGetSize( &w, &h );
- h += dif;
- m_candidateWindow->winSetSize( w, h );
-
- if ( m_candidateDownArrow )
- {
- Int x, y;
- m_candidateDownArrow->winGetPosition( &x, &y );
- y += dif;
- m_candidateDownArrow->winSetPosition( x, y );
- }
-
-}
-
-//============================================================================
-// IMEManager::getCandidateCount
-//============================================================================
-
-Int IMEManager::getCandidateCount()
-{
- return m_candidateCount;
-}
-
-//============================================================================
-// IMEManager::getCandidate
-//============================================================================
-
-const UnicodeString* IMEManager::getCandidate( Int index )
-{
- if ( m_candidateString != nullptr && index >=0 && index < m_candidateCount )
- {
- return &m_candidateString[index];
- }
-
- return &UnicodeString::TheEmptyString;
-}
-
-//============================================================================
-// IMEManager::getSelectedCandidateIndex
-//============================================================================
-
-Int IMEManager::getSelectedCandidateIndex()
-{
- return m_selectedIndex;
-}
-
-//============================================================================
-// IMEManager::getCandidatePageSize
-//============================================================================
-
-Int IMEManager::getCandidatePageSize()
-{
- return m_pageSize;
-}
-
-//============================================================================
-// IMEManager::getStartCandidateIndex
-//============================================================================
-
-Int IMEManager::getCandidatePageStart()
-{
- return m_pageStart;
-}
-
-//============================================================================
-// IMEManager::openStatusWindow
-//============================================================================
-
-void IMEManager::openStatusWindow( void )
-{
- if ( m_statusWindow == nullptr )
- {
- return;
- }
- m_statusWindow->winHide( FALSE );
-}
-
-//============================================================================
-// IMEManager::closeStatusWindow
-//============================================================================
-
-void IMEManager::closeStatusWindow( void )
-{
- if ( m_statusWindow == nullptr )
- {
- return;
- }
-
- m_statusWindow->winHide( TRUE );
-}
-
-//============================================================================
-// IMEManager::updateStatusWindow
-//============================================================================
-
-void IMEManager::updateStatusWindow( void )
-{
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
deleted file mode 100644
index b59692c25ae..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
+++ /dev/null
@@ -1,1391 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: LoadScreen.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Mar 2002
-//
-// Filename: LoadScreen.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: Contains each of the different derived LoadClasses for each of the
-// Different kind of games we can have.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Common/NameKeyGenerator.h"
-#include "Common/MultiplayerSettings.h"
-#include "Common/GameEngine.h"
-#include "Common/GameState.h"
-#include "Common/PlayerTemplate.h"
-#include "Common/PlayerList.h"
-#include "Common/Player.h"
-#include "Common/GameLOD.h"
-#include "Common/GameAudio.h"
-#include "Common/AudioEventRTS.h"
-#include "Common/AudioHandleSpecialValues.h"
-#include "Common/AudioAffect.h"
-
-#include "GameClient/LoadScreen.h"
-#include "GameClient/Keyboard.h"
-#include "GameClient/Shell.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetProgressBar.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GameText.h"
-#include "GameClient/Display.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/VideoPlayer.h"
-#include "GameClient/MapUtil.h"
-#include "GameLogic/FPUControl.h"
-#include "GameLogic/GameLogic.h"
-#include "GameNetwork/NetworkInterface.h"
-#include "GameNetwork/GameSpy/PeerDefs.h"
-#include "GameNetwork/GameSpy/PersistentStorageThread.h"
-#include "GameClient/CampaignManager.h"
-#include "GameNetwork/RankPointValue.h"
-#include "GameClient/GameWindowTransitions.h"
-
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-void positionStartSpots( GameInfo *myGame, GameWindow *buttonMapStartPositions[], GameWindow *mapWindow);
-void updateMapStartSpots( GameInfo *myGame, GameWindow *buttonMapStartPositions[], Bool onLoadScreen = FALSE );
-void positionAdditionalImages( MapMetaData *mmd, GameWindow *mapWindow, Bool force);
-
-enum{
-FRAME_FUDGE_ADD = 30,
-};
-//-----------------------------------------------------------------------------
-// LoadScreen Class
-//-----------------------------------------------------------------------------
-
-LoadScreen::LoadScreen( void )
-{
- m_loadScreen = nullptr;
-}
-
-LoadScreen::~LoadScreen( void )
-{
- //if(m_loadScreen)
- // delete (m_loadScreen);
- if(m_loadScreen)
- TheWindowManager->winDestroy( m_loadScreen );
- m_loadScreen = nullptr;
-}
-
-void LoadScreen::update( Int percent )
-{
- TheGameEngine->serviceWindowsOS();
- TheWindowManager->update();
- TheDisplay->update();
- // redraw all views, update the GUI
- TheDisplay->draw();
-
- setFPMode();
-}
-
-
-// SinglePlayerLoadScreen Class ///////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-SinglePlayerLoadScreen::SinglePlayerLoadScreen( void )
-{
- m_currentObjectiveLine = 0;
- m_currentObjectiveLineCharacter = 0;
- m_finishedObjectiveText = FALSE;
- m_currentObjectiveWidthOffset = 0;
- m_progressBar = nullptr;
- m_percent = nullptr;
- m_videoStream = nullptr;
- m_videoBuffer = nullptr;
- m_objectiveWin = nullptr;
- for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i)
- m_objectiveLines[i] = nullptr;
-
-}
-
-SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void )
-{
- m_progressBar = nullptr;
- m_percent = nullptr;
- m_objectiveWin = nullptr;
- for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i)
- m_objectiveLines[i] = nullptr;
-
- delete m_videoBuffer;
- m_videoBuffer = nullptr;
-
- if ( m_videoStream )
- {
- m_videoStream->close();
- m_videoStream = nullptr;
- }
-
- TheAudio->removeAudioEvent( m_ambientLoopHandle );
- m_ambientLoopHandle = 0;
-
-}
-
-void SinglePlayerLoadScreen::moveWindows( Int frame )
-{
- enum{
- STATE_BEGIN = 250,
- STATE_SHOW_LOCATION = 251,
- STATE_BEGIN_BRIEFING = 255,
-// STATE_BEGIN_ANIMATING_TEXT = 250,
- STATE_SHOW_CAMEO_1 = 434,
- STATE_BEGIN_ANIMATING_TEXT = 356,
- STATE_HIDE_CAMEO_1 = 459,
- STATE_SHOW_CAMEO_2 = 464,
- STATE_HIDE_CAMEO_2 = 492,
- STATE_SHOW_CAMEO_3 = 497,
- STATE_HIDE_CAMEO_3 = 524,
-// STATE_END_ANIM_HEAD = 450,
- STATE_END_ANIMATING_TEXT = 730,
- STATE_END = 730
- };
- if(frame < STATE_BEGIN || frame > STATE_END)
- return;
-
- if( frame == STATE_BEGIN_BRIEFING)
- {
- // add sound support here
- TheAudio->friend_forcePlayAudioEventRTS(&TheCampaignManager->getCurrentMission()->m_briefingVoice);
- }
-
- if( frame == STATE_BEGIN_ANIMATING_TEXT)
- {
- m_objectiveWin->winHide(FALSE);
- // animate the text and stuff
- }
-
- if( frame > STATE_BEGIN_ANIMATING_TEXT && frame <= STATE_END_ANIMATING_TEXT && !m_finishedObjectiveText)
- {
- if(m_currentObjectiveLineCharacter >= m_unicodeObjectiveLines[m_currentObjectiveLine].getLength() )
- {
- m_currentObjectiveLine++;
- m_currentObjectiveLineCharacter =0;
- }
- if(m_currentObjectiveLine >= MAX_OBJECTIVE_LINES || m_unicodeObjectiveLines[m_currentObjectiveLine].isEmpty())
- {
- m_finishedObjectiveText = TRUE;
- }
- else
- {
- WideChar wChar = m_unicodeObjectiveLines[m_currentObjectiveLine].getCharAt(m_currentObjectiveLineCharacter);
- UnicodeString text = GadgetStaticTextGetText(m_objectiveLines[m_currentObjectiveLine]);
- text.concat(wChar);
- GadgetStaticTextSetText(m_objectiveLines[m_currentObjectiveLine], text);
-
- }
- m_currentObjectiveLineCharacter++;
- }
- switch (frame) {
-
- case STATE_SHOW_LOCATION:
- m_location->winHide(FALSE);
- break;
- case STATE_SHOW_CAMEO_1:
- m_unitDesc[0]->winHide(FALSE);
- break;
- case STATE_HIDE_CAMEO_1:
- m_unitDesc[0]->winHide(TRUE);
- break;
- case STATE_SHOW_CAMEO_2:
- m_unitDesc[1]->winHide(FALSE);
- break;
- case STATE_HIDE_CAMEO_2:
- m_unitDesc[1]->winHide(TRUE);
- break;
- case STATE_SHOW_CAMEO_3:
- m_unitDesc[2]->winHide(FALSE);
- break;
- case STATE_HIDE_CAMEO_3:
- m_unitDesc[2]->winHide(TRUE);
- break;
- }
-
-}
-/*
- static Bool on = FALSE;
- static ICoord2D startPos, endPos;
- enum{
- STATE_BEGIN = 275,
- STATE_BEGIN_ANIM = 290,
- STATE_ANIM_CAMEO1 = 300,
- STATE_ANIM_CAMEO1_TRANSITION_CAMEO2 = 350,
- STATE_ANIM_CAMEO2 = 400,
- STATE_ANIM_CAMEO2_TRANSITION_CAMEO3 = 450,
- STATE_ANIM_CAMEO3 = 500,
- STATED_END_ANIM = 550,
- STATE_END = 800
- };
- if(frame < STATE_BEGIN)
- return;
- else if(frame == STATE_BEGIN )
- {
- m_cameoWindow1->winHide(FALSE);
- m_cameoWindow2->winHide(FALSE);
- m_cameoWindow3->winHide(FALSE);
- m_cameoFrame->winHide(FALSE);
- }
- else if( frame == STATE_ANIM_CAMEO1)
- {
- m_cameoWindow1->winEnable(TRUE);
- GadgetStaticTextSetText(m_cameoText, TheGameText->fetch(TheCampaignManager->getCurrentMission()->m_cameoImageName[0]));
- //save of positions
- }
- else if( frame == STATE_ANIM_CAMEO1_TRANSITION_CAMEO2)
- {
- m_cameoWindow1->winEnable(FALSE);
- GadgetStaticTextSetText(m_cameoText, UnicodeString::TheEmptyString);
- ICoord2D tempPos;
- Int xOffset;
- m_cameoFrame->winGetPosition(&startPos.x, &startPos.y);
- m_cameoWindow1->winGetPosition(&tempPos.x, &tempPos.y);
- xOffset = tempPos.x - startPos.x;
- m_cameoWindow2->winGetPosition(&endPos.x, &endPos.y);
- endPos.x = endPos.x - xOffset;
- endPos.y = startPos.y;
-
- }
- else if( frame > STATE_ANIM_CAMEO1_TRANSITION_CAMEO2 && frame < STATE_ANIM_CAMEO2)
- {
-
- //extrapolate between start and end pos
- Real percent = INT_TO_REAL((frame - STATE_ANIM_CAMEO1_TRANSITION_CAMEO2)) / (STATE_ANIM_CAMEO2 - STATE_ANIM_CAMEO1_TRANSITION_CAMEO2);
- m_cameoFrame->winSetPosition(startPos.x + (endPos.x - startPos.x) * percent, endPos.y);
- }
- else if( frame == STATE_ANIM_CAMEO2 )
- {
- m_cameoWindow2->winEnable(TRUE);
- m_cameoFrame->winSetPosition(endPos.x, endPos.y);
- GadgetStaticTextSetText(m_cameoText, TheGameText->fetch(TheCampaignManager->getCurrentMission()->m_cameoImageName[1]));
- }
- else if( frame == STATE_ANIM_CAMEO2_TRANSITION_CAMEO3)
- {
- m_cameoWindow2->winEnable(FALSE);
- GadgetStaticTextSetText(m_cameoText, UnicodeString::TheEmptyString);
- ICoord2D tempPos;
- Int xOffset;
- m_cameoFrame->winGetPosition(&startPos.x, &startPos.y);
- m_cameoWindow2->winGetPosition(&tempPos.x, &tempPos.y);
- xOffset = tempPos.x - startPos.x;
- m_cameoWindow3->winGetPosition(&endPos.x, &endPos.y);
- endPos.x = endPos.x - xOffset;
- endPos.y = startPos.y;
-
- }
- else if( frame > STATE_ANIM_CAMEO2_TRANSITION_CAMEO3 && frame < STATE_ANIM_CAMEO3)
- {
-
- //extrapolate between start and end pos
- Real percent = INT_TO_REAL((frame - STATE_ANIM_CAMEO2_TRANSITION_CAMEO3)) / (STATE_ANIM_CAMEO3 - STATE_ANIM_CAMEO2_TRANSITION_CAMEO3);
- m_cameoFrame->winSetPosition(startPos.x + (endPos.x - startPos.x) * percent, endPos.y);
- }
- else if( frame == STATE_ANIM_CAMEO3 )
- {
- m_cameoFrame->winSetPosition(endPos.x, endPos.y);
- m_cameoWindow3->winEnable(TRUE);
- GadgetStaticTextSetText(m_cameoText, TheGameText->fetch(TheCampaignManager->getCurrentMission()->m_cameoImageName[2]));
- }
- else if( frame ==STATED_END_ANIM)
- {
- m_cameoWindow3->winEnable(FALSE);
- GadgetStaticTextSetText(m_cameoText, UnicodeString::TheEmptyString);
- m_cameoFrame->winHide(TRUE);
-
- }
-}*/
-
-void SinglePlayerLoadScreen::init( GameInfo *game )
-{
- //No music in SinglePlayerLoadScreen
-
- // create the layout of the load screen
- m_loadScreen = TheWindowManager->winCreateFromScript( "Menus/SinglePlayerLoadScreen.wnd" );
- DEBUG_ASSERTCRASH(m_loadScreen, ("Can't initialize the single player loadscreen"));
- m_loadScreen->winHide(FALSE);
- m_loadScreen->winBringToTop();
-// Mission *mission = TheCampaignManager->getCurrentMission();
- // Store the pointer to the progress bar on the loadscreen
- m_progressBar = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:ProgressLoad" ));
- DEBUG_ASSERTCRASH(m_progressBar, ("Can't initialize the progressbar for the single player loadscreen"));
- GadgetProgressBarSetProgress(m_progressBar, 0 );
-
- m_percent = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:Percent" ));
- DEBUG_ASSERTCRASH(m_percent, ("Can't initialize the m_percent for the single player loadscreen"));
- GadgetStaticTextSetText(m_percent,L"0%");
- m_percent->winHide(TRUE);
-
- m_objectiveWin = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:ObjectivesWin" ));
- DEBUG_ASSERTCRASH(m_objectiveWin, ("Can't initialize the m_objectiveWin for the single player loadscreen"));
- m_objectiveWin->winHide(TRUE);
-
-
- Mission *mission = TheCampaignManager->getCurrentMission();
- AsciiString lineName;
- Int i = 0;
- for(; i < MAX_OBJECTIVE_LINES; ++i)
- {
- lineName.format("SinglePlayerLoadScreen.wnd:StaticTextLine%d",i);
- m_objectiveLines[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( lineName ));
- DEBUG_ASSERTCRASH(m_objectiveLines[i], ("Can't initialize the m_objectiveLines[%d] for the single player loadscreen", i));
- GadgetStaticTextSetText(m_objectiveLines[i],UnicodeString::TheEmptyString);
-
- // translate the objective lines
- if(mission->m_missionObjectivesLabel[i].isNotEmpty())
- m_unicodeObjectiveLines[i] = TheGameText->fetch(mission->m_missionObjectivesLabel[i]);
- }
-
- for(i = 0; i < MAX_DISPLAYED_UNITS; ++i)
- {
- lineName.format("SinglePlayerLoadScreen.wnd:StaticTextCameoText%d",i);
- m_unitDesc[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( lineName ));
- DEBUG_ASSERTCRASH(m_unitDesc[i], ("Can't initialize the m_objectiveLines[%d] for the single player loadscreen", i));
- GadgetStaticTextSetText(m_unitDesc[i],TheGameText->fetch(mission->m_unitNames[i]));
- m_unitDesc[i]->winHide(TRUE);
- }
- m_location = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:StaticTextCameoText3" ));
- DEBUG_ASSERTCRASH(m_location, ("Can't initialize the m_objectiveWin for the single player loadscreen"));
- m_location->winHide(TRUE);
- GadgetStaticTextSetText(m_location, TheGameText->fetch(mission->m_locationNameLabel));
-
-
-
- m_currentObjectiveLine = 0;
- m_currentObjectiveWidthOffset = 0;
- m_currentObjectiveLineCharacter = 0;
- m_finishedObjectiveText = FALSE;
-/*
- m_cameoWindow1 = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:WindowCameo1" ));
- DEBUG_ASSERTCRASH(m_cameoWindow1, ("Can't initialize the m_cameoWindow1 for the single player loadscreen"));
- m_cameoWindow1->winHide(TRUE);
- m_cameoWindow1->winEnable(FALSE);
- m_cameoWindow1->winSetEnabledImage(0, mission->m_cameoImage[0]);
- m_cameoWindow1->winSetDisabledImage(0, mission->m_cameoDisabledImage[0]);
-
- m_cameoWindow2 = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:WindowCameo2" ));
- DEBUG_ASSERTCRASH(m_cameoWindow2, ("Can't initialize the m_cameoWindow2 for the single player loadscreen"));
- m_cameoWindow2->winHide(TRUE);
- m_cameoWindow2->winEnable(FALSE);
- m_cameoWindow2->winSetEnabledImage(0, mission->m_cameoImage[1]);
- m_cameoWindow2->winSetDisabledImage(0, mission->m_cameoDisabledImage[1]);
-
- m_cameoWindow3 = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:WindowCameo3" ));
- DEBUG_ASSERTCRASH(m_cameoWindow3, ("Can't initialize the m_cameoWindow3 for the single player loadscreen"));
- m_cameoWindow3->winHide(TRUE);
- m_cameoWindow3->winEnable(FALSE);
- m_cameoWindow3->winSetEnabledImage(0, mission->m_cameoImage[2]);
- m_cameoWindow3->winSetDisabledImage(0, mission->m_cameoDisabledImage[2]);
-
- m_headMovie = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:WindowHead" ));
- DEBUG_ASSERTCRASH(m_headMovie, ("Can't initialize the m_headMovie for the single player loadscreen"));
- m_headMovie->winHide(TRUE);
- m_cameoFrame = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:WindowHiliteCameo" ));
- DEBUG_ASSERTCRASH(m_cameoFrame, ("Can't initialize the m_cameoFrame for the single player loadscreen"));
- m_cameoFrame->winHide(TRUE);
- m_cameoText = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "SinglePlayerLoadScreen.wnd:StaticTextCameoText" ));
- DEBUG_ASSERTCRASH(m_cameoText, ("Can't initialize the m_cameoText for the single player loadscreen"));
-
-*/
- m_ambientLoop.setEventName("LoadScreenAmbient");
- // create the new stream
- m_videoStream = TheVideoPlayer->open( TheCampaignManager->getCurrentMission()->m_movieLabel );
- if ( m_videoStream == nullptr )
- {
- m_percent->winHide(TRUE);
- return;
- }
-
- // Create the new buffer
- m_videoBuffer = TheDisplay->createVideoBuffer();
- if ( m_videoBuffer == nullptr ||
- !m_videoBuffer->allocate( m_videoStream->width(),
- m_videoStream->height())
- )
- {
- delete m_videoBuffer;
- m_videoBuffer = nullptr;
-
- if ( m_videoStream )
- {
- m_videoStream->close();
- m_videoStream = nullptr;
- }
-
- return;
- }
-
- if(TheGameLODManager && TheGameLODManager->didMemPass())
- {
- // TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
- // This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
-
- Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
- Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
- while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
- {
- // TheSuperHackers @feature User can now skip video by pressing ESC
- if (TheKeyboard)
- {
- TheKeyboard->UPDATE();
- KeyboardIO *io = TheKeyboard->findKey(KEY_ESC, KeyboardIO::STATUS_UNUSED);
- if (io && BitIsSet(io->state, KEY_STATE_DOWN))
- {
- io->setUsed();
- break;
- }
- }
-
- TheGameEngine->serviceWindowsOS();
-
- if(!m_videoStream->isFrameReady())
- {
- Sleep(1);
- continue;
- }
-
- m_videoStream->frameDecompress();
- m_videoStream->frameRender(m_videoBuffer);
- moveWindows( m_videoStream->frameIndex());
- m_videoStream->frameNext();
-
- if(m_videoBuffer)
- m_loadScreen->winGetInstanceData()->setVideoBuffer(m_videoBuffer);
- if(m_videoStream->frameIndex() % progressUpdateCount == 0)
- {
- shiftedPercent++;
- if(shiftedPercent >0)
- shiftedPercent = 0;
- Int percent = (shiftedPercent + FRAME_FUDGE_ADD)/1.3;
- UnicodeString per;
- per.format(L"%d%%",percent);
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
- GadgetProgressBarSetProgress(m_progressBar, percent);
- GadgetStaticTextSetText(m_percent, per);
-
- }
- TheWindowManager->update();
-
- //TheShell->update();
- //TheDisplay->update();
- // redraw all views, update the GUI
- TheDisplay->draw();
- }
- }
- else
- {
- // if we're min speced
- m_videoStream->frameGoto(m_videoStream->frameCount()); // zero based
- while(!m_videoStream->isFrameReady())
- Sleep(1);
- m_videoStream->frameDecompress();
- m_videoStream->frameRender(m_videoBuffer);
- if(m_videoBuffer)
- m_loadScreen->winGetInstanceData()->setVideoBuffer(m_videoBuffer);
-
- m_objectiveWin->winHide(FALSE);
- for(i = 0; i < MAX_DISPLAYED_UNITS; ++i)
- m_unitDesc[i]->winHide(FALSE);
- m_location->winHide(FALSE);
-
- // Audio was choppy so, I chopped it out!
- TheAudio->friend_forcePlayAudioEventRTS(&TheCampaignManager->getCurrentMission()->m_briefingVoice);
-
- for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i)
- {
- GadgetStaticTextSetText(m_objectiveLines[i], m_unicodeObjectiveLines[i]);
- }
-
- Int delay = mission->m_voiceLength * 1000;
- Int begin = timeGetTime();
- Int currTime = begin;
- Int fudgeFactor = 0;
- while(begin + delay > currTime )
- {
- fudgeFactor = 30 * ((currTime - begin)/ INT_TO_REAL(delay ));
- GadgetProgressBarSetProgress(m_progressBar, fudgeFactor);
-
- TheWindowManager->update();
- TheDisplay->draw();
- Sleep(100);
- currTime = timeGetTime();
- }
-
-
- TheWindowManager->update();
- TheDisplay->draw();
-
- }
- setFPMode();
- m_percent->winHide(TRUE);
- m_ambientLoopHandle = TheAudio->addAudioEvent(&m_ambientLoop);
-
-}
-
-void SinglePlayerLoadScreen::reset( void )
-{
- setLoadScreen(nullptr);
- m_progressBar = nullptr;
-}
-
-void SinglePlayerLoadScreen::update( Int percent )
-{
- percent = (percent + FRAME_FUDGE_ADD)/1.3;
- UnicodeString per;
- per.format(L"%d%%",percent);
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
- GadgetProgressBarSetProgress(m_progressBar, percent);
- GadgetStaticTextSetText(m_percent, per);
-
- // Do this last!
- LoadScreen::update( percent );
-}
-
-void SinglePlayerLoadScreen::setProgressRange( Int min, Int max )
-{
-
-}
-
-// ShellGameLoadScreen Class //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-ShellGameLoadScreen::ShellGameLoadScreen( void )
-{
- m_progressBar = nullptr;
-}
-
-ShellGameLoadScreen::~ShellGameLoadScreen( void )
-{
-
- m_progressBar = nullptr;
-}
-
-void ShellGameLoadScreen::init( GameInfo *game )
-{
- static BOOL firstLoad = TRUE;
-
-
- // create the layout of the load screen
- m_loadScreen = TheWindowManager->winCreateFromScript( "Menus/ShellGameLoadScreen.wnd" );
- DEBUG_ASSERTCRASH(m_loadScreen, ("Can't initialize the ShellGame loadscreen"));
- m_loadScreen->winHide(FALSE);
- m_loadScreen->winBringToTop();
-
- // Store the pointer to the progress bar on the loadscreen
- m_progressBar = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "ShellGameLoadScreen.wnd:ProgressLoad" ));
- DEBUG_ASSERTCRASH(m_progressBar, ("Can't initialize the progressbar for the single player loadscreen"));
- GadgetProgressBarSetProgress(m_progressBar, 0 );
- m_progressBar->winHide(TRUE);
-
- if(m_loadScreen && firstLoad && TheGameLODManager && TheGameLODManager->didMemPass())
- {
- m_loadScreen->winSetEnabledImage(0, TheMappedImageCollection->findImageByName("TitleScreen"));
- TheWritableGlobalData->m_breakTheMovie = FALSE;
-
- GameWindow *win = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "ShellGameLoadScreen.wnd:StaticTextLegal" ));
- if(win)
- win->winHide(FALSE);
- firstLoad = FALSE;
- }
- m_progressBar->winHide(FALSE);
-}
-
-void ShellGameLoadScreen::reset( void )
-{
- setLoadScreen(nullptr);
- m_progressBar = nullptr;
-}
-
-void ShellGameLoadScreen::update( Int percent )
-{
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
- GadgetProgressBarSetProgress(m_progressBar, percent);
-
- // Do this last!
- LoadScreen::update( percent );
-}
-
-// MultiPlayerLoadScreen Class //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-MultiPlayerLoadScreen::MultiPlayerLoadScreen( void )
-{
- m_mapPreview = nullptr;
-
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_buttonMapStartPosition[i] = nullptr;
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- m_playerLookup[i] = -1;
- }
-}
-
-MultiPlayerLoadScreen::~MultiPlayerLoadScreen( void )
-{
- if(m_mapPreview)
- {
- m_mapPreview->winSetUserData(nullptr);
- }
-
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- m_playerLookup[i] = -1;
- }
-
- TheAudio->removeAudioEvent( AHSV_StopTheMusicFade );
-// TheAudio->stopAudio( AudioAffect_Music );
-}
-
-void MultiPlayerLoadScreen::init( GameInfo *game )
-{
- // create the layout of the load screen
- m_loadScreen = TheWindowManager->winCreateFromScript( "Menus/MultiplayerLoadScreen.wnd" );
- DEBUG_ASSERTCRASH(m_loadScreen, ("Can't initialize the Multiplayer loadscreen"));
- m_loadScreen->winHide(FALSE);
- m_loadScreen->winBringToTop();
- m_mapPreview = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "MultiplayerLoadScreen.wnd:WinMapPreview"));
- GameSlot *lSlot = game->getSlot(game->getLocalSlotNum());
- const PlayerTemplate* pt;
- if (lSlot->getPlayerTemplate() >= 0)
- pt = ThePlayerTemplateStore->getNthPlayerTemplate(lSlot->getPlayerTemplate());
- else
- pt = ThePlayerTemplateStore->findPlayerTemplate( TheNameKeyGenerator->nameToKey("FactionObserver") );
- const Image *loadScreenImage = TheMappedImageCollection->findImageByName(pt->getLoadScreen());
-
-
- AsciiString musicName = pt->getLoadScreenMusic();
- if ( ! musicName.isEmpty() )
- {
- TheAudio->removeAudioEvent( AHSV_StopTheMusicFade );
- AudioEventRTS event( musicName );
- event.setShouldFade( TRUE );
-
- TheAudio->addAudioEvent( &event );
- TheAudio->update();//Since GameEngine::update() is suspended until after I am gone...
-
- }
-
-
- if(loadScreenImage)
- m_loadScreen->winSetEnabledImage(0, loadScreenImage);
- //DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!"));
- //DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers()));
-
- GameWindow *teamWin[MAX_SLOTS];
- Int i = 0;
- for (; i < MAX_SLOTS; ++i)
- {
- teamWin[i] = nullptr;
- }
-
- Int netSlot = 0;
- // Loop through and make the loadscreen look all good.
- for (i = 0; i < MAX_SLOTS; ++i)
- {
- // Load the Progress Bar
- AsciiString winName;
- winName.format( "MultiplayerLoadScreen.wnd:ProgressLoad%d",i);
- m_progressBars[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_progressBars[i], ("Can't initialize the progressbars for the Multiplayer loadscreen"));
- // set the progressbar to zero
- GadgetProgressBarSetProgress(m_progressBars[i], 0 );
-
- // Load MapStart Positions
- winName.format( "MultiplayerLoadScreen.wnd:ButtonMapStartPosition%d",i);
- m_buttonMapStartPosition[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_buttonMapStartPosition[i], ("Can't initialize the MapStart Positions for the MultiplayerLoadScreen loadscreen"));
-
-
- // Load the Player's name
- winName.format( "MultiplayerLoadScreen.wnd:StaticTextPlayer%d",i);
- m_playerNames[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerNames[i], ("Can't initialize the Names for the Multiplayer loadscreen"));
-
- // Load the Player's Side
- winName.format( "MultiplayerLoadScreen.wnd:StaticTextSide%d",i);
- m_playerSide[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerSide[i], ("Can't initialize the Sides for the Multiplayer loadscreen"));
-
- winName.format( "MultiplayerLoadScreen.wnd:StaticTextTeam%d",i);
- teamWin[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
-
- // get the slot man!
- GameSlot *slot = game->getSlot(i);
- if (!slot || !slot->isOccupied())
- continue;
- Color houseColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor();
- GadgetProgressBarSetEnabledBarColor(m_progressBars[netSlot],houseColor );
-
- UnicodeString name = slot->getName();
- GadgetStaticTextSetText(m_playerNames[netSlot], name );
- m_playerNames[netSlot]->winSetEnabledTextColors(houseColor, m_playerNames[netSlot]->winGetEnabledTextBorderColor());
-
- GadgetStaticTextSetText(m_playerSide[netSlot], slot->getApparentPlayerTemplateDisplayName() );
- m_playerSide[netSlot]->winSetEnabledTextColors(houseColor, m_playerSide[netSlot]->winGetEnabledTextBorderColor());
-
- if (slot->isAI() && m_progressBars[netSlot])
- m_progressBars[netSlot]->winHide(TRUE);
-
- if (teamWin[netSlot])
- {
- AsciiString teamStr;
- teamStr.format("Team:%d", slot->getTeamNumber() + 1);
- GadgetStaticTextSetText(teamWin[netSlot], TheGameText->fetch(teamStr));
- teamWin[netSlot]->winSetEnabledTextColors(houseColor, m_playerNames[netSlot]->winGetEnabledTextBorderColor());
- }
-
- m_playerLookup[i] = netSlot; // save our mapping so we can update progress correctly
-
- netSlot++;
- }
-
- for(i = netSlot; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i]->winHide(TRUE);
- m_playerNames[i]->winHide(TRUE);
- m_playerSide[i]->winHide(TRUE);
- teamWin[i]->winHide(TRUE);
- }
-
- if(m_mapPreview)
- {
- const MapMetaData *mmd = TheMapCache->findMap(game->getMap());
- Image *image = getMapPreviewImage(game->getMap());
- m_mapPreview->winSetUserData((void *)mmd);
-
- positionStartSpots( game, m_buttonMapStartPosition, m_mapPreview);
- updateMapStartSpots( game, m_buttonMapStartPosition, TRUE );
- //positionAdditionalImages((MapMetaData *)mmd, m_mapPreview, TRUE);
- if(image)
- {
- m_mapPreview->winSetStatus(WIN_STATUS_IMAGE);
- m_mapPreview->winSetEnabledImage(0, image);
- }
- else
- {
- m_mapPreview->winClearStatus(WIN_STATUS_IMAGE);
- }
- }
-
-
- TheGameLogic->initTimeOutValues();
-}
-
-void MultiPlayerLoadScreen::reset( void )
-{
- setLoadScreen(nullptr);
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- }
-}
-
-void MultiPlayerLoadScreen::update( Int percent )
-{
- if (TheNetwork)
- {
- if(percent <= 100)
- TheNetwork->updateLoadProgress( percent );
- TheNetwork->liteupdate();
- }
- else
- {
- if (percent <= 100)
- TheGameLogic->processProgress( TheGameInfo->getLocalSlotNum(), percent );
- }
-
- //GadgetProgressBarSetProgress(m_progressBars[TheNetwork->getLocalPlayerID()], percent );
-
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
-
- // Do this last!
- LoadScreen::update( percent );
-}
-
-void MultiPlayerLoadScreen::processProgress(Int playerId, Int percentage)
-{
-
- if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1)
- {
- DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId));
- return;
- }
- //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId]));
- if(m_progressBars[m_playerLookup[playerId]])
- GadgetProgressBarSetProgress(m_progressBars[m_playerLookup[playerId]], percentage );
-}
-
-// GameSpyLoadScreen Class //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-GameSpyLoadScreen::GameSpyLoadScreen( void )
-{
-
- m_mapPreview = nullptr;
-
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
-
- m_buttonMapStartPosition[i] = nullptr;
- m_playerRank[i] = nullptr;
-
- m_playerOfficerMedal[i] = nullptr;
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- m_playerLookup[i] = -1;
- m_playerFavoriteFactions[i]= nullptr;
- m_playerTotalDisconnects[i]= nullptr;
- m_playerWin[i]= nullptr;
- m_playerWinLosses[i]= nullptr;
- }
-}
-
-GameSpyLoadScreen::~GameSpyLoadScreen( void )
-{
- if(m_mapPreview)
- {
- m_mapPreview->winSetUserData(nullptr);
- }
-
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- m_playerLookup[i] = -1;
- m_playerFavoriteFactions[i]= nullptr;
- m_playerTotalDisconnects[i]= nullptr;
- m_playerWin[i]= nullptr;
- m_playerWinLosses[i]= nullptr;
- }
-}
-
-extern Int GetAdditionalDisconnectsFromUserFile(Int playerID);
-
-void GameSpyLoadScreen::init( GameInfo *game )
-{
- // create the layout of the load screen
- m_loadScreen = TheWindowManager->winCreateFromScript( "Menus/GameSpyLoadScreen.wnd" );
- DEBUG_ASSERTCRASH(m_loadScreen, ("Can't initialize the Multiplayer loadscreen"));
- m_loadScreen->winHide(FALSE);
- m_loadScreen->winBringToTop();
- m_mapPreview = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "GameSpyLoadScreen.wnd:WinMapPreview"));
- DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!"));
- DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers()));
-GameSlot *lSlot = game->getSlot(game->getLocalSlotNum());
- const PlayerTemplate* pt;
- if (lSlot->getPlayerTemplate() >= 0)
- pt = ThePlayerTemplateStore->getNthPlayerTemplate(lSlot->getPlayerTemplate());
- else
- pt = ThePlayerTemplateStore->findPlayerTemplate( TheNameKeyGenerator->nameToKey("FactionObserver") );
- const Image *loadScreenImage = TheMappedImageCollection->findImageByName(pt->getLoadScreen());
- if(loadScreenImage)
- m_loadScreen->winSetEnabledImage(0, loadScreenImage);
-
- GameWindow *teamWin[MAX_SLOTS];
- Int i = 0;
- for (; i < MAX_SLOTS; ++i)
- {
- teamWin[i] = nullptr;
- }
-
- Int netSlot = 0;
- // Loop through and make the loadscreen look all good.
- for (i = 0; i < MAX_SLOTS; ++i)
- {
- // Load the Progress Bar
- AsciiString winName;
- winName.format( "GameSpyLoadScreen.wnd:ProgressLoad%d",i);
- m_progressBars[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_progressBars[i], ("Can't initialize the progressbars for the GameSpyLoadScreen loadscreen"));
- // set the progressbar to zero
- GadgetProgressBarSetProgress(m_progressBars[i], 0 );
-
- // Load the Player's name
- winName.format( "GameSpyLoadScreen.wnd:StaticTextPlayer%d",i);
- m_playerNames[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerNames[i], ("Can't initialize the Names for the GameSpyLoadScreen loadscreen"));
-
- // Load MapStart Positions
- winName.format( "GameSpyLoadScreen.wnd:ButtonMapStartPosition%d",i);
- m_buttonMapStartPosition[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_buttonMapStartPosition[i], ("Can't initialize the MapStart Positions for the GameSpyLoadScreen loadscreen"));
-
-
- // Load the Player's Side
- winName.format( "GameSpyLoadScreen.wnd:StaticTextSide%d",i);
- m_playerSide[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerSide[i], ("Can't initialize the Sides for the GameSpyLoadScreen loadscreen"));
-
- // Load the Player's window
- winName.format( "GameSpyLoadScreen.wnd:WinPlayer%d",i);
- m_playerWin[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerWin[i], ("Can't initialize the WinPlayer for the GameSpyLoadScreen loadscreen"));
-
- // Load the Player's m_playerTotalDisconnects
- winName.format( "GameSpyLoadScreen.wnd:StaticTextTotalDisconnects%d",i);
- m_playerTotalDisconnects[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerTotalDisconnects[i], ("Can't initialize the m_playerTotalDisconnects for the GameSpyLoadScreen loadscreen"));
-
-// // Load the Player's m_playerFavoriteFactions
-// winName.format( "GameSpyLoadScreen.wnd:StaticTextFavoriteFaction%d",i);
-// m_playerFavoriteFactions[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
-// DEBUG_ASSERTCRASH(m_playerFavoriteFactions[i], ("Can't initialize the StaticTextFavoriteFaction for the GameSpyLoadScreen loadscreen"));
-
- // Load the Player's m_playerWinLosses
- winName.format( "GameSpyLoadScreen.wnd:StaticTextWinLoss%d",i);
- m_playerWinLosses[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerWinLosses[i], ("Can't initialize the m_playerWinLosses for the GameSpyLoadScreen loadscreen"));
-
- // Load the Player's m_playerWinLosses
- winName.format( "GameSpyLoadScreen.wnd:WinRank%d",i);
- m_playerRank[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerRank[i], ("Can't initialize the m_playerRank for the GameSpyLoadScreen loadscreen"));
-
- // Load the Player's m_playerOfficerMedal
- winName.format( "GameSpyLoadScreen.wnd:WinOfficer%d",i);
- m_playerOfficerMedal[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerOfficerMedal[i], ("Can't initialize the m_playerOfficerMedal for the GameSpyLoadScreen loadscreen"));
-
- winName.format( "MultiplayerLoadScreen.wnd:StaticTextTeam%d",i);
- teamWin[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
-
- // get the slot man!
- GameSpyGameSlot *slot = (GameSpyGameSlot *)game->getSlot(i);
- if (!slot || !slot->isOccupied())
- continue;
- Color houseColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor();
- GadgetProgressBarSetEnabledBarColor(m_progressBars[netSlot],houseColor );
-
- UnicodeString name = slot->getName();
- GadgetStaticTextSetText(m_playerNames[netSlot], name );
- m_playerNames[netSlot]->winSetEnabledTextColors(houseColor, m_playerNames[netSlot]->winGetEnabledTextBorderColor());
-
- // Get the stats for the player
- PSPlayerStats stats = TheGameSpyPSMessageQueue->findPlayerStatsByID(slot->getProfileID());
- DEBUG_LOG(("LoadScreen - populating info for %ls(%d) - stats returned id %d",
- slot->getName().str(), slot->getProfileID(), stats.id));
-
- Bool isPreorder = TheGameSpyInfo->didPlayerPreorder(stats.id);
- Int rankPoints = CalculateRank(stats);
- Int favSide = GetFavoriteSide(stats);
- const Image *preorderImg = TheMappedImageCollection->findImageByName("OfficersClubsmall");
- if (!isPreorder)
- preorderImg = nullptr;
- const Image *rankImg = LookupSmallRankImage(favSide, rankPoints);
- m_playerOfficerMedal[i]->winSetEnabledImage(0, preorderImg);
- m_playerRank[i]->winSetEnabledImage(0, rankImg);
-
- UnicodeString formatString;
-
- // pop wins and losses
- Int numLosses = 0;
- PerGeneralMap::iterator it;
- for(it = stats.losses.begin(); it != stats.losses.end(); ++it)
- {
- numLosses += it->second;
- }
- Int numWins = 0;
- for(it =stats.wins.begin(); it != stats.wins.end(); ++it)
- {
- numWins += it->second;
- }
- formatString.format(L"%d/%d", numWins, numLosses);
- GadgetStaticTextSetText(m_playerWinLosses[netSlot], formatString);
- m_playerWinLosses[netSlot]->winSetEnabledTextColors(houseColor, m_playerWinLosses[netSlot]->winGetEnabledTextBorderColor());
- // favoriteFaction
- Int numGames = 0;
- Int favorite = 0;
- for(it =stats.games.begin(); it != stats.games.end(); ++it)
- {
- if(it->second >= numGames)
- {
- numGames = it->second;
- favorite = it->first;
- }
- }
-// if(numGames == 0)
-// GadgetStaticTextSetText(m_playerFavoriteFactions[netSlot], TheGameText->fetch("GUI:None"));
-// else if( stats.gamesAsRandom > numGames )
-// GadgetStaticTextSetText(m_playerFavoriteFactions[netSlot], TheGameText->fetch("GUI:Random"));
-// else
-// {
-// const PlayerTemplate *fac = ThePlayerTemplateStore->getNthPlayerTemplate(favorite);
-// if (fac)
-// {
-// AsciiString side;
-// side.format("SIDE:%s", fac->getSide().str());
-//
-// GadgetStaticTextSetText(m_playerFavoriteFactions[netSlot], TheGameText->fetch(side));
-// }
-// }
-// m_playerFavoriteFactions[netSlot]->winSetEnabledTextColors(houseColor, m_playerFavoriteFactions[netSlot]->winGetEnabledTextBorderColor());
- // disconnects
- numGames = 0;
- for(it =stats.discons.begin(); it != stats.discons.end(); ++it)
- {
- numGames += it->second;
- }
- for(it =stats.desyncs.begin(); it != stats.desyncs.end(); ++it)
- {
- numGames += it->second;
- }
- numGames += GetAdditionalDisconnectsFromUserFile(stats.id);
-
- formatString.format(L"%d", numGames);
- GadgetStaticTextSetText(m_playerTotalDisconnects[netSlot], formatString);
- m_playerTotalDisconnects[netSlot]->winSetEnabledTextColors(houseColor, m_playerTotalDisconnects[netSlot]->winGetEnabledTextBorderColor());
- GadgetStaticTextSetText(m_playerSide[netSlot], slot->getApparentPlayerTemplateDisplayName() );
- m_playerSide[netSlot]->winSetEnabledTextColors(houseColor, m_playerSide[netSlot]->winGetEnabledTextBorderColor());
-
- if (slot->isAI())
- {
- if (m_progressBars[netSlot])
- m_progressBars[netSlot]->winHide(TRUE);
- if (m_playerTotalDisconnects[netSlot])
- m_playerTotalDisconnects[netSlot]->winHide(TRUE);
-// if (m_playerFavoriteFactions[netSlot])
-// m_playerFavoriteFactions[netSlot]->winHide(TRUE);
- if (m_playerWinLosses[netSlot])
- m_playerWinLosses[netSlot]->winHide(TRUE);
- if (m_playerRank[netSlot])
- m_playerRank[netSlot]->winHide(TRUE);
- if (m_playerOfficerMedal[netSlot])
- m_playerOfficerMedal[netSlot]->winHide(TRUE);
- }
-
- if (teamWin[netSlot])
- {
- AsciiString teamStr;
- teamStr.format("Team:%d", slot->getTeamNumber() + 1);
- if (slot->isAI() && slot->getTeamNumber() == -1)
- teamStr = "Team:AI";
- GadgetStaticTextSetText(teamWin[netSlot], TheGameText->fetch(teamStr));
- teamWin[netSlot]->winSetEnabledTextColors(houseColor, m_playerNames[netSlot]->winGetEnabledTextBorderColor());
- }
-
- m_playerLookup[i] = netSlot; // save our mapping so we can update progress correctly
-
- netSlot++;
- }
-
- for(i = netSlot; i < MAX_SLOTS; ++i)
- {
- m_playerWin[i]->winHide(TRUE);
- //m_playerNames[i]->winHide(TRUE);
- //m_playerSide[i]->winHide(TRUE);
- }
-
- if(m_mapPreview)
- {
- const MapMetaData *mmd = TheMapCache->findMap(game->getMap());
- Image *image = getMapPreviewImage(game->getMap());
- m_mapPreview->winSetUserData((void *)mmd);
-
- positionStartSpots( game, m_buttonMapStartPosition, m_mapPreview);
- updateMapStartSpots( game, m_buttonMapStartPosition, TRUE );
- //positionAdditionalImages((MapMetaData *)mmd, m_mapPreview, TRUE);
- if(image)
- {
- m_mapPreview->winSetStatus(WIN_STATUS_IMAGE);
- m_mapPreview->winSetEnabledImage(0, image);
- }
- else
- {
- m_mapPreview->winClearStatus(WIN_STATUS_IMAGE);
- }
- }
-
- TheGameLogic->initTimeOutValues();
-}
-
-void GameSpyLoadScreen::reset( void )
-{
- setLoadScreen(nullptr);
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_playerSide[i]= nullptr;
- }
-}
-
-void GameSpyLoadScreen::update( Int percent )
-{
- if(percent <= 100)
- TheNetwork->updateLoadProgress( percent );
- TheNetwork->liteupdate();
-
- //GadgetProgressBarSetProgress(m_progressBars[TheNetwork->getLocalPlayerID()], percent );
-
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
-
- // Do this last!
- LoadScreen::update( percent );
-}
-
-void GameSpyLoadScreen::processProgress(Int playerId, Int percentage)
-{
-
- if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1)
- {
- DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId));
- return;
- }
- //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId]));
- if(m_progressBars[m_playerLookup[playerId]])
- GadgetProgressBarSetProgress(m_progressBars[m_playerLookup[playerId]], percentage );
-}
-
-// MapTransferLoadScreen Class //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-MapTransferLoadScreen::MapTransferLoadScreen( void )
-{
- m_oldTimeout = 0;
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_progressText[i]= nullptr;
- m_playerLookup[i] = -1;
- m_oldProgress[i] = -1;
- }
- m_fileNameText = nullptr;
- m_timeoutText = nullptr;
-}
-
-MapTransferLoadScreen::~MapTransferLoadScreen( void )
-{
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_progressText[i]= nullptr;
- m_playerLookup[i] = -1;
- m_oldProgress[i] = -1;
- }
- m_fileNameText = nullptr;
- m_timeoutText = nullptr;
-}
-
-void MapTransferLoadScreen::init( GameInfo *game )
-{
- // create the layout of the load screen
- m_loadScreen = TheWindowManager->winCreateFromScript( "Menus/MapTransferScreen.wnd" );
- DEBUG_ASSERTCRASH(m_loadScreen, ("Can't initialize the map transfer loadscreen"));
- if (!m_loadScreen)
- return;
-
- m_loadScreen->winHide(FALSE);
- m_loadScreen->winBringToTop();
-
- DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network?!!!!"));
- DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers()));
-
- AsciiString winName;
- Int i;
-
- // Load the Filename Text
- m_fileNameText = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "MapTransferScreen.wnd:StaticTextCurrentFile" ));
- DEBUG_ASSERTCRASH(m_fileNameText, ("Can't initialize the filename for the map transfer loadscreen"));
-
- // Load the Timeout Text
- m_timeoutText = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "MapTransferScreen.wnd:StaticTextTimeout" ));
- DEBUG_ASSERTCRASH(m_timeoutText, ("Can't initialize the timeout for the map transfer loadscreen"));
-
- Int netSlot = 0;
- // Loop through and make the loadscreen look all good.
- for (i = 0; i < MAX_SLOTS; ++i)
- {
- // Load the Progress Bar
- winName.format( "MapTransferScreen.wnd:ProgressLoad%d",i);
- m_progressBars[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_progressBars[i], ("Can't initialize the progressbars for the map transfer loadscreen"));
- // set the progressbar to zero
- GadgetProgressBarSetProgress(m_progressBars[i], 0 );
-
- // Load the Player's name
- winName.format( "MapTransferScreen.wnd:StaticTextPlayer%d",i);
- m_playerNames[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_playerNames[i], ("Can't initialize the Names for the map transfer loadscreen"));
-
- // Load the Progress Text
- winName.format( "MapTransferScreen.wnd:StaticTextProgress%d",i);
- m_progressText[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( winName ));
- DEBUG_ASSERTCRASH(m_progressText[i], ("Can't initialize the progress text for the map transfer loadscreen"));
-
- // get the slot man!
- GameSlot *slot = game->getSlot(i);
- if (!slot || !slot->isHuman())
- continue;
- Color houseColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor();
- GadgetProgressBarSetEnabledBarColor(m_progressBars[netSlot], houseColor );
-
- UnicodeString name = slot->getName();
- GadgetStaticTextSetText(m_playerNames[netSlot], name );
- m_playerNames[netSlot]->winSetEnabledTextColors(houseColor, m_playerNames[netSlot]->winGetEnabledTextBorderColor());
-
- GadgetStaticTextSetText(m_progressText[netSlot], UnicodeString::TheEmptyString );
- m_progressText[netSlot]->winSetEnabledTextColors(houseColor, m_progressText[netSlot]->winGetEnabledTextBorderColor());
-
- if ((i == 0 || (TheGameInfo->getConstSlot(i)->isHuman() && TheGameInfo->getConstSlot(i)->hasMap())) && m_progressBars[netSlot])
- m_progressBars[netSlot]->winHide(TRUE);
-
- m_playerLookup[i] = netSlot; // save our mapping so we can update progress correctly
-
- netSlot++;
- }
-
- for(i = netSlot; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i]->winHide(TRUE);
- m_playerNames[i]->winHide(TRUE);
- m_progressText[i]->winHide(TRUE);
- }
-}
-
-void MapTransferLoadScreen::reset( void )
-{
- setLoadScreen(nullptr);
- for(Int i = 0; i < MAX_SLOTS; ++i)
- {
- m_progressBars[i] = nullptr;
- m_playerNames[i] = nullptr;
- m_progressText[i]= nullptr;
- m_playerLookup[i] = -1;
- m_oldProgress[i] = -1;
- }
- m_fileNameText = nullptr;
- m_timeoutText = nullptr;
-}
-
-void MapTransferLoadScreen::update( Int percent )
-{
- if (TheNetwork)
- {
- TheNetwork->liteupdate();
- }
-
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
-
- // Do this last!
- LoadScreen::update( percent );
-}
-
-void MapTransferLoadScreen::processProgress(Int playerId, Int percentage, AsciiString stateStr)
-{
-
- if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1)
- {
- DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId));
- return;
- }
-
- if (m_oldProgress[playerId] == percentage)
- return;
- m_oldProgress[playerId] = percentage;
-
- Int translatedSlot = m_playerLookup[playerId];
- if(m_progressBars[translatedSlot])
- GadgetProgressBarSetProgress(m_progressBars[translatedSlot], percentage );
- if (m_progressText[translatedSlot])
- GadgetStaticTextSetText(m_progressText[translatedSlot], TheGameText->fetch(stateStr));
-}
-
-void MapTransferLoadScreen::processTimeout(Int secondsLeft)
-{
- if (m_oldTimeout == secondsLeft)
- return;
- m_oldTimeout = secondsLeft;
-
- if (m_timeoutText)
- {
- UnicodeString txt;
- txt.format(TheGameText->fetch("MapTransfer:Timeout"), (secondsLeft/60), (secondsLeft%60));
- GadgetStaticTextSetText(m_timeoutText, txt);
- }
-}
-
-void MapTransferLoadScreen::setCurrentFilename(AsciiString filename)
-{
- if (m_fileNameText)
- {
- UnicodeString txt;
- txt.translate(TheGameState->getMapLeafName(filename));
- txt.format(TheGameText->fetch("MapTransfer:CurrentFile"), txt.str());
- GadgetStaticTextSetText(m_fileNameText, txt);
- }
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp
deleted file mode 100644
index 347addb6c90..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp
+++ /dev/null
@@ -1,1544 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ProcessAnimateWindow.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Mar 2002
-//
-// Filename: ProcessAnimateWindow.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: Holds all the process modules for the Animate Window Class
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/ProcessAnimateWindow.h"
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Display.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-static Real getDisplayWidthScaler()
-{
- return static_cast(TheDisplay->getWidth()) / DEFAULT_DISPLAY_WIDTH;
-}
-
-static Real getDisplayHeightScaler()
-{
- return static_cast(TheDisplay->getHeight()) / DEFAULT_DISPLAY_HEIGHT;
-}
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromRight PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromRight::ProcessAnimateWindowSlideFromRight( void )
-{
- m_maxVel.x = 0.0f; // top speed windows travel in x and y
- m_maxVel.y = 0.0f;
- m_slowDownThreshold = 0; // when windows get this close to their resting positions they start to slow down
-
- m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker)
- m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up
-}
-
-//-----------------------------------------------------------------------------
-ProcessAnimateWindowSlideFromRight::~ProcessAnimateWindowSlideFromRight( void ) { }
-
-//-----------------------------------------------------------------------------
-void ProcessAnimateWindowSlideFromRight::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x *= -1;
- vel.y *= -1;
- animWin->setVel( vel );
- animWin->setFinished( FALSE );
-
-}
-
-//-----------------------------------------------------------------------------
-void ProcessAnimateWindowSlideFromRight::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- animWin->setFinished( FALSE );
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Right of the screen
- Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- startPos.x = curPos.x = restPos.x + travelDistance;
- startPos.y = curPos.y = restPos.y;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- // TheSuperHackers @bugfix tophroxx 31/01/2026 Scale movement by display size so that it looks
- // consistent regardless of the display resolution.
- const Real widthScaler = getDisplayWidthScaler();
- m_maxVel.x = -40 * widthScaler;
- m_slowDownThreshold = 80 * widthScaler;
-
- //Now initialize the velocities
- vel.x = m_maxVel.x;
- vel.y = 0.0f;
-
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-
-//-----------------------------------------------------------------------------
-Bool ProcessAnimateWindowSlideFromRight::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
- curPos.x += (Int)vel.x;
-
- if(curPos.x < endPos.x)
- {
- curPos.x = endPos.x;
- animWin->setFinished( TRUE );
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- if( curPos.x - endPos.x <= m_slowDownThreshold )
- {
- vel.x *= m_slowDownRatio;
- }
- if( vel.x >= -1.0f)
- vel.x = -1.0f;
- animWin->setVel(vel);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromRight::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D startPos = animWin->getStartPos();
- Coord2D vel = animWin->getVel();
- curPos.x += (Int)vel.x;
-
- if(curPos.x > startPos.x)
- {
- curPos.x = startPos.x;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
-
- ICoord2D endPos = animWin->getEndPos();
- if( curPos.x - endPos.x <= m_slowDownThreshold )
- {
- vel.x *= m_speedUpRatio;
- }
- else
- {
- vel.x = -m_maxVel.x;
- }
- if( vel.x > -m_maxVel.x)
- vel.x = -m_maxVel.x;
- animWin->setVel(vel);
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromLeft PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromLeft::ProcessAnimateWindowSlideFromLeft( void )
-{
- m_maxVel.x = 0.0f; // top speed windows travel in x and y
- m_maxVel.y = 0.0f;
- m_slowDownThreshold = 0; // when windows get this close to their resting positions they start to slow down
-
- m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker)
- m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up
-}
-
-ProcessAnimateWindowSlideFromLeft::~ProcessAnimateWindowSlideFromLeft( void ) { }
-
-void ProcessAnimateWindowSlideFromLeft::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x *= -1;
- vel.y *= -1;
- animWin->setVel( vel );
-
-}
-
-void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Left of the screen
- Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- startPos.x = curPos.x = restPos.x - travelDistance;
- startPos.y = curPos.y = restPos.y;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- // TheSuperHackers @bugfix tophroxx 31/01/2026 Scale movement by display size so that it looks
- // consistent regardless of the display resolution.
- const Real widthScaler = getDisplayWidthScaler();
- m_maxVel.x = 40 * widthScaler;
- m_slowDownThreshold = 80 * widthScaler;
-
- //Now initialize the velocities
- vel = m_maxVel;
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-Bool ProcessAnimateWindowSlideFromLeft::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
- curPos.x += (Int)vel.x;
-
- if(curPos.x > endPos.x)
- {
- curPos.x = endPos.x;
- animWin->setFinished( TRUE );
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- if( endPos.x - curPos.x <= m_slowDownThreshold )
- {
- vel.x *= m_slowDownRatio;
- }
- if( vel.x < 1.0f)
- vel.x = 1.0f;
- animWin->setVel(vel);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromLeft::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D startPos = animWin->getStartPos();
- Coord2D vel = animWin->getVel();
- curPos.x += (Int)vel.x;
-
- if(curPos.x < startPos.x)
- {
- curPos.x = startPos.x;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
-
- ICoord2D endPos = animWin->getEndPos();
- if( endPos.x - curPos.x <= m_slowDownThreshold )
- {
- vel.x *= m_speedUpRatio;
- }
- else
- {
- vel.x = -m_maxVel.x;
- }
- if( vel.x < -m_maxVel.x)
- vel.x = -m_maxVel.x;
- animWin->setVel(vel);
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromTop PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromTop::ProcessAnimateWindowSlideFromTop( void )
-{
- m_maxVel.x = 0.0f; // top speed windows travel in x and y
- m_maxVel.y = 0.0f;
- m_slowDownThreshold = 0; // when windows get this close to their resting positions they start to slow down
-
- m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker)
- m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up
-}
-
-ProcessAnimateWindowSlideFromTop::~ProcessAnimateWindowSlideFromTop( void ) { }
-
-void ProcessAnimateWindowSlideFromTop::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x *= -1;
- vel.y *= -1;
- animWin->setVel( vel );
-
-}
-
-void ProcessAnimateWindowSlideFromTop::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Top of the screen
- Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- startPos.x = curPos.x = restPos.x ;
- startPos.y = curPos.y = restPos.y - travelDistance;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- // TheSuperHackers @bugfix tophroxx 31/01/2026 Scale movement by display size so that it looks
- // consistent regardless of the display resolution.
- const Real heightScaler = getDisplayHeightScaler();
- m_maxVel.y = 40 * heightScaler;
- m_slowDownThreshold = 80 * heightScaler;
-
- //Now initialize the velocities
- vel = m_maxVel;
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-Bool ProcessAnimateWindowSlideFromTop::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
- curPos.y += (Int)vel.y;
-
- if(curPos.y > endPos.y)
- {
- curPos.y = endPos.y;
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setFinished( TRUE );
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- if( endPos.y - curPos.y <= m_slowDownThreshold )
- {
- vel.y *= m_slowDownRatio;
- }
- if( vel.y < 1.0f)
- vel.y = 1.0f;
- animWin->setVel(vel);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromTop::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D startPos = animWin->getStartPos();
- Coord2D vel = animWin->getVel();
- curPos.y += (Int)vel.y;
-
- if(curPos.y < startPos.y)
- {
- curPos.y = startPos.y;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
-
- ICoord2D endPos = animWin->getEndPos();
- if( endPos.y - curPos.y <= m_slowDownThreshold )
- {
- vel.y *= m_speedUpRatio;
- }
- else
- {
- vel.y = -m_maxVel.y;
- }
- if( vel.y < -m_maxVel.y)
- vel.y = -m_maxVel.y;
- animWin->setVel(vel);
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromBottom PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromBottom::ProcessAnimateWindowSlideFromBottom( void )
-{
- m_maxVel.x = 0.0f; // top speed windows travel in x and y
- m_maxVel.y = 0.0f;
- m_slowDownThreshold = 0; // when windows get this close to their resting positions they start to slow down
-
- m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker)
- m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up
-}
-
-ProcessAnimateWindowSlideFromBottom::~ProcessAnimateWindowSlideFromBottom( void ) { }
-
-void ProcessAnimateWindowSlideFromBottom::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x *= -1;
- vel.y *= -1;
- animWin->setVel( vel );
-
-}
-
-
-void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Bottom of the screen
- Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- startPos.x = curPos.x = restPos.x;
- startPos.y = curPos.y = restPos.y + travelDistance;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- // TheSuperHackers @bugfix tophroxx 31/01/2026 Scale movement by display size so that it looks
- // consistent regardless of the display resolution.
- const Real heightScaler = getDisplayHeightScaler();
- m_maxVel.y = -40 * heightScaler;
- m_slowDownThreshold = 80 * heightScaler;
-
- //Now initialize the velocities
- vel = m_maxVel;
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-Bool ProcessAnimateWindowSlideFromBottom::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
- curPos.y += (Int)vel.y;
-
- if(curPos.y < endPos.y)
- {
- curPos.y = endPos.y;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- if( curPos.y - endPos.y <= m_slowDownThreshold )
- {
- vel.y *= m_slowDownRatio;
- }
- if( vel.y >= -1.0f)
- vel.y = -1.0f;
- animWin->setVel(vel);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromBottom::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D startPos = animWin->getStartPos();
- Coord2D vel = animWin->getVel();
- curPos.y += (Int)vel.y;
-
- if(curPos.y > startPos.y)
- {
- curPos.y = startPos.y;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
-
- ICoord2D endPos = animWin->getEndPos();
- if( curPos.y - endPos.y <= m_slowDownThreshold )
- {
- vel.y *= m_speedUpRatio;
- }
- else
- {
- vel.y = -m_maxVel.y;
- }
- if( vel.y > -m_maxVel.y)
- vel.y = -m_maxVel.y;
- animWin->setVel(vel);
- return FALSE;
-}
-
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromBottomTimed PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromBottomTimed::ProcessAnimateWindowSlideFromBottomTimed( void )
-{
- m_maxDuration = 1000;
-}
-
-ProcessAnimateWindowSlideFromBottomTimed::~ProcessAnimateWindowSlideFromBottomTimed( void ) { }
-
-void ProcessAnimateWindowSlideFromBottomTimed::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- restPos = animWin->getRestPos();
- startPos.x = restPos.x;
- curPos.y = startPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Bottom of the screen
- Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- endPos.x = curPos.x = restPos.x;
- endPos.y = restPos.y + travelDistance;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- UnsignedInt now = timeGetTime();
-
- DEBUG_LOG(("initReverseAnimateWindow at %d (%d->%d)", now, now, now + m_maxDuration));
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now, now + m_maxDuration);
-}
-
-
-void ProcessAnimateWindowSlideFromBottomTimed::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Bottom of the screen
- Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- startPos.x = curPos.x = restPos.x;
- startPos.y = curPos.y = restPos.y + travelDistance;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- UnsignedInt now = timeGetTime();
- UnsignedInt delay = animWin->getDelay();
-
- DEBUG_LOG(("initAnimateWindow at %d (%d->%d)", now, now + delay, now + m_maxDuration + delay));
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now + delay, now + m_maxDuration + delay);
-}
-
-Bool ProcessAnimateWindowSlideFromBottomTimed::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D startPos = animWin->getStartPos();
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
-
- UnsignedInt now = timeGetTime();
- UnsignedInt startTime = animWin->getStartTime();
- UnsignedInt endTime = animWin->getEndTime();
-
- if (now < startTime)
- return FALSE;
-
- Real percentDone = 1.0f - (Real)(endTime - now) / (Real)(m_maxDuration);
- if (now >= endTime)
- {
- curPos.y = endPos.y;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- DEBUG_LOG(("window finished animating at %d (%d->%d)", now, startTime, endTime));
- return TRUE;
- }
-
- curPos.y = startPos.y + percentDone*(endPos.y - startPos.y);
- DEBUG_LOG(("(%d,%d) -> (%d,%d) -> (%d,%d) at %g",
- startPos.x, startPos.y, curPos.x, curPos.y, endPos.x, endPos.y, percentDone));
-
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromBottomTimed::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
- return updateAnimateWindow(animWin);
-}
-
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSpiral PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSpiral::ProcessAnimateWindowSpiral( void )
-{
- m_maxR = TheDisplay->getWidth() / 2;
- m_deltaTheta = .33f;
-}
-
-//-----------------------------------------------------------------------------
-ProcessAnimateWindowSpiral::~ProcessAnimateWindowSpiral( void ) { }
-
-//-----------------------------------------------------------------------------
-void ProcessAnimateWindowSpiral::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x = 0;
- vel.y = 0;
- animWin->setVel( vel );
-
-}
-
-//-----------------------------------------------------------------------------
-void ProcessAnimateWindowSpiral::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- ICoord2D size = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- win->winGetSize(&size.x,&size.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
- //set the initial positions for the window. In this case, off the Bottom of the screen
- vel.x = 0;
- vel.y = m_maxR;
- startPos.x = curPos.x = (vel.y * cos(vel.x)) + endPos.x;
- startPos.y = curPos.y = (vel.y * sin(vel.x)) + endPos.y;
-
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-//-----------------------------------------------------------------------------
-Bool ProcessAnimateWindowSpiral::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
-
- curPos.x = (vel.y * cos(vel.x)) + endPos.x;
- curPos.y = (vel.y * sin(vel.x)) + endPos.y;
-
- vel.x = vel.x + m_deltaTheta;
- vel.y -=5;
-
- ICoord2D size;
- win->winGetSize(&size.x, &size.y);
- Int m_max = min(size.x/2, size.y/2);
-
- if(vel.y < m_max)
- {
- ICoord2D restPos = animWin->getRestPos();
- animWin->setFinished( TRUE );
- win->winSetPosition(restPos.x, restPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- animWin->setVel(vel);
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-Bool ProcessAnimateWindowSpiral::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
-
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
-
- curPos.x = (vel.y * cos(vel.x)) + endPos.x;
- curPos.y = (vel.y * sin(vel.x)) + endPos.y;
-
- vel.x = vel.x - m_deltaTheta;
- vel.y +=5;
-
- ICoord2D size;
- win->winGetSize(&size.x, &size.y);
-// Int m_max = min(size.x/2, size.y/2);
-
- if(vel.y > m_maxR)
- {
- //ICoord2D restPos = animWin->getRestPos();
- animWin->setFinished( TRUE );
- //win->winSetPosition(restPos.x, restPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- animWin->setVel(vel);
- return FALSE;
-}
-
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromTopFast PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromTopFast::ProcessAnimateWindowSlideFromTopFast( void )
-{
- m_maxVel.y = 60.0f; // top speed windows travel in x and y
- m_maxVel.x = 0.0f;
- m_slowDownThreshold = 40; // when windows get this close to their resting
- // positions they start to slow down
- m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker)
- m_speedUpRatio = 4.0f - m_slowDownRatio; // how fast the windows speed up
-
-}
-
-ProcessAnimateWindowSlideFromTopFast::~ProcessAnimateWindowSlideFromTopFast( void ) { }
-
-void ProcessAnimateWindowSlideFromTopFast::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x *= -1;
- vel.y *= -1;
- animWin->setVel( vel );
-
-}
-
-void ProcessAnimateWindowSlideFromTopFast::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
- ICoord2D size = {0,0};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- win->winGetSize(&size.x, &size.y);
-
- //set the initial positions for the window. In this case, off the Top of the screen
- //Int travelDistance = TheDisplay->getWidth();// / 4 * 3;
- startPos.x = curPos.x = restPos.x ;
- startPos.y = curPos.y = -size.y;//restPos.y - travelDistance;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- //Now initialize the velocities
- vel = m_maxVel;
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-Bool ProcessAnimateWindowSlideFromTopFast::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
- curPos.y += (Int)vel.y;
-
- if(curPos.y > endPos.y)
- {
- curPos.y = endPos.y;
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setFinished( TRUE );
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- if( endPos.y - curPos.y <= m_slowDownThreshold )
- {
- vel.y *= m_slowDownRatio;
- }
- if( vel.y < 1.0f)
- vel.y = 1.0f;
- animWin->setVel(vel);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromTopFast::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D startPos = animWin->getStartPos();
- Coord2D vel = animWin->getVel();
- curPos.y += (Int)vel.y;
-
- if(curPos.y < startPos.y)
- {
- curPos.y = startPos.y;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
-
- ICoord2D endPos = animWin->getEndPos();
- if( endPos.y - curPos.y <= m_slowDownThreshold )
- {
- vel.y *= m_speedUpRatio;
- }
- else
- {
- vel.y = -m_maxVel.y;
- }
- if( vel.y < -m_maxVel.y)
- vel.y = -m_maxVel.y;
- animWin->setVel(vel);
- return FALSE;
-}
-
-
-//-----------------------------------------------------------------------------
-// ProcessAnimateWindowSlideFromRightFast PUBLIC FUNCTIONS ////////////////////////
-//-----------------------------------------------------------------------------
-
-ProcessAnimateWindowSlideFromRightFast::ProcessAnimateWindowSlideFromRightFast( void )
-{
- m_maxVel.x = -80.0f; // top speed windows travel in x and y
- m_maxVel.y = 0.0f;
- m_slowDownThreshold = 60; // when windows get this close to their resting
- // positions they start to slow down
- m_slowDownRatio = 0.77f; // how fast the windows slow down (smaller slows quicker)
- m_speedUpRatio = 3.0f - m_slowDownRatio; // how fast the windows speed up
-
-}
-
-//-----------------------------------------------------------------------------
-ProcessAnimateWindowSlideFromRightFast::~ProcessAnimateWindowSlideFromRightFast( void ) { }
-
-//-----------------------------------------------------------------------------
-void ProcessAnimateWindowSlideFromRightFast::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay )
-{
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- if(animWin->getDelay() > 0)
- animWin->setStartTime(timeGetTime() + (maxDelay - animWin->getDelay()));
- Coord2D vel = animWin->getVel();
- vel.x *= -1;
- vel.y *= -1;
- animWin->setVel( vel );
- animWin->setFinished( FALSE );
- GameWindow * win = animWin->getGameWindow();
- ICoord2D pos, tempPos;
- win->winGetPosition(&pos.x, &pos.y);
- tempPos = animWin->getCurPos();
- tempPos.y = pos.y;
- animWin->setCurPos(tempPos);
-
- tempPos = animWin->getEndPos();
- tempPos.y = pos.y;
- animWin->setEndPos(tempPos);
-
- tempPos = animWin->getStartPos();
- tempPos.y = pos.y;
- animWin->setStartPos(tempPos);
-
-
-
-
-}
-
-//-----------------------------------------------------------------------------
-void ProcessAnimateWindowSlideFromRightFast::initAnimateWindow( wnd::AnimateWindow *animWin )
-{
- ICoord2D restPos = {0,0};
- ICoord2D startPos = {0,0};
- ICoord2D size = {0,0};
- ICoord2D curPos = {0,0};
- ICoord2D endPos = {0,0};
- Coord2D vel = {0.0f,0.0f};
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into initAnimateWindow as a null... bad bad bad!"));
- return;
- }
- animWin->setFinished( FALSE );
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return;
- }
- win->winGetPosition(&restPos.x, &restPos.y);
- win->winGetSize(&size.x, &size.y);
- endPos.x = restPos.x;
- endPos.y = restPos.y;
-
- //set the initial positions for the window. In this case, off the Right of the screen
- Int travelDistance = TheDisplay->getWidth() - restPos.x + size.x ;// / 4 * 3;
- startPos.x = curPos.x = restPos.x + travelDistance;
- startPos.y = curPos.y = restPos.y;
-
- //set the window's position to the new start positions.
- win->winSetPosition(startPos.x, startPos.y);
-
- //Now initialize the velocities
- vel.x = m_maxVel.x;
- vel.y = 0.0f;
-
-
- animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0);
-}
-
-
-//-----------------------------------------------------------------------------
-Bool ProcessAnimateWindowSlideFromRightFast::updateAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D endPos = animWin->getEndPos();
- Coord2D vel = animWin->getVel();
- curPos.x += (Int)vel.x;
-
- if(curPos.x < endPos.x)
- {
- curPos.x = endPos.x;
- animWin->setFinished( TRUE );
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
- if( curPos.x - endPos.x <= m_slowDownThreshold )
- {
- vel.x *= m_slowDownRatio;
- }
- if( vel.x >= -1.0f)
- vel.x = -1.0f;
- animWin->setVel(vel);
- return FALSE;
-}
-
-Bool ProcessAnimateWindowSlideFromRightFast::reverseAnimateWindow( wnd::AnimateWindow *animWin )
-{
-
- if(!animWin)
- {
- DEBUG_ASSERTCRASH( animWin, ("animWin was passed into updateAnimateWindow as a null... bad bad bad!"));
- return TRUE;
- }
-
- // if the window has finished animating into position, return
- if(animWin->isFinished())
- return TRUE;
-
- // if the window hasn't started animating...return that we're not finished
- if(timeGetTime() < animWin->getStartTime())
- return FALSE;
-
- // it's set that the window is passed in as it's current position being it's rest position
- // so save off the rest position
- GameWindow *win = animWin->getGameWindow();
- if(!win)
- {
- DEBUG_ASSERTCRASH( win, ("animWin contains a null for it's GameWindow... Whatup wit dat?"));
- return TRUE;
- }
-
- ICoord2D curPos = animWin->getCurPos();
- ICoord2D startPos = animWin->getStartPos();
- Coord2D vel = animWin->getVel();
- curPos.x += (Int)vel.x;
-
- if(curPos.x > startPos.x)
- {
- curPos.x = startPos.x;
- animWin->setFinished( TRUE );
- win->winSetPosition(curPos.x, curPos.y);
- return TRUE;
- }
- win->winSetPosition(curPos.x, curPos.y);
- animWin->setCurPos(curPos);
-
- ICoord2D endPos = animWin->getEndPos();
- if( curPos.x - endPos.x <= m_slowDownThreshold )
- {
- vel.x *= m_speedUpRatio;
- }
- else
- {
- vel.x = -m_maxVel.x;
- }
- if( vel.x > -m_maxVel.x)
- vel.x = -m_maxVel.x;
- animWin->setVel(vel);
- return FALSE;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp
deleted file mode 100644
index 1593115b371..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/WinInstanceData.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: WinInstanceData.cpp //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: WinInstanceData.cpp
-//
-// Created: Colin Day, July 2001
-//
-// Desc: Game window instance data
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/WinInstanceData.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/DisplayStringManager.h"
-#include "Common/Debug.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// WinInstanceData::WinInstanceData ===========================================
-//=============================================================================
-WinInstanceData::WinInstanceData( void )
-{
-
- // we don't allocate strings unless we need them
- m_text = nullptr;
- m_tooltip = nullptr;
- m_videoBuffer = nullptr;
- init();
-
-}
-
-// WinInstanceData::~WinInstanceData ==========================================
-//=============================================================================
-WinInstanceData::~WinInstanceData( void )
-{
-
- if( m_text )
- TheDisplayStringManager->freeDisplayString( m_text );
-
- if( m_tooltip )
- TheDisplayStringManager->freeDisplayString( m_tooltip );
-
- m_videoBuffer = nullptr; //Video Buffer needs to be clean up by the control that is in charge of the video.
-
-}
-
-// WinInstanceData::init ======================================================
-/** Set initial values for instance data if desired */
-//=============================================================================
-void WinInstanceData::init( void )
-{
- Int i;
-
- // init our draw data images/colors for the states
- for( i = 0; i < MAX_DRAW_DATA; i++ )
- {
-
- m_enabledDrawData[ i ].image = nullptr;
- m_enabledDrawData[ i ].color = WIN_COLOR_UNDEFINED;
- m_enabledDrawData[ i ].borderColor = WIN_COLOR_UNDEFINED;
-
- m_disabledDrawData[ i ].image = nullptr;
- m_disabledDrawData[ i ].color = WIN_COLOR_UNDEFINED;
- m_disabledDrawData[ i ].borderColor = WIN_COLOR_UNDEFINED;
-
- m_hiliteDrawData[ i ].image = nullptr;
- m_hiliteDrawData[ i ].color = WIN_COLOR_UNDEFINED;
- m_hiliteDrawData[ i ].borderColor = WIN_COLOR_UNDEFINED;
-
- }
-
- // initialize text colors
- m_enabledText.color = WIN_COLOR_UNDEFINED;
- m_enabledText.borderColor = WIN_COLOR_UNDEFINED;
- m_disabledText.color = WIN_COLOR_UNDEFINED;
- m_disabledText.borderColor = WIN_COLOR_UNDEFINED;
- m_hiliteText.color = WIN_COLOR_UNDEFINED;
- m_hiliteText.borderColor = WIN_COLOR_UNDEFINED;
-
- m_id = 0;
- m_state = 0;
- m_style = 0;
- m_status = WIN_STATUS_NONE;
- m_owner = nullptr;
- m_textLabelString.clear();
- m_tooltipString.clear();
- m_tooltipDelay = -1; ///< default value
- m_decoratedNameString.clear();
-
- m_imageOffset.x = 0;
- m_imageOffset.y = 0;
-
- // reset all data for the text display strings and font for window
- m_font = nullptr;
- if( m_text )
- {
-
- TheDisplayStringManager->freeDisplayString( m_text );
- m_text = nullptr;
-
- }
- if( m_tooltip )
- {
-
- TheDisplayStringManager->freeDisplayString( m_tooltip );
- m_tooltip = nullptr;
-
- }
-
- m_videoBuffer = nullptr;
-
-
-}
-
-// WinInstanceData::setTooltipText ============================================
-//=============================================================================
-void WinInstanceData::setTooltipText( UnicodeString tip )
-{
-
- // allocate a text tooltip string if needed
- if( m_tooltip == nullptr )
- m_tooltip = TheDisplayStringManager->newDisplayString();
- DEBUG_ASSERTCRASH( m_tooltip, ("no tooltip") );
-
- // set text
- m_tooltip->setText( tip );
-
-}
-
-// WinInstanceData:setText ====================================================
-/** Set the text for this window instance data */
-//=============================================================================
-void WinInstanceData::setText( UnicodeString text )
-{
-
- // allocate a text instance if needed
- if( m_text == nullptr )
- m_text = TheDisplayStringManager->newDisplayString();
- DEBUG_ASSERTCRASH( m_text, ("no text") );
-
- // set the text
- m_text->setText( text );
-
-}
-
-// WinInstanceData:setText ====================================================
-/** Set the text for this window instance data */
-//=============================================================================
-void WinInstanceData::setVideoBuffer( VideoBuffer * videoBuffer )
-{
- m_videoBuffer = videoBuffer;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp
deleted file mode 100644
index 595fd760724..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: WindowLayout.cpp /////////////////////////////////////////////////////////////////////////
-// Created: Colin Day, September 2001
-// Desc: Layouts for grouping windows together
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Shell.h"
-#include "GameClient/GameWindowManager.h"
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-WindowLayout::WindowLayout( void )
-{
- m_filenameString.set("EmptyLayout");
-
- m_windowList = nullptr;
- m_windowTail = nullptr;
- m_windowCount = 0;
-
- m_hidden = FALSE;
-
- m_init = nullptr;
- m_update = nullptr;
- m_shutdown = nullptr;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-WindowLayout::~WindowLayout( void )
-{
-
- //
- // it is the users responsibility to remove windows from the layout before destroying the
- // layout itself. This allows for maximum flexibility of the window layouts and you can
- // use them in any you see fit, as long as they are clean when they go away
- //
- DEBUG_ASSERTCRASH( m_windowList == nullptr, ("Window layout being destroyed still has window references") );
- DEBUG_ASSERTCRASH( m_windowTail == nullptr, ("Window layout being destroyed still has window references") );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Set the hidden/visible status of all the windows in this layout */
-//-------------------------------------------------------------------------------------------------
-void WindowLayout::hide( Bool hide )
-{
- GameWindow *window;
-
- // hide or unhide all windows in this layout
- for( window = m_windowList; window; window = window->winGetNextInLayout() )
- {
-
- window->winHide( hide );
-
- }
-
- // save the new visible state of the system
- m_hidden = hide;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Add window to this layout */
-//-------------------------------------------------------------------------------------------------
-void WindowLayout::addWindow( GameWindow *window )
-{
- GameWindow *win = findWindow( window );
-
- // only add window if window is not in this layout already
- if( win == nullptr )
- {
-
- DEBUG_ASSERTCRASH( window->winGetNextInLayout() == nullptr,
- ("NextInLayout should be null before adding") );
- DEBUG_ASSERTCRASH( window->winGetPrevInLayout() == nullptr,
- ("PrevInLayout should be null before adding") );
-
- window->winSetPrevInLayout( nullptr );
- window->winSetNextInLayout( m_windowList );
- if( m_windowList )
- m_windowList->winSetPrevInLayout( window );
- m_windowList = window;
-
- // set layout into window
- window->winSetLayout( this );
-
- // if no tail pointer, this is it
- if( m_windowTail == nullptr )
- m_windowTail = window;
-
- // we gots another window now
- m_windowCount++;
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Remove window from this layout */
-//-------------------------------------------------------------------------------------------------
-void WindowLayout::removeWindow( GameWindow *window )
-{
- GameWindow *win = findWindow( window );
-
- // can't remove window unless it's really part of this layout
- if( win )
- {
- GameWindow *prev, *next;
-
- prev = win->winGetPrevInLayout();
- next = win->winGetNextInLayout();
-
- if( next )
- next->winSetPrevInLayout( prev );
- if( prev )
- prev->winSetNextInLayout( next );
- else
- m_windowList = next;
-
- // set window as having no layout info
- win->winSetLayout( nullptr );
- win->winSetNextInLayout( nullptr );
- win->winSetPrevInLayout( nullptr );
-
- // if we removed the tail, set the new tail
- if( m_windowTail == win )
- m_windowTail = prev;
-
- // we lost one sir!
- m_windowCount--;
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Destroy all the windows in a layout */
-//-------------------------------------------------------------------------------------------------
-void WindowLayout::destroyWindows( void )
-{
- GameWindow *window;
-
- while( (window = getFirstWindow()) != nullptr )
- {
-
- // remove window from this layout
- removeWindow( window );
-
- // destroy window in window system
- TheWindowManager->winDestroy( window );
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create the windows using the .wnd file script and load all windows into
- * this layout */
-//-------------------------------------------------------------------------------------------------
-Bool WindowLayout::load( AsciiString filename )
-{
-
- // sanity
- if( filename.isEmpty() )
- return FALSE;
-
- //
- // when we create new windows they are always placed on the top
- // of the window stack. The load layout from script will return the
- // FIRST window loaded from the script, if we traverse from the head of
- // the window list till we see that window returned from the layout
- // loader, that will be all the root windows loaded from the .wnd file
- //
- GameWindow *target;
- WindowLayoutInfo info;
-
- target = TheWindowManager->winCreateFromScript( filename, &info );
- if( target == nullptr )
- {
-
- DEBUG_ASSERTCRASH( target, ("WindowLayout::load - Failed to load layout") );
- DEBUG_LOG(( "WindowLayout::load - Unable to load layout file '%s'", filename.str() ));
- return FALSE;
-
- }
-
- //
- // add windows loaded from .wnd file to the layout, via info.windows.
- //
- std::list::iterator it;
- for (it = info.windows.begin(); it != info.windows.end(); ++it)
- {
- // add window to this layout
- addWindow( *it );
- }
-
- /* MDC - can't do this, as modal windows will be at the head...
- //
- // add windows loaded from .wnd file to the layout, note we start at
- // target and go backwards as the layout->addWindow() puts at top
- // of list and will therefore reverse the order
- //
- GameWindow *window;
- for( window = target; window; window = window->winGetPrev() )
- {
-
- // add window to this layout
- addWindow( window );
-
- }
- */
-
- // copy filename
- m_filenameString = filename;
-
- // assign script info to the layout
- setInit( info.init );
- setUpdate( info.update );
- setShutdown( info.shutdown );
-
- return TRUE; // success
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Bring all windows in this layout forward */
-//-------------------------------------------------------------------------------------------------
-void WindowLayout::bringForward( void )
-{
-
- //
- // loop through all our windows and bring each of them to the top of
- // the window stack, note that we are getting a prev pointer because the
- // action of bringing a window to the top of the stack does detach it
- // from the window list and the layout window list ... it is then
- // re-attached at the top. Also note, to preserve the ordering of
- // the windows we pull from the tail and add to the top
- //
- GameWindow *window, *prev;
- Int countLeft = m_windowCount;
-
- for( window = m_windowTail; countLeft; window = prev )
- {
-
- DEBUG_ASSERTCRASH( window, ("Must have window: m_windowCount is off") );
- prev = window->winGetPrevInLayout();
- window->winBringToTop();
- countLeft--;
-
- }
-
-}
-
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////////////////////////
-//-------------------------------------------------------------------------------------------------
-/** Find window within this layout */
-//-------------------------------------------------------------------------------------------------
-GameWindow *WindowLayout::findWindow( GameWindow *window )
-{
- GameWindow *win;
-
- for( win = m_windowList; win; win = win->winGetNextInLayout() )
- if( win == window )
- return win;
-
- return nullptr; // window not found
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp b/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp
index 13a7f51a8d0..0f981f3e540 100644
--- a/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp
+++ b/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp
@@ -362,10 +362,10 @@ void CampaignManager::parseMissionPart( INI* ini, void *instance, void *store, c
{ "UnitNames0", INI::parseAsciiString, nullptr, offsetof( Mission, m_unitNames[0] ) },
{ "UnitNames1", INI::parseAsciiString, nullptr, offsetof( Mission, m_unitNames[1] ) },
{ "UnitNames2", INI::parseAsciiString, nullptr, offsetof( Mission, m_unitNames[2] ) },
+ { "GeneralName", INI::parseAsciiString, nullptr, offsetof( Mission, m_generalName) },
{ "LocationNameLabel",INI::parseAsciiString, nullptr, offsetof( Mission, m_locationNameLabel ) },
{ "VoiceLength", INI::parseInt , nullptr, offsetof( Mission, m_voiceLength ) },
-
{ nullptr, nullptr, nullptr, 0 }
};
AsciiString name;
diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt
index f965d280474..37281a7db18 100644
--- a/GeneralsMD/Code/GameEngine/CMakeLists.txt
+++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt
@@ -173,29 +173,29 @@ set(GAMEENGINE_SRC
Include/GameClient/GadgetTabControl.h
Include/GameClient/GadgetTextEntry.h
Include/GameClient/GameClient.h
- Include/GameClient/GameFont.h
+# Include/GameClient/GameFont.h
Include/GameClient/GameInfoWindow.h
Include/GameClient/GameText.h
- Include/GameClient/GameWindow.h
- Include/GameClient/GameWindowGlobal.h
+# Include/GameClient/GameWindow.h
+# Include/GameClient/GameWindowGlobal.h
Include/GameClient/GameWindowID.h
Include/GameClient/GameWindowManager.h
- Include/GameClient/GameWindowTransitions.h
+# Include/GameClient/GameWindowTransitions.h
Include/GameClient/GlobalLanguage.h
Include/GameClient/GraphDraw.h
Include/GameClient/GUICallbacks.h
Include/GameClient/GUICommandTranslator.h
- Include/GameClient/HeaderTemplate.h
+# Include/GameClient/HeaderTemplate.h
Include/GameClient/HintSpy.h
Include/GameClient/HotKey.h
Include/GameClient/Image.h
- Include/GameClient/IMEManager.h
+# Include/GameClient/IMEManager.h
Include/GameClient/InGameUI.h
# Include/GameClient/Keyboard.h
Include/GameClient/KeyDefs.h
Include/GameClient/LanguageFilter.h
Include/GameClient/Line2D.h
- Include/GameClient/LoadScreen.h
+# Include/GameClient/LoadScreen.h
Include/GameClient/LookAtXlat.h
# Include/GameClient/MapUtil.h
Include/GameClient/MessageBox.h
@@ -207,7 +207,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/ParabolicEase.h
# Include/GameClient/ParticleSys.h
Include/GameClient/PlaceEventTranslator.h
- Include/GameClient/ProcessAnimateWindow.h
+# Include/GameClient/ProcessAnimateWindow.h
Include/GameClient/RadiusDecal.h
Include/GameClient/RayEffect.h
Include/GameClient/SelectionInfo.h
@@ -224,10 +224,10 @@ set(GAMEENGINE_SRC
# Include/GameClient/VideoPlayer.h
# Include/GameClient/View.h
# Include/GameClient/Water.h
- Include/GameClient/WindowLayout.h
+# Include/GameClient/WindowLayout.h
# Include/GameClient/WindowVideoManager.h
Include/GameClient/WindowXlat.h
- Include/GameClient/WinInstanceData.h
+# Include/GameClient/WinInstanceData.h
Include/GameLogic/AI.h
Include/GameLogic/AIDock.h
Include/GameLogic/AIGuard.h
@@ -722,12 +722,12 @@ set(GAMEENGINE_SRC
Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
- Source/GameClient/GUI/GameFont.cpp
- Source/GameClient/GUI/GameWindow.cpp
- Source/GameClient/GUI/GameWindowGlobal.cpp
+# Source/GameClient/GUI/GameFont.cpp
+# Source/GameClient/GUI/GameWindow.cpp
+# Source/GameClient/GUI/GameWindowGlobal.cpp
Source/GameClient/GUI/GameWindowManager.cpp
Source/GameClient/GUI/GameWindowManagerScript.cpp
- Source/GameClient/GUI/GameWindowTransitions.cpp
+# Source/GameClient/GUI/GameWindowTransitions.cpp
Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
@@ -780,15 +780,15 @@ set(GAMEENGINE_SRC
Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp
Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
- Source/GameClient/GUI/HeaderTemplate.cpp
- Source/GameClient/GUI/IMEManager.cpp
- Source/GameClient/GUI/LoadScreen.cpp
- Source/GameClient/GUI/ProcessAnimateWindow.cpp
+# Source/GameClient/GUI/HeaderTemplate.cpp
+# Source/GameClient/GUI/IMEManager.cpp
+# Source/GameClient/GUI/LoadScreen.cpp
+# Source/GameClient/GUI/ProcessAnimateWindow.cpp
Source/GameClient/GUI/Shell/Shell.cpp
Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
- Source/GameClient/GUI/WindowLayout.cpp
+# Source/GameClient/GUI/WindowLayout.cpp
# Source/GameClient/GUI/WindowVideoManager.cpp
- Source/GameClient/GUI/WinInstanceData.cpp
+# Source/GameClient/GUI/WinInstanceData.cpp
Source/GameClient/InGameUI.cpp
# Source/GameClient/Input/Keyboard.cpp
# Source/GameClient/Input/Mouse.cpp
diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py
index 6d459d744e8..7180244f56f 100644
--- a/scripts/cpp/unify_move_files.py
+++ b/scripts/cpp/unify_move_files.py
@@ -357,6 +357,27 @@ def main():
#unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp", Game.CORE, "GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp")
#unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp", Game.CORE, "GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameFont.h", Game.CORE, "GameEngine/Include/GameClient/GameFont.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameWindow.h", Game.CORE, "GameEngine/Include/GameClient/GameWindow.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameWindowGlobal.h", Game.CORE, "GameEngine/Include/GameClient/GameWindowGlobal.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameWindowTransitions.h", Game.CORE, "GameEngine/Include/GameClient/GameWindowTransitions.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/HeaderTemplate.h", Game.CORE, "GameEngine/Include/GameClient/HeaderTemplate.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/IMEManager.h", Game.CORE, "GameEngine/Include/GameClient/IMEManager.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/LoadScreen.h", Game.CORE, "GameEngine/Include/GameClient/LoadScreen.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ProcessAnimateWindow.h", Game.CORE, "GameEngine/Include/GameClient/ProcessAnimateWindow.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/WindowLayout.h", Game.CORE, "GameEngine/Include/GameClient/WindowLayout.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/WinInstanceData.h", Game.CORE, "GameEngine/Include/GameClient/WinInstanceData.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GameFont.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GameFont.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GameWindow.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GameWindow.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/IMEManager.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/IMEManager.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/LoadScreen.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/LoadScreen.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/WindowLayout.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/WindowLayout.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/WinInstanceData.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/WinInstanceData.cpp")
+
return