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; ///