diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt index c2bd873cce6..4de35b21a25 100644 --- a/Core/GameEngine/CMakeLists.txt +++ b/Core/GameEngine/CMakeLists.txt @@ -82,6 +82,7 @@ set(GAMEENGINE_SRC # Include/Common/MultiplayerSettings.h # Include/Common/NameKeyGenerator.h Include/Common/ObjectStatusTypes.h + Include/Common/OptionPreferences.h # Include/Common/OSDisplay.h # Include/Common/Overridable.h # Include/Common/Override.h @@ -144,28 +145,28 @@ set(GAMEENGINE_SRC # Include/GameClient/AnimateWindowManager.h # Include/GameClient/CampaignManager.h Include/GameClient/ChallengeGenerals.h -# Include/GameClient/ClientInstance.h + Include/GameClient/ClientInstance.h Include/GameClient/ClientRandomValue.h -# Include/GameClient/Color.h + Include/GameClient/Color.h # Include/GameClient/CommandXlat.h # Include/GameClient/ControlBar.h # Include/GameClient/ControlBarResizer.h # Include/GameClient/ControlBarScheme.h -# Include/GameClient/Credits.h + Include/GameClient/Credits.h # Include/GameClient/DebugDisplay.h # Include/GameClient/Diplomacy.h # Include/GameClient/DisconnectMenu.h # Include/GameClient/Display.h -# Include/GameClient/DisplayString.h -# Include/GameClient/DisplayStringManager.h + Include/GameClient/DisplayString.h + Include/GameClient/DisplayStringManager.h # Include/GameClient/Drawable.h # Include/GameClient/DrawableInfo.h -# Include/GameClient/DrawGroupInfo.h + Include/GameClient/DrawGroupInfo.h # Include/GameClient/EstablishConnectionsMenu.h # Include/GameClient/Eva.h # Include/GameClient/ExtendedMessageBox.h # Include/GameClient/FontDesc.h -# Include/GameClient/FXList.h + Include/GameClient/FXList.h # Include/GameClient/Gadget.h # Include/GameClient/GadgetCheckBox.h # Include/GameClient/GadgetComboBox.h @@ -178,29 +179,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/GameText.h + Include/GameClient/GameWindow.h + Include/GameClient/GameWindowGlobal.h # Include/GameClient/GameWindowID.h # Include/GameClient/GameWindowManager.h -# Include/GameClient/GameWindowTransitions.h -# Include/GameClient/GlobalLanguage.h -# Include/GameClient/GraphDraw.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/Keyboard.h # Include/GameClient/KeyDefs.h -# Include/GameClient/LanguageFilter.h -# Include/GameClient/Line2D.h -# Include/GameClient/LoadScreen.h + Include/GameClient/LanguageFilter.h + Include/GameClient/Line2D.h + Include/GameClient/LoadScreen.h # Include/GameClient/LookAtXlat.h Include/GameClient/MapUtil.h # Include/GameClient/MessageBox.h @@ -208,14 +209,14 @@ set(GAMEENGINE_SRC # Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h # Include/GameClient/Module/BeaconClientUpdate.h # Include/GameClient/Module/SwayClientUpdate.h -# Include/GameClient/Mouse.h + Include/GameClient/Mouse.h Include/GameClient/ParabolicEase.h Include/GameClient/ParticleSys.h # Include/GameClient/PlaceEventTranslator.h -# Include/GameClient/ProcessAnimateWindow.h -# Include/GameClient/RadiusDecal.h + Include/GameClient/ProcessAnimateWindow.h + Include/GameClient/RadiusDecal.h # Include/GameClient/RayEffect.h -# Include/GameClient/SelectionInfo.h + Include/GameClient/SelectionInfo.h # Include/GameClient/SelectionXlat.h # Include/GameClient/Shadow.h # Include/GameClient/Shell.h @@ -223,16 +224,16 @@ set(GAMEENGINE_SRC # Include/GameClient/ShellMenuScheme.h Include/GameClient/Smudge.h Include/GameClient/Snow.h -# Include/GameClient/Statistics.h + Include/GameClient/Statistics.h Include/GameClient/TerrainRoads.h Include/GameClient/TerrainVisual.h 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 @@ -621,6 +622,7 @@ set(GAMEENGINE_SRC # Source/Common/MiniLog.cpp # Source/Common/MultiplayerSettings.cpp # Source/Common/NameKeyGenerator.cpp + Source/Common/OptionPreferences.cpp # Source/Common/PartitionSolver.cpp # Source/Common/PerfTimer.cpp Source/Common/RandomValue.cpp @@ -696,24 +698,24 @@ set(GAMEENGINE_SRC Source/Common/UserPreferences.cpp # Source/Common/version.cpp Source/Common/WorkerProcess.cpp -# Source/GameClient/ClientInstance.cpp -# Source/GameClient/Color.cpp -# Source/GameClient/Credits.cpp + Source/GameClient/ClientInstance.cpp + Source/GameClient/Color.cpp + Source/GameClient/Credits.cpp # Source/GameClient/Display.cpp -# Source/GameClient/DisplayString.cpp -# Source/GameClient/DisplayStringManager.cpp + Source/GameClient/DisplayString.cpp + Source/GameClient/DisplayStringManager.cpp # Source/GameClient/Drawable.cpp # Source/GameClient/Drawable/Update/AnimatedParticleSysBoneClientUpdate.cpp # Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp # Source/GameClient/Drawable/Update/SwayClientUpdate.cpp -# Source/GameClient/DrawGroupInfo.cpp + Source/GameClient/DrawGroupInfo.cpp # Source/GameClient/Eva.cpp -# Source/GameClient/FXList.cpp + Source/GameClient/FXList.cpp # Source/GameClient/GameClient.cpp # Source/GameClient/GameClientDispatch.cpp -# Source/GameClient/GameText.cpp -# Source/GameClient/GlobalLanguage.cpp -# Source/GameClient/GraphDraw.cpp + Source/GameClient/GameText.cpp + Source/GameClient/GlobalLanguage.cpp + Source/GameClient/GraphDraw.cpp # Source/GameClient/GUI/AnimateWindowManager.cpp Source/GameClient/GUI/ChallengeGenerals.cpp # Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -741,12 +743,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 @@ -799,20 +801,20 @@ 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 -# Source/GameClient/LanguageFilter.cpp -# Source/GameClient/Line2D.cpp + Source/GameClient/Input/Keyboard.cpp + Source/GameClient/Input/Mouse.cpp + Source/GameClient/LanguageFilter.cpp + Source/GameClient/Line2D.cpp Source/GameClient/MapUtil.cpp # Source/GameClient/MessageStream/CommandXlat.cpp # Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -824,10 +826,10 @@ set(GAMEENGINE_SRC # Source/GameClient/MessageStream/SelectionXlat.cpp # Source/GameClient/MessageStream/WindowXlat.cpp Source/GameClient/ParabolicEase.cpp -# Source/GameClient/RadiusDecal.cpp -# Source/GameClient/SelectionInfo.cpp + Source/GameClient/RadiusDecal.cpp + Source/GameClient/SelectionInfo.cpp Source/GameClient/Snow.cpp -# Source/GameClient/Statistics.cpp + Source/GameClient/Statistics.cpp # Source/GameClient/System/Anim2D.cpp # Source/GameClient/System/CampaignManager.cpp Source/GameClient/System/Debug/AudioDebugDisplay.cpp diff --git a/Core/GameEngine/Include/Common/OptionPreferences.h b/Core/GameEngine/Include/Common/OptionPreferences.h new file mode 100644 index 00000000000..9b007449d98 --- /dev/null +++ b/Core/GameEngine/Include/Common/OptionPreferences.h @@ -0,0 +1,116 @@ +/* +** Command & Conquer Generals Zero Hour(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: OptionPreferences.h +// Author: Matthew D. Campbell, April 2002 +// Description: Saving/Loading of option preferences +/////////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "Common/UserPreferences.h" + +typedef UnsignedInt CursorCaptureMode; +typedef UnsignedInt ScreenEdgeScrollMode; + +//----------------------------------------------------------------------------- +// OptionsPreferences options menu class +//----------------------------------------------------------------------------- +class OptionPreferences : public UserPreferences +{ +public: + OptionPreferences(); + virtual ~OptionPreferences(); + + Bool loadFromIniFile(); + + UnsignedInt getLANIPAddress(void); + UnsignedInt getOnlineIPAddress(void); + void setLANIPAddress(AsciiString IP); + void setOnlineIPAddress(AsciiString IP); + void setLANIPAddress(UnsignedInt IP); + void setOnlineIPAddress(UnsignedInt IP); + Bool getArchiveReplaysEnabled() const; + Bool getAlternateMouseModeEnabled(void); + Bool getRetaliationModeEnabled(); + Bool getDoubleClickAttackMoveEnabled(void); + Real getScrollFactor(void); + Bool getDrawScrollAnchor(void); + Bool getMoveScrollAnchor(void); + Bool getCursorCaptureEnabledInWindowedGame() const; + Bool getCursorCaptureEnabledInWindowedMenu() const; + Bool getCursorCaptureEnabledInFullscreenGame() const; + Bool getCursorCaptureEnabledInFullscreenMenu() const; + CursorCaptureMode getCursorCaptureMode() const; + Bool getScreenEdgeScrollEnabledInWindowedApp() const; + Bool getScreenEdgeScrollEnabledInFullscreenApp() const; + ScreenEdgeScrollMode getScreenEdgeScrollMode() const; + Bool getSendDelay(void); + Int getFirewallBehavior(void); + Short getFirewallPortAllocationDelta(void); + UnsignedShort getFirewallPortOverride(void); + Bool getFirewallNeedToRefresh(void); + Bool usesSystemMapDir(void); + AsciiString getPreferred3DProvider(void); + AsciiString getSpeakerType(void); + Real getSoundVolume(void); + Real get3DSoundVolume(void); + Real getSpeechVolume(void); + Real getMusicVolume(void); + Real getMoneyTransactionVolume(void) const; + Bool saveCameraInReplays(void); + Bool useCameraInReplays(void); + Bool getPlayerObserverEnabled() const; + Int getStaticGameDetail(void); + Int getIdealStaticGameDetail(void); + Real getGammaValue(void); + Int getTextureReduction(void); + void getResolution(Int *xres, Int *yres); + Bool get3DShadowsEnabled(void); + Bool get2DShadowsEnabled(void); + Bool getCloudShadowsEnabled(void); + Bool getLightmapEnabled(void); + Bool getSmoothWaterEnabled(void); + Bool getTreesEnabled(void); + Bool getExtraAnimationsDisabled(void); + Bool getUseHeatEffects(void); + Bool getDynamicLODEnabled(void); + Bool getFPSLimitEnabled(void); + Bool getBuildingOcclusionEnabled(void); + Int getParticleCap(void); + + Int getCampaignDifficulty(void); + void setCampaignDifficulty(Int diff); + + Int getNetworkLatencyFontSize(void); + Int getRenderFpsFontSize(void); + Int getSystemTimeFontSize(void); + Int getGameTimeFontSize(void); + Int getPlayerInfoListFontSize(void); + + Real getResolutionFontAdjustment(void); + + Bool getShowMoneyPerMinute(void) const; +}; diff --git a/Core/GameEngine/Include/Common/Radar.h b/Core/GameEngine/Include/Common/Radar.h index ce9ed8042d4..50e3e8e4ee0 100644 --- a/Core/GameEngine/Include/Common/Radar.h +++ b/Core/GameEngine/Include/Common/Radar.h @@ -106,7 +106,6 @@ class RadarObject : public MemoryPoolObject, const RadarObject *friend_getNext( void ) const { return m_next; } Bool isTemporarilyHidden() const; - static Bool isTemporarilyHidden(const Object* obj); protected: @@ -260,12 +259,6 @@ class Radar : public Snapshot, * in exactly the same priority as the regular * object list for all other objects */ - // TheSuperHackers @bugfix xezon 22/11/2025 Now stores local heroes in a separate list, - // because they are treated with special icons but should otherwise work like all other - // radar objects. In retail version, the cached hero object data was able to dangle - // for a few frames and cause undefined behavior. - RadarObject *m_localHeroObjectList; ///< list of hero objects for the local player - Real m_terrainAverageZ; ///< average Z for terrain samples Real m_waterAverageZ; ///< average Z for water samples diff --git a/Core/GameEngine/Include/Common/UserPreferences.h b/Core/GameEngine/Include/Common/UserPreferences.h index e3ec9b450ec..64f969f168d 100644 --- a/Core/GameEngine/Include/Common/UserPreferences.h +++ b/Core/GameEngine/Include/Common/UserPreferences.h @@ -36,8 +36,6 @@ #include "Common/STLTypedefs.h" class Money; -typedef UnsignedInt CursorCaptureMode; -typedef UnsignedInt ScreenEdgeScrollMode; //----------------------------------------------------------------------------- // PUBLIC TYPES /////////////////////////////////////////////////////////////// @@ -72,87 +70,6 @@ class UserPreferences : public PreferenceMap AsciiString m_filename; }; -//----------------------------------------------------------------------------- -// OptionsPreferences options menu class -//----------------------------------------------------------------------------- -class OptionPreferences : public UserPreferences -{ -public: - OptionPreferences( ); - virtual ~OptionPreferences(); - - Bool loadFromIniFile(); - - UnsignedInt getLANIPAddress(void); // convenience function - UnsignedInt getOnlineIPAddress(void); // convenience function - void setLANIPAddress(AsciiString IP); // convenience function - void setOnlineIPAddress(AsciiString IP); // convenience function - void setLANIPAddress(UnsignedInt IP); // convenience function - void setOnlineIPAddress(UnsignedInt IP); // convenience function - Bool getArchiveReplaysEnabled() const; // convenience function - Bool getAlternateMouseModeEnabled(void); // convenience function - Bool getRetaliationModeEnabled(); // convenience function - Bool getDoubleClickAttackMoveEnabled(void); // convenience function - Real getScrollFactor(void); // convenience function - Bool getDrawScrollAnchor(void); - Bool getMoveScrollAnchor(void); - Bool getCursorCaptureEnabledInWindowedGame() const; - Bool getCursorCaptureEnabledInWindowedMenu() const; - Bool getCursorCaptureEnabledInFullscreenGame() const; - Bool getCursorCaptureEnabledInFullscreenMenu() const; - CursorCaptureMode getCursorCaptureMode() const; - Bool getScreenEdgeScrollEnabledInWindowedApp() const; - Bool getScreenEdgeScrollEnabledInFullscreenApp() const; - ScreenEdgeScrollMode getScreenEdgeScrollMode() const; - Bool getSendDelay(void); // convenience function - Int getFirewallBehavior(void); // convenience function - Short getFirewallPortAllocationDelta(void); // convenience function - UnsignedShort getFirewallPortOverride(void); // convenience function - Bool getFirewallNeedToRefresh(void); // convenience function - Bool usesSystemMapDir(void); // convenience function - AsciiString getPreferred3DProvider(void); // convenience function - AsciiString getSpeakerType(void); // convenience function - Real getSoundVolume(void); // convenience function - Real get3DSoundVolume(void); // convenience function - Real getSpeechVolume(void); // convenience function - Real getMusicVolume(void); // convenience function - Real getMoneyTransactionVolume(void) const; - Bool saveCameraInReplays(void); - Bool useCameraInReplays(void); - Bool getPlayerObserverEnabled() const; - Int getStaticGameDetail(void); // detail level selected by the user. - Int getIdealStaticGameDetail(void); // detail level detected for user. - Real getGammaValue(void); - Int getTextureReduction(void); - void getResolution(Int *xres, Int *yres); - Bool get3DShadowsEnabled(void); - Bool get2DShadowsEnabled(void); - Bool getCloudShadowsEnabled(void); - Bool getLightmapEnabled(void); - Bool getSmoothWaterEnabled(void); - Bool getTreesEnabled(void); - Bool getExtraAnimationsDisabled(void); - Bool getUseHeatEffects(void); - Bool getDynamicLODEnabled(void); - Bool getFPSLimitEnabled(void); - Bool getNoDynamicLODEnabled(void); - Bool getBuildingOcclusionEnabled(void); - Int getParticleCap(void); - - Int getCampaignDifficulty(void); - void setCampaignDifficulty( Int diff ); - - Int getNetworkLatencyFontSize(void); - Int getRenderFpsFontSize(void); - Int getSystemTimeFontSize(void); - Int getGameTimeFontSize(void); - Int getPlayerInfoListFontSize(void); - - Real getResolutionFontAdjustment(void); - - Bool getShowMoneyPerMinute(void) const; -}; - //----------------------------------------------------------------------------- // LANPreferences class //----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/ClientInstance.h b/Core/GameEngine/Include/GameClient/ClientInstance.h similarity index 100% rename from Generals/Code/GameEngine/Include/GameClient/ClientInstance.h rename to Core/GameEngine/Include/GameClient/ClientInstance.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Color.h b/Core/GameEngine/Include/GameClient/Color.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Color.h rename to Core/GameEngine/Include/GameClient/Color.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Credits.h b/Core/GameEngine/Include/GameClient/Credits.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Credits.h rename to Core/GameEngine/Include/GameClient/Credits.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/DisplayString.h b/Core/GameEngine/Include/GameClient/DisplayString.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/DisplayString.h rename to Core/GameEngine/Include/GameClient/DisplayString.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/DisplayStringManager.h b/Core/GameEngine/Include/GameClient/DisplayStringManager.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/DisplayStringManager.h rename to Core/GameEngine/Include/GameClient/DisplayStringManager.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/DrawGroupInfo.h b/Core/GameEngine/Include/GameClient/DrawGroupInfo.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/DrawGroupInfo.h rename to Core/GameEngine/Include/GameClient/DrawGroupInfo.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h b/Core/GameEngine/Include/GameClient/FXList.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h rename to Core/GameEngine/Include/GameClient/FXList.h 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/GameText.h b/Core/GameEngine/Include/GameClient/GameText.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h rename to Core/GameEngine/Include/GameClient/GameText.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/GlobalLanguage.h b/Core/GameEngine/Include/GameClient/GlobalLanguage.h similarity index 88% rename from GeneralsMD/Code/GameEngine/Include/GameClient/GlobalLanguage.h rename to Core/GameEngine/Include/GameClient/GlobalLanguage.h index d69b73eda4d..cbb44d5f0c1 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/GlobalLanguage.h +++ b/Core/GameEngine/Include/GameClient/GlobalLanguage.h @@ -77,6 +77,8 @@ class GlobalLanguage : public SubsystemInterface ResolutionFontSizeMethod_Default = ResolutionFontSizeMethod_ClassicNoCeiling, }; + typedef std::list StringList; // Used for our font file names that we want to load + public: GlobalLanguage(); @@ -84,7 +86,19 @@ class GlobalLanguage : public SubsystemInterface void init(); void reset(); - void update() { } + void update() {} + + Real getResolutionFontSizeAdjustment() const; + Int adjustFontSize(Int theFontSize); // Adjusts font size for resolution. jba. + + void parseCustomDefinition(); + + // Get current resolution font size scale for the given method and scaler, based on the base game resolution of 800 x 600. + // Defaults to a scaler of 1 for a uniform resolution scale. + static Real getResolutionFontSizeScale(ResolutionFontSizeMethod method, Real scaler = 1.0f); + + static void parseFontFileName(INI *ini, void *instance, void *store, const void *userData); + static void parseFontDesc(INI *ini, void *instance, void *store, const void *userData); AsciiString m_unicodeFontName; AsciiString m_unicodeFontFileName; @@ -111,19 +125,9 @@ class GlobalLanguage : public SubsystemInterface Real m_resolutionFontSizeAdjustment; Real m_userResolutionFontSizeAdjustment; ResolutionFontSizeMethod m_resolutionFontSizeMethod; - - float getResolutionFontSizeAdjustment() const; - Int adjustFontSize(Int theFontSize); // Adjusts font size for resolution. jba. - - void parseCustomDefinition(); - - typedef std::list StringList; // Used for our font file names that we want to load - typedef StringList::iterator StringListIt; - - StringList m_localFonts; // List of the font filenames that are in our local directory - static void parseFontFileName( INI *ini, void *instance, void *store, const void* userData ); - static void parseFontDesc(INI *ini, void *instance, void *store, const void* userData); + StringList m_localFonts; // List of the font filenames that are in our local directory }; + //----------------------------------------------------------------------------- // INLINING /////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GraphDraw.h b/Core/GameEngine/Include/GameClient/GraphDraw.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/GraphDraw.h rename to Core/GameEngine/Include/GameClient/GraphDraw.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/Keyboard.h b/Core/GameEngine/Include/GameClient/Keyboard.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Keyboard.h rename to Core/GameEngine/Include/GameClient/Keyboard.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h b/Core/GameEngine/Include/GameClient/LanguageFilter.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h rename to Core/GameEngine/Include/GameClient/LanguageFilter.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Line2D.h b/Core/GameEngine/Include/GameClient/Line2D.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Line2D.h rename to Core/GameEngine/Include/GameClient/Line2D.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/Mouse.h b/Core/GameEngine/Include/GameClient/Mouse.h similarity index 99% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Mouse.h rename to Core/GameEngine/Include/GameClient/Mouse.h index 73e6512381c..ce9edc90e75 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Mouse.h +++ b/Core/GameEngine/Include/GameClient/Mouse.h @@ -323,7 +323,6 @@ class Mouse : public SubsystemInterface Bool isClick(const ICoord2D *anchor, const ICoord2D *dest, UnsignedInt previousMouseClick, UnsignedInt currentMouseClick); - AsciiString m_tooltipFontName; ///< tooltip font Int m_tooltipFontSize; ///< tooltip font Bool m_tooltipFontIsBold; ///< tooltip font 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/RadiusDecal.h b/Core/GameEngine/Include/GameClient/RadiusDecal.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/RadiusDecal.h rename to Core/GameEngine/Include/GameClient/RadiusDecal.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionInfo.h b/Core/GameEngine/Include/GameClient/SelectionInfo.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/SelectionInfo.h rename to Core/GameEngine/Include/GameClient/SelectionInfo.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Statistics.h b/Core/GameEngine/Include/GameClient/Statistics.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Statistics.h rename to Core/GameEngine/Include/GameClient/Statistics.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/Core/GameEngine/Include/GameNetwork/NetworkDefs.h b/Core/GameEngine/Include/GameNetwork/NetworkDefs.h index 450bee52104..6cb01381c5c 100644 --- a/Core/GameEngine/Include/GameNetwork/NetworkDefs.h +++ b/Core/GameEngine/Include/GameNetwork/NetworkDefs.h @@ -41,11 +41,10 @@ extern Int MIN_RUNAHEAD; extern Int FRAME_DATA_LENGTH; extern Int FRAMES_TO_KEEP; -// This is the connection numbering: 1-8 are for players, 9 is a broadcast con. +// This is the connection numbering: 1-8 are for players enum ConnectionNumbers CPP_11(: Int) { MAX_PLAYER = 7, // The index of the highest possible player number. This is 0 based, so the most players allowed in a game is MAX_PLAYER+1. - NUM_CONNECTIONS }; static constexpr const Int MAX_SLOTS = MAX_PLAYER+1; diff --git a/Core/GameEngine/Source/Common/Audio/GameAudio.cpp b/Core/GameEngine/Source/Common/Audio/GameAudio.cpp index ea9a1956eed..c2ed8b344e1 100644 --- a/Core/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/Core/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -59,7 +59,7 @@ #include "Common/OSDisplay.h" #include "Common/Player.h" #include "Common/PlayerList.h" -#include "Common/UserPreferences.h" +#include "Common/OptionPreferences.h" #include "GameClient/ControlBar.h" #include "GameClient/Drawable.h" diff --git a/Core/GameEngine/Source/Common/INI/INI.cpp b/Core/GameEngine/Source/Common/INI/INI.cpp index d1be02f84d9..ddf32efa668 100644 --- a/Core/GameEngine/Source/Common/INI/INI.cpp +++ b/Core/GameEngine/Source/Common/INI/INI.cpp @@ -457,7 +457,7 @@ UnsignedInt INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer, } else { - DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown block '%s'", + DEBUG_CRASH( ("[LINE: %d - FILE: '%s'] Unknown block '%s'", getLineNum(), getFilename().str(), token ) ); throw INI_UNKNOWN_TOKEN; } @@ -543,7 +543,7 @@ void INI::readLine( void ) // check for at the max if ( p == m_buffer+INI_MAX_CHARS_PER_LINE ) { - DEBUG_ASSERTCRASH( 0, ("Buffer too small (%d) and was truncated, increase INI_MAX_CHARS_PER_LINE", INI_MAX_CHARS_PER_LINE) ); + DEBUG_CRASH( ("Buffer too small (%d) and was truncated, increase INI_MAX_CHARS_PER_LINE", INI_MAX_CHARS_PER_LINE) ); } } @@ -1639,7 +1639,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if( what == nullptr ) { - DEBUG_ASSERTCRASH( 0, ("INI::initFromINI - Invalid parameters supplied!") ); + DEBUG_CRASH( ("INI::initFromINI - Invalid parameters supplied!") ); throw INI_INVALID_PARAMS; } @@ -1693,7 +1693,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if (!found) { - DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'", + DEBUG_CRASH( ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'", INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) ); } @@ -1706,7 +1706,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList { done = TRUE; - DEBUG_ASSERTCRASH( 0, ("Error parsing block '%s', in INI file '%s'. Missing '%s' token", + DEBUG_CRASH( ("Error parsing block '%s', in INI file '%s'. Missing '%s' token", m_curBlockStart, getFilename().str(), m_blockEndToken) ); throw INI_MISSING_END_TOKEN; @@ -1782,7 +1782,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if( nameList == nullptr || nameList[ 0 ] == nullptr ) { - DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanIndexList, invalid name list") ); + DEBUG_CRASH( ("INTERNAL ERROR! scanIndexList, invalid name list") ); throw INI_INVALID_NAME_LIST; } @@ -1807,7 +1807,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList { if( lookupList == nullptr || lookupList[ 0 ].name == nullptr ) { - DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanLookupList, invalid name list") ); + DEBUG_CRASH( ("INTERNAL ERROR! scanLookupList, invalid name list") ); throw INI_INVALID_NAME_LIST; } diff --git a/Core/GameEngine/Source/Common/OptionPreferences.cpp b/Core/GameEngine/Source/Common/OptionPreferences.cpp new file mode 100644 index 00000000000..7db1b7f53d3 --- /dev/null +++ b/Core/GameEngine/Source/Common/OptionPreferences.cpp @@ -0,0 +1,839 @@ +/* +** Command & Conquer Generals Zero Hour(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: OptionPreferences.cpp +// Author: Matthew D. Campbell, April 2002 +// Description: Saving/Loading of option preferences +/////////////////////////////////////////////////////////////////////////////////////// + +// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// +#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine + +#include "Common/AudioSettings.h" +#include "Common/GameAudio.h" +#include "Common/GameLOD.h" +#include "Common/GlobalData.h" +#include "Common/OptionPreferences.h" + +#include "GameClient/ClientInstance.h" +#include "GameClient/LookAtXlat.h" +#include "GameClient/Mouse.h" + +#include "GameLogic/ScriptEngine.h" + +#include "GameNetwork/IPEnumeration.h" + +OptionPreferences::OptionPreferences() +{ + loadFromIniFile(); +} + +OptionPreferences::~OptionPreferences() +{ +} + +Bool OptionPreferences::loadFromIniFile() +{ + if (rts::ClientInstance::getInstanceId() > 1u) + { + AsciiString fname; + fname.format("Options_Instance%.2u.ini", rts::ClientInstance::getInstanceId()); + return load(fname); + } + + return load("Options.ini"); +} + +Int OptionPreferences::getCampaignDifficulty(void) +{ + OptionPreferences::const_iterator it = find("CampaignDifficulty"); + if (it == end()) + return TheScriptEngine->getGlobalDifficulty(); + + Int factor = atoi(it->second.str()); + if (factor < DIFFICULTY_EASY) + factor = DIFFICULTY_EASY; + if (factor > DIFFICULTY_HARD) + factor = DIFFICULTY_HARD; + + return factor; +} + +void OptionPreferences::setCampaignDifficulty(Int diff) +{ + AsciiString prefString; + prefString.format("%d", diff); + (*this)["CampaignDifficulty"] = prefString; +} + +UnsignedInt OptionPreferences::getLANIPAddress(void) +{ + AsciiString selectedIP = (*this)["IPAddress"]; + IPEnumeration IPs; + EnumeratedIP *IPlist = IPs.getAddresses(); + while (IPlist) + { + if (selectedIP.compareNoCase(IPlist->getIPstring()) == 0) + { + return IPlist->getIP(); + } + IPlist = IPlist->getNext(); + } + return TheGlobalData->m_defaultIP; +} + +void OptionPreferences::setLANIPAddress(AsciiString IP) +{ + (*this)["IPAddress"] = IP; +} + +void OptionPreferences::setLANIPAddress(UnsignedInt IP) +{ + AsciiString tmp; + tmp.format("%d.%d.%d.%d", PRINTF_IP_AS_4_INTS(IP)); + (*this)["IPAddress"] = tmp; +} + +UnsignedInt OptionPreferences::getOnlineIPAddress(void) +{ + AsciiString selectedIP = (*this)["GameSpyIPAddress"]; + IPEnumeration IPs; + EnumeratedIP *IPlist = IPs.getAddresses(); + while (IPlist) + { + if (selectedIP.compareNoCase(IPlist->getIPstring()) == 0) + { + return IPlist->getIP(); + } + IPlist = IPlist->getNext(); + } + return TheGlobalData->m_defaultIP; +} + +void OptionPreferences::setOnlineIPAddress(AsciiString IP) +{ + (*this)["GameSpyIPAddress"] = IP; +} + +void OptionPreferences::setOnlineIPAddress(UnsignedInt IP) +{ + AsciiString tmp; + tmp.format("%d.%d.%d.%d", PRINTF_IP_AS_4_INTS(IP)); + (*this)["GameSpyIPAddress"] = tmp; +} + +Bool OptionPreferences::getArchiveReplaysEnabled() const +{ + OptionPreferences::const_iterator it = find("ArchiveReplays"); + if (it == end()) + return FALSE; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getAlternateMouseModeEnabled(void) +{ + OptionPreferences::const_iterator it = find("UseAlternateMouse"); + if (it == end()) + return TheGlobalData->m_useAlternateMouse; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getRetaliationModeEnabled(void) +{ + OptionPreferences::const_iterator it = find("Retaliation"); + if (it == end()) + return TheGlobalData->m_clientRetaliationModeEnabled; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getDoubleClickAttackMoveEnabled(void) +{ + OptionPreferences::const_iterator it = find("UseDoubleClickAttackMove"); + if( it == end() ) + return TheGlobalData->m_doubleClickAttackMove; + + if( stricmp( it->second.str(), "yes" ) == 0 ) + return TRUE; + + return FALSE; +} + +Real OptionPreferences::getScrollFactor(void) +{ + OptionPreferences::const_iterator it = find("ScrollFactor"); + if (it == end()) + return TheGlobalData->m_keyboardDefaultScrollFactor; + + Int factor = atoi(it->second.str()); + + // TheSuperHackers @tweak xezon 11/07/2025 + // No longer caps the upper limit to 100, because the options setting can go beyond that. + // No longer caps the lower limit to 0, because that would mean standstill. + if (factor < 1) + factor = 1; + + return factor/100.0f; +} + +Bool OptionPreferences::getDrawScrollAnchor(void) +{ + OptionPreferences::const_iterator it = find("DrawScrollAnchor"); + // TheSuperHackers @info this default is based on the same variable within InGameUi.ini + if (it == end()) + return FALSE; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getMoveScrollAnchor(void) +{ + OptionPreferences::const_iterator it = find("MoveScrollAnchor"); + // TheSuperHackers @info this default is based on the same variable within InGameUi.ini + if (it == end()) + return TRUE; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getCursorCaptureEnabledInWindowedGame() const +{ + OptionPreferences::const_iterator it = find("CursorCaptureEnabledInWindowedGame"); + if (it == end()) + return (CursorCaptureMode_Default & CursorCaptureMode_EnabledInWindowedGame) != 0; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +Bool OptionPreferences::getCursorCaptureEnabledInWindowedMenu() const +{ + OptionPreferences::const_iterator it = find("CursorCaptureEnabledInWindowedMenu"); + if (it == end()) + return (CursorCaptureMode_Default & CursorCaptureMode_EnabledInWindowedMenu) != 0; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +Bool OptionPreferences::getCursorCaptureEnabledInFullscreenGame() const +{ + OptionPreferences::const_iterator it = find("CursorCaptureEnabledInFullscreenGame"); + if (it == end()) + return (CursorCaptureMode_Default & CursorCaptureMode_EnabledInFullscreenGame) != 0; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +Bool OptionPreferences::getCursorCaptureEnabledInFullscreenMenu() const +{ + OptionPreferences::const_iterator it = find("CursorCaptureEnabledInFullscreenMenu"); + if (it == end()) + return (CursorCaptureMode_Default & CursorCaptureMode_EnabledInFullscreenMenu) != 0; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +CursorCaptureMode OptionPreferences::getCursorCaptureMode() const +{ + CursorCaptureMode mode = 0; + mode |= getCursorCaptureEnabledInWindowedGame() ? CursorCaptureMode_EnabledInWindowedGame : 0; + mode |= getCursorCaptureEnabledInWindowedMenu() ? CursorCaptureMode_EnabledInWindowedMenu : 0; + mode |= getCursorCaptureEnabledInFullscreenGame() ? CursorCaptureMode_EnabledInFullscreenGame : 0; + mode |= getCursorCaptureEnabledInFullscreenMenu() ? CursorCaptureMode_EnabledInFullscreenMenu : 0; + return mode; +} + +Bool OptionPreferences::getScreenEdgeScrollEnabledInWindowedApp() const +{ + OptionPreferences::const_iterator it = find("ScreenEdgeScrollEnabledInWindowedApp"); + if (it == end()) + return (ScreenEdgeScrollMode_Default & ScreenEdgeScrollMode_EnabledInWindowedApp) != 0; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +Bool OptionPreferences::getScreenEdgeScrollEnabledInFullscreenApp() const +{ + OptionPreferences::const_iterator it = find("ScreenEdgeScrollEnabledInFullscreenApp"); + if (it == end()) + return (ScreenEdgeScrollMode_Default & ScreenEdgeScrollMode_EnabledInFullscreenApp) != 0; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +ScreenEdgeScrollMode OptionPreferences::getScreenEdgeScrollMode() const +{ + ScreenEdgeScrollMode mode = 0; + mode |= getScreenEdgeScrollEnabledInWindowedApp() ? ScreenEdgeScrollMode_EnabledInWindowedApp : 0; + mode |= getScreenEdgeScrollEnabledInFullscreenApp() ? ScreenEdgeScrollMode_EnabledInFullscreenApp : 0; + return mode; +} + +Bool OptionPreferences::usesSystemMapDir(void) +{ + OptionPreferences::const_iterator it = find("UseSystemMapDir"); + if (it == end()) + return TRUE; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::saveCameraInReplays(void) +{ + OptionPreferences::const_iterator it = find("SaveCameraInReplays"); + if (it == end()) + return TRUE; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::useCameraInReplays(void) +{ + OptionPreferences::const_iterator it = find("UseCameraInReplays"); + if (it == end()) + return TRUE; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getPlayerObserverEnabled() const +{ + OptionPreferences::const_iterator it = find("PlayerObserverEnabled"); + if (it == end()) + return TRUE; + + if (stricmp(it->second.str(), "yes") == 0) + return TRUE; + + return FALSE; +} + +Int OptionPreferences::getIdealStaticGameDetail(void) +{ + OptionPreferences::const_iterator it = find("IdealStaticGameLOD"); + if (it == end()) + return STATIC_GAME_LOD_UNKNOWN; + + return TheGameLODManager->getStaticGameLODIndex(it->second); +} + +Int OptionPreferences::getStaticGameDetail(void) +{ + OptionPreferences::const_iterator it = find("StaticGameLOD"); + if (it == end()) + return TheGameLODManager->getStaticLODLevel(); + + return TheGameLODManager->getStaticGameLODIndex(it->second); +} + +Bool OptionPreferences::getSendDelay(void) +{ + OptionPreferences::const_iterator it = find("SendDelay"); + if (it == end()) + return TheGlobalData->m_firewallSendDelay; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Int OptionPreferences::getFirewallBehavior() +{ + OptionPreferences::const_iterator it = find("FirewallBehavior"); + if (it == end()) + return TheGlobalData->m_firewallBehavior; + + Int behavior = atoi(it->second.str()); + if (behavior < 0) + { + behavior = 0; + } + return behavior; +} + +Short OptionPreferences::getFirewallPortAllocationDelta() +{ + OptionPreferences::const_iterator it = find("FirewallPortAllocationDelta"); + if (it == end()) { + return TheGlobalData->m_firewallPortAllocationDelta; + } + + Short delta = atoi(it->second.str()); + return delta; +} + +UnsignedShort OptionPreferences::getFirewallPortOverride() +{ + OptionPreferences::const_iterator it = find("FirewallPortOverride"); + if (it == end()) { + return TheGlobalData->m_firewallPortOverride; + } + + Int override = atoi(it->second.str()); + if (override < 0 || override > 65535) + override = 0; + return override; +} + +Bool OptionPreferences::getFirewallNeedToRefresh() +{ + OptionPreferences::const_iterator it = find("FirewallNeedToRefresh"); + if (it == end()) { + return FALSE; + } + + Bool retval = FALSE; + AsciiString str = it->second; + if (str.compareNoCase("TRUE") == 0) { + retval = TRUE; + } + return retval; +} + +AsciiString OptionPreferences::getPreferred3DProvider(void) +{ + OptionPreferences::const_iterator it = find("3DAudioProvider"); + if (it == end()) + return TheAudio->getAudioSettings()->m_preferred3DProvider[MAX_HW_PROVIDERS]; + return it->second; +} + +AsciiString OptionPreferences::getSpeakerType(void) +{ + OptionPreferences::const_iterator it = find("SpeakerType"); + if (it == end()) + return TheAudio->translateUnsignedIntToSpeakerType(TheAudio->getAudioSettings()->m_defaultSpeakerType2D); + return it->second; +} + +Real OptionPreferences::getSoundVolume(void) +{ + OptionPreferences::const_iterator it = find("SFXVolume"); + if (it == end()) + { + Real relative = TheAudio->getAudioSettings()->m_relative2DVolume; + if( relative < 0 ) + { + Real scale = 1.0f + relative; + return TheAudio->getAudioSettings()->m_defaultSoundVolume * 100.0f * scale; + } + return TheAudio->getAudioSettings()->m_defaultSoundVolume * 100.0f; + } + + Real volume = (Real) atof(it->second.str()); + if (volume < 0.0f) + { + volume = 0.0f; + } + return volume; +} + +Real OptionPreferences::get3DSoundVolume(void) +{ + OptionPreferences::const_iterator it = find("SFX3DVolume"); + if (it == end()) + { + Real relative = TheAudio->getAudioSettings()->m_relative2DVolume; + if( relative > 0 ) + { + Real scale = 1.0f - relative; + return TheAudio->getAudioSettings()->m_default3DSoundVolume * 100.0f * scale; + } + return TheAudio->getAudioSettings()->m_default3DSoundVolume * 100.0f; + } + + Real volume = (Real) atof(it->second.str()); + if (volume < 0.0f) + { + volume = 0.0f; + } + return volume; +} + +Real OptionPreferences::getSpeechVolume(void) +{ + OptionPreferences::const_iterator it = find("VoiceVolume"); + if (it == end()) + return TheAudio->getAudioSettings()->m_defaultSpeechVolume * 100.0f; + + Real volume = (Real) atof(it->second.str()); + if (volume < 0.0f) + { + volume = 0.0f; + } + return volume; +} + +Bool OptionPreferences::getCloudShadowsEnabled(void) +{ + OptionPreferences::const_iterator it = find("UseCloudMap"); + if (it == end()) + return TheGlobalData->m_useCloudMap; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getLightmapEnabled(void) +{ + OptionPreferences::const_iterator it = find("UseLightMap"); + if (it == end()) + return TheGlobalData->m_useLightMap; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getSmoothWaterEnabled(void) +{ + OptionPreferences::const_iterator it = find("ShowSoftWaterEdge"); + if (it == end()) + return TheGlobalData->m_showSoftWaterEdge; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getTreesEnabled(void) +{ + OptionPreferences::const_iterator it = find("ShowTrees"); + if (it == end()) + return TheGlobalData->m_useTrees; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getExtraAnimationsDisabled(void) +{ + OptionPreferences::const_iterator it = find("ExtraAnimations"); + if (it == end()) + return TheGlobalData->m_useDrawModuleLOD; + + if (stricmp(it->second.str(), "yes") == 0) { + return FALSE; //we are enabling extra animations, so disabled LOD + } + return TRUE; +} + +Bool OptionPreferences::getUseHeatEffects(void) +{ + OptionPreferences::const_iterator it = find("HeatEffects"); + if (it == end()) + return TheGlobalData->m_useHeatEffects; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getDynamicLODEnabled(void) +{ + OptionPreferences::const_iterator it = find("DynamicLOD"); + if (it == end()) + return TheGlobalData->m_enableDynamicLOD; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getFPSLimitEnabled(void) +{ + OptionPreferences::const_iterator it = find("FPSLimit"); + if (it == end()) + return TheGlobalData->m_useFpsLimit; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::get3DShadowsEnabled(void) +{ + OptionPreferences::const_iterator it = find("UseShadowVolumes"); + if (it == end()) + return TheGlobalData->m_useShadowVolumes; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::get2DShadowsEnabled(void) +{ + OptionPreferences::const_iterator it = find("UseShadowDecals"); + if (it == end()) + return TheGlobalData->m_useShadowDecals; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Bool OptionPreferences::getBuildingOcclusionEnabled(void) +{ + OptionPreferences::const_iterator it = find("BuildingOcclusion"); + if (it == end()) + return TheGlobalData->m_enableBehindBuildingMarkers; + + if (stricmp(it->second.str(), "yes") == 0) { + return TRUE; + } + return FALSE; +} + +Int OptionPreferences::getParticleCap(void) +{ + OptionPreferences::const_iterator it = find("MaxParticleCount"); + if (it == end()) + return TheGlobalData->m_maxParticleCount; + + Int factor = (Int) atoi(it->second.str()); + if (factor < 100) //clamp to at least 100 particles. + factor = 100; + + return factor; +} + +Int OptionPreferences::getTextureReduction(void) +{ + OptionPreferences::const_iterator it = find("TextureReduction"); + if (it == end()) + return -1; //unknown texture reduction + + Int factor = (Int) atoi(it->second.str()); + if (factor > 2) //clamp it. + factor=2; + return factor; +} + +Real OptionPreferences::getGammaValue(void) +{ + OptionPreferences::const_iterator it = find("Gamma"); + if (it == end()) + return 50.0f; + + Real gamma = (Real) atoi(it->second.str()); + return gamma; +} + +void OptionPreferences::getResolution(Int *xres, Int *yres) +{ + *xres = TheGlobalData->m_xResolution; + *yres = TheGlobalData->m_yResolution; + + OptionPreferences::const_iterator it = find("Resolution"); + if (it == end()) + return; + + Int selectedXRes,selectedYRes; + if (sscanf(it->second.str(),"%d%d", &selectedXRes, &selectedYRes) != 2) + return; + + *xres=selectedXRes; + *yres=selectedYRes; +} + +Real OptionPreferences::getMusicVolume(void) +{ + OptionPreferences::const_iterator it = find("MusicVolume"); + if (it == end()) + return TheAudio->getAudioSettings()->m_defaultMusicVolume * 100.0f; + + Real volume = (Real) atof(it->second.str()); + if (volume < 0.0f) + { + volume = 0.0f; + } + return volume; +} + +Real OptionPreferences::getMoneyTransactionVolume(void) const +{ + OptionPreferences::const_iterator it = find("MoneyTransactionVolume"); + if (it == end()) + return TheAudio->getAudioSettings()->m_defaultMoneyTransactionVolume * 100.0f; + + Real volume = (Real) atof(it->second.str()); + if (volume < 0.0f) + volume = 0.0f; + + return volume; +} + +Int OptionPreferences::getNetworkLatencyFontSize(void) +{ + OptionPreferences::const_iterator it = find("NetworkLatencyFontSize"); + if (it == end()) + return 8; + + Int fontSize = atoi(it->second.str()); + if (fontSize < 0) + { + fontSize = 0; + } + return fontSize; +} + +Int OptionPreferences::getRenderFpsFontSize(void) +{ + OptionPreferences::const_iterator it = find("RenderFpsFontSize"); + if (it == end()) + return 8; + + Int fontSize = atoi(it->second.str()); + if (fontSize < 0) + { + fontSize = 0; + } + return fontSize; +} + +Int OptionPreferences::getSystemTimeFontSize(void) +{ + OptionPreferences::const_iterator it = find("SystemTimeFontSize"); + if (it == end()) + return 8; + + Int fontSize = atoi(it->second.str()); + if (fontSize < 0) + { + fontSize = 0; + } + return fontSize; +} + +Int OptionPreferences::getGameTimeFontSize(void) +{ + OptionPreferences::const_iterator it = find("GameTimeFontSize"); + if (it == end()) + return 8; + + Int fontSize = atoi(it->second.str()); + if (fontSize < 0) + { + fontSize = 0; + } + return fontSize; +} + +Int OptionPreferences::getPlayerInfoListFontSize(void) +{ + OptionPreferences::const_iterator it = find("PlayerInfoListFontSize"); + if (it == end()) + return 8; + + Int fontSize = atoi(it->second.str()); + if (fontSize < 0) + { + fontSize = 0; + } + return fontSize; +} + +Real OptionPreferences::getResolutionFontAdjustment(void) +{ + OptionPreferences::const_iterator it = find("ResolutionFontAdjustment"); + if (it == end()) + return -1.0f; + + Real fontScale = (Real)atof(it->second.str()) / 100.0f; + if (fontScale < 0.0f) + { + fontScale = -1.0f; + } + return fontScale; +} + +Bool OptionPreferences::getShowMoneyPerMinute(void) const +{ + OptionPreferences::const_iterator it = find("ShowMoneyPerMinute"); + if (it == end()) + return TheGlobalData->m_showMoneyPerMinute; + + if (stricmp(it->second.str(), "yes") == 0) + { + return TRUE; + } + return FALSE; +} diff --git a/Core/GameEngine/Source/Common/System/Radar.cpp b/Core/GameEngine/Source/Common/System/Radar.cpp index 4b482a2c188..f69ebaa9ee5 100644 --- a/Core/GameEngine/Source/Common/System/Radar.cpp +++ b/Core/GameEngine/Source/Common/System/Radar.cpp @@ -81,7 +81,6 @@ void Radar::deleteListResources( void ) { deleteList(&m_objectList); deleteList(&m_localObjectList); - deleteList(&m_localHeroObjectList); #ifdef DEBUG_CRASHING for( Object *obj = TheGameLogic->getFirstObject(); obj; obj = obj->getNextObject() ) @@ -115,14 +114,8 @@ RadarObject::~RadarObject( void ) //------------------------------------------------------------------------------------------------- Bool RadarObject::isTemporarilyHidden() const { - return isTemporarilyHidden(m_object); -} + Drawable* draw = m_object->getDrawable(); -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Bool RadarObject::isTemporarilyHidden(const Object* obj) -{ - Drawable* draw = obj->getDrawable(); if (draw == nullptr || draw->getStealthLook() == STEALTHLOOK_INVISIBLE || draw->isDrawableEffectivelyHidden()) return true; @@ -192,7 +185,6 @@ Radar::Radar( void ) m_radarWindow = nullptr; m_objectList = nullptr; m_localObjectList = nullptr; - m_localHeroObjectList = nullptr; std::fill(m_radarHidden, m_radarHidden + ARRAY_SIZE(m_radarHidden), false); std::fill(m_radarForceOn, m_radarForceOn + ARRAY_SIZE(m_radarForceOn), false); m_terrainAverageZ = 0.0f; @@ -416,10 +408,7 @@ Bool Radar::addObject( Object *obj ) // if( obj->isLocallyControlled() ) { - if ( obj->isHero() ) - list = &m_localHeroObjectList; - else - list = &m_localObjectList; + list = &m_localObjectList; } else { @@ -483,15 +472,13 @@ Bool Radar::removeObject( Object *obj ) if( obj->friend_getRadarData() == nullptr ) return FALSE; - if( deleteFromList( obj, &m_localHeroObjectList ) == TRUE ) - return TRUE; if( deleteFromList( obj, &m_localObjectList ) == TRUE ) return TRUE; else if( deleteFromList( obj, &m_objectList ) == TRUE ) return TRUE; else { - DEBUG_ASSERTCRASH( 0, ("Radar: Tried to remove object '%s' which was not found", + DEBUG_CRASH( ("Radar: Tried to remove object '%s' which was not found", obj->getTemplate()->getName().str()) ); return FALSE; } @@ -718,14 +705,10 @@ Object *Radar::objectUnderRadarPixel( const ICoord2D *pixel ) // to the radar location // - // search the local hero object list - obj = searchListForRadarLocationMatch( m_localHeroObjectList, &radar ); - - // search the local object list if not found - if( obj == nullptr ) - obj = searchListForRadarLocationMatch( m_localObjectList, &radar ); + // search the local object list + obj = searchListForRadarLocationMatch( m_localObjectList, &radar ); - // search all other objects if still not found + // search all other objects if not found if( obj == nullptr ) obj = searchListForRadarLocationMatch( m_objectList, &radar ); @@ -1365,7 +1348,6 @@ static void xferRadarObjectList( Xfer *xfer, RadarObject **head ) * Version Info: * 1: Initial version * 2: TheSuperHackers @tweak Serialize m_radarHidden, m_radarForceOn for each player - * 3: TheSuperHackers @tweak Serialize m_localHeroObjectList */ // ------------------------------------------------------------------------------------------------ void Radar::xfer( Xfer *xfer ) @@ -1375,7 +1357,7 @@ void Radar::xfer( Xfer *xfer ) #if RETAIL_COMPATIBLE_XFER_SAVE XferVersion currentVersion = 1; #else - XferVersion currentVersion = 3; + XferVersion currentVersion = 2; #endif XferVersion version = currentVersion; xfer->xferVersion( &version, currentVersion ); @@ -1405,66 +1387,12 @@ void Radar::xfer( Xfer *xfer ) xfer->xferUser(&m_radarForceOn, sizeof(m_radarForceOn)); } - if (version <= 2) - { - if (xfer->getXferMode() == XFER_SAVE) - { - // TheSuperHackers @info For legacy xfer compatibility. - // Transfer all local hero objects to local object list. - RadarObject **fromList = &m_localHeroObjectList; - RadarObject **toList = &m_localObjectList; - while (*fromList != nullptr) - { - RadarObject* nextObject = (*fromList)->friend_getNext(); - (*fromList)->friend_setNext(nullptr); - linkRadarObject(*fromList, toList); - *fromList = nextObject; - } - } - } - else - { - xferRadarObjectList( xfer, &m_localHeroObjectList ); - } - // save our local object list xferRadarObjectList( xfer, &m_localObjectList ); // save the regular object list xferRadarObjectList( xfer, &m_objectList ); - if (version <= 2) - { - // TheSuperHackers @info For legacy xfer compatibility. - // Transfer hero local object(s) back to local hero object list. - // This needs to be done on both load and save. - RadarObject **fromList = &m_localObjectList; - RadarObject **toList = &m_localHeroObjectList; - RadarObject *currObject; - RadarObject *prevObject; - RadarObject *nextObject; - prevObject = nullptr; - for (currObject = *fromList; currObject != nullptr; currObject = nextObject) - { - nextObject = currObject->friend_getNext(); - if (currObject->friend_getObject()->isHero()) - { - if (prevObject != nullptr) - { - prevObject->friend_setNext(nextObject); - } - else - { - *fromList = nextObject; - } - currObject->friend_setNext(nullptr); - linkRadarObject(currObject, toList); - continue; - } - prevObject = currObject; - } - } - // save the radar event count and data UnsignedShort eventCountVerify = MAX_RADAR_EVENTS; UnsignedShort eventCount = eventCountVerify; diff --git a/Generals/Code/GameEngine/Source/GameClient/ClientInstance.cpp b/Core/GameEngine/Source/GameClient/ClientInstance.cpp similarity index 100% rename from Generals/Code/GameEngine/Source/GameClient/ClientInstance.cpp rename to Core/GameEngine/Source/GameClient/ClientInstance.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Color.cpp b/Core/GameEngine/Source/GameClient/Color.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/Color.cpp rename to Core/GameEngine/Source/GameClient/Color.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp b/Core/GameEngine/Source/GameClient/Credits.cpp similarity index 99% rename from GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp rename to Core/GameEngine/Source/GameClient/Credits.cpp index fc23c65eac8..f732f0a546f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp +++ b/Core/GameEngine/Source/GameClient/Credits.cpp @@ -460,7 +460,7 @@ void CreditsManager::addText( AsciiString text ) } break; default: - DEBUG_ASSERTCRASH( FALSE, ("CreditsManager::addText we tried to add a credit text with the wrong style before it. Style is %d", m_currentStyle) ); + DEBUG_CRASH( ("CreditsManager::addText we tried to add a credit text with the wrong style before it. Style is %d", m_currentStyle) ); delete cLine; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/DisplayString.cpp b/Core/GameEngine/Source/GameClient/DisplayString.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/DisplayString.cpp rename to Core/GameEngine/Source/GameClient/DisplayString.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/DisplayStringManager.cpp b/Core/GameEngine/Source/GameClient/DisplayStringManager.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/DisplayStringManager.cpp rename to Core/GameEngine/Source/GameClient/DisplayStringManager.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/DrawGroupInfo.cpp b/Core/GameEngine/Source/GameClient/DrawGroupInfo.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/DrawGroupInfo.cpp rename to Core/GameEngine/Source/GameClient/DrawGroupInfo.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp b/Core/GameEngine/Source/GameClient/FXList.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp rename to Core/GameEngine/Source/GameClient/FXList.cpp 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 98% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp rename to Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp index fc99b16ba8b..cd2205a44a2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp @@ -135,7 +135,7 @@ Transition *getTransitionForStyle( Int style ) return NEW ScoreScaleUpTransition; default: - DEBUG_ASSERTCRASH(FALSE, ("getTransitionForStyle:: An invalid style was passed in. Style = %d", style)); + DEBUG_CRASH(("getTransitionForStyle:: An invalid style was passed in. Style = %d", style)); return nullptr; } return nullptr; @@ -532,7 +532,7 @@ TransitionGroup *GameWindowTransitionsHandler::getNewGroup( AsciiString name ) // 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())); + DEBUG_CRASH(("GameWindowTransitionsHandler::getNewGroup - We already have a group %s", name.str())); return nullptr; } TransitionGroup *g = NEW TransitionGroup; 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..e646b216c26 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 ); @@ -1484,7 +1472,7 @@ 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)); + DEBUG_CRASH(("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])); @@ -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 ); @@ -1846,7 +1831,7 @@ 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)); + DEBUG_CRASH(("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])); @@ -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 ) @@ -1994,7 +1969,7 @@ void MapTransferLoadScreen::processProgress(Int playerId, Int percentage, AsciiS 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)); + DEBUG_CRASH(("Percentage %d was passed in for Player %d", percentage, playerId)); return; } 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/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp b/Core/GameEngine/Source/GameClient/GameText.cpp similarity index 98% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp rename to Core/GameEngine/Source/GameClient/GameText.cpp index 97a2c9d5dfa..27f15985361 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp +++ b/Core/GameEngine/Source/GameClient/GameText.cpp @@ -266,7 +266,6 @@ GameTextManager::GameTextManager() m_buffer2[i] = 0; m_buffer3[i] = 0; } - // } //============================================================================ @@ -1038,7 +1037,7 @@ Bool GameTextManager::parseStringFile( const char *filename ) { if ( stricmp ( m_stringInfo[i].label.str(), m_buffer ) == 0) { - DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' multiply defined!", m_buffer )); + DEBUG_CRASH ( ("String label '%s' multiply defined!", m_buffer )); } } @@ -1056,7 +1055,7 @@ Bool GameTextManager::parseStringFile( const char *filename ) { if (!readLine ( m_buffer, sizeof(m_buffer)-1, file )) { - DEBUG_ASSERTCRASH (FALSE, ("Unexpected end of string file")); + DEBUG_CRASH (("Unexpected end of string file")); ok = FALSE; goto quit; } @@ -1074,7 +1073,7 @@ Bool GameTextManager::parseStringFile( const char *filename ) if ( readString ) { // only one string per label allows - DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' has more than one string defined!", m_stringInfo[listCount].label.str())); + DEBUG_CRASH ( ("String label '%s' has more than one string defined!", m_stringInfo[listCount].label.str())); } else { @@ -1169,7 +1168,7 @@ Bool GameTextManager::parseMapStringFile( const char *filename ) { if ( stricmp ( m_mapStringInfo[i].label.str(), m_buffer ) == 0) { - DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' multiply defined!", m_buffer )); + DEBUG_CRASH ( ("String label '%s' multiply defined!", m_buffer )); } } @@ -1187,7 +1186,7 @@ Bool GameTextManager::parseMapStringFile( const char *filename ) { if (!readLine ( m_buffer, sizeof(m_buffer)-1, file )) { - DEBUG_ASSERTCRASH (FALSE, ("Unexpected end of string file")); + DEBUG_CRASH (("Unexpected end of string file")); ok = FALSE; goto quit; } @@ -1205,7 +1204,7 @@ Bool GameTextManager::parseMapStringFile( const char *filename ) if ( readString ) { // only one string per label allowed - DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' has more than one string defined!", m_stringInfo[listCount].label.str())); + DEBUG_CRASH ( ("String label '%s' has more than one string defined!", m_stringInfo[listCount].label.str())); } else { @@ -1459,4 +1458,3 @@ static int __cdecl compareLUT ( const void *i1, const void*i2) return stricmp( lut1->label->str(), lut2->label->str()); } - diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp b/Core/GameEngine/Source/GameClient/GlobalLanguage.cpp similarity index 89% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp rename to Core/GameEngine/Source/GameClient/GlobalLanguage.cpp index 2683c02d7ff..cdff70b6b9f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp +++ b/Core/GameEngine/Source/GameClient/GlobalLanguage.cpp @@ -56,7 +56,7 @@ #include "Common/INI.h" #include "Common/Registry.h" #include "Common/FileSystem.h" -#include "Common/UserPreferences.h" +#include "Common/OptionPreferences.h" #include "GameClient/Display.h" #include "GameClient/GlobalLanguage.h" @@ -64,7 +64,7 @@ //----------------------------------------------------------------------------- // DEFINES //////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- -GlobalLanguage *TheGlobalLanguageData = nullptr; ///< The global language singleton +GlobalLanguage *TheGlobalLanguageData = nullptr; static const LookupListRec ResolutionFontSizeMethodNames[] = { @@ -116,7 +116,7 @@ void INI::parseLanguageDefinition( INI *ini ) DEBUG_ASSERTCRASH(TheGlobalLanguageData, ("INI::parseLanguageDefinition - TheGlobalLanguage Data is not around, please create it before trying to parse the ini file.")); return; } - // parse the ini weapon definition + ini->initFromINI( TheGlobalLanguageData, TheGlobalLanguageDataFieldParseTable ); } @@ -136,7 +136,7 @@ GlobalLanguage::GlobalLanguage() GlobalLanguage::~GlobalLanguage() { - StringListIt it = m_localFonts.begin(); + StringList::iterator it = m_localFonts.begin(); while( it != m_localFonts.end()) { AsciiString font = *it; @@ -146,7 +146,7 @@ GlobalLanguage::~GlobalLanguage() } } -void GlobalLanguage::init( void ) +void GlobalLanguage::init() { { AsciiString fname; @@ -156,13 +156,13 @@ void GlobalLanguage::init( void ) ini.loadFileDirectory( fname, INI_LOAD_OVERWRITE, nullptr ); } - StringListIt it = m_localFonts.begin(); + StringList::iterator it = m_localFonts.begin(); while( it != m_localFonts.end()) { AsciiString font = *it; if(AddFontResource(font.str()) == 0) { - DEBUG_ASSERTCRASH(FALSE,("GlobalLanguage::init Failed to add font %s", font.str())); + DEBUG_CRASH(("GlobalLanguage::init Failed to add font %s", font.str())); } else { @@ -174,12 +174,13 @@ void GlobalLanguage::init( void ) // override values with user preferences OptionPreferences optionPref; m_userResolutionFontSizeAdjustment = optionPref.getResolutionFontAdjustment(); - } -void GlobalLanguage::reset( void ) {} +void GlobalLanguage::reset() +{ +} -void GlobalLanguage::parseFontDesc(INI *ini, void *instance, void *store, const void* userData) +void GlobalLanguage::parseFontDesc(INI *ini, void *instance, void *store, const void *userData) { FontDesc *fontDesc = (FontDesc *)store; fontDesc->name = ini->getNextQuotedAsciiString(); @@ -187,14 +188,14 @@ void GlobalLanguage::parseFontDesc(INI *ini, void *instance, void *store, const fontDesc->bold = ini->scanBool(ini->getNextToken()); } -void GlobalLanguage::parseFontFileName( INI *ini, void * instance, void *store, const void* userData ) +void GlobalLanguage::parseFontFileName(INI *ini, void *instance, void *store, const void *userData) { - GlobalLanguage *monkey = (GlobalLanguage *)instance; + GlobalLanguage *globalLanguage = static_cast(instance); AsciiString asciiString = ini->getNextAsciiString(); - monkey->m_localFonts.push_front(asciiString); + globalLanguage->m_localFonts.push_front(asciiString); } -float GlobalLanguage::getResolutionFontSizeAdjustment( void ) const +Real GlobalLanguage::getResolutionFontSizeAdjustment() const { if (m_userResolutionFontSizeAdjustment >= 0.0f) return m_userResolutionFontSizeAdjustment; @@ -202,13 +203,11 @@ float GlobalLanguage::getResolutionFontSizeAdjustment( void ) const return m_resolutionFontSizeAdjustment; } -Int GlobalLanguage::adjustFontSize(Int theFontSize) +Real GlobalLanguage::getResolutionFontSizeScale(ResolutionFontSizeMethod method, Real scaler) { - // TheSuperHackers @todo This function is called very often. - // Therefore cache the adjustFactor on resolution change to not recompute it on every call. Real adjustFactor; - switch (m_resolutionFontSizeMethod) + switch (method) { default: case ResolutionFontSizeMethod_Classic: @@ -216,7 +215,7 @@ Int GlobalLanguage::adjustFontSize(Int theFontSize) // TheSuperHackers @info The original font scaling for this game. // Useful for not breaking legacy Addons and Mods. Scales poorly with large resolutions. adjustFactor = TheDisplay->getWidth() / (Real)DEFAULT_DISPLAY_WIDTH; - adjustFactor = 1.0f + (adjustFactor - 1.0f) * getResolutionFontSizeAdjustment(); + adjustFactor = 1.0f + (adjustFactor - 1.0f) * scaler; if (adjustFactor > 2.0f) adjustFactor = 2.0f; break; @@ -226,7 +225,7 @@ Int GlobalLanguage::adjustFontSize(Int theFontSize) // TheSuperHackers @feature The original font scaling, but without ceiling. // Useful for not changing the original look of the game. Scales alright with large resolutions. adjustFactor = TheDisplay->getWidth() / (Real)DEFAULT_DISPLAY_WIDTH; - adjustFactor = 1.0f + (adjustFactor - 1.0f) * getResolutionFontSizeAdjustment(); + adjustFactor = 1.0f + (adjustFactor - 1.0f) * scaler; break; } case ResolutionFontSizeMethod_Strict: @@ -236,7 +235,7 @@ Int GlobalLanguage::adjustFontSize(Int theFontSize) const Real wScale = TheDisplay->getWidth() / (Real)DEFAULT_DISPLAY_WIDTH; const Real hScale = TheDisplay->getHeight() / (Real)DEFAULT_DISPLAY_HEIGHT; adjustFactor = min(wScale, hScale); - adjustFactor = 1.0f + (adjustFactor - 1.0f) * getResolutionFontSizeAdjustment(); + adjustFactor = 1.0f + (adjustFactor - 1.0f) * scaler; break; } case ResolutionFontSizeMethod_Balanced: @@ -265,14 +264,25 @@ Int GlobalLanguage::adjustFontSize(Int theFontSize) hScale = h / (Real)DEFAULT_DISPLAY_HEIGHT; } adjustFactor = (wScale + hScale) * 0.5f; - adjustFactor = 1.0f + (adjustFactor - 1.0f) * getResolutionFontSizeAdjustment(); + adjustFactor = 1.0f + (adjustFactor - 1.0f) * scaler; break; } } if (adjustFactor < 1.0f) adjustFactor = 1.0f; - Int pointSize = REAL_TO_INT_FLOOR(theFontSize*adjustFactor); + + return adjustFactor; +} + +Int GlobalLanguage::adjustFontSize(Int theFontSize) +{ + // TheSuperHackers @todo This function is called very often. + // Therefore cache the adjustFactor on resolution change to not recompute it on every call. + const Real resolutionScaler = getResolutionFontSizeAdjustment(); + const Real adjustFactor = getResolutionFontSizeScale(m_resolutionFontSizeMethod, resolutionScaler); + const Int pointSize = REAL_TO_INT_FLOOR(theFontSize * adjustFactor); + return pointSize; } @@ -288,9 +298,9 @@ void GlobalLanguage::parseCustomDefinition() FontDesc::FontDesc(void) { - name = "Arial Unicode MS"; ///newCountMine > 0) { if (outSelectionInfo->newCountMine == 1 && selectionIsPoint && !TheInGameUI->isInPreferSelectionMode()) { - return TheGameClient->evaluateContextCommand(newMine, newMine->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID; + return TheGameClient->evaluateContextCommand(newMine, newMine->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID; } return FALSE; @@ -346,6 +346,10 @@ Bool addDrawableToList( Drawable *draw, void *userData ) return FALSE; #if !RTS_GENERALS || !PRESERVE_RETAIL_BEHAVIOR + // TheSuperHackers @info + // In retail, drag-selecting allows the player to select stealthed objects and objects through the + // fog. Some players exploit this bug to determine where an opponent's units are and consider this + // an important feature and an advanced skill to pull off, so we must leave the exploit. if (draw->getFullyObscuredByShroud()) return FALSE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Statistics.cpp b/Core/GameEngine/Source/GameClient/Statistics.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/Statistics.cpp rename to Core/GameEngine/Source/GameClient/Statistics.cpp diff --git a/Core/GameEngine/Source/GameClient/System/ParticleSys.cpp b/Core/GameEngine/Source/GameClient/System/ParticleSys.cpp index 4e4e6d6970a..44bd9d203e1 100644 --- a/Core/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/Core/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -1230,7 +1230,10 @@ ParticleSystem::ParticleSystem( const ParticleSystemTemplate *sysTemplate, m_personalityStore = 0; m_controlParticle = nullptr; - TheParticleSystemManager->friend_addParticleSystem(this); + if ( m_systemID != INVALID_PARTICLE_SYSTEM_ID ) + { + TheParticleSystemManager->friend_addParticleSystem(this); + } //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d", m_totalParticleSystemCount )); } @@ -1275,7 +1278,10 @@ ParticleSystem::~ParticleSystem() m_controlParticle = nullptr; - TheParticleSystemManager->friend_removeParticleSystem(this); + if ( m_systemID != INVALID_PARTICLE_SYSTEM_ID ) + { + TheParticleSystemManager->friend_removeParticleSystem(this); + } //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d", m_totalParticleSystemCount )); } @@ -3379,20 +3385,24 @@ void ParticleSystemManager::xfer( Xfer *xfer ) } // create system - system = createParticleSystem( systemTemplate, FALSE ); + // TheSuperHackers @bugfix stephanmeesters 16/02/2026 + // Particle systems originally were assigned an incrementing system ID in the constructor that did not + // always match the ID that was xfer'd. When using findParticleSystem this would cause master/slave lookups to fail. + // Defer registering particle systems to ParticleSystemManager until the system ID is properly restored. + system = newInstance(ParticleSystem)( systemTemplate, INVALID_PARTICLE_SYSTEM_ID, FALSE ); - if( system == nullptr ) - { + // read system data + xfer->xferSnapshot( system ); - DEBUG_CRASH(( "ParticleSystemManager::xfer - Unable to allocate particle system '%s'", + if( system->getSystemID() == INVALID_PARTICLE_SYSTEM_ID ) + { + DEBUG_CRASH(( "ParticleSystemManager::xfer - Unable to restore system ID to particle system '%s'", systemName.str() )); + deleteInstance(system); throw SC_INVALID_DATA; - } - // read system data - xfer->xferSnapshot( system ); - + friend_addParticleSystem(system); } } diff --git a/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp index 959c882d625..3cb4483ffa5 100644 --- a/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -102,7 +102,7 @@ ConnectionManager::~ConnectionManager(void) m_frameData[i] = nullptr; } - for (i = 0; i < NUM_CONNECTIONS; ++i) { + for (i = 0; i < MAX_SLOTS; ++i) { deleteInstance(m_connections[i]); m_connections[i] = nullptr; } @@ -160,7 +160,7 @@ void ConnectionManager::init() // m_transport->reset(); UnsignedInt i = 0; - for (; i < NUM_CONNECTIONS; ++i) { + for (; i < MAX_SLOTS; ++i) { m_connections[i] = nullptr; } @@ -236,7 +236,7 @@ void ConnectionManager::reset() m_transport = nullptr; UnsignedInt i = 0; - for (; i < (UnsignedInt)NUM_CONNECTIONS; ++i) { + for (; i < (UnsignedInt)MAX_SLOTS; ++i) { deleteInstance(m_connections[i]); m_connections[i] = nullptr; } @@ -302,6 +302,7 @@ Int ConnectionManager::getPingsReceived() Bool ConnectionManager::isPlayerConnected( Int playerID ) { + DEBUG_ASSERTCRASH( playerID < MAX_SLOTS, ("ConnectionManager::isPlayerConnected - %d is an invalid player number", playerID) ); return ( playerID == m_localSlot || (m_connections[playerID] && !m_connections[playerID]->isQuitting()) ); } @@ -431,6 +432,10 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { } // Early validation checks + if (msg->getPlayerID() >= MAX_SLOTS) { + return TRUE; + } + if ((m_connections[msg->getPlayerID()] == nullptr) && (msg->getPlayerID() != m_localSlot)) { // if this is from a player that is no longer in the game, then ignore them. return TRUE; @@ -442,7 +447,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { return FALSE; } - if ((msg->getPlayerID() >= 0) && (msg->getPlayerID() < MAX_SLOTS) && (msg->getPlayerID() != m_localSlot)) { + if (msg->getPlayerID() != m_localSlot) { if (m_connections[msg->getPlayerID()] == nullptr) { return TRUE; } @@ -536,8 +541,8 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { void ConnectionManager::processFrameResendRequest(NetFrameResendRequestCommandMsg *msg) { // first make sure this is a valid slot - Int playerID = msg->getPlayerID(); - if ((playerID < 0) || (playerID >= MAX_SLOTS)) { + const UnsignedInt playerID = msg->getPlayerID(); + if (playerID >= MAX_SLOTS) { return; } @@ -601,16 +606,19 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) */ void ConnectionManager::processRunAheadMetrics(NetRunAheadMetricsCommandMsg *msg) { - UnsignedInt player = msg->getPlayerID(); - if ((player >= 0) && (player < MAX_SLOTS) && (isPlayerConnected(player))) { - m_latencyAverages[player] = msg->getAverageLatency(); - m_fpsAverages[player] = msg->getAverageFps(); + const UnsignedInt playerID = msg->getPlayerID(); + if (playerID >= MAX_SLOTS) { + return; + } + if (isPlayerConnected(playerID)) { + m_latencyAverages[playerID] = msg->getAverageLatency(); + m_fpsAverages[playerID] = msg->getAverageFps(); //DEBUG_LOG(("ConnectionManager::processRunAheadMetrics - player %d, fps = %d, latency = %f", player, msg->getAverageFps(), msg->getAverageLatency())); - if (m_fpsAverages[player] > 100) { + if (m_fpsAverages[playerID] > 100) { // limit the reported frame rate average to 100. This is done because if a // user alt-tab's out of the game their frame rate climbs to in the neighborhood of // 300, that was deemed "ugly" by the powers that be. - m_fpsAverages[player] = 100; + m_fpsAverages[playerID] = 100; } } } @@ -619,7 +627,10 @@ void ConnectionManager::processDisconnectChat(NetDisconnectChatCommandMsg *msg) { UnicodeString unitext; UnicodeString name; - UnsignedByte playerID = msg->getPlayerID(); + const UnsignedInt playerID = msg->getPlayerID(); + if (playerID >= MAX_SLOTS) { + return; + } if (playerID == m_localSlot) { name = m_localUser->GetName(); } else if (isPlayerConnected(playerID)) { @@ -634,12 +645,15 @@ void ConnectionManager::processChat(NetChatCommandMsg *msg) { UnicodeString unitext; UnicodeString name; - UnsignedByte playerID = msg->getPlayerID(); + const UnsignedInt playerID = msg->getPlayerID(); + if (playerID >= MAX_SLOTS) { + return; + } //DEBUG_LOG(("processChat(): playerID = %d", playerID)); if (playerID == m_localSlot) { name = m_localUser->GetName(); //DEBUG_LOG(("connection is null, using %ls", name.str())); - } else if (((m_connections[playerID] != nullptr) && (m_connections[playerID]->isQuitting() == FALSE))) { + } else if ((m_connections[playerID] != nullptr) && (m_connections[playerID]->isQuitting() == FALSE)) { name = m_connections[playerID]->getUser()->GetName(); //DEBUG_LOG(("connection is non-null, using %ls", name.str())); } @@ -794,9 +808,14 @@ void ConnectionManager::processFileProgress(NetFileProgressCommandMsg *msg) { DEBUG_LOG(("ConnectionManager::processFileProgress() - command %d is at %d%%", msg->getFileID(), msg->getProgress())); - Int oldProgress = s_fileProgressMap[msg->getPlayerID()][msg->getFileID()]; - s_fileProgressMap[msg->getPlayerID()][msg->getFileID()] = max(oldProgress, msg->getProgress()); + const UnsignedInt playerID = msg->getPlayerID(); + if (playerID >= MAX_SLOTS) { + return; + } + const UnsignedShort fileID = msg->getFileID(); + const Int oldProgress = s_fileProgressMap[playerID][fileID]; + s_fileProgressMap[playerID][fileID] = max(oldProgress, msg->getProgress()); } void ConnectionManager::processProgress( NetProgressCommandMsg *msg ) @@ -820,9 +839,9 @@ void ConnectionManager::processTimeOutGameStart( NetCommandMsg *msg ) void ConnectionManager::processFrameInfo(NetFrameCommandMsg *msg) { //stupid frame info, why don't you process yourself? - UnsignedInt playerID = msg->getPlayerID(); + const UnsignedInt playerID = msg->getPlayerID(); - if ((playerID >= 0) && (playerID < MAX_SLOTS)) { + if (playerID < MAX_SLOTS) { if (m_frameData[playerID] != nullptr) { // DEBUG_LOG(("ConnectionManager::processFrameInfo - player %d, frame %d, command count %d, received on frame %d", playerID, msg->getExecutionFrame(), msg->getCommandCount(), TheGameLogic->getFrame())); m_frameData[playerID]->setFrameCommandCount(msg->getExecutionFrame(), msg->getCommandCount()); @@ -839,7 +858,7 @@ void ConnectionManager::processAckStage1(NetCommandMsg *msg) { Bool doDebug = (msg->getNetCommandType() == NETCOMMANDTYPE_DISCONNECTFRAME) ? TRUE : FALSE; #endif - UnsignedByte playerID = msg->getPlayerID(); + const UnsignedInt playerID = msg->getPlayerID(); NetCommandRef *ref = nullptr; #if defined(RTS_DEBUG) @@ -848,12 +867,12 @@ void ConnectionManager::processAckStage1(NetCommandMsg *msg) { } #endif - if ((playerID >= 0) && (playerID < NUM_CONNECTIONS)) { + if (playerID < MAX_SLOTS) { if (m_connections[playerID] != nullptr) { ref = m_connections[playerID]->processAck(msg); } } else { - DEBUG_ASSERTCRASH((playerID >= 0) && (playerID < NUM_CONNECTIONS), ("ConnectionManager::processAck - %d is an invalid player number", playerID)); + DEBUG_CRASH(("ConnectionManager::processAck - %d is an invalid player number", playerID)); } if (ref != nullptr) { @@ -1073,7 +1092,7 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { if (CommandRequiresDirectSend(msg) && CommandRequiresAck(msg)) { // Send this ack directly back to the sending player, don't go through the packet router. - if ((msg->getPlayerID() >= 0) && (msg->getPlayerID() < MAX_SLOTS)) { + if (msg->getPlayerID() < MAX_SLOTS) { if (m_connections[msg->getPlayerID()] != nullptr) { m_connections[msg->getPlayerID()]->sendNetCommandMsg(ackmsg, 1 << msg->getPlayerID()); } @@ -1086,21 +1105,21 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { m_connections[m_packetRouterSlot]->sendNetCommandMsg(ackmsg, 1 << m_packetRouterSlot); } else if (m_localSlot == m_packetRouterSlot) { // we are the packet router, send the ack to the player that sent the command. - if ((msg->getPlayerID() >= 0) && (msg->getPlayerID() < MAX_SLOTS)) { + if (msg->getPlayerID() < MAX_SLOTS) { if (m_connections[msg->getPlayerID()] != nullptr) { // DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d directly to player.", commandID, msg->getPlayerID())); m_connections[msg->getPlayerID()]->sendNetCommandMsg(ackmsg, 1 << msg->getPlayerID()); } else { - // DEBUG_ASSERTCRASH(m_connections[msg->getPlayerID()] != nullptr, ("Connection to player is null")); + // DEBUG_CRASH(("Connection to player is null")); } } else { - DEBUG_ASSERTCRASH((msg->getPlayerID() >= 0) && (msg->getPlayerID() < MAX_SLOTS), ("Command sent by an invalid player ID.")); + DEBUG_CRASH(("Command sent by an invalid player ID.")); } } else { - DEBUG_ASSERTCRASH(m_connections[m_packetRouterSlot] != nullptr, ("Connection to packet router is null")); + DEBUG_CRASH(("Connection to packet router is null")); } } else { - DEBUG_ASSERTCRASH((m_packetRouterSlot >= 0) && (m_packetRouterSlot < MAX_SLOTS), ("I don't know who the packet router is.")); + DEBUG_CRASH(("I don't know who the packet router is.")); } } @@ -1120,11 +1139,13 @@ void ConnectionManager::sendRemoteCommand(NetCommandRef *msg) { DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - sending net command %d of type %s from player %d, relay is 0x%x", msg->getCommand()->getID(), GetNetCommandTypeAsString(msg->getCommand()->getNetCommandType()), msg->getCommand()->getPlayerID(), msg->getRelay())); - UnsignedByte relay = msg->getRelay(); - if ((relay & (1 << m_localSlot)) && (m_frameData[msg->getCommand()->getPlayerID()] != nullptr)) { + const UnsignedByte relay = msg->getRelay(); + const UnsignedInt playerID = msg->getCommand()->getPlayerID(); + FrameDataManager *frameDataMgr = playerID < MAX_SLOTS ? m_frameData[playerID] : nullptr; + if ((relay & (1 << m_localSlot)) && (frameDataMgr != nullptr)) { if (IsCommandSynchronized(msg->getCommand()->getNetCommandType())) { DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - adding net command of type %s to player %d for frame %d", GetNetCommandTypeAsString(msg->getCommand()->getNetCommandType()), msg->getCommand()->getPlayerID(), msg->getCommand()->getExecutionFrame())); - m_frameData[msg->getCommand()->getPlayerID()]->addNetCommandMsg(msg->getCommand()); + frameDataMgr->addNetCommandMsg(msg->getCommand()); } } @@ -1190,7 +1211,7 @@ void ConnectionManager::update(Bool isInGame) { // send any necessary keep-alive packets. doKeepAlive(); - for (Int i = 0; i < NUM_CONNECTIONS; ++i) { + for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_connections[i] != nullptr) { /* if (m_connections[i]->isQueueEmpty() == FALSE) { diff --git a/Core/GameEngine/Source/GameNetwork/DisconnectManager.cpp b/Core/GameEngine/Source/GameNetwork/DisconnectManager.cpp index 6aec6e5868d..19256a2d54c 100644 --- a/Core/GameEngine/Source/GameNetwork/DisconnectManager.cpp +++ b/Core/GameEngine/Source/GameNetwork/DisconnectManager.cpp @@ -371,7 +371,11 @@ void DisconnectManager::processDisconnectVote(NetCommandMsg *msg, ConnectionMana void DisconnectManager::processDisconnectFrame(NetCommandMsg *msg, ConnectionManager *conMgr) { NetDisconnectFrameCommandMsg *cmdMsg = (NetDisconnectFrameCommandMsg *)msg; - UnsignedInt playerID = cmdMsg->getPlayerID(); + const UnsignedInt playerID = cmdMsg->getPlayerID(); + if (playerID >= MAX_SLOTS) { + return; + } + if (m_disconnectFrames[playerID] >= cmdMsg->getDisconnectFrame()) { // this message isn't valid, we have a disconnect frame that is later than this already. return; @@ -415,7 +419,7 @@ void DisconnectManager::processDisconnectScreenOff(NetCommandMsg *msg, Connectio DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - got a screen off command from player %d for frame %d", cmdMsg->getPlayerID(), cmdMsg->getNewFrame())); - if ((playerID < 0) || (playerID >= MAX_SLOTS)) { + if (playerID >= MAX_SLOTS) { return; } diff --git a/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp b/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp index e6619efd0c8..e42b7072d24 100644 --- a/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp +++ b/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp @@ -49,7 +49,7 @@ #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine #include "Common/crc.h" -#include "Common/UserPreferences.h" +#include "Common/OptionPreferences.h" #include "GameNetwork/FirewallHelper.h" #include "GameNetwork/NAT.h" #include "GameNetwork/udp.h" diff --git a/Core/GameEngine/Source/GameNetwork/GameInfo.cpp b/Core/GameEngine/Source/GameNetwork/GameInfo.cpp index 0b5370f0947..648c13d3354 100644 --- a/Core/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -978,7 +978,7 @@ AsciiString GameInfoToAsciiString( const GameInfo *game ) } else { - DEBUG_ASSERTCRASH(false, ("Bad slot type")); + DEBUG_CRASH(("Bad slot type")); str = "X:"; } optionsString.concat(str); diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 592e14b133e..a1b326fa0dd 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -32,7 +32,7 @@ #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine #include "Common/Registry.h" -#include "Common/UserPreferences.h" +#include "Common/OptionPreferences.h" #include "Common/version.h" #include "GameNetwork/IPEnumeration.h" #include "GameNetwork/GameSpy/BuddyThread.h" diff --git a/Core/GameEngine/Source/GameNetwork/LANAPI.cpp b/Core/GameEngine/Source/GameNetwork/LANAPI.cpp index c7671fdc5c5..be01cd197fc 100644 --- a/Core/GameEngine/Source/GameNetwork/LANAPI.cpp +++ b/Core/GameEngine/Source/GameNetwork/LANAPI.cpp @@ -989,7 +989,7 @@ AsciiString LANAPI::createSlotString( void ) } else { - DEBUG_ASSERTCRASH(false, ("Bad slot type")); + DEBUG_CRASH(("Bad slot type")); str = "X,"; } @@ -1153,7 +1153,7 @@ void LANAPI::removeGame( LANGameInfo *game ) else { // Odd. We went the whole way without finding it in the list. - DEBUG_ASSERTCRASH(false, ("LANGameInfo wasn't in the list")); + DEBUG_CRASH(("LANGameInfo wasn't in the list")); } } } @@ -1194,7 +1194,7 @@ void LANAPI::removePlayer( LANPlayer *player ) else { // Odd. We went the whole way without finding it in the list. - DEBUG_ASSERTCRASH(false, ("LANPlayer wasn't in the list")); + DEBUG_CRASH(("LANPlayer wasn't in the list")); } } } diff --git a/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index 2c344553f76..9423e7663fa 100644 --- a/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -551,7 +551,7 @@ void LANAPI::OnPlayerLeave( UnicodeString player ) if (m_name.compare(player) == 0) { // We're leaving. Save options and Pop the shell up a screen. - //DEBUG_ASSERTCRASH(false, ("Slot is %d", m_currentGame->getLocalSlotNum())); + //DEBUG_CRASH(("Slot is %d", m_currentGame->getLocalSlotNum())); if (m_currentGame && m_currentGame->isInGame() && m_currentGame->getLocalSlotNum() >= 0) { LANPreferences pref; diff --git a/Core/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp b/Core/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp index 0f44f1d681d..7f88b835f86 100644 --- a/Core/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp +++ b/Core/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp @@ -432,7 +432,7 @@ void LANAPI::handleJoinAccept( LANMessage *msg, UnsignedInt senderIP ) if (!m_currentGame) { - DEBUG_ASSERTCRASH(false, ("Could not find game to join!")); + DEBUG_CRASH(("Could not find game to join!")); OnGameJoin(RET_UNKNOWN, nullptr); } else @@ -463,7 +463,7 @@ void LANAPI::handleJoinAccept( LANMessage *msg, UnsignedInt senderIP ) prefs.write(); OnGameJoin(RET_OK, m_currentGame); - //DEBUG_ASSERTCRASH(false, ("setting host to %ls@%ls", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(), + //DEBUG_CRASH(("setting host to %ls@%ls", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(), // m_currentGame->getLANSlot(0)->getUser()->getHost().str())); } m_pendingAction = ACT_NONE; diff --git a/Core/GameEngine/Source/GameNetwork/NetMessageStream.cpp b/Core/GameEngine/Source/GameNetwork/NetMessageStream.cpp index c2855eca5ce..2ae6a14899e 100644 --- a/Core/GameEngine/Source/GameNetwork/NetMessageStream.cpp +++ b/Core/GameEngine/Source/GameNetwork/NetMessageStream.cpp @@ -181,7 +181,7 @@ Bool AddCommandToPacket(const GameMessage *msg) commandBuf[0] = MSGTYPE_PARTIALCOMMAND; if (!TheNetwork->queueSend(BROADCAST_CON, commandBuf, bytesUsed + sizeof(CommandPacketHeader) + 1, MSG_NEEDACK | MSG_SEQUENCED)) { - //DEBUG_ASSERTCRASH(false, ("Too many commands in one frame! Some will be dropped.")); + //DEBUG_CRASH(("Too many commands in one frame! Some will be dropped.")); DEBUG_LOG(("Too many commands in one frame! Some will be dropped.")); return false; } @@ -192,7 +192,7 @@ Bool AddCommandToPacket(const GameMessage *msg) if (bytesUsed + sizeof(CommandPacketHeader) + messageSize >= MAX_MESSAGE_LEN) { - //DEBUG_ASSERTCRASH(false, ("Too many commands in one frame! Some will be dropped.")); + //DEBUG_CRASH(("Too many commands in one frame! Some will be dropped.")); DEBUG_LOG(("Too many commands in one frame! Some will be dropped.")); return false; } diff --git a/Core/GameEngine/Source/GameNetwork/NetPacket.cpp b/Core/GameEngine/Source/GameNetwork/NetPacket.cpp index 66546da7190..3d4315f7f2d 100644 --- a/Core/GameEngine/Source/GameNetwork/NetPacket.cpp +++ b/Core/GameEngine/Source/GameNetwork/NetPacket.cpp @@ -276,7 +276,7 @@ UnsignedInt NetPacket::GetBufferSizeNeededForCommand(NetCommandMsg *msg) { // This is where the fun begins... if (msg == nullptr) { - return TRUE; // There was nothing to add, so it was successful. + return 0; // There was nothing to add. } // Use the virtual function for all command message types return msg->getPackedByteCount(); diff --git a/Core/GameEngineDevice/CMakeLists.txt b/Core/GameEngineDevice/CMakeLists.txt index 93184aa47b1..25a6583230d 100644 --- a/Core/GameEngineDevice/CMakeLists.txt +++ b/Core/GameEngineDevice/CMakeLists.txt @@ -54,7 +54,7 @@ set(GAMEENGINEDEVICE_SRC # Include/W3DDevice/GameClient/W3DGUICallbacks.h # Include/W3DDevice/GameClient/W3DInGameUI.h # Include/W3DDevice/GameClient/W3DMirror.h -# Include/W3DDevice/GameClient/W3DMouse.h + Include/W3DDevice/GameClient/W3DMouse.h # Include/W3DDevice/GameClient/W3DParticleSys.h # Include/W3DDevice/GameClient/W3DPoly.h # Include/W3DDevice/GameClient/W3DProjectedShadow.h @@ -87,9 +87,9 @@ set(GAMEENGINEDEVICE_SRC # Include/Win32Device/Common/Win32GameEngine.h Include/Win32Device/Common/Win32LocalFile.h Include/Win32Device/Common/Win32LocalFileSystem.h -# Include/Win32Device/GameClient/Win32DIKeyboard.h -# Include/Win32Device/GameClient/Win32DIMouse.h -# Include/Win32Device/GameClient/Win32Mouse.h + Include/Win32Device/GameClient/Win32DIKeyboard.h + #Include/Win32Device/GameClient/Win32DIMouse.h + Include/Win32Device/GameClient/Win32Mouse.h Source/MilesAudioDevice/MilesAudioManager.cpp Source/VideoDevice/Bink/BinkVideoPlayer.cpp # Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp @@ -158,7 +158,7 @@ set(GAMEENGINEDEVICE_SRC # Source/W3DDevice/GameClient/W3DFileSystem.cpp # Source/W3DDevice/GameClient/W3DGameClient.cpp # Source/W3DDevice/GameClient/W3DInGameUI.cpp -# Source/W3DDevice/GameClient/W3DMouse.cpp + Source/W3DDevice/GameClient/W3DMouse.cpp # Source/W3DDevice/GameClient/W3DParticleSys.cpp # Source/W3DDevice/GameClient/W3DPoly.cpp Source/W3DDevice/GameClient/W3DPropBuffer.cpp @@ -189,9 +189,9 @@ set(GAMEENGINEDEVICE_SRC Source/Win32Device/Common/Win32LocalFile.cpp Source/Win32Device/Common/Win32LocalFileSystem.cpp # Source/Win32Device/Common/Win32OSDisplay.cpp -# Source/Win32Device/GameClient/Win32DIKeyboard.cpp + Source/Win32Device/GameClient/Win32DIKeyboard.cpp #Source/Win32Device/GameClient/Win32DIMouse.cpp -# Source/Win32Device/GameClient/Win32Mouse.cpp + Source/Win32Device/GameClient/Win32Mouse.cpp ) # Add C++ 17 FileSystem implementation for non-VS6 builds diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DMouse.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DMouse.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DMouse.h rename to Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DMouse.h diff --git a/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/GameClient/Win32DIKeyboard.h b/Core/GameEngineDevice/Include/Win32Device/GameClient/Win32DIKeyboard.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/Win32Device/GameClient/Win32DIKeyboard.h rename to Core/GameEngineDevice/Include/Win32Device/GameClient/Win32DIKeyboard.h diff --git a/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/GameClient/Win32DIMouse.h b/Core/GameEngineDevice/Include/Win32Device/GameClient/Win32DIMouse.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/Win32Device/GameClient/Win32DIMouse.h rename to Core/GameEngineDevice/Include/Win32Device/GameClient/Win32DIMouse.h diff --git a/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/GameClient/Win32Mouse.h b/Core/GameEngineDevice/Include/Win32Device/GameClient/Win32Mouse.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/Win32Device/GameClient/Win32Mouse.h rename to Core/GameEngineDevice/Include/Win32Device/GameClient/Win32Mouse.h diff --git a/Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index 4535e76f05a..4dde9b806ae 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -602,12 +602,17 @@ void W3DRadar::drawEvents( Int pixelX, Int pixelY, Int width, Int height ) void W3DRadar::drawIcons( Int pixelX, Int pixelY, Int width, Int height ) { Player *player = rts::getObservedOrLocalPlayer(); - for (RadarObject *heroObj = m_localHeroObjectList; heroObj; heroObj = heroObj->friend_getNext()) + for (RadarObject *heroObj = m_localObjectList; heroObj; heroObj = heroObj->friend_getNext()) { - if (canRenderObject(heroObj, player)) - { - drawHeroIcon(pixelX, pixelY, width, height, heroObj->friend_getObject()->getPosition()); - } + const Object *obj = heroObj->friend_getObject(); + + if (!obj->isHero()) + continue; + + if (!canRenderObject(heroObj, player)) + continue; + + drawHeroIcon(pixelX, pixelY, width, height, obj->getPosition()); } } @@ -623,7 +628,6 @@ void W3DRadar::updateObjectTexture(TextureClass *texture) // rebuild the object overlay renderObjectList( m_objectList, texture ); renderObjectList( m_localObjectList, texture ); - renderObjectList( m_localHeroObjectList, texture ); } //------------------------------------------------------------------------------------------------- diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp index 62b3e8669ea..eb76054b6b2 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp @@ -304,7 +304,7 @@ void W3DLaserDraw::doDrawModule(const Matrix3D* transformMtx) LaserUpdate *update = (LaserUpdate*)draw->findClientUpdateModule( key_LaserUpdate ); if( !update ) { - DEBUG_ASSERTCRASH( 0, ("W3DLaserDraw::doDrawModule() expects its owner drawable %s to have a ClientUpdate = LaserUpdate module.", draw->getTemplate()->getName().str() )); + DEBUG_CRASH( ("W3DLaserDraw::doDrawModule() expects its owner drawable %s to have a ClientUpdate = LaserUpdate module.", draw->getTemplate()->getName().str() )); return; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp rename to Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp b/Core/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp rename to Core/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp b/Core/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp rename to Core/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp b/Core/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp rename to Core/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp diff --git a/Core/Tools/ImagePacker/Source/ImagePacker.cpp b/Core/Tools/ImagePacker/Source/ImagePacker.cpp index fb180b69806..3bf47871c9a 100644 --- a/Core/Tools/ImagePacker/Source/ImagePacker.cpp +++ b/Core/Tools/ImagePacker/Source/ImagePacker.cpp @@ -251,7 +251,7 @@ Bool ImagePacker::packImages( void ) char buffer[ _MAX_PATH ]; sprintf( buffer, "Unable to add image '%s' to a brand new page!\n", image->m_path ); - DEBUG_ASSERTCRASH( 0, (buffer) ); + DEBUG_CRASH( (buffer) ); MessageBox( nullptr, buffer, "Internal Error", MB_OK | MB_ICONERROR ); return FALSE; diff --git a/Core/Tools/ImagePacker/Source/TexturePage.cpp b/Core/Tools/ImagePacker/Source/TexturePage.cpp index a2520e4c92f..c3ffadf843f 100644 --- a/Core/Tools/ImagePacker/Source/TexturePage.cpp +++ b/Core/Tools/ImagePacker/Source/TexturePage.cpp @@ -524,7 +524,7 @@ Bool TexturePage::addImageData( Byte *destBuffer, char buffer[ _MAX_PATH + 32 ]; sprintf( buffer, "Error loading source file '%s'\n", image->m_path ); - DEBUG_ASSERTCRASH( 0, (buffer) ); + DEBUG_CRASH( (buffer) ); MessageBox( nullptr, buffer, "Cannot Load Source File", MB_OK | MB_ICONERROR ); return FALSE; diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt index 991e6a72698..044a2ec6952 100644 --- a/Generals/Code/GameEngine/CMakeLists.txt +++ b/Generals/Code/GameEngine/CMakeLists.txt @@ -133,28 +133,28 @@ set(GAMEENGINE_SRC Include/GameClient/AnimateWindowManager.h # Include/GameClient/ChallengeGenerals.h Include/GameClient/CampaignManager.h - Include/GameClient/ClientInstance.h +# Include/GameClient/ClientInstance.h # Include/GameClient/ClientRandomValue.h - Include/GameClient/Color.h +# Include/GameClient/Color.h Include/GameClient/CommandXlat.h Include/GameClient/ControlBar.h Include/GameClient/ControlBarResizer.h Include/GameClient/ControlBarScheme.h - Include/GameClient/Credits.h +# Include/GameClient/Credits.h Include/GameClient/DebugDisplay.h Include/GameClient/Diplomacy.h Include/GameClient/DisconnectMenu.h Include/GameClient/Display.h - Include/GameClient/DisplayString.h - Include/GameClient/DisplayStringManager.h +# Include/GameClient/DisplayString.h +# Include/GameClient/DisplayStringManager.h Include/GameClient/Drawable.h Include/GameClient/DrawableInfo.h - Include/GameClient/DrawGroupInfo.h +# Include/GameClient/DrawGroupInfo.h Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h - Include/GameClient/FXList.h +# Include/GameClient/FXList.h Include/GameClient/Gadget.h Include/GameClient/GadgetCheckBox.h Include/GameClient/GadgetComboBox.h @@ -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/GameText.h +# Include/GameClient/GameWindow.h +# Include/GameClient/GameWindowGlobal.h Include/GameClient/GameWindowID.h Include/GameClient/GameWindowManager.h - Include/GameClient/GameWindowTransitions.h - Include/GameClient/GlobalLanguage.h - Include/GameClient/GraphDraw.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/Keyboard.h Include/GameClient/KeyDefs.h - Include/GameClient/LanguageFilter.h - Include/GameClient/Line2D.h - Include/GameClient/LoadScreen.h +# Include/GameClient/LanguageFilter.h +# Include/GameClient/Line2D.h +# Include/GameClient/LoadScreen.h Include/GameClient/LookAtXlat.h # Include/GameClient/MapUtil.h Include/GameClient/MessageBox.h @@ -197,28 +197,28 @@ set(GAMEENGINE_SRC Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h Include/GameClient/Module/BeaconClientUpdate.h Include/GameClient/Module/SwayClientUpdate.h - Include/GameClient/Mouse.h +# Include/GameClient/Mouse.h # Include/GameClient/ParticleSys.h Include/GameClient/PlaceEventTranslator.h - Include/GameClient/ProcessAnimateWindow.h - Include/GameClient/RadiusDecal.h +# Include/GameClient/ProcessAnimateWindow.h +# Include/GameClient/RadiusDecal.h Include/GameClient/RayEffect.h - Include/GameClient/SelectionInfo.h +# Include/GameClient/SelectionInfo.h Include/GameClient/SelectionXlat.h Include/GameClient/Shadow.h Include/GameClient/Shell.h Include/GameClient/ShellHooks.h Include/GameClient/ShellMenuScheme.h - Include/GameClient/Statistics.h +# Include/GameClient/Statistics.h # Include/GameClient/TerrainRoads.h # Include/GameClient/TerrainVisual.h # 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 @@ -636,24 +636,24 @@ set(GAMEENGINE_SRC # Source/Common/UserPreferences.cpp Source/Common/version.cpp # Source/Common/WorkerProcess.cpp - Source/GameClient/ClientInstance.cpp - Source/GameClient/Color.cpp - Source/GameClient/Credits.cpp +# Source/GameClient/ClientInstance.cpp +# Source/GameClient/Color.cpp +# Source/GameClient/Credits.cpp Source/GameClient/Display.cpp - Source/GameClient/DisplayString.cpp - Source/GameClient/DisplayStringManager.cpp +# Source/GameClient/DisplayString.cpp +# Source/GameClient/DisplayStringManager.cpp Source/GameClient/Drawable.cpp Source/GameClient/Drawable/Update/AnimatedParticleSysBoneClientUpdate.cpp Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp Source/GameClient/Drawable/Update/SwayClientUpdate.cpp - Source/GameClient/DrawGroupInfo.cpp +# Source/GameClient/DrawGroupInfo.cpp Source/GameClient/Eva.cpp - Source/GameClient/FXList.cpp +# Source/GameClient/FXList.cpp Source/GameClient/GameClient.cpp Source/GameClient/GameClientDispatch.cpp - Source/GameClient/GameText.cpp - Source/GameClient/GlobalLanguage.cpp - Source/GameClient/GraphDraw.cpp +# Source/GameClient/GameText.cpp +# Source/GameClient/GlobalLanguage.cpp +# Source/GameClient/GraphDraw.cpp Source/GameClient/GUI/AnimateWindowManager.cpp # Source/GameClient/GUI/ChallengeGenerals.cpp Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -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,20 +738,20 @@ 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 - Source/GameClient/LanguageFilter.cpp - Source/GameClient/Line2D.cpp +# Source/GameClient/Input/Keyboard.cpp +# Source/GameClient/Input/Mouse.cpp +# Source/GameClient/LanguageFilter.cpp +# Source/GameClient/Line2D.cpp # Source/GameClient/MapUtil.cpp Source/GameClient/MessageStream/CommandXlat.cpp Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -762,9 +762,9 @@ set(GAMEENGINE_SRC Source/GameClient/MessageStream/PlaceEventTranslator.cpp Source/GameClient/MessageStream/SelectionXlat.cpp Source/GameClient/MessageStream/WindowXlat.cpp - Source/GameClient/RadiusDecal.cpp - Source/GameClient/SelectionInfo.cpp - Source/GameClient/Statistics.cpp +# Source/GameClient/RadiusDecal.cpp +# Source/GameClient/SelectionInfo.cpp +# Source/GameClient/Statistics.cpp Source/GameClient/System/Anim2D.cpp Source/GameClient/System/CampaignManager.cpp # "Source/GameClient/System/Debug Displayers/AudioDebugDisplay.cpp" diff --git a/Generals/Code/GameEngine/Include/Common/TunnelTracker.h b/Generals/Code/GameEngine/Include/Common/TunnelTracker.h index eddc5b3c104..188eb61180c 100644 --- a/Generals/Code/GameEngine/Include/Common/TunnelTracker.h +++ b/Generals/Code/GameEngine/Include/Common/TunnelTracker.h @@ -44,6 +44,7 @@ class TunnelTracker : public MemoryPoolObject, // contain list access void iterateContained( ContainIterateFunc func, void *userData, Bool reverse ); UnsignedInt getContainCount() const { return m_containListSize; } + UnsignedInt getHeroUnitsContained() const { return m_heroUnitsContained; } Int getContainMax() const; const ContainedItemsList* getContainedItemsList() const { return &m_containList; } void swapContainedItemsList(ContainedItemsList& newList); @@ -85,6 +86,7 @@ class TunnelTracker : public MemoryPoolObject, ContainedItemsList m_containList; ///< the contained object pointers list std::list< ObjectID > m_xferContainList;///< for loading of m_containList during post processing Int m_containListSize; ///< size of the contain list + UnsignedInt m_heroUnitsContained; ///< cached hero count UnsignedInt m_tunnelCount; ///< How many tunnels have registered so we know when we should kill our contain list UnsignedInt m_framesForFullHeal; ///< How many frames it takes to fully heal a unit Bool m_needsFullHealTimeUpdate; ///< Set to true when needing to recalc full heal time to batch the operation 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/Color.h b/Generals/Code/GameEngine/Include/GameClient/Color.h deleted file mode 100644 index 842827c3028..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Color.h +++ /dev/null @@ -1,87 +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: Color.h ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Color.h -// -// Created: Colin Day, July 2001 -// -// Desc: Management of color representations -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "Lib/BaseType.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -// TYPE DEFINES /////////////////////////////////////////////////////////////// -enum { GAME_COLOR_UNDEFINED = 0x00FFFFFF }; // this is white with zero alpha... safe to use! - -/** @todo we need real color representation, this is just placeholder so we -can more easily identify sections of the code that need it */ -typedef Int Color; - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// - -inline Color GameMakeColor( UnsignedByte red, UnsignedByte green, UnsignedByte blue, UnsignedByte alpha ) -{ - return (alpha << 24) | (red << 16) | (green << 8) | (blue); -} - -extern void GameGetColorComponents( Color color, - UnsignedByte *red, - UnsignedByte *green, - UnsignedByte *blue, - UnsignedByte *alpha ); - -// Put on ice until later - M Lorenzen -//extern void GameGetColorComponentsWithCheatSpy( Color color, -// UnsignedByte *red, -// UnsignedByte *green, -// UnsignedByte *blue, -// UnsignedByte *alpha ); - - -extern void GameGetColorComponentsReal( Color color, Real *red, Real *green, Real *blue, Real *alpha ); - -extern Color GameDarkenColor( Color color, Int percent = 10 ); diff --git a/Generals/Code/GameEngine/Include/GameClient/Credits.h b/Generals/Code/GameEngine/Include/GameClient/Credits.h deleted file mode 100644 index 5055907b0dd..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Credits.h +++ /dev/null @@ -1,164 +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: Credits.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Dec 2002 -// -// Filename: Credits.h -// -// author: Chris Huybregts -// -// purpose: header file for the credits -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameClient/FontDesc.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class DisplayString; -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -enum -{ -CREDIT_STYLE_TITLE = 0, -CREDIT_STYLE_POSITION, -CREDIT_STYLE_NORMAL, -CREDIT_STYLE_COLUMN, -CREDIT_STYLE_BLANK, ///< Keep this second to last - -MAX_CREDIT_STYLES -}; - -enum{ CREDIT_SPACE_OFFSET = 2 }; - -static const LookupListRec CreditStyleNames[] = -{ - { "TITLE", CREDIT_STYLE_TITLE }, - { "MINORTITLE", CREDIT_STYLE_POSITION }, - { "NORMAL", CREDIT_STYLE_NORMAL }, - { "COLUMN", CREDIT_STYLE_COLUMN }, - // CREDIT_STYLE_BLANK - { nullptr, 0 } -}; -static_assert(ARRAY_SIZE(CreditStyleNames) == MAX_CREDIT_STYLES, "Incorrect array size"); - - -class CreditsLine -{ -public: - CreditsLine(); - ~CreditsLine(); - -// parsing variables - Int m_style; - UnicodeString m_text; - UnicodeString m_secondText; - Bool m_useSecond; - Bool m_done; - -// drawing variables - DisplayString *m_displayString; - DisplayString *m_secondDisplayString; - ICoord2D m_pos; - Int m_height; - Int m_color; -}; - -class CreditsManager: public SubsystemInterface -{ -public: - CreditsManager(void); - ~CreditsManager(void); - - void init(void ); - void load(void ); - void reset( void ); - void update( void ); - void draw( void ); - - const FieldParse *getFieldParse() const { return m_creditsFieldParseTable; } ///< returns the parsing fields - static const FieldParse m_creditsFieldParseTable[]; ///< the parse table - static void parseBlank( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the image part of the INI file - static void parseText( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the image part of the INI file - - Bool isFinished( void ) { return m_isFinished; } - void addBlank( void ); - void addText( AsciiString text ); -private: - - UnicodeString getUnicodeString(AsciiString str); - - typedef std::list CreditsLineList; - CreditsLineList m_creditLineList; - CreditsLineList::iterator m_creditLineListIt; - - CreditsLineList m_displayedCreditLineList; - - Int m_scrollRate; // in pixels - Int m_scrollRatePerFrames; - Bool m_scrollDown; // if TRUE text will come from the top to the bottom if False, it will go from the bottom up - - Color m_titleColor; - Color m_positionColor; - Color m_normalColor; - - Int m_currentStyle; - - Bool m_isFinished; - - Int m_framesSinceStarted; - Int m_normalFontHeight; -}; - - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -extern CreditsManager *TheCredits; diff --git a/Generals/Code/GameEngine/Include/GameClient/DisplayString.h b/Generals/Code/GameEngine/Include/GameClient/DisplayString.h deleted file mode 100644 index 164ad25bbb2..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/DisplayString.h +++ /dev/null @@ -1,128 +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: DisplayString.h ////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: DisplayString.h -// -// Created: Colin Day, July 2001 -// -// Desc: Contstuct for holding double byte game string data and being -// able to draw that text to the screen. -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "Lib/BaseType.h" -#include "GameClient/GameFont.h" -#include "GameClient/Color.h" -#include "Common/AsciiString.h" -#include "Common/UnicodeString.h" -#include "Common/GameMemory.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -class DisplayStringManager; - -// TYPE DEFINES /////////////////////////////////////////////////////////////// - -// DisplayString -------------------------------------------------------------- -/** String representation that can also has additional information and - * methods for drawing to the screen */ -//----------------------------------------------------------------------------- -class DisplayString : public MemoryPoolObject -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DisplayString, "DisplayString" ) - -public: - - friend DisplayStringManager; - - DisplayString( void ); - // virtual ~DisplayString( void ); // destructor defined by memory pool - - virtual void setText( UnicodeString text ); ///< set text for this string - virtual UnicodeString getText( void ); ///< get text for this string - virtual Int getTextLength( void ); ///< return number of chars in string - virtual void notifyTextChanged( void ); ///< called when text has changed - virtual void reset( void ); ///< reset all contents of string - - virtual void setFont( GameFont *font ); ///< set a font for display - virtual GameFont *getFont( void ); ///< return font in string - virtual void setWordWrap( Int wordWrap ) = 0; ///< Set the width that we want to start wrapping text - virtual void setWordWrapCentered( Bool isCentered ) = 0; ///< If this is set to true, the text on a new line is centered - virtual void draw( Int x, Int y, Color color, Color dropColor ) = 0; ///< render text - virtual void draw( Int x, Int y, Color color, Color dropColor, Int xDrop, Int yDrop ) = 0; ///< render text with the drop shadow being at the offsets passed in - virtual void getSize( Int *width, Int *height ) = 0; ///< get render size - virtual Int getWidth( Int charPos = -1 ) = 0; ///< get text with up to charPos characters, 1- = all characters - - virtual void setUseHotkey( Bool useHotkey, Color hotKeyColor ) = 0; - - virtual void setClipRegion( IRegion2D *region ); ///< clip text in this region - - virtual void removeLastChar( void ); ///< remove the last character - virtual void truncateBy(const Int charCount); ///< remove the last charCount characters - virtual void truncateTo(const Int maxLength); ///< remove characters, if needed, until the string is maxLength long excluding null terminator - - virtual void appendChar( WideChar c ); ///< append character to end - - DisplayString *next( void ); ///< return next string - -protected: - - UnicodeString m_textString; - GameFont *m_font; ///< font to display this string with - - DisplayString *m_next; ///< for the display string factory list ONLY - DisplayString *m_prev; ///< for the display string factory list ONLY - -}; - -/////////////////////////////////////////////////////////////////////////////// -// INLINING /////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -inline UnicodeString DisplayString::getText( void ) { return m_textString; } -inline Int DisplayString::getTextLength( void ) { return m_textString.getLength(); } -inline void DisplayString::setFont( GameFont *font ) { m_font = font; } -inline GameFont *DisplayString::getFont( void ) { return m_font; } -inline void DisplayString::setClipRegion( IRegion2D *region ) {} -inline void DisplayString::notifyTextChanged( void ) {} -inline DisplayString *DisplayString::next( void ) { return m_next; } - -// EXTERNALS ////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngine/Include/GameClient/DisplayStringManager.h b/Generals/Code/GameEngine/Include/GameClient/DisplayStringManager.h deleted file mode 100644 index 6ce394d3fe5..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/DisplayStringManager.h +++ /dev/null @@ -1,65 +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: DisplayStringManager.h /////////////////////////////////////////////////////////////////// -// Created: Colin Day, July 2001 -// Desc: Access for creating game managed display strings -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/SubsystemInterface.h" -#include "GameClient/DisplayString.h" - -//------------------------------------------------------------------------------------------------- -/** Factory for managing and creating display strings */ -//------------------------------------------------------------------------------------------------- -class DisplayStringManager : public SubsystemInterface -{ - -public: - - DisplayStringManager( void ); - virtual ~DisplayStringManager( void ); - - virtual void init( void ) {} ///< initialize the factory - virtual void reset( void ) {} ///< reset system - virtual void update( void ) {}; ///< update anything we need to in our strings - - virtual DisplayString *newDisplayString( void ) = 0; ///< allocate new display string - virtual void freeDisplayString( DisplayString *string ) = 0; ///< free string - - virtual DisplayString *getGroupNumeralString( Int numeral ) = 0; - virtual DisplayString *getFormationLetterString( void ) = 0; -protected: - - void link( DisplayString *string ); ///< link display string to list - void unLink( DisplayString *string ); ///< unlink display string from list - - DisplayString *m_stringList; ///< list of all display strings - DisplayString *m_currentCheckpoint; ///< current checkpoint of strings to be freed -}; - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// -extern DisplayStringManager *TheDisplayStringManager; ///< singleton extern diff --git a/Generals/Code/GameEngine/Include/GameClient/DrawGroupInfo.h b/Generals/Code/GameEngine/Include/GameClient/DrawGroupInfo.h deleted file mode 100644 index 0637bd8ec4b..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/DrawGroupInfo.h +++ /dev/null @@ -1,64 +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: DrawGroupInfo.h ////////////////////////////////////////////////////////////////////////// -// AudioEventRTS structure -// Author: John K. McDonald, March 2002 - -#pragma once - -struct DrawGroupInfo -{ - AsciiString m_fontName; - Int m_fontSize; - Bool m_fontIsBold; - - Bool m_usePlayerColor; - Color m_colorForText; - Color m_colorForTextDropShadow; - - Int m_dropShadowOffsetX; - Int m_dropShadowOffsetY; - - union - { - Int m_pixelOffsetX; - Real m_percentOffsetX; - }; - Bool m_usingPixelOffsetX; - - union - { - Int m_pixelOffsetY; - Real m_percentOffsetY; - }; - Bool m_usingPixelOffsetY; - - DrawGroupInfo(); - - static const FieldParse s_fieldParseTable[]; ///< the parse table for INI definition - const FieldParse *getFieldParse( void ) const { return s_fieldParseTable; } -}; - -extern DrawGroupInfo *TheDrawGroupInfo; diff --git a/Generals/Code/GameEngine/Include/GameClient/FXList.h b/Generals/Code/GameEngine/Include/GameClient/FXList.h deleted file mode 100644 index 4d1204c19ea..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/FXList.h +++ /dev/null @@ -1,219 +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: FXList.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, December 2001 -// Desc: General Effects Descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameMemory.h" -#include "Common/NameKeyGenerator.h" -#include "Common/STLTypedefs.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class FXNugget; -class FXList; -class FXListStore; -class INI; -class Object; -class Matrix3D; - -//------------------------------------------------------------------------------------------------- -/** - An FXNugget encapsulates a particular type of audio/video effect. FXNuggets are virtually - never used on their own, but rather, as a component of an FXList (see below). - - Important notes: - - -- FXNugget is an ABC; all the implementations are (currently) located in FXList.cpp, - thought they will probably be spread out more as we add more implementations. - - -- As part of an FXList, an FXNugget is shared between multiple units. The implication is that - an FXNugget should not require private data storage to do what it needs to do, aside from stuff - initialized at FXNugget instantiation time (eg, parameters from an INI file). To help - enforce this, all it's methods are declared 'const'. If you can't implement what you - need within this framework, please *don't* simply de-const things, because it could lead to very - strange side-effects. Instead, the system will have to be enhanced to allow for multiple instances - of each FXNugget. - - -- an individual FXNugget is generally not directly accessible to anyone outside of the - FXList system; in fact, it could probably be a private class, but isn't, mainly for coding convenience. - - -- Unlike most other game systems, FXNuggets can't be overridden by subsequent INI file - loads. This isn't really a problem, because all you really need to do to "override" one is to - specify a different one. -*/ -class FXNugget : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_ABC(FXNugget) -public: - - FXNugget() { } - //virtual ~FXNugget() { } - - /** - The main guts of the system: actually perform the sound and/or video effects - needed. Note that primary and/or secondary can be null, so you must check for this. - */ - virtual void doFXPos(const Coord3D *primary, const Matrix3D* primaryMtx = nullptr, const Real primarySpeed = 0.0f, const Coord3D *secondary = nullptr, const Real overrideRadius = 0.0f) const = 0; - - /** - the object-based version... by default, just call the location-based implementation. - Note that primary and/or secondary can be null, so you must check for this. - */ - virtual void doFXObj(const Object* primary, const Object* secondary = nullptr) const; - -private: - -}; -EMPTY_DTOR(FXNugget) - -//------------------------------------------------------------------------------------------------- -/** - An FXList is a way of encapsulating a particular set of audio/video effect(s). - Lots of other game systems (eg, DamageFX) use FXLists to abstract AV effects into data files - (rather than hardcoding them, which would be suboptimal). - - Important notes: - - -- an FXList is specified solely by name, and the only parameters it receives when performing - its AV effects are a primary (and optional secondary) object position. - - -- There is no inheritance or overriding of FXLists; if you need an FXList that is nearly-but-not-quite - identical to an existing one, you must simply make an entirely new FXList. Realistically, this shouldn't - be a problem, since they are pretty simple to specify, and don't consume a lot of memory. - - -- an FXList is shared between multiple units. To help - enforce this, all it's methods are declared 'const'. If you can't implement the stuff you - need within this framework, please *don't* simply de-const things, because it could lead to very - strange side-effects. Instead, the system will have to be enhanced to allow for multiple instances - of each FXNugget. - - -- Unlike most other game systems, FXList can't be overridden by subsequent INI file - loads. This isn't really a problem, because all you really need to do to "override" one is to - specify a different one. -*/ -class FXList -{ - -public: - - FXList(); - virtual ~FXList(); - - /** - Toss the contents. - */ - void clear(); - - /** - add a nugget to the list. It belongs to the FXList, who is responsible for freeing it. - */ - void addFXNugget(FXNugget *fxn) - { - m_nuggets.push_back(fxn); - } - - /// inline convenience method to avoid having to check for null. - inline static void doFXPos(const FXList* fx, const Coord3D *primary, const Matrix3D* primaryMtx = nullptr, const Real primarySpeed = 0.0f, const Coord3D *secondary = nullptr, const Real overrideRadius = 0.0f) - { - if (fx) fx->doFXPos(primary, primaryMtx, primarySpeed, secondary, overrideRadius); - } - - /// inline convenience method to avoid having to check for null. - inline static void doFXObj(const FXList* fx, const Object* primary, const Object* secondary = nullptr) - { - if (fx) - { - fx->doFXObj(primary, secondary); - - //if (fx->) // here we need to cal doFXRicochet, if fx calls for it - - } - - } - - - -protected: - - - /** - The main guts of the system: actually perform the sound and/or video effects - needed. Note that primary and/or secondary can be null, so you must check for this. - */ - void doFXPos(const Coord3D *primary, const Matrix3D* primaryMtx = nullptr, const Real primarySpeed = 0.0f, const Coord3D *secondary = nullptr, const Real overrideRadius = 0.0f) const; - - /** - the object-based version... by default, just call the location-based implementation. - Note that primary and/or secondary can be null, so you must check for this. - */ - void doFXObj(const Object* primary, const Object* secondary = nullptr) const; - -private: - - typedef std::list< FXNugget* > FXNuggetList; - - FXNuggetList m_nuggets; - -}; - -//------------------------------------------------------------------------------------------------- -/** - The "store" used to hold all the FXLists in existence. -*/ -class FXListStore : public SubsystemInterface -{ - -public: - - FXListStore(); - ~FXListStore(); - - void init() { } - void reset() { } - void update() { } - - /** - return the FXList with the given namekey. - return nullptr if no such FXList exists. - */ - const FXList *findFXList( const char* name ) const; - - static void parseFXListDefinition(INI* ini); - -private: - - // use the hashing function for Ints. - typedef std::hash_map< NameKeyType, FXList, rts::hash, rts::equal_to > FXListMap; - - FXListMap m_fxmap; - -}; - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// -extern FXListStore *TheFXListStore; 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/GameText.h b/Generals/Code/GameEngine/Include/GameClient/GameText.h deleted file mode 100644 index bf8c94fb88c..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/GameText.h +++ /dev/null @@ -1,133 +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: RTS 3 -// -// File name: GameClient/GameText.h -// -// Created: 11/07/01 -// -//---------------------------------------------------------------------------- - -#pragma once - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- -// Forward References -//---------------------------------------------------------------------------- - -class AsciiString; -class UnicodeString; - -//---------------------------------------------------------------------------- -// Type Defines -//---------------------------------------------------------------------------- -typedef std::vector AsciiStringVec; - -//=============================== -// GameTextInterface -//=============================== -/** Game text interface object for localised text. - */ -//=============================== - -class GameTextInterface : public SubsystemInterface -{ - - public: - - virtual ~GameTextInterface() {}; - - virtual UnicodeString fetch( const Char *label, Bool *exists = nullptr ) = 0; ///< Returns the associated labeled unicode text - virtual UnicodeString fetch( AsciiString label, Bool *exists = nullptr ) = 0; ///< Returns the associated labeled unicode text ; TheSuperHackers @todo Remove - virtual UnicodeString fetchFormat( const Char *label, ... ) = 0; - - // Do not call this directly, but use the FETCH_OR_SUBSTITUTE macro - virtual UnicodeString fetchOrSubstitute( const Char *label, const WideChar *substituteText ) = 0; - virtual UnicodeString fetchOrSubstituteFormat( const Char *label, const WideChar *substituteFormat, ... ) = 0; - virtual UnicodeString fetchOrSubstituteFormatVA( const Char *label, const WideChar *substituteFormat, va_list args ) = 0; - - // This function is not performance tuned.. Its really only for Worldbuilder. jkmcd - virtual AsciiStringVec& getStringsWithLabelPrefix(AsciiString label) = 0; - - virtual void initMapStringFile( const AsciiString& filename ) = 0; - -#if __cplusplus < 201103L // TheSuperHackers @todo Remove function when abandoning VC6 - inline UnicodeString FETCH_OR_SUBSTITUTE_FORMAT( const Char *label, const WideChar *substituteFormat, ... ) - { - va_list args; - va_start(args, substituteFormat); - UnicodeString str = fetchOrSubstituteFormatVA(label, substituteFormat, args); - va_end(args); - return str; - } -#endif -}; - - -extern GameTextInterface *TheGameText; -extern GameTextInterface* CreateGameTextInterface( void ); - -//---------------------------------------------------------------------------- -// Inlining -//---------------------------------------------------------------------------- - -// TheSuperHackers @info This is meant to be used like: -// TheGameText->FETCH_OR_SUBSTITUTE("GUI:LabelName", L"Substitute Fallback Text") -// TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:LabelName", L"Substitute Fallback Text %d %d", 1, 2) -// The substitute text will be compiled out if ENABLE_GAMETEXT_SUBSTITUTES is not defined. -// -// Note: ##__VA_ARGS__ handles zero variadic arguments by removing the preceding comma when empty. -// Example: FETCH_OR_SUBSTITUTE_FORMAT("Label", L"Text") expands correctly without trailing comma. -// Without ##, it would expand to fetchOrSubstituteFormat("Label", L"Text",) causing a syntax error. -// This extension is widely supported (GCC, Clang, MSVC 2015+). C++20 __VA_OPT__ is the standard -// alternative, but ##__VA_ARGS__ is simpler and compatible across C++11/14/17/20. -#if ENABLE_GAMETEXT_SUBSTITUTES - -#define FETCH_OR_SUBSTITUTE(labelA, substituteTextW) fetchOrSubstitute(labelA, substituteTextW) -#if __cplusplus >= 201103L // TheSuperHackers @todo Remove condition when abandoning VC6 -#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchOrSubstituteFormat(labelA, substituteFormatW, ##__VA_ARGS__) -#endif - -#else - -#define FETCH_OR_SUBSTITUTE(labelA, substituteTextW) fetch(labelA) -#if __cplusplus >= 201103L // TheSuperHackers @todo Remove condition when abandoning VC6 -#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchFormat(labelA, ##__VA_ARGS__) -#endif - -#endif // ENABLE_GAMETEXT_SUBSTITUTES 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; ///