diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt index 0a58dfc431..094bf7f572 100644 --- a/Core/GameEngine/CMakeLists.txt +++ b/Core/GameEngine/CMakeLists.txt @@ -139,31 +139,31 @@ set(GAMEENGINE_SRC Include/Common/XferDeepCRC.h Include/Common/XferLoad.h Include/Common/XferSave.h -# Include/GameClient/Anim2D.h -# Include/GameClient/AnimateWindowManager.h + Include/GameClient/Anim2D.h + Include/GameClient/AnimateWindowManager.h # Include/GameClient/CampaignManager.h -# Include/GameClient/CDCheck.h + Include/GameClient/CDCheck.h # Include/GameClient/ChallengeGenerals.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/ControlBarResizer.h # Include/GameClient/ControlBarScheme.h -# Include/GameClient/Credits.h -# Include/GameClient/DebugDisplay.h -# Include/GameClient/Diplomacy.h -# Include/GameClient/DisconnectMenu.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/EstablishConnectionsMenu.h + Include/GameClient/DrawGroupInfo.h + Include/GameClient/EstablishConnectionsMenu.h # Include/GameClient/Eva.h -# Include/GameClient/ExtendedMessageBox.h + Include/GameClient/ExtendedMessageBox.h # Include/GameClient/FontDesc.h # Include/GameClient/FXList.h # Include/GameClient/Gadget.h @@ -176,14 +176,14 @@ set(GAMEENGINE_SRC # Include/GameClient/GadgetSlider.h # Include/GameClient/GadgetStaticText.h # Include/GameClient/GadgetTabControl.h -# Include/GameClient/GadgetTextEntry.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/GameText.h # Include/GameClient/GameWindow.h # Include/GameClient/GameWindowGlobal.h -# Include/GameClient/GameWindowID.h + Include/GameClient/GameWindowID.h # Include/GameClient/GameWindowManager.h # Include/GameClient/GameWindowTransitions.h # Include/GameClient/GlobalLanguage.h @@ -192,39 +192,39 @@ set(GAMEENGINE_SRC # Include/GameClient/GUICommandTranslator.h # Include/GameClient/HeaderTemplate.h # Include/GameClient/HintSpy.h -# Include/GameClient/HotKey.h + Include/GameClient/HotKey.h # Include/GameClient/Image.h -# Include/GameClient/IMEManager.h + Include/GameClient/IMEManager.h # Include/GameClient/InGameUI.h -# Include/GameClient/Keyboard.h -# Include/GameClient/KeyDefs.h + Include/GameClient/Keyboard.h + Include/GameClient/KeyDefs.h # Include/GameClient/LanguageFilter.h -# Include/GameClient/Line2D.h + Include/GameClient/Line2D.h # Include/GameClient/LoadScreen.h # Include/GameClient/LookAtXlat.h # Include/GameClient/MapUtil.h -# Include/GameClient/MessageBox.h + Include/GameClient/MessageBox.h # Include/GameClient/MetaEvent.h -# Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h -# Include/GameClient/Module/BeaconClientUpdate.h -# Include/GameClient/Module/SwayClientUpdate.h -# Include/GameClient/Mouse.h + Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h + Include/GameClient/Module/BeaconClientUpdate.h + Include/GameClient/Module/SwayClientUpdate.h + #Include/GameClient/Mouse.h # Include/GameClient/ParabolicEase.h # Include/GameClient/ParticleSys.h # Include/GameClient/PlaceEventTranslator.h -# Include/GameClient/ProcessAnimateWindow.h + Include/GameClient/ProcessAnimateWindow.h # Include/GameClient/RadiusDecal.h -# Include/GameClient/RayEffect.h + Include/GameClient/RayEffect.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/Shadow.h + Include/GameClient/Shell.h + Include/GameClient/ShellHooks.h + Include/GameClient/ShellMenuScheme.h # Include/GameClient/Smudge.h # Include/GameClient/Snow.h -# Include/GameClient/Statistics.h -# Include/GameClient/TerrainRoads.h + Include/GameClient/Statistics.h + Include/GameClient/TerrainRoads.h # Include/GameClient/TerrainVisual.h Include/GameClient/VideoPlayer.h # Include/GameClient/View.h @@ -687,21 +687,21 @@ set(GAMEENGINE_SRC # Source/Common/version.cpp Source/Common/WorkerProcess.cpp # Source/GameClient/ClientInstance.cpp -# Source/GameClient/Color.cpp + #Source/GameClient/Color.cpp # Source/GameClient/Credits.cpp # Source/GameClient/Display.cpp # Source/GameClient/DisplayString.cpp -# Source/GameClient/DisplayStringManager.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/GameClient.cpp # Source/GameClient/GameClientDispatch.cpp -# Source/GameClient/GameText.cpp + Source/GameClient/GameText.cpp # Source/GameClient/GlobalLanguage.cpp # Source/GameClient/GraphDraw.cpp # Source/GameClient/GUI/AnimateWindowManager.cpp @@ -713,7 +713,7 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp # Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp # Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp -# Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp + Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp # Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp # Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp # Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp @@ -731,7 +731,7 @@ 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/GameFont.cpp # Source/GameClient/GUI/GameWindow.cpp # Source/GameClient/GUI/GameWindowGlobal.cpp # Source/GameClient/GUI/GameWindowManager.cpp @@ -795,14 +795,14 @@ set(GAMEENGINE_SRC # 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/InGameUI.cpp # Source/GameClient/Input/Keyboard.cpp # Source/GameClient/Input/Mouse.cpp -# Source/GameClient/LanguageFilter.cpp -# Source/GameClient/Line2D.cpp + Source/GameClient/LanguageFilter.cpp + Source/GameClient/Line2D.cpp # Source/GameClient/MapUtil.cpp # Source/GameClient/MessageStream/CommandXlat.cpp # Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -817,11 +817,11 @@ set(GAMEENGINE_SRC # 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 -# Source/GameClient/System/DebugDisplay.cpp + Source/GameClient/System/DebugDisplay.cpp # Source/GameClient/System/Image.cpp # Source/GameClient/System/ParticleSys.cpp # Source/GameClient/System/RayEffect.cpp diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h b/Core/GameEngine/Include/GameClient/Anim2D.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h rename to Core/GameEngine/Include/GameClient/Anim2D.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h b/Core/GameEngine/Include/GameClient/AnimateWindowManager.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h rename to Core/GameEngine/Include/GameClient/AnimateWindowManager.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/CDCheck.h b/Core/GameEngine/Include/GameClient/CDCheck.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/CDCheck.h rename to Core/GameEngine/Include/GameClient/CDCheck.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarResizer.h b/Core/GameEngine/Include/GameClient/ControlBarResizer.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarResizer.h rename to Core/GameEngine/Include/GameClient/ControlBarResizer.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/DebugDisplay.h b/Core/GameEngine/Include/GameClient/DebugDisplay.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/DebugDisplay.h rename to Core/GameEngine/Include/GameClient/DebugDisplay.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Diplomacy.h b/Core/GameEngine/Include/GameClient/Diplomacy.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Diplomacy.h rename to Core/GameEngine/Include/GameClient/Diplomacy.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/DisconnectMenu.h b/Core/GameEngine/Include/GameClient/DisconnectMenu.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/DisconnectMenu.h rename to Core/GameEngine/Include/GameClient/DisconnectMenu.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/EstablishConnectionsMenu.h b/Core/GameEngine/Include/GameClient/EstablishConnectionsMenu.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h rename to Core/GameEngine/Include/GameClient/EstablishConnectionsMenu.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h b/Core/GameEngine/Include/GameClient/ExtendedMessageBox.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h rename to Core/GameEngine/Include/GameClient/ExtendedMessageBox.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetTextEntry.h b/Core/GameEngine/Include/GameClient/GadgetTextEntry.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetTextEntry.h rename to Core/GameEngine/Include/GameClient/GadgetTextEntry.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/GameWindowID.h b/Core/GameEngine/Include/GameClient/GameWindowID.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowID.h rename to Core/GameEngine/Include/GameClient/GameWindowID.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h b/Core/GameEngine/Include/GameClient/HotKey.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h rename to Core/GameEngine/Include/GameClient/HotKey.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/KeyDefs.h b/Core/GameEngine/Include/GameClient/KeyDefs.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/KeyDefs.h rename to Core/GameEngine/Include/GameClient/KeyDefs.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/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/MessageBox.h b/Core/GameEngine/Include/GameClient/MessageBox.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/MessageBox.h rename to Core/GameEngine/Include/GameClient/MessageBox.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h b/Core/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h rename to Core/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h b/Core/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h rename to Core/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Module/SwayClientUpdate.h b/Core/GameEngine/Include/GameClient/Module/SwayClientUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Module/SwayClientUpdate.h rename to Core/GameEngine/Include/GameClient/Module/SwayClientUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h b/Core/GameEngine/Include/GameClient/ProcessAnimateWindow.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h rename to Core/GameEngine/Include/GameClient/ProcessAnimateWindow.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/RayEffect.h b/Core/GameEngine/Include/GameClient/RayEffect.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/RayEffect.h rename to Core/GameEngine/Include/GameClient/RayEffect.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Shadow.h b/Core/GameEngine/Include/GameClient/Shadow.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Shadow.h rename to Core/GameEngine/Include/GameClient/Shadow.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Shell.h b/Core/GameEngine/Include/GameClient/Shell.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Shell.h rename to Core/GameEngine/Include/GameClient/Shell.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h b/Core/GameEngine/Include/GameClient/ShellHooks.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h rename to Core/GameEngine/Include/GameClient/ShellHooks.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellMenuScheme.h b/Core/GameEngine/Include/GameClient/ShellMenuScheme.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ShellMenuScheme.h rename to Core/GameEngine/Include/GameClient/ShellMenuScheme.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/TerrainRoads.h b/Core/GameEngine/Include/GameClient/TerrainRoads.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/TerrainRoads.h rename to Core/GameEngine/Include/GameClient/TerrainRoads.h 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/GUI/ControlBar/ControlBarPrintPositions.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp rename to Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.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/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 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp rename to Core/GameEngine/Source/GameClient/GameText.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp b/Core/GameEngine/Source/GameClient/LanguageFilter.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp rename to Core/GameEngine/Source/GameClient/LanguageFilter.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Line2D.cpp b/Core/GameEngine/Source/GameClient/Line2D.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/Line2D.cpp rename to Core/GameEngine/Source/GameClient/Line2D.cpp 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/GeneralsMD/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp b/Core/GameEngine/Source/GameClient/System/DebugDisplay.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp rename to Core/GameEngine/Source/GameClient/System/DebugDisplay.cpp diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt index 64236aa60d..00fe897d48 100644 --- a/Generals/Code/GameEngine/CMakeLists.txt +++ b/Generals/Code/GameEngine/CMakeLists.txt @@ -130,30 +130,30 @@ set(GAMEENGINE_SRC # Include/Common/XferDeepCRC.h # Include/Common/XferLoad.h # Include/Common/XferSave.h - Include/GameClient/Anim2D.h - Include/GameClient/AnimateWindowManager.h + #Include/GameClient/Anim2D.h + #Include/GameClient/AnimateWindowManager.h Include/GameClient/CampaignManager.h - Include/GameClient/CDCheck.h + #Include/GameClient/CDCheck.h Include/GameClient/ClientInstance.h # Include/GameClient/ClientRandomValue.h Include/GameClient/Color.h Include/GameClient/CommandXlat.h Include/GameClient/ControlBar.h - Include/GameClient/ControlBarResizer.h + #Include/GameClient/ControlBarResizer.h Include/GameClient/ControlBarScheme.h - Include/GameClient/Credits.h - Include/GameClient/DebugDisplay.h - Include/GameClient/Diplomacy.h - Include/GameClient/DisconnectMenu.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/EstablishConnectionsMenu.h + #Include/GameClient/DrawGroupInfo.h + #Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h - Include/GameClient/ExtendedMessageBox.h + #Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h Include/GameClient/FXList.h Include/GameClient/Gadget.h @@ -166,14 +166,14 @@ set(GAMEENGINE_SRC Include/GameClient/GadgetSlider.h Include/GameClient/GadgetStaticText.h Include/GameClient/GadgetTabControl.h - Include/GameClient/GadgetTextEntry.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/GameText.h Include/GameClient/GameWindow.h Include/GameClient/GameWindowGlobal.h - Include/GameClient/GameWindowID.h + #Include/GameClient/GameWindowID.h Include/GameClient/GameWindowManager.h Include/GameClient/GameWindowTransitions.h Include/GameClient/GlobalLanguage.h @@ -182,36 +182,36 @@ set(GAMEENGINE_SRC Include/GameClient/GUICommandTranslator.h Include/GameClient/HeaderTemplate.h Include/GameClient/HintSpy.h - Include/GameClient/HotKey.h + #Include/GameClient/HotKey.h Include/GameClient/Image.h - Include/GameClient/IMEManager.h + #Include/GameClient/IMEManager.h Include/GameClient/InGameUI.h - Include/GameClient/Keyboard.h - Include/GameClient/KeyDefs.h + #Include/GameClient/Keyboard.h + #Include/GameClient/KeyDefs.h Include/GameClient/LanguageFilter.h - Include/GameClient/Line2D.h + #Include/GameClient/Line2D.h Include/GameClient/LoadScreen.h Include/GameClient/LookAtXlat.h Include/GameClient/MapUtil.h - Include/GameClient/MessageBox.h + #Include/GameClient/MessageBox.h Include/GameClient/MetaEvent.h - Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h - Include/GameClient/Module/BeaconClientUpdate.h - Include/GameClient/Module/SwayClientUpdate.h + #Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h + #Include/GameClient/Module/BeaconClientUpdate.h + #Include/GameClient/Module/SwayClientUpdate.h Include/GameClient/Mouse.h Include/GameClient/ParticleSys.h Include/GameClient/PlaceEventTranslator.h - Include/GameClient/ProcessAnimateWindow.h + #Include/GameClient/ProcessAnimateWindow.h Include/GameClient/RadiusDecal.h - Include/GameClient/RayEffect.h + #Include/GameClient/RayEffect.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/TerrainRoads.h + #Include/GameClient/Shadow.h + #Include/GameClient/Shell.h + #Include/GameClient/ShellHooks.h + #Include/GameClient/ShellMenuScheme.h + #Include/GameClient/Statistics.h + #Include/GameClient/TerrainRoads.h Include/GameClient/TerrainVisual.h # Include/GameClient/VideoPlayer.h Include/GameClient/View.h @@ -643,17 +643,17 @@ set(GAMEENGINE_SRC Source/GameClient/Credits.cpp Source/GameClient/Display.cpp Source/GameClient/DisplayString.cpp - Source/GameClient/DisplayStringManager.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/GameClient.cpp Source/GameClient/GameClientDispatch.cpp - Source/GameClient/GameText.cpp + #Source/GameClient/GameText.cpp Source/GameClient/GlobalLanguage.cpp Source/GameClient/GraphDraw.cpp Source/GameClient/GUI/AnimateWindowManager.cpp @@ -664,7 +664,7 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp - Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp + #Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp @@ -682,7 +682,7 @@ 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/GameFont.cpp Source/GameClient/GUI/GameWindow.cpp Source/GameClient/GUI/GameWindowGlobal.cpp Source/GameClient/GUI/GameWindowManager.cpp @@ -745,14 +745,14 @@ set(GAMEENGINE_SRC 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/InGameUI.cpp Source/GameClient/Input/Keyboard.cpp Source/GameClient/Input/Mouse.cpp - Source/GameClient/LanguageFilter.cpp - Source/GameClient/Line2D.cpp + #Source/GameClient/LanguageFilter.cpp + #Source/GameClient/Line2D.cpp Source/GameClient/MapUtil.cpp Source/GameClient/MessageStream/CommandXlat.cpp Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -765,11 +765,11 @@ set(GAMEENGINE_SRC Source/GameClient/MessageStream/WindowXlat.cpp Source/GameClient/RadiusDecal.cpp Source/GameClient/SelectionInfo.cpp - Source/GameClient/Statistics.cpp + #Source/GameClient/Statistics.cpp Source/GameClient/System/Anim2D.cpp Source/GameClient/System/CampaignManager.cpp # "Source/GameClient/System/Debug Displayers/AudioDebugDisplay.cpp" - Source/GameClient/System/DebugDisplay.cpp + #Source/GameClient/System/DebugDisplay.cpp Source/GameClient/System/Image.cpp Source/GameClient/System/ParticleSys.cpp Source/GameClient/System/RayEffect.cpp diff --git a/Generals/Code/GameEngine/Include/GameClient/Anim2D.h b/Generals/Code/GameEngine/Include/GameClient/Anim2D.h deleted file mode 100644 index e3853a3710..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Anim2D.h +++ /dev/null @@ -1,221 +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: Anim2D.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, July 2002 -// Desc: A collection of 2D images to make animation -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Snapshot.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Image; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -enum Anim2DMode CPP_11(: Int) -{ - - ANIM_2D_INVALID = 0, - ANIM_2D_ONCE, - ANIM_2D_ONCE_BACKWARDS, - ANIM_2D_LOOP, - ANIM_2D_LOOP_BACKWARDS, - ANIM_2D_PING_PONG, - ANIM_2D_PING_PONG_BACKWARDS, - // dont' forget to add new animation mode names to Anim2DModeNames[] below - - ANIM_2D_NUM_MODES - -}; -#ifdef DEFINE_ANIM_2D_MODE_NAMES -static const char *const Anim2DModeNames[] = -{ - "NONE", - "ONCE", - "ONCE_BACKWARDS", - "LOOP", - "LOOP_BACKWARDS", - "PING_PONG", - "PING_PONG_BACKWARDS", - NULL -}; -static_assert(ARRAY_SIZE(Anim2DModeNames) == ANIM_2D_NUM_MODES + 1, "Incorrect array size"); -#endif - -// ------------------------------------------------------------------------------------------------ -/** A template of a 2D animation */ -// ------------------------------------------------------------------------------------------------ -class Anim2DTemplate : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(Anim2DTemplate, "Anim2DTemplate") -public: - - Anim2DTemplate( AsciiString name ); - //virtual ~Anim2DTemplate( void ); - - AsciiString getName( void ) const { return m_name; } - const Image *getFrame( UnsignedShort frameNumber ) const; - UnsignedShort getNumFrames( void ) const { return m_numFrames; } - UnsignedShort getNumFramesBetweenUpdates( void ) const { return m_framesBetweenUpdates; } - Anim2DMode getAnimMode( void ) const { return m_animMode; } - Bool isRandomizedStartFrame( void ) const { return m_randomizeStartFrame; } - - // list access for use by the Anim2DCollection only - void friend_setNextTemplate( Anim2DTemplate *animTemplate ) { m_nextTemplate = animTemplate; } - Anim2DTemplate *friend_getNextTemplate( void ) const { return m_nextTemplate; }; - - // INI methods - const FieldParse *getFieldParse( void ) const { return s_anim2DFieldParseTable; } - void storeImage( const Image *image ); ///< store image in next available slot - void allocateImages( UnsignedShort numFrames ); ///< allocate the array of image pointers to use - -protected: - - static void parseImage( INI *ini, void *instance, void *store, const void *userData ); - static void parseNumImages( INI *ini, void *instance, void *store, const void *userData ); - static void parseImageSequence( INI *ini, void *instance, void *store, const void *userData ); - -protected: - enum { NUM_FRAMES_INVALID = 0 }; ///< initialization value for num frames - - Anim2DTemplate* m_nextTemplate; ///< next animation in collections animation list - AsciiString m_name; ///< name of this 2D animation - const Image** m_images; ///< array of image pointers that make up this animation - UnsignedShort m_numFrames; ///< total number of frames in this animation - UnsignedShort m_framesBetweenUpdates; ///< frames between frame updates - Anim2DMode m_animMode; ///< the animation mode - Bool m_randomizeStartFrame; ///< randomize animation instance start frames - -protected: - static const FieldParse s_anim2DFieldParseTable[]; ///< the parse table for INI definition - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -enum Anim2DStatus CPP_11(: Int) -{ - ANIM_2D_STATUS_NONE = 0x00, - ANIM_2D_STATUS_FROZEN = 0x01, - ANIM_2D_STATUS_REVERSED = 0x02, // used for ping pong direction tracking - ANIM_2D_STATUS_COMPLETE = 0x04, // set when uni-directional things reach their last frame -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class Anim2D : public MemoryPoolObject, - public Snapshot -{ - -friend class Anim2DCollection; - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( Anim2D, "Anim2D" ); - -public: - - Anim2D( Anim2DTemplate *animTemplate, Anim2DCollection *collectionSystem ); - // virtual destructor prototype provided by memory pool object - - UnsignedShort getCurrentFrame( void ) const { return m_currentFrame; } ///< get our current frame # - void setCurrentFrame( UnsignedShort frame ); ///< set the current frame # - void randomizeCurrentFrame( void ); ///< randomize the current frame # - void reset( void ); ///< reset the current frame to the "start" - void setStatus( UnsignedByte statusBits ); ///< set status bit(s) - void clearStatus( UnsignedByte statusBits ); ///< clear status bit(s) - UnsignedByte getStatus( void ) const { return m_status; } ///< return status bits(s) - void setAlpha( Real alpha ) { m_alpha = alpha; } ///< set alpha value - Real getAlpha( void ) const { return m_alpha; } ///< return the current alpha value - - //Allows you to play a segment of an animation. - void setMinFrame( UnsignedShort frame ) { m_minFrame = frame; } - void setMaxFrame( UnsignedShort frame ) { m_maxFrame = frame; } - - // info about the size of the current frame - UnsignedInt getCurrentFrameWidth( void ) const; ///< return natural width of image in the current frame - UnsignedInt getCurrentFrameHeight( void ) const; ///< return natural height of image in the current frame - const Anim2DTemplate *getAnimTemplate( void ) const { return m_template; } ///< return our template - - void draw( Int x, Int y ); ///< draw iamge at location using natural width/height - void draw( Int x, Int y, Int width, Int height ); ///< draw image at location using forced width/height - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) { } - virtual void xfer( Xfer *xfer ); - virtual void loadPostProcess( void ) { } - - void tryNextFrame( void ); ///< we've just drawn ... try to update our frame if necessary - - UnsignedShort m_currentFrame; ///< current frame of our animation - UnsignedInt m_lastUpdateFrame; ///< last frame we updated on - Anim2DTemplate *m_template; ///< pointer back to the template that defines this animation - UnsignedByte m_status; ///< status bits (see Anim2DStatus) - UnsignedShort m_minFrame; ///< min animation frame used inclusively. - UnsignedShort m_maxFrame; ///< max animation frame used inclusively. - UnsignedInt m_framesBetweenUpdates; ///< duration between each frame. - Real m_alpha; - - Anim2DCollection *m_collectionSystem; ///< system collection (if any) we're registered with - Anim2D *m_collectionSystemNext; ///< system instance tracking list - Anim2D *m_collectionSystemPrev; ///< system instance tracking list - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class Anim2DCollection : public SubsystemInterface -{ - -public: - - Anim2DCollection( void ); - virtual ~Anim2DCollection( void ); - - virtual void init( void ); ///< initialize system - virtual void reset( void ) { }; ///< reset system - virtual void update( void ); ///< update system - - Anim2DTemplate *findTemplate( const AsciiString& name ); ///< find animation template - Anim2DTemplate *newTemplate( const AsciiString& name ); ///< allocate a new template to be loaded - - void registerAnimation( Anim2D *anim ); ///< register animation with system - void unRegisterAnimation( Anim2D *anim ); ///< un-register animation from system - - Anim2DTemplate* getTemplateHead() const { return m_templateList; } - Anim2DTemplate* getNextTemplate( Anim2DTemplate *animTemplate ) const; - -protected: - - Anim2DTemplate *m_templateList; ///< list of available animation templates - Anim2D *m_instanceList; ///< list of all the anim 2D instance we're tracking - -}; - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// -extern Anim2DCollection *TheAnim2DCollection; diff --git a/Generals/Code/GameEngine/Include/GameClient/AnimateWindowManager.h b/Generals/Code/GameEngine/Include/GameClient/AnimateWindowManager.h deleted file mode 100644 index a3e72e0dae..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/AnimateWindowManager.h +++ /dev/null @@ -1,235 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: AnimateWindowManager.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Mar 2002 -// -// Filename: AnimateWindowManager.h -// -// author: Chris Huybregts -// -// purpose: The Animate Window class will be used by registering a window with -// the manager with stating what kind of animation to do. Then on every -// update, we'll move the windows. -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "Lib/BaseType.h" -#include "Common/SubsystemInterface.h" -#include "Common/GameMemory.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class GameWindow; -class ProcessAnimateWindowSlideFromBottom; -class ProcessAnimateWindowSlideFromBottomTimed; -class ProcessAnimateWindowSlideFromTop; -class ProcessAnimateWindowSlideFromLeft; -class ProcessAnimateWindowSlideFromRight; -class ProcessAnimateWindowSlideFromRightFast; -class ProcessAnimateWindowSpiral; -class ProcessAnimateWindowSlideFromTopFast; -class ProcessAnimateWindowSideSelect; -class ProcessAnimateWindow; - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -enum AnimTypes CPP_11(: Int) -{ - WIN_ANIMATION_NONE = 0, - WIN_ANIMATION_SLIDE_RIGHT, - WIN_ANIMATION_SLIDE_RIGHT_FAST, - WIN_ANIMATION_SLIDE_LEFT, - WIN_ANIMATION_SLIDE_TOP, - WIN_ANIMATION_SLIDE_BOTTOM, - WIN_ANIMATION_SPIRAL, - WIN_ANIMATION_SLIDE_BOTTOM_TIMED, - WIN_ANIMATION_SLIDE_TOP_FAST, - WIN_ANIMATION_COUNT -} ; - -//----------------------------------------------------------------------------- -// TheSuperHackers @build xezon 14/03/2025 Puts class into namespace to avoid name collision with AnimateWindow function in WinUser.h -namespace wnd -{ -class AnimateWindow : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AnimateWindow, "AnimateWindow") -public: - AnimateWindow( void ); - //~AnimateWindow( void ); - - static AnimateWindow* createNewInstance() - { - return newInstance(AnimateWindow); - } - - void setAnimData( ICoord2D startPos, ICoord2D endPos, ICoord2D curPos, ICoord2D restPos, Coord2D vel, UnsignedInt startTime, UnsignedInt endTime); - - ICoord2D getStartPos( void ); ///< Get the Start Position 2D coord - ICoord2D getCurPos( void ); ///< Get the Current Position 2D coord - ICoord2D getEndPos( void ); ///< Get the End Position 2D coord - ICoord2D getRestPos( void ); ///< Get the Rest Position 2D coord - GameWindow *getGameWindow( void ); ///< Get the GameWindow that will be animating - AnimTypes getAnimType( void ); ///< Get the Animation type - UnsignedInt getDelay( void ); ///< Get the Time Delay - Coord2D getVel( void ); ///< Get the Velocity Position 2D coord - UnsignedInt getStartTime( void ); ///< Get the start time of the time-based anim - UnsignedInt getEndTime( void ); ///< Get the end time of the time-based anim - - void setStartPos( ICoord2D starPos); ///< Set the Start Position 2D coord - void setCurPos( ICoord2D curPos); ///< Set the Current Position 2D coord - void setEndPos( ICoord2D endPos); ///< Set the End Position 2D coord - void setRestPos( ICoord2D restPos); ///< Set the Rest Position 2D coord - void setGameWindow( GameWindow *win); ///< Set the GameWindow that will be animating - void setAnimType( AnimTypes animType); ///< Set the Animation type - void setDelay( UnsignedInt delay); ///< Set the Time Delay - void setVel( Coord2D vel); ///< Set the Velocity Position 2D coord - void setStartTime( UnsignedInt t); ///< Set the start time of the time-based anim - void setEndTime( UnsignedInt t); ///< Set the end time of the time-based anim - - void setFinished(Bool finished); ///< Set if the animation has finished - Bool isFinished( void ); ///< Return if the animation has finished or not. - void setNeedsToFinish( Bool needsToFinish); ///< set if we need this animation to finish for the manager to return true - Bool needsToFinish( void ); ///< set if the animation has finished - -private: - UnsignedInt m_delay; ///< Holds the delay time in which the animation will start (in milliseconds) - ICoord2D m_startPos; ///< Holds the starting position of the animation - ///<(usuall is also the end position of the animation when the animation is reversed) - ICoord2D m_endPos; ///< Holds the target End Position (usually is the same as the rest position) - ICoord2D m_curPos; ///< It's Current Position - ICoord2D m_restPos; ///< When the Manager Resets, It sets the window's position to this position - GameWindow *m_win; ///< the window that this animation is happening on - Coord2D m_vel; ///< the Velocity of the animation - UnsignedInt m_startTime; ///< time we started the time-based anim - UnsignedInt m_endTime; ///< time we should end the time-based anim - AnimTypes m_animType; ///< The type of animation that will happen - Bool m_needsToFinish; ///< Flag to tell the manager if we need to finish before it's done with it's animation - Bool m_isFinished; ///< We're finished -}; -} // namespace wnd - - - -//----------------------------------------------------------------------------- -typedef std::list AnimateWindowList; - -//----------------------------------------------------------------------------- -class AnimateWindowManager : public SubsystemInterface -{ -public: - AnimateWindowManager( void ); - ~AnimateWindowManager( void ); - - // Inhertited from subsystem ==================================================================== - virtual void init( void ); - virtual void reset( void ); - virtual void update( void ); - //=============================================================================================== - - void registerGameWindow(GameWindow *win, AnimTypes animType, Bool needsToFinish, UnsignedInt ms = 0, UnsignedInt delayMs = 0); // Registers a new window to animate. - Bool isFinished( void ); ///< Are all the animations that need to be finished, finished? - void reverseAnimateWindow( void ); ///< tell each animation type to setup the windows to run in reverse - void resetToRestPosition( void ); ///< Reset all windows to their rest position - Bool isReversed( void ); ///< Returns whether or not we're in our reversed state. - Bool isEmpty( void ); -private: - AnimateWindowList m_winList; ///< A list of AnimationWindows that we don't care if their finished animating - AnimateWindowList m_winMustFinishList; ///< A list of AnimationWindows that we do care about - Bool m_needsUpdate; ///< If we're done animating all our monitored windows, then this will be false - Bool m_reverse; ///< Are we in a reverse state? - ProcessAnimateWindowSlideFromRight *m_slideFromRight; ///< Holds the process in which the windows slide from the right - ProcessAnimateWindowSlideFromRightFast *m_slideFromRightFast; - ProcessAnimateWindowSlideFromTop *m_slideFromTop; ///< Holds the process in which the windows slide from the Top - ProcessAnimateWindowSlideFromLeft *m_slideFromLeft; ///< Holds the process in which the windows slide from the Left - ProcessAnimateWindowSlideFromBottom *m_slideFromBottom; ///< Holds the process in which the windows slide from the Bottom - ProcessAnimateWindowSpiral *m_spiral; ///< Holds the process in which the windows Spiral onto the screen - ProcessAnimateWindowSlideFromBottomTimed *m_slideFromBottomTimed; ///< Holds the process in which the windows slide from the Bottom in a time-based fashion - ProcessAnimateWindowSlideFromTopFast *m_slideFromTopFast; ///< holds the process in wich the windows slide from the top,fast - ProcessAnimateWindow *getProcessAnimate( AnimTypes animType); ///< returns the process for the kind of animation we need. - -}; - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -namespace wnd -{ - inline ICoord2D AnimateWindow::getStartPos( void ) { return m_startPos; }; - inline ICoord2D AnimateWindow::getCurPos( void ) { return m_curPos; }; - inline ICoord2D AnimateWindow::getEndPos( void ) { return m_endPos; }; - inline ICoord2D AnimateWindow::getRestPos( void ) { return m_restPos; }; - inline GameWindow *AnimateWindow::getGameWindow( void ){ return m_win; }; - inline AnimTypes AnimateWindow::getAnimType( void ) { return m_animType; }; - inline UnsignedInt AnimateWindow::getDelay( void ) { return m_delay; }; - inline Coord2D AnimateWindow::getVel( void ) { return m_vel; }; - inline UnsignedInt AnimateWindow::getStartTime( void ) { return m_startTime; }; - inline UnsignedInt AnimateWindow::getEndTime( void ) { return m_endTime; }; - - inline void AnimateWindow::setStartPos( ICoord2D startPos) { m_startPos = startPos; }; - inline void AnimateWindow::setCurPos( ICoord2D curPos) { m_curPos = curPos; }; - inline void AnimateWindow::setEndPos( ICoord2D endPos) { m_endPos = endPos; }; - inline void AnimateWindow::setRestPos( ICoord2D restPos) { m_restPos = restPos; }; - inline void AnimateWindow::setGameWindow( GameWindow *win) { m_win = win; }; - inline void AnimateWindow::setAnimType( AnimTypes animType) { m_animType = animType; }; - inline void AnimateWindow::setDelay( UnsignedInt delay) { m_delay = delay; }; - inline void AnimateWindow::setVel( Coord2D vel) { m_vel = vel; }; - inline void AnimateWindow::setStartTime( UnsignedInt t ) { m_startTime = t; } - inline void AnimateWindow::setEndTime( UnsignedInt t ) { m_endTime = t; } - - inline void AnimateWindow::setFinished( Bool finished) { m_isFinished = finished; }; - inline Bool AnimateWindow::isFinished( void ) { return m_isFinished; }; - inline void AnimateWindow::setNeedsToFinish( Bool needsToFinish) { m_needsToFinish = needsToFinish; }; - inline Bool AnimateWindow::needsToFinish( void ) { return m_needsToFinish; }; -} // namespace wnd - - inline Bool AnimateWindowManager::isFinished( void ) { return !m_needsUpdate; }; - inline Bool AnimateWindowManager::isReversed( void ) { return m_reverse; }; - inline Bool AnimateWindowManager::isEmpty( void ){return (m_winList.size() == 0 && m_winMustFinishList.size() == 0); } -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/CDCheck.h b/Generals/Code/GameEngine/Include/GameClient/CDCheck.h deleted file mode 100644 index e5e3a8921e..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/CDCheck.h +++ /dev/null @@ -1,35 +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: CDCheck.h //////////////////////////////////////////////////////////////////////////////// -// Author: Matt Campbell, January 2003 -// Description: check for CD, popping up an in-game message box at game start. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -typedef void (*gameStartCallback) (void); - -Bool IsFirstCDPresent(void); -void CheckForCDAtGameStart( gameStartCallback callback ); diff --git a/Generals/Code/GameEngine/Include/GameClient/ControlBarResizer.h b/Generals/Code/GameEngine/Include/GameClient/ControlBarResizer.h deleted file mode 100644 index 62b82e01ad..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/ControlBarResizer.h +++ /dev/null @@ -1,102 +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: ControlBarResizer.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Sep 2002 -// -// Filename: ControlBarResizer.h -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class ResizerWindow -{ -public: -ResizerWindow( void ); - AsciiString m_name; - ICoord2D m_defaultSize; - ICoord2D m_defaultPos; - ICoord2D m_altSize; - ICoord2D m_altPos; -}; - -class ControlBarResizer -{ -public: - ControlBarResizer( void ); - ~ControlBarResizer( void ); - - void init( void ); - - // parse Functions for the INI file - const FieldParse *getFieldParse() const { return m_controlBarResizerParseTable; } ///< returns the parsing fields - static const FieldParse m_controlBarResizerParseTable[]; ///< the parse table - - ResizerWindow *findResizerWindow( AsciiString name ); ///< attempt to find the control bar scheme by it's name - ResizerWindow *newResizerWindow( AsciiString name ); ///< create a new control bar scheme and return it. - - void sizeWindowsDefault( void ); - void sizeWindowsAlt( void ); - - typedef std::list< ResizerWindow *> ResizerWindowList; - ResizerWindowList m_resizerWindowsList; - -}; -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/Credits.h b/Generals/Code/GameEngine/Include/GameClient/Credits.h deleted file mode 100644 index bba068bd64..0000000000 --- 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 - { NULL, 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/DebugDisplay.h b/Generals/Code/GameEngine/Include/GameClient/DebugDisplay.h deleted file mode 100644 index 145cff3c5d..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/DebugDisplay.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: Generals -// -// Module: Debug -// -// File name: GameClient/DebugDisplay.h -// -// Created: 11/13/01 TR -// -//---------------------------------------------------------------------------- - -#pragma once - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "Lib/BaseType.h" -#include - - -//---------------------------------------------------------------------------- -// Forward References -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Type Defines -//---------------------------------------------------------------------------- - - -//=============================== -// DebugDisplayInterface -//=============================== - -class DebugDisplayInterface -{ - - public: - - enum Color - { - WHITE, - BLACK, - YELLOW, - RED, - GREEN, - BLUE, - }; - - virtual ~DebugDisplayInterface() {}; - - virtual void printf( const Char *format, ...) = 0; ///< Print formatted text at current cursor position - virtual void setCursorPos( Int x, Int y ) = 0; ///< Set new cursor position - virtual Int getCursorXPos( void ) = 0; ///< Get current X position of cursor - virtual Int getCursorYPos( void ) = 0; ///< Get current Y position of cursor - virtual Int getWidth( void ) = 0; ///< Get character width of display - virtual Int getHeight( void ) = 0; ///< Get character height of display - virtual void setTextColor( Color color ) = 0; ///< Set text color - virtual void setRightMargin( Int rightPos ) = 0; ///< Set right margin position - virtual void setLeftMargin( Int leftPos ) = 0; ///< Set left margin position - virtual void reset( void ) = 0; ///< Reset back to default settings - - protected: - - virtual void drawText( Int x, Int y, Char *text ) = 0; ///< Render null ternimated string at current cursor position -}; - - -//=============================== -// DebugDisplay -//=============================== - -class DebugDisplay : public DebugDisplayInterface -{ - - public: - - DebugDisplay(); - virtual ~DebugDisplay() {}; - - virtual void printf( const Char *format, ...); ///< Print formatted text at current cursor position - virtual void setCursorPos( Int x, Int y ); ///< Set new cursor position - virtual Int getCursorXPos( void ); ///< Get current X position of cursor - virtual Int getCursorYPos( void ); ///< Get current Y position of cursor - virtual Int getWidth( void ); ///< Get character width of display - virtual Int getHeight( void ); ///< Get character height of display - virtual void setTextColor( Color color ); ///< set text color - virtual void setRightMargin( Int rightPos ); ///< set right margin position - virtual void setLeftMargin( Int leftPos ); ///< set left margin position - virtual void reset( void ); ///< Reset back to default settings - - protected: - - Color m_textColor; ///< Color to render text in - Int m_xPos; ///< Current X position of cursor - Int m_yPos; ///< Current Y position of cursor - Int m_width; ///< Character width of display - Int m_height; ///< Character height of display - Int m_rightMargin;///< Right margin position - Int m_leftMargin; ///< Left margin position - -}; - -// displayers - -#if defined(RTS_DEBUG) -extern void AudioDebugDisplay( DebugDisplayInterface *debugDisplay, void *userData, FILE *fp ); -#endif - - -//---------------------------------------------------------------------------- -// Inlining -//---------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h b/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h deleted file mode 100644 index a26861cf43..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h +++ /dev/null @@ -1,35 +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: Diplomacy.h ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, Sept 2002 -////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -void PopulateInGameDiplomacyPopup( void ); -void UpdateDiplomacyBriefingText(AsciiString newText, Bool clear); - -typedef std::list BriefingList; -BriefingList* GetBriefingTextList(void); diff --git a/Generals/Code/GameEngine/Include/GameClient/DisconnectMenu.h b/Generals/Code/GameEngine/Include/GameClient/DisconnectMenu.h deleted file mode 100644 index 457c263feb..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/DisconnectMenu.h +++ /dev/null @@ -1,77 +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. // -// // -//////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameNetwork/DisconnectManager.h" - -enum DisconnectMenuStateType CPP_11(: Int) { - DISCONNECTMENUSTATETYPE_SCREENON, - DISCONNECTMENUSTATETYPE_SCREENOFF -}; - -class DisconnectMenu { -public: - DisconnectMenu(); - virtual ~DisconnectMenu(); - - void init(); - - void attachDisconnectManager(DisconnectManager *disconnectManager); - - void showScreen(); - void hideScreen(); - Bool isScreenVisible( void ) { return m_menuState == DISCONNECTMENUSTATETYPE_SCREENON; } - - void showPlayerControls(Int slot); - void hidePlayerControls(Int slot); - void showPacketRouterTimeout(); - void hidePacketRouterTimeout(); - - void setPlayerName(Int playerNum, UnicodeString name); - void setPlayerTimeoutTime(Int playerNum, time_t newTime); - void setPacketRouterTimeoutTime(time_t newTime); - - void sendChat(UnicodeString text); - void showChat(UnicodeString text); - - void quitGame(); - void removePlayer(Int slot, UnicodeString playerName); - void voteForPlayer(Int slot); - void updateVotes(Int slot, Int votes); - -protected: - DisconnectManager *m_disconnectManager; ///< For retrieving status updates from the disconnect manager. - DisconnectMenuStateType m_menuState; ///< The current state of the menu screen. - - static const char *const m_playerNameTextControlNames[MAX_SLOTS]; ///< names of the player name controls in the window. - static const char *const m_playerTimeoutTextControlNames[MAX_SLOTS]; ///< names of the timeout controls in the window. - static const char *const m_playerVoteButtonControlNames[MAX_SLOTS]; ///< names of the vote button controls in the window. - static const char *const m_playerVoteCountControlNames[MAX_SLOTS]; ///< names of the vote count static text controls in the window. - static const char *const m_packetRouterTimeoutControlName; ///< name of the packet router timeout control window. - static const char *const m_packetRouterTimeoutLabelControlName; ///< name of the packet router timeout label control window. - static const char *const m_textDisplayControlName; ///< name of the text display listbox control window. -}; - -extern DisconnectMenu *TheDisconnectMenu; diff --git a/Generals/Code/GameEngine/Include/GameClient/DisplayStringManager.h b/Generals/Code/GameEngine/Include/GameClient/DisplayStringManager.h deleted file mode 100644 index 6ce394d3fe..0000000000 --- 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 0637bd8ec4..0000000000 --- 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/EstablishConnectionsMenu.h b/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h deleted file mode 100644 index 50351552e0..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h +++ /dev/null @@ -1,55 +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. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//// EstablishConnectionsMenu.h ///////////////////////// - -#include "GameNetwork/NetworkDefs.h" -#include "GameNetwork/NAT.h" - -enum EstablishConnectionsMenuStateType CPP_11(: Int) { - ESTABLISHCONNECTIONSMENUSTATETYPE_SCREENON, - ESTABLISHCONNECTIONSMENUSTATETYPE_SCREENOFF -}; - -class EstablishConnectionsMenu { -public: - EstablishConnectionsMenu(); - virtual ~EstablishConnectionsMenu(); - - void initMenu(); - void endMenu(); - void abortGame(); - - void setPlayerName(Int slot, UnicodeString name); - void setPlayerStatus(Int slot, NATConnectionState state); - -protected: - EstablishConnectionsMenuStateType m_menuState; - - static const char *const m_playerReadyControlNames[MAX_SLOTS]; - static const char *const m_playerNameControlNames[MAX_SLOTS]; - static const char *const m_playerStatusControlNames[MAX_SLOTS]; -}; - -extern EstablishConnectionsMenu *TheEstablishConnectionsMenu; diff --git a/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h b/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h deleted file mode 100644 index 25c13a718f..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h +++ /dev/null @@ -1,69 +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: ExtendedMessageBox.h ///////////////////////////////////////////////////////////////////// -// Author: Matt Campbell, January 2003 -// Description: We go quiet in 1 day, gold in 15. Poor time to rewrite message boxes, so -// we get this file instead. Phooey. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameClient/GameWindowManager.h" - -// return codes for message box callbacks -enum MessageBoxReturnType CPP_11(: Int) { - MB_RETURN_CLOSE, - MB_RETURN_KEEPOPEN -}; - -typedef MessageBoxReturnType (* MessageBoxFunc)( void *userData ); - -// WindowExMessageBoxData --------------------------------------------------------- -/** Data attached to each extended Message box window */ -//----------------------------------------------------------------------------- -struct WindowExMessageBoxData -{ - MessageBoxFunc yesCallback; ///. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: GadgetTextEntry.h //////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: GadgetTextEntry.h -// -// Created: Colin Day, June 2001 -// -// Desc: Helpful interface for TextEntrys -// -// TextEntry IMAGE/COLOR organization -// -// note that windows that have an outlined text field will use the color -// for the outline specified with the TextBorder... functions -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "GameClient/GameWindowManager.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -class GameWindow; - -// TYPE DEFINES /////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// INLINING /////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -inline void GadgetTextEntrySetText( GameWindow *g, UnicodeString text ) -{ - TheWindowManager->winSendSystemMsg( g, GEM_SET_TEXT, (WindowMsgData)&text, 0 ); -} -extern UnicodeString GadgetTextEntryGetText( GameWindow *textentry ); ///< Get the text from the text entry field -extern void GadgetTextEntrySetFont( GameWindow *g, GameFont *font ); ///< set font for window and edit text display strings -inline void GadgetTextEntrySetTextColor( GameWindow *g, Color color ) -{ - Color back = g->winGetEnabledTextBorderColor(); - g->winSetEnabledTextColors(color,back); - g->winSetDisabledTextColors(GameDarkenColor(color, 25),back); -} -// text colors - -// enabled -inline void GadgetTextEntrySetEnabledImageLeft( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); } -inline void GadgetTextEntrySetEnabledImageRight( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); } -inline void GadgetTextEntrySetEnabledImageCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); } -inline void GadgetTextEntrySetEnabledImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 3, image ); } -inline void GadgetTextEntrySetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); } -inline void GadgetTextEntrySetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); } -inline const Image *GadgetTextEntryGetEnabledImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 0 ); } -inline const Image *GadgetTextEntryGetEnabledImageRight( GameWindow *g ) { return g->winGetEnabledImage( 1 ); } -inline const Image *GadgetTextEntryGetEnabledImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 2 ); } -inline const Image *GadgetTextEntryGetEnabledImageSmallCenter( GameWindow *g ) { return g->winGetEnabledImage( 3 ); } -inline Color GadgetTextEntryGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); } -inline Color GadgetTextEntryGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); } - -// disabled -inline void GadgetTextEntrySetDisabledImageLeft( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); } -inline void GadgetTextEntrySetDisabledImageRight( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); } -inline void GadgetTextEntrySetDisabledImageCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); } -inline void GadgetTextEntrySetDisabledImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 3, image ); } -inline void GadgetTextEntrySetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); } -inline void GadgetTextEntrySetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); } -inline const Image *GadgetTextEntryGetDisabledImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 0 ); } -inline const Image *GadgetTextEntryGetDisabledImageRight( GameWindow *g ) { return g->winGetDisabledImage( 1 ); } -inline const Image *GadgetTextEntryGetDisabledImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 2 ); } -inline const Image *GadgetTextEntryGetDisabledImageSmallCenter( GameWindow *g ) { return g->winGetDisabledImage( 3 ); } -inline Color GadgetTextEntryGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); } -inline Color GadgetTextEntryGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); } - -// hilite -inline void GadgetTextEntrySetHiliteImageLeft( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); } -inline void GadgetTextEntrySetHiliteImageRight( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); } -inline void GadgetTextEntrySetHiliteImageCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); } -inline void GadgetTextEntrySetHiliteImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 3, image ); } -inline void GadgetTextEntrySetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); } -inline void GadgetTextEntrySetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); } -inline const Image *GadgetTextEntryGetHiliteImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 0 ); } -inline const Image *GadgetTextEntryGetHiliteImageRight( GameWindow *g ) { return g->winGetHiliteImage( 1 ); } -inline const Image *GadgetTextEntryGetHiliteImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 2 ); } -inline const Image *GadgetTextEntryGetHiliteImageSmallCenter( GameWindow *g ) { return g->winGetHiliteImage( 3 ); } -inline Color GadgetTextEntryGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); } -inline Color GadgetTextEntryGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); } - -// EXTERNALS ////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngine/Include/GameClient/GameFont.h b/Generals/Code/GameEngine/Include/GameClient/GameFont.h deleted file mode 100644 index 2307e00547..0000000000 --- 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 NULL; -} - -// 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 65d9ce60fb..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/GameText.h +++ /dev/null @@ -1,127 +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 = NULL ) = 0; ///< Returns the associated labeled unicode text - virtual UnicodeString fetch( AsciiString label, Bool *exists = NULL ) = 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. -#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, substituteTextW, ...) fetchFormat(labelA, __VA_ARGS__) -#endif - -#endif // ENABLE_GAMETEXT_SUBSTITUTES diff --git a/Generals/Code/GameEngine/Include/GameClient/GameWindowID.h b/Generals/Code/GameEngine/Include/GameClient/GameWindowID.h deleted file mode 100644 index 9d5eec2be5..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/GameWindowID.h +++ /dev/null @@ -1,83 +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: GameWindowID.h /////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: GameWindowID.h -// -// Created: Colin Day, July 2001 -// -// Desc: Game window ID definitions, this is so we can uniquely -// identify any window in the game and pass messages from -// anywhere to anywhere else instantly -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -// TYPE DEFINES /////////////////////////////////////////////////////////////// -#define GWID_INVALID 0 - -#define GWID_SIDEBAR 100 - -#define GWID_SIDEBAR_1 101 -#define GWID_SIDEBAR_2 102 -#define GWID_SIDEBAR_3 103 -#define GWID_SIDEBAR_4 104 -#define GWID_SIDEBAR_5 105 -#define GWID_SIDEBAR_6 106 -#define GWID_SIDEBAR_7 107 -#define GWID_SIDEBAR_8 108 -#define GWID_SIDEBAR_9 109 -#define GWID_SIDEBAR_10 110 -#define GWID_SIDEBAR_11 111 -#define GWID_SIDEBAR_12 112 - -#define GWID_SIDEBAR_TAB_1 151 -#define GWID_SIDEBAR_TAB_2 152 -#define GWID_SIDEBAR_TAB_3 153 -#define GWID_SIDEBAR_TAB_4 154 - -#define GWID_SIDEBAR_RADAR 175 - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngine/Include/GameClient/HotKey.h b/Generals/Code/GameEngine/Include/GameClient/HotKey.h deleted file mode 100644 index 84becd005d..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/HotKey.h +++ /dev/null @@ -1,112 +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: HotKey.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Sep 2002 -// -// Filename: HotKey.h -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "Common/SubsystemInterface.h" -#include "Common/MessageStream.h" -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class AsciiString; -class GameWindow; -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class HotKeyTranslator : public GameMessageTranslator -{ -public: - virtual GameMessageDisposition translateGameMessage(const GameMessage *msg); - virtual ~HotKeyTranslator() { } -}; - -//----------------------------------------------------------------------------- -class HotKey -{ -public: - HotKey( void ); - GameWindow *m_win; - AsciiString m_key; - // we may need a checkmark system. -}; - -//----------------------------------------------------------------------------- -class HotKeyManager : public SubsystemInterface -{ -public: - HotKeyManager( void ); - ~HotKeyManager( void ); - // Inherited from subsystem interface ----------------------------------------------------------- - virtual void init( void ); ///< Initialize the Hotkey system - virtual void update( void ) {} ///< A No-op for us - virtual void reset( void ); ///< Reset - //----------------------------------------------------------------------------------------------- - - void addHotKey( GameWindow *win, const AsciiString& key); - Bool executeHotKey( const AsciiString& key); // called fromt eh HotKeyTranslator - - AsciiString searchHotKey( const AsciiString& label); - AsciiString searchHotKey( const UnicodeString& uStr ); - -private: - typedef std::map HotKeyMap; - HotKeyMap m_hotKeyMap; -}; -extern HotKeyManager *TheHotKeyManager; -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/IMEManager.h b/Generals/Code/GameEngine/Include/GameClient/IMEManager.h deleted file mode 100644 index be703e1bb4..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/IMEManager.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: Generals -// -// Module: IME -// -// File name: GameClient/IMEManager.h -// -// Created: 11/14/01 TR -// -//---------------------------------------------------------------------------- - -#pragma once - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "Lib/BaseType.h" -#include "Common/SubsystemInterface.h" -#include "Common/UnicodeString.h" - -//---------------------------------------------------------------------------- -// Forward References -//---------------------------------------------------------------------------- - -class GameWindow; -class UnicodeString; - -//---------------------------------------------------------------------------- -// Type Defines -//---------------------------------------------------------------------------- - - -//=============================== -// IMEManagerInterface -//=============================== - -class IMEManagerInterface : public SubsystemInterface -{ - - public: - - virtual ~IMEManagerInterface() {}; - - virtual void attach( GameWindow *window ) = 0; ///< attach IME to specified window - virtual void detatch( void ) = 0; ///< detatch IME from current window - virtual void enable( void ) = 0; ///< Enable IME - virtual void disable( void ) = 0; ///< Disable IME - virtual Bool isEnabled( void ) = 0; ///< Is IME enabled - virtual Bool isAttachedTo( GameWindow *window ) = 0; ///< Is the manager currently attached to the window - virtual GameWindow* getWindow( void ) = 0; ///< Returns the window we are currently attached to - virtual Bool isComposing( void ) = 0; ///< Manager is currently composing new input string - virtual void getCompositionString( UnicodeString &string ) = 0; ///< Return the current composition string - virtual Int getCompositionCursorPosition( void ) =0; ///< Returns the composition cursor position - virtual Int getIndexBase( void ) = 0; ///< Get index base for candidate list - - - virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates - virtual UnicodeString*getCandidate( Int index ) = 0; ///< Returns the candidate string - virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate - virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list - virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate - - - - /// Checks for and service IME messages. Returns TRUE if message serviced - virtual Bool serviceIMEMessage( void *windowsHandle, - UnsignedInt message, - Int wParam, - Int lParam ) = 0; - virtual Int result( void ) = 0; ///< result return value of last serviced IME message -}; - - -extern IMEManagerInterface *TheIMEManager; -extern IMEManagerInterface *CreateIMEManagerInterface( void ); - - -//---------------------------------------------------------------------------- -// Inlining -//---------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/KeyDefs.h b/Generals/Code/GameEngine/Include/GameClient/KeyDefs.h deleted file mode 100644 index a6e19e19bc..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/KeyDefs.h +++ /dev/null @@ -1,256 +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: KeyDefs.h //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: KeyDefs.h -// -// Created: Mike Morrison, 1995 -// Colin Day, June 2001 -// -// Desc: Basic keyboard key definitions. -// -/** @todo NOTE: These key definitions are currently tied directly to the -* Direct Input key codes, therefore making these definitions device -* dependent even though this code lives on the device INdependent side -* of the engine. In the future to be truly device independent we -* need to define our own key codes, and have a translation between -* what we read from the device to our own system*/ -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -#include -#ifndef DIRECTINPUT_VERSION -# define DIRECTINPUT_VERSION 0x800 -#endif - -#include -#include - -// USER INCLUDES ////////////////////////////////////////////////////////////// - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// TYPE DEFINES /////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef DIK_OEM_102 -#define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */ -#endif - -#ifndef DIK_KANA -#define DIK_KANA 0x70 /* (Japanese keyboard) */ -#endif - -#ifndef DIK_CONVERT -#define DIK_CONVERT 0x79 /* (Japanese keyboard) */ -#endif - -#ifndef DIK_NOCONVERT -#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */ -#endif - -#ifndef DIK_YEN -#define DIK_YEN 0x7D /* (Japanese keyboard) */ -#endif - -#ifndef DIK_CIRCUMFLEX -#define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */ -#endif - -#ifndef DIK_KANJI -#define DIK_KANJI 0x94 /* (Japanese keyboard) */ -#endif - -//============================================================================= -/** The key tables */ -//============================================================================= - -enum KeyDefType CPP_11(: Int) -{ - // keypad keys ---------------------------------------------------------------- - KEY_KP0 = DIK_NUMPAD0, - KEY_KP1 = DIK_NUMPAD1, - KEY_KP2 = DIK_NUMPAD2, - KEY_KP3 = DIK_NUMPAD3, - KEY_KP4 = DIK_NUMPAD4, - KEY_KP5 = DIK_NUMPAD5, - KEY_KP6 = DIK_NUMPAD6, - KEY_KP7 = DIK_NUMPAD7, - KEY_KP8 = DIK_NUMPAD8, - KEY_KP9 = DIK_NUMPAD9, - KEY_KPDEL = DIK_NUMPADPERIOD, - KEY_KPSTAR = DIK_NUMPADSTAR, - KEY_KPMINUS = DIK_NUMPADMINUS, - KEY_KPPLUS = DIK_NUMPADPLUS, - - // regular keys --------------------------------------------------------------- - KEY_ESC = DIK_ESCAPE, - KEY_BACKSPACE = DIK_BACK, - KEY_ENTER = DIK_RETURN, - KEY_SPACE = DIK_SPACE, - KEY_TAB = DIK_TAB, - KEY_F1 = DIK_F1, - KEY_F2 = DIK_F2, - KEY_F3 = DIK_F3, - KEY_F4 = DIK_F4, - KEY_F5 = DIK_F5, - KEY_F6 = DIK_F6, - KEY_F7 = DIK_F7, - KEY_F8 = DIK_F8, - KEY_F9 = DIK_F9, - KEY_F10 = DIK_F10, - KEY_F11 = DIK_F11, - KEY_F12 = DIK_F12, - KEY_A = DIK_A, - KEY_B = DIK_B, - KEY_C = DIK_C, - KEY_D = DIK_D, - KEY_E = DIK_E, - KEY_F = DIK_F, - KEY_G = DIK_G, - KEY_H = DIK_H, - KEY_I = DIK_I, - KEY_J = DIK_J, - KEY_K = DIK_K, - KEY_L = DIK_L, - KEY_M = DIK_M, - KEY_N = DIK_N, - KEY_O = DIK_O, - KEY_P = DIK_P, - KEY_Q = DIK_Q, - KEY_R = DIK_R, - KEY_S = DIK_S, - KEY_T = DIK_T, - KEY_U = DIK_U, - KEY_V = DIK_V, - KEY_W = DIK_W, - KEY_X = DIK_X, - KEY_Y = DIK_Y, - KEY_Z = DIK_Z, - KEY_1 = DIK_1, - KEY_2 = DIK_2, - KEY_3 = DIK_3, - KEY_4 = DIK_4, - KEY_5 = DIK_5, - KEY_6 = DIK_6, - KEY_7 = DIK_7, - KEY_8 = DIK_8, - KEY_9 = DIK_9, - KEY_0 = DIK_0, - KEY_MINUS = DIK_MINUS, - KEY_EQUAL = DIK_EQUALS, - KEY_LBRACKET = DIK_LBRACKET, - KEY_RBRACKET = DIK_RBRACKET, - KEY_SEMICOLON = DIK_SEMICOLON, - KEY_APOSTROPHE = DIK_APOSTROPHE, - KEY_TICK = DIK_GRAVE, - KEY_BACKSLASH = DIK_BACKSLASH, - KEY_COMMA = DIK_COMMA, - KEY_PERIOD = DIK_PERIOD, - KEY_SLASH = DIK_SLASH, - - // special keys --------------------------------------------------------------- - KEY_SYSREQ = DIK_SYSRQ, - - KEY_CAPS = DIK_CAPSLOCK, - KEY_NUM = DIK_NUMLOCK, - KEY_SCROLL = DIK_SCROLL, - KEY_LCTRL = DIK_LCONTROL, - KEY_LALT = DIK_LALT, - KEY_LSHIFT = DIK_LSHIFT, - KEY_RSHIFT = DIK_RSHIFT, - - KEY_UP = DIK_UPARROW, - KEY_DOWN = DIK_DOWNARROW, - KEY_LEFT = DIK_LEFTARROW, - KEY_RIGHT = DIK_RIGHTARROW, - KEY_RALT = DIK_RALT, - KEY_RCTRL = DIK_RCONTROL, - KEY_HOME = DIK_HOME, - KEY_END = DIK_END, - KEY_PGUP = DIK_PGUP, - KEY_PGDN = DIK_PGDN, - KEY_INS = DIK_INSERT, - KEY_DEL = DIK_DELETE, - KEY_KPENTER = DIK_NUMPADENTER, - KEY_KPSLASH = DIK_NUMPADSLASH, - - KEY_102 = DIK_OEM_102, - - // Japanese keyboard keys ----------------------------------------------------- - KEY_KANA = DIK_KANA, - KEY_CONVERT = DIK_CONVERT, - KEY_NOCONVERT = DIK_NOCONVERT, - KEY_YEN = DIK_YEN, - KEY_CIRCUMFLEX = DIK_CIRCUMFLEX, - KEY_KANJI = DIK_KANJI, - - // specials ------------------------------------------------------------------- - KEY_NONE = 0x00, ///< to report end of key stream - KEY_LOST = 0xFF ///< to report lost keyboard focus - -}; - -// state for keyboard IO ------------------------------------------------------ -enum -{ - KEY_STATE_NONE = 0x0000, // No modifier state - KEY_STATE_UP = 0x0001, // Key is up (default state) - KEY_STATE_DOWN = 0x0002, // Key is down - KEY_STATE_LCONTROL = 0x0004, // Left control is pressed - KEY_STATE_RCONTROL = 0x0008, // Right control is pressed - KEY_STATE_LSHIFT = 0x0010, // left shift is pressed - KEY_STATE_RSHIFT = 0x0020, // right shift is pressed - KEY_STATE_LALT = 0x0040, // left alt is pressed - KEY_STATE_RALT = 0x0080, // right alt is pressed - KEY_STATE_AUTOREPEAT = 0x0100, // Key is down due to autorepeat (only seen in conjunction with KEY_STATE_DOWN) - KEY_STATE_CAPSLOCK = 0x0200, // Caps Lock key is on. - KEY_STATE_SHIFT2 = 0x0400, // Alternate shift key is pressed (I think this is for foreign keyboards..) - - // modifier combinations when left/right isn't a factor - KEY_STATE_CONTROL = (KEY_STATE_LCONTROL | KEY_STATE_RCONTROL), - KEY_STATE_SHIFT = (KEY_STATE_LSHIFT | KEY_STATE_RSHIFT | KEY_STATE_SHIFT2 ), - KEY_STATE_ALT = (KEY_STATE_LALT | KEY_STATE_RALT) - -}; - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngine/Include/GameClient/Keyboard.h b/Generals/Code/GameEngine/Include/GameClient/Keyboard.h deleted file mode 100644 index 638df5a3a3..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Keyboard.h +++ /dev/null @@ -1,167 +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: Keyboard.h /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Keyboard.h -// -// Created: Mike Morrison, 1995 -// Colin Day, June 2001 -// -// Desc: Basic keyboard -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "Common/SubsystemInterface.h" -#include "GameClient/KeyDefs.h" -#include "Lib/BaseType.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// TYPE DEFINITIONS /////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// KeyboardIO ----------------------------------------------------------------- -/** Holds a single keyboard event */ -//----------------------------------------------------------------------------- -struct KeyboardIO -{ - - enum StatusType - { - STATUS_UNUSED = 0x00, // Key has not been used - STATUS_USED = 0x01 // Key has been eaten - }; - - UnsignedByte key; // key data - UnsignedByte status; // StatusType, above - UnsignedShort state; // KEY_STATE_* in KeyDefs.h - UnsignedInt sequence; // sequence info from DirectX used for order - -}; - -// class Keyboard ============================================================= -/** Keyboard singleton to interface with the keyboard */ -//============================================================================= -class Keyboard : public SubsystemInterface -{ - - enum { KEY_REPEAT_DELAY = 10 }; - -public: - - Keyboard( void ); - virtual ~Keyboard( void ); - - // you may extend the functionanilty of these for your device - virtual void init( void ); /**< initialize the keyboard, only extend this - functionality, do not replace */ - virtual void reset( void ); ///< Reset keyboard system - virtual void update( void ); /**< gather current state of all keys, extend - this functionality, do not replace */ - virtual Bool getCapsState( void ) = 0; ///< get state of caps lock key, return TRUE if down - - virtual void createStreamMessages( void ); /**< given state of device, create - messages and put them on the - stream for the raw state. */ - // simplified versions where the caller doesn't care which key type was pressed. - Bool isShift(); - Bool isCtrl(); - Bool isAlt(); - Int getModifierFlags() { return m_modifiers; } - - // access methods for key data - void resetKeys( void ); ///< reset the state of the keys - KeyboardIO *getFirstKey( void ); ///< get first key ready for processing - void setKeyStatusData( UnsignedByte key, - KeyboardIO::StatusType data ); ///< set key status - WideChar translateKey( WideChar keyCode ); ///< translte key code to printable UNICODE char - WideChar getPrintableKey( UnsignedByte key, Int state ); - enum { MAX_KEY_STATES = 3}; -protected: - - /** get the key data for a single key, KEY_NONE should be returned when - no key data is available to get anymore, you must implement this for your device */ - virtual void getKey( KeyboardIO *key ) = 0; - - // internal methods to update the key states - void initKeyNames( void ); ///< initialize the key names table - void updateKeys( void ); ///< update the state of our key data - Bool checkKeyRepeat( void ); ///< check for repeating keys - UnsignedByte getKeyStatusData( UnsignedByte key ); ///< get key status - Bool getKeyStateBit( UnsignedByte key, Int bit ); ///< get key state bit - UnsignedInt getKeySequenceData( UnsignedByte key ); ///< get key sequence - void setKeyStateData( UnsignedByte key, UnsignedByte data ); ///< get key state - - UnsignedShort m_modifiers; - // internal keyboard data members - //Bool m_capsState; // 1 if caps lock is on - //Bool m_shiftState; // 1 if either shift key is pressed - //Bool m_shift2State; // 1 if secondary shift key is pressed - //Bool m_lShiftState; // 1 if left state is down - //Bool m_rShiftState; // 1 if right shift is down - //Bool m_lControlState; // 1 if left control is down - //Bool m_rControlState; // 1 if right control is down - //Bool m_lAltState; // 1 if left alt is down - //Bool m_rAltState; // 1 if right alt is down - UnsignedByte m_shift2Key; // what key is the secondary shift key - - enum { NUM_KEYS = 256 }; - KeyboardIO m_keys[ NUM_KEYS ]; ///< the keys - KeyboardIO m_keyStatus[ NUM_KEYS ]; ///< the key status flags - - enum { KEY_NAMES_COUNT = 256 }; - struct - { - - WideChar stdKey; - WideChar shifted; - WideChar shifted2; - - } m_keyNames[ KEY_NAMES_COUNT ]; - UnsignedInt m_inputFrame; ///< frame input was gathered on - -}; - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// -extern Keyboard *TheKeyboard; diff --git a/Generals/Code/GameEngine/Include/GameClient/Line2D.h b/Generals/Code/GameEngine/Include/GameClient/Line2D.h deleted file mode 100644 index 218ebb40b8..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Line2D.h +++ /dev/null @@ -1,84 +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: Line2D.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, January 2002 -// Desc: 2D line helping stuff -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -typedef std::vector Coord2DVector; -typedef std::vector Coord3DVector; - - -// PROTOTYPES ///////////////////////////////////////////////////////////////////////////////////// -extern Bool ClipLine2D( ICoord2D *p1, ICoord2D *p2, ICoord2D *c1, ICoord2D *c2, - IRegion2D *clipRegion ); - -///< IntersectLine2D will take two segments delimited by ab and cd and will return whether -///< they intersect within the length of ab. They will also return the intersection point out -///< intersection if it is non-NULL. -extern Bool IntersectLine2D( const Coord2D *a, const Coord2D *b, - const Coord2D *c, const Coord2D *d, - Coord2D *intersection = NULL); - -///< PointInsideRect2D will return true iff inputPoint lies iside of the rectangle specified -///< by bl, tl, br, tr. -extern Bool PointInsideRect2D( const Coord2D *bl, const Coord2D *tl, - const Coord2D *br, const Coord2D *tr, - const Coord2D *inputPoint); - -///< Checks if a point is inside a perfect rectangle (top left and bottom right) -extern Bool Coord3DInsideRect2D( const Coord3D *inputPoint, const Coord2D *tl, const Coord2D *br ); - -///< Scales a rect by a factor either growing or shrinking it. -extern void ScaleRect2D( Coord2D *tl, Coord2D *br, Real scaleFactor ); - -/** PointInsideRect3D will return true iff inputPoint lies iside of the rectangle specified -by bl, tl, br, tr. It does not actually consider the Z value, it is merely a convenience function -for calling PointInsideRect2D */ -extern Bool PointInsideRect3D( const Coord3D *bl, const Coord3D *tl, - const Coord3D *br, const Coord3D *tr, - const Coord3D *inputPoint); - - -///< This function will take the ptToTest and will perform even-odd checking against the area. -///< If the area is not closed, it will be closed for this check. -extern Bool PointInsideArea2D( const Coord2D *ptToTest, - const Coord2D *area, - Int numPointsInArea); - -///< This function will take the ptToTest and will perform even-odd checking against the area. -///< The area and the ptToTest will be flattened first, so a 2-D check will be sufficient. -///< This function is only for convenience so that points do not need to first be flattened. -extern Bool PointInsideArea2D( const Coord3D *ptToTest, - const Coord3D *area, - Int numPointsInArea); - -///< This function will find the shortest distance between the given segment (ab) and the pt. -///< It will also give the intersection points on the segment (ab) if desired. -///< outU will return the U value determined. This is a shortcut for panning -extern void ShortestDistancePointToSegment2D( const Coord2D *a, const Coord2D *b, const Coord2D *pt, - Real *outDistance, Coord2D *outPosition, Real *outU ); diff --git a/Generals/Code/GameEngine/Include/GameClient/MessageBox.h b/Generals/Code/GameEngine/Include/GameClient/MessageBox.h deleted file mode 100644 index cf5951e099..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/MessageBox.h +++ /dev/null @@ -1,46 +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: MessageBox.h ///////////////////////////////////////////////////////////////////////////// -// Author: Chris Huybregts, November 2001 -// Description: Message Box file containing user aliases -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameClient/GameWindowManager.h" - -GameWindow *MessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback); ///< convenience function for displaying a Message box with Yes and No buttons -GameWindow *QuitMessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback); ///< convenience function for displaying a Message box with Yes and No buttons - - -GameWindow *MessageBoxYesNoCancel(UnicodeString titleString,UnicodeString bodyString, GameWinMsgBoxFunc yesCallback, GameWinMsgBoxFunc noCallback, GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Yes,No and Cancel buttons - - -GameWindow *MessageBoxOkCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback,GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Ok and Cancel buttons - -GameWindow *MessageBoxOk(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback);///< convenience function for displaying a Message box with Ok button - - -GameWindow *MessageBoxCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Cancel button diff --git a/Generals/Code/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h b/Generals/Code/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h deleted file mode 100644 index f3296be380..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h +++ /dev/null @@ -1,58 +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: AnimatedParticleSysBoneClientUpdate.h ////////////////////////////////////////////////////////////////// -// Author: Mark Lorenzen, October 2002 -// Desc: client update module to translate particle systems with animation -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/ClientUpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -class AnimatedParticleSysBoneClientUpdate : public ClientUpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( AnimatedParticleSysBoneClientUpdate, "AnimatedParticleSysBoneClientUpdate" ) - MAKE_STANDARD_MODULE_MACRO( AnimatedParticleSysBoneClientUpdate ); - -public: - - AnimatedParticleSysBoneClientUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - /// the client update callback - virtual void clientUpdate( void ); - - -protected: - - - UnsignedInt m_life; - -}; diff --git a/Generals/Code/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h b/Generals/Code/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h deleted file mode 100644 index d50ac63373..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h +++ /dev/null @@ -1,74 +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: BeaconClientUpdate.h //////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, August 2002 -// Desc: Beacon client update module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/ClientUpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class ParticleSystem; - -//------------------------------------------------------------------------------------------------- -class BeaconClientUpdateModuleData : public ClientUpdateModuleData -{ -public: - UnsignedInt m_framesBetweenRadarPulses; - UnsignedInt m_radarPulseDuration; - - BeaconClientUpdateModuleData(); - ~BeaconClientUpdateModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); -}; - -//------------------------------------------------------------------------------------------------- -/** The tree way client update module */ -//------------------------------------------------------------------------------------------------- -class BeaconClientUpdate : public ClientUpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BeaconClientUpdate, "BeaconClientUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( BeaconClientUpdate, BeaconClientUpdateModuleData ); - -public: - - BeaconClientUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - /// the client update callback - virtual void clientUpdate( void ); - void hideBeacon( void ); - -protected: - - ParticleSystemID m_particleSystemID; - UnsignedInt m_lastRadarPulse; - -}; diff --git a/Generals/Code/GameEngine/Include/GameClient/Module/SwayClientUpdate.h b/Generals/Code/GameEngine/Include/GameClient/Module/SwayClientUpdate.h deleted file mode 100644 index e2046660e7..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Module/SwayClientUpdate.h +++ /dev/null @@ -1,69 +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: SwayClientUpdate.h //////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, May 2002 -// Desc: Tree sway client update module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/ClientUpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -/** The tree way client update module */ -//------------------------------------------------------------------------------------------------- -class SwayClientUpdate : public ClientUpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SwayClientUpdate, "SwayClientUpdate" ) - MAKE_STANDARD_MODULE_MACRO( SwayClientUpdate ); - -public: - - SwayClientUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - /// the client update callback - virtual void clientUpdate( void ); - - void stopSway( void ) { m_swaying = false; } - -protected: - - Real m_curValue; - Real m_curAngle; - Real m_curDelta; - Real m_curAngleLimit; - Real m_leanAngle; ///. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ProcessAnimateWindow.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Mar 2002 -// -// Filename: ProcessAnimateWindow.h -// -// author: Chris Huybregts -// -// purpose: If a new animation is wanted to be added for the windows, All you -// have to do is create a new class derived from ProcessAnimateWindow. -// Then setup each of the virtual classes to process an AnimateWindow -// class. The Update adn reverse functions get called every frame -// by the shell and will continue to process the AdminWin until the -// isFinished flag on the adminWin is set to true. -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "Lib/BaseType.h" -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -namespace wnd -{ -class AnimateWindow; -} -class GameWindow; -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -class ProcessAnimateWindow -{ -public: - - ProcessAnimateWindow( void ){}; - virtual ~ProcessAnimateWindow( void ){}; - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ) = 0; - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ) = 0; - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ) = 0; - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ) = 0; - virtual void setMaxDuration(UnsignedInt maxDuration) { } -}; - -//----------------------------------------------------------------------------- - -class ProcessAnimateWindowSlideFromRight : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromRight( void ); - virtual ~ProcessAnimateWindowSlideFromRight( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: -Coord2D m_maxVel; // top speed windows travel in x and y -Int m_slowDownThreshold; // when widnows get this close to their resting - // positions they start to slow down -Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker) -Real m_speedUpRatio; // how fast the windows speed up - -}; - - -//----------------------------------------------------------------------------- - -class ProcessAnimateWindowSlideFromLeft : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromLeft( void ); - virtual ~ProcessAnimateWindowSlideFromLeft( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: -Coord2D m_maxVel; // top speed windows travel in x and y -Int m_slowDownThreshold; // when widnows get this close to their resting - // positions they start to slow down -Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker) -Real m_speedUpRatio; // how fast the windows speed up - -}; - - -//----------------------------------------------------------------------------- - -class ProcessAnimateWindowSlideFromTop : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromTop( void ); - virtual ~ProcessAnimateWindowSlideFromTop( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: -Coord2D m_maxVel; // top speed windows travel in x and y -Int m_slowDownThreshold; // when widnows get this close to their resting - // positions they start to slow down -Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker) -Real m_speedUpRatio; // how fast the windows speed up - -}; - -//----------------------------------------------------------------------------- -class ProcessAnimateWindowSlideFromTopFast : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromTopFast( void ); - virtual ~ProcessAnimateWindowSlideFromTopFast( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: -Coord2D m_maxVel; // top speed windows travel in x and y -Int m_slowDownThreshold; // when widnows get this close to their resting - // positions they start to slow down -Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker) -Real m_speedUpRatio; // how fast the windows speed up - -}; - - -//----------------------------------------------------------------------------- - -class ProcessAnimateWindowSlideFromBottom : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromBottom( void ); - virtual ~ProcessAnimateWindowSlideFromBottom( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: -Coord2D m_maxVel; // top speed windows travel in x and y -Int m_slowDownThreshold; // when widnows get this close to their resting - // positions they start to slow down -Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker) -Real m_speedUpRatio; // how fast the windows speed up - -}; - -//----------------------------------------------------------------------------- - -class ProcessAnimateWindowSpiral : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSpiral( void ); - virtual ~ProcessAnimateWindowSpiral( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: - Real m_deltaTheta; - Int m_maxR; -}; - -//----------------------------------------------------------------------------- - -class ProcessAnimateWindowSlideFromBottomTimed : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromBottomTimed( void ); - virtual ~ProcessAnimateWindowSlideFromBottomTimed( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void setMaxDuration(UnsignedInt maxDuration) { m_maxDuration = maxDuration; } - -private: - UnsignedInt m_maxDuration; - -}; - -class ProcessAnimateWindowSlideFromRightFast : public ProcessAnimateWindow -{ -public: - - ProcessAnimateWindowSlideFromRightFast( void ); - virtual ~ProcessAnimateWindowSlideFromRightFast( void ); - - virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); -private: -Coord2D m_maxVel; // top speed windows travel in x and y -Int m_slowDownThreshold; // when widnows get this close to their resting - // positions they start to slow down -Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker) -Real m_speedUpRatio; // how fast the windows speed up - -}; - - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/RayEffect.h b/Generals/Code/GameEngine/Include/GameClient/RayEffect.h deleted file mode 100644 index f7442da69b..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/RayEffect.h +++ /dev/null @@ -1,90 +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: RayEffect.h ////////////////////////////////////////////////////////////////////////////// -// Created: Colin Day, May 2001 -// Desc: Ray effect manager -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDE //////////////////////////////////////////////////////////////////////////////////////// -#include "Lib/BaseType.h" -#include "Common/SubsystemInterface.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Drawable; - -//------------------------------------------------------------------------------------------------- -/** Data the ray effect system keeps for an entry */ -//------------------------------------------------------------------------------------------------- -struct RayEffectData -{ - - const Drawable *draw; ///< the drawable - Coord3D startLoc; ///< start location for ray - Coord3D endLoc; ///< end location for ray - -}; - -//------------------------------------------------------------------------------------------------- -/** This class maintains all the ray effects visible in the world */ -//------------------------------------------------------------------------------------------------- -class RayEffectSystem : public SubsystemInterface -{ - -public: - - RayEffectSystem( void ); - ~RayEffectSystem( void ); - - virtual void init( void ); - virtual void reset( void ); - virtual void update( void ) { } - - /// add a ray effect entry for this drawable - void addRayEffect( const Drawable *draw, const Coord3D *startLoc, const Coord3D *endLoc ); - - /// given a drawable, remove its effect from the system - void deleteRayEffect( const Drawable *draw ); - - /** given a drawable, if it is in the ray effect system list retrieve - the ray effect data for its entry */ - void getRayEffectData( const Drawable *draw, RayEffectData *effectData ); - -protected: - - /// find an effect data entry based on the drawable - RayEffectData *findEntry( const Drawable *draw ); - - enum - { - MAX_RAY_EFFECTS = 128 - }; - RayEffectData m_effectData[ MAX_RAY_EFFECTS ]; ///< all the ray effects - -}; - -// EXTERN ///////////////////////////////////////////////////////////////////////////////////////// -extern RayEffectSystem *TheRayEffects; ///< the ray effects singleton external diff --git a/Generals/Code/GameEngine/Include/GameClient/Shadow.h b/Generals/Code/GameEngine/Include/GameClient/Shadow.h deleted file mode 100644 index 0ea345a84f..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Shadow.h +++ /dev/null @@ -1,212 +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: Shadow.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Modified: Mark Wilczynski, February 2002 -// Desc: Shadow descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// -// skeleton definition of shadow types -// - -// shadow bit flags, keep this in sync with TheShadowNames -enum ShadowType CPP_11(: Int) -{ - SHADOW_NONE = 0x00000000, - SHADOW_DECAL = 0x00000001, //shadow decal applied via modulate blend - SHADOW_VOLUME = 0x00000002, - SHADOW_PROJECTION = 0x00000004, - SHADOW_DYNAMIC_PROJECTION = 0x00000008, //extra setting for shadows which need dynamic updates - SHADOW_DIRECTIONAL_PROJECTION = 0x00000010, //extra setting for shadow decals that rotate with sun direction - SHADOW_ALPHA_DECAL = 0x00000020, //not really for shadows but for other decal uses. Alpha blended. - SHADOW_ADDITIVE_DECAL = 0x00000040 //not really for shadows but for other decal uses. Additive blended. -}; -#ifdef DEFINE_SHADOW_NAMES -static const char* const TheShadowNames[] = -{ - "SHADOW_DECAL", - "SHADOW_VOLUME", - "SHADOW_PROJECTION", - "SHADOW_DYNAMIC_PROJECTION", - "SHADOW_DIRECTIONAL_PROJECTION", - "SHADOW_ALPHA_DECAL", - "SHADOW_ADDITIVE_DECAL", - NULL -}; -#endif // end DEFINE_SHADOW_NAMES - -#define MAX_SHADOW_LIGHTS 1 //maximum number of shadow casting light sources in scene - support for more than 1 has been dropped from most code. - -class RenderObjClass; //forward reference -class RenderCost; //forward reference - -//Interface to all shadow objects. -class Shadow -{ - -public: - - struct ShadowTypeInfo - { - char m_ShadowName[64]; //when set, overrides the default model shadow (used mostly for Decals). - ShadowType m_type; //type of shadow - Bool allowUpdates; //whether to update the shadow image when object/light moves. - Bool allowWorldAlign; //whether to align shadow to world geometry or draw as horizontal decal. - Real m_sizeX; //world size of decal projection - Real m_sizeY; //world size of decal projection - Real m_offsetX; //world shift along x axis - Real m_offsetY; //world shift along y axis - }; - - Shadow(void) : m_diffuse(0xffffffff), m_color(0xffffffff), m_opacity (0x000000ff), m_localAngle(0.0f) {} - - ///> 8) & 0xff) * fvalue)) - |REAL_TO_INT(((Real)((m_color >> 16) & 0xff) * fvalue)); - } - } -} - -inline void Shadow::setColor(Color value) -{ - m_color = value & 0x00ffffff; //filter out alpha - - if (m_type & SHADOW_ALPHA_DECAL) - { - m_diffuse=m_color | (m_opacity << 24); - } - else - { - if (m_type & SHADOW_ADDITIVE_DECAL) - { - Real fvalue=(Real)m_opacity/255.0f; - m_diffuse=REAL_TO_INT(((Real)(m_color & 0xff) * fvalue)) - |REAL_TO_INT(((Real)((m_color >> 8) & 0xff) * fvalue)) - |REAL_TO_INT(((Real)((m_color >> 16) & 0xff) * fvalue)); - } - } -} - -inline void Shadow::setPosition(Real x, Real y, Real z) -{ - m_x=x; m_y=y; m_z=z; -} - -inline void Shadow::setAngle(Real angle) -{ - m_localAngle=angle; -} - -class Drawable; //forward ref. - -class ProjectedShadowManager -{ -public: - virtual ~ProjectedShadowManager() { }; - virtual Shadow *addDecal(RenderObjClass *, Shadow::ShadowTypeInfo *shadowInfo)=0; ///. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Shell.h ////////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2001 -// Description: Shell menu representations -// -// Using The Shell: -// ---------------- -// -// The Shell makes use of the window layouts to represent screens. You can push and -// pop screens on the stack so that you don't have to keep track of how you got -// to which screen. -// -// Here is what happens when you push a layout on the shell stack: -// 1) The layout name is stored as a "pending push" -// 2) The top of the stack has the Shutdown() method run -// 3) The Shutdown() method (or other mechanisms like Update()) will call -// Shell::shutdownComplete() when the shutdown process for that layout is "complete" -// 4) Shell::shutdownComplete() sees the "pending push" in the shell -// 5) "Pending push" layout is then loaded from disk and the pending push state is cleared -// 6) The new layout is put on the top of the stack -// 7) The new layout Init() method is called -// -// Here is what happens when you pop the top of the stack -// 1) The stack sets a "pending pop" as in progress -// 2) The top layout of the stack has the Shutdown() method called -// 3) The Shutdown() method (or other mechanisms like Update()) will call -// Shell::shutdownComplete() when the shutdown process for that layout is "complete" -// 4) Shell::shutdownComplete() sees the "pending pop" in the shell -// 5) The "pending pop" layout is then destroyed and removed from the stack -// 6) The new top of the stack has the Init() method run -// -// Window Layouts and the Shell: -// ----------------------------- -// -// Window Layouts in the shell need the following functions to work property, these -// can be assigned from the GUIEdit window layout tool: -// -// - Init() [OPTIONAL] -// This is called as a result of a push or pop operation (see above for more info) -// The window layout is loaded from disk and then this Init() -// method is run. All shell layout Init() methods should show -// the layout windows. At this point you could move windows -// to starting positions, set a state that the Update() method looks at to -// "animate" the windows to the desired positions. -// -// - Update() [OPTIONAL] -// This is called once at a rate of "shellUpdateDelay" for EVERY screen on the shell -// stack. It does not matter if the screen is on the top, or is hidden, or -// anything, this is always called. Each update is run starting with the screen -// at the top of the stack and progressing to the bottom of the stack. -// States could be set in the Init() or Shutdown() methods of the layout -// that the Update() looks at and reacts to appropriately if desired. -// -// - Shutdown() [REQUIRED] -// This is called when a layout is popped off the stack, or when a new layout -// is pushed on top of this one (see above for more detail on what happens -// during the push/pop process). You can switch into a "shutdown" state and -// animate the layout appropriately in the Update() method for the layout. -// When shutdown is actually complete you should hide the all windows in -// the layout and then you are REQUIRED to notify the shell by calling -// the Shell::shutdownComplete() method. -// -// Shutdown() is also required to be able to handle the paramater "immediatePop". -// If this paramater is TRUE it means that when control returns from the -// shutdown function that the layout will immediately be popped off the -// stack. We need to be able to handle this when in code we want to -// traverse back down the stack rapidly (like when we lose connection to -// an online service, we might pop all the way back to the login screen) -// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class WindowLayout; -class AnimateWindowManager; -class GameWindow; -class ShellMenuSchemeManager; - -enum AnimTypes CPP_11(: Int); - -//------------------------------------------------------------------------------------------------- -/** This is the interface to the shell system to load, display, and - * manage screen menu shell system layouts */ -//------------------------------------------------------------------------------------------------- -class Shell : public SubsystemInterface -{ - -public: - - Shell( void ); - ~Shell( void ); - - // Inhertited from subsystem ==================================================================== - virtual void init( void ); - virtual void reset( void ); - virtual void update( void ); - //=============================================================================================== - - void recreateWindowLayouts( void ); - - void showShellMap(Bool useShellMap ); ///< access function to turn on and off the shell map - - void hide( Bool hide ); ///< show/hide all shell layouts - - // pseudo-stack operations for manipulating layouts - void push( AsciiString filename, Bool shutdownImmediate = FALSE ); ///< load new screen on top, optionally doing an immediate shutdown - void pop( void ); ///< pop top layout - void popImmediate( void ); ///< pop now, don't wait for shutdown - void showShell( Bool runInit = TRUE ); ///< init the top of stack - void hideShell( void ); ///< shutdown the top of stack - WindowLayout *top( void ); ///< return top layout - - void shutdownComplete( WindowLayout *layout, Bool impendingPush = FALSE ); ///< layout has completed shutdown - - WindowLayout *findScreenByFilename( AsciiString filename ); ///< find screen - inline Bool isShellActive( void ) { return m_isShellActive; } ///< Returns true if the shell is active - - void registerWithAnimateManager( GameWindow *win, AnimTypes animType, Bool needsToFinish, UnsignedInt delayMS = 0); - Bool isAnimFinished( void ); - void reverseAnimatewindow( void ); - Bool isAnimReversed( void ); - - void loadScheme( AsciiString name ); - ShellMenuSchemeManager *getShellMenuSchemeManager( void ) { return m_schemeManager; } - - Int getScreenCount( void ) const { return m_screenCount; } ///< Return the current number of screens - WindowLayout *getScreenLayout( Int index ) const; - - WindowLayout *getSaveLoadMenuLayout( void ); ///< create if necessary and return layout for save load menu - WindowLayout *getPopupReplayLayout( void ); ///< create if necessary and return layout for replay save menu - WindowLayout *getOptionsLayout( Bool create ); ///< return layout for options menu, create if necessary and we are allowed to. - void destroyOptionsLayout( void ); ///< destroy the shell's options layout. - -protected: - - void construct( void ); - void deconstruct( void ); - - void linkScreen( WindowLayout *screen ); ///< link screen to list - void unlinkScreen( WindowLayout *screen ); ///< remove screen from list - - void doPush( AsciiString layoutFile ); ///< workhorse for push action - void doPop( Bool impendingPush ); ///< workhorse for pop action - - enum { MAX_SHELL_STACK = 16 }; ///< max simultaneous shell screens - WindowLayout *m_screenStack[ MAX_SHELL_STACK ]; ///< the screen layout stack - Int m_screenCount; ///< # of screens in screen stack - - WindowLayout *m_background; ///< The Background layout if the 3d shell isn't running - Bool m_clearBackground; ///< Flag if we're going to clear the background or not - - Bool m_pendingPush; ///< TRUE when a push is pending - Bool m_pendingPop; ///< TRUE when a pop is pending - AsciiString m_pendingPushName; ///< layout name to be pushed - Bool m_isShellActive; ///< TRUE when the shell is active - Bool m_shellMapOn; ///< TRUE when the shell map is on - AnimateWindowManager *m_animateWindowManager; ///< The animate Window Manager - ShellMenuSchemeManager *m_schemeManager; ///< The Shell Scheme Manager - - // - // we keep a pointer to this layout so that we can simply just hide/unhide this - // window layout. Why you ask? Well, as the result of pressing a button to start - // a save game load a super large set of operations will happen as the game - // loads. One of those operations is the destruction of the menu, which although - // it just destroys the windows and puts them on a destroyed list, that destroyed - // list is also processed before we are out of our own window procedure. - // This is a prime example why it's easier to just deal with windows by hiding and - // un-hiding them rather than actually creating and destroying them. - // - WindowLayout *m_saveLoadMenuLayout; ///< save/load menu layout - WindowLayout *m_popupReplayLayout; ///< replay save menu layout - WindowLayout *m_optionsLayout; ///< options menu layout - -}; - -// INLINING /////////////////////////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// -extern Shell *TheShell; ///< the shell external interface diff --git a/Generals/Code/GameEngine/Include/GameClient/ShellHooks.h b/Generals/Code/GameEngine/Include/GameClient/ShellHooks.h deleted file mode 100644 index d6fe041860..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/ShellHooks.h +++ /dev/null @@ -1,81 +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. // -// // -//////////////////////////////////////////////////////////////////////////////// - - -// ShellHooks.h -// Author: Matthew D. Campbell, October 2002 - -#pragma once - -// -// This enumeration holds all the shell script hooks that we currently have, If you are going to -// add more, it's important to keep the enum lined up with the names in TheShellHookNames located -// in Scripts.cpp. -// -enum -{ - SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_SELECTED = 0, - SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_HIGHLIGHTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_UNHIGHLIGHTED, - - SHELL_SCRIPT_HOOK_MAIN_MENU_SKIRMISH_SELECTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_SKIRMISH_HIGHLIGHTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_SKIRMISH_UNHIGHLIGHTED, - - SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_SELECTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_HIGHLIGHTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_UNHIGHLIGHTED, - - SHELL_SCRIPT_HOOK_MAIN_MENU_ONLINE_SELECTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_ONLINE_HIGHLIGHTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_ONLINE_UNHIGHLIGHTED, - - SHELL_SCRIPT_HOOK_MAIN_MENU_NETWORK_SELECTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_NETWORK_HIGHLIGHTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_NETWORK_UNHIGHLIGHTED, - - SHELL_SCRIPT_HOOK_MAIN_MENU_EXIT_SELECTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_EXIT_HIGHLIGHTED, - SHELL_SCRIPT_HOOK_MAIN_MENU_EXIT_UNHIGHLIGHTED, - - SHELL_SCRIPT_HOOK_GENERALS_ONLINE_LOGIN, - SHELL_SCRIPT_HOOK_GENERALS_ONLINE_LOGOUT, - SHELL_SCRIPT_HOOK_GENERALS_ONLINE_ENTERED_FROM_GAME, - - SHELL_SCRIPT_HOOK_OPTIONS_OPENED, - SHELL_SCRIPT_HOOK_OPTIONS_CLOSED, - - SHELL_SCRIPT_HOOK_SKIRMISH_OPENED, - SHELL_SCRIPT_HOOK_SKIRMISH_CLOSED, - SHELL_SCRIPT_HOOK_SKIRMISH_ENTERED_FROM_GAME, - - SHELL_SCRIPT_HOOK_LAN_OPENED, - SHELL_SCRIPT_HOOK_LAN_CLOSED, - SHELL_SCRIPT_HOOK_LAN_ENTERED_FROM_GAME, - - SHELL_SCRIPT_HOOK_TOTAL -}; - -extern const char *const TheShellHookNames[]; ///< Contains a list of the text representation of the shell hooks Used in WorldBuilder and in the shell. -void SignalUIInteraction(Int interaction); diff --git a/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h b/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h deleted file mode 100644 index 3219b1a87c..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h +++ /dev/null @@ -1,152 +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: ShellMenuScheme.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Jul 2002 -// -// Filename: ShellMenuScheme.h -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameClient/Color.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Image; - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class ShellMenuSchemeLine -{ -public: - ShellMenuSchemeLine( void ); - ~ShellMenuSchemeLine( void ); - - ICoord2D m_startPos; - ICoord2D m_endPos; - Int m_width; - Color m_color; - -}; - -class ShellMenuSchemeImage -{ -public: - ShellMenuSchemeImage( void ); - ~ShellMenuSchemeImage( void ); - - AsciiString m_name; ///< Name of the image - ICoord2D m_position; ///< the position we'll draw it at - ICoord2D m_size; ///< the size of the image needed when we draw it - Image *m_image; ///< the actual pointer to the mapped image -}; - -class ShellMenuScheme -{ -public: - ShellMenuScheme( void ); - ~ShellMenuScheme( void ); - - void draw( void ); - void addImage( ShellMenuSchemeImage* schemeImage ); - void addLine( ShellMenuSchemeLine* schemeLine ); - - - AsciiString m_name; - - typedef std::list< ShellMenuSchemeImage* > ShellMenuSchemeImageList; - typedef ShellMenuSchemeImageList::iterator ShellMenuSchemeImageListIt; - ShellMenuSchemeImageList m_imageList; - - typedef std::list< ShellMenuSchemeLine* > ShellMenuSchemeLineList; - typedef ShellMenuSchemeLineList::iterator ShellMenuSchemeLineListIt; - ShellMenuSchemeLineList m_lineList; - - - - -}; - -class ShellMenuSchemeManager -{ -public: - ShellMenuSchemeManager( void ); - ~ShellMenuSchemeManager( void ); - - void init( void ); - void update( void ); - - void setShellMenuScheme( AsciiString name ); - - void draw( void ); - - // parse Functions for the INI file - const FieldParse *getFieldParse() const { return m_shellMenuSchemeFieldParseTable; } ///< returns the parsing fields - static const FieldParse m_shellMenuSchemeFieldParseTable[]; ///< the parse table - static void parseImagePart( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the image part of the INI file - static void parseLinePart( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the line part of the INI file - - ShellMenuScheme *newShellMenuScheme(AsciiString name); - -private: - typedef std::list< ShellMenuScheme* > ShellMenuSchemeList; ///< list of Shell Menu schemes - typedef ShellMenuSchemeList::iterator ShellMenuSchemeListIt; - ShellMenuSchemeList m_schemeList; - ShellMenuScheme *m_currentScheme; - -}; - - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/Statistics.h b/Generals/Code/GameEngine/Include/GameClient/Statistics.h deleted file mode 100644 index 8031fe35fd..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Statistics.h +++ /dev/null @@ -1,62 +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: Statistics.h -/*---------------------------------------------------------------------------*/ -/* EA Pacific */ -/* Confidential Information */ -/* Copyright (C) 2001 - All Rights Reserved */ -/* DO NOT DISTRIBUTE */ -/*---------------------------------------------------------------------------*/ -/* Project: RTS3 */ -/* File name: Statistics.h */ -/* Created: John K. McDonald, Jr., 4/2/2002 */ -/* Desc: Common statistical functions */ -/* Revision History: */ -/* 4/2/2002 : Initial creation */ -/*---------------------------------------------------------------------------*/ - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////// -#include "Lib/BaseType.h" - -// DEFINES //////////////////////////////////////////////////////////////////// -// TYPE DEFINES /////////////////////////////////////////////////////////////// -// FORWARD DECLARATIONS /////////////////////////////////////////////////////// - - -// valueToRun is the value (between 0 and maxValueForVal) to test. -// mu is designates the steepness of the curve. -// The return value is a value in [-1, 1] -extern Real MuLaw(Real valueToRun, Real maxValueForVal, Real mu); - -// valueToNormalize is a value in minRange..maxRange -// minRange is the smallest value the range contains -// maxRange is the largest value the range contains -// the return is a value in [0, 1]. -extern Real Normalize(Real valueToNormalize, Real minRange, Real maxRange); - -// same as Normalize, except that output will be in the range [outRangeMin, outRangeMax] -extern Real NormalizeToRange(Real valueToNormalize, Real minRange, Real maxRange, Real outRangeMin, Real outRangeMax); diff --git a/Generals/Code/GameEngine/Include/GameClient/TerrainRoads.h b/Generals/Code/GameEngine/Include/GameClient/TerrainRoads.h deleted file mode 100644 index c0c4ee72fc..0000000000 --- a/Generals/Code/GameEngine/Include/GameClient/TerrainRoads.h +++ /dev/null @@ -1,229 +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: TerrainRoads.h /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Terrain road descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameMemory.h" -#include "Common/SubsystemInterface.h" - -#include "GameLogic/Module/BodyModule.h" - - -// FORWARD DECLARATIONS /////////////////////////////////////////////////////////////////////////// -struct FieldParse; -class AsciiString; - -// ------------------------------------------------------------------------------------------------ -/** Bridges have 4 towers around it that the player can attack or use to repair the bridge */ -// ------------------------------------------------------------------------------------------------ -enum BridgeTowerType CPP_11(: Int) -{ - BRIDGE_TOWER_FROM_LEFT = 0, - BRIDGE_TOWER_FROM_RIGHT, - BRIDGE_TOWER_TO_LEFT, - BRIDGE_TOWER_TO_RIGHT, - - BRIDGE_MAX_TOWERS -}; - -// ------------------------------------------------------------------------------------------------ -enum { MAX_BRIDGE_BODY_FX = 3 }; - -//------------------------------------------------------------------------------------------------- -/** Terrain road description, good for roads and bridges */ -//------------------------------------------------------------------------------------------------- -class TerrainRoadType : public MemoryPoolObject -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( TerrainRoadType, "TerrainRoadType" ) - -public: - - TerrainRoadType( void ); - // destructor prototypes defined by memory pool object - - inline AsciiString getName( void ) { return m_name; } - inline AsciiString getTexture( void ) { return m_texture; } - inline Bool isBridge( void ) { return m_isBridge; } - inline UnsignedInt getID( void ) { return m_id; } - - inline Real getRoadWidth( void ) { return m_roadWidth; } - inline Real getRoadWidthInTexture( void ) { return m_roadWidthInTexture; } - - inline Real getBridgeScale( void ) { return m_bridgeScale; } - inline AsciiString getScaffoldObjectName( void ) { return m_scaffoldObjectName; } - inline AsciiString getScaffoldSupportObjectName( void ) { return m_scaffoldSupportObjectName; } - inline RGBColor getRadarColor( void ) { return m_radarColor; } - inline AsciiString getBridgeModel( void ) { return m_bridgeModelName; } - inline AsciiString getBridgeModelNameDamaged( void ) { return m_bridgeModelNameDamaged; } - inline AsciiString getBridgeModelNameReallyDamaged( void ) { return m_bridgeModelNameReallyDamaged; } - inline AsciiString getBridgeModelNameBroken( void ) { return m_bridgeModelNameBroken; } - inline AsciiString getTextureDamaged( void ) { return m_textureDamaged; } - inline AsciiString getTextureReallyDamaged( void ) { return m_textureReallyDamaged; } - inline AsciiString getTextureBroken( void ) { return m_textureBroken; } - inline AsciiString getTowerObjectName( BridgeTowerType tower ) { return m_towerObjectName[ tower ]; } - inline AsciiString getDamageToSoundString( BodyDamageType state ) { return m_damageToSoundString[ state ]; } - inline AsciiString getDamageToOCLString( BodyDamageType state, Int index ) { return m_damageToOCLString[ state ][ index ]; } - inline AsciiString getDamageToFXString( BodyDamageType state, Int index ) { return m_damageToFXString[ state ][ index ]; } - inline AsciiString getRepairedToSoundString( BodyDamageType state ) { return m_repairedToSoundString[ state ]; } - inline AsciiString getRepairedToOCLString( BodyDamageType state, Int index ) { return m_repairedToOCLString[ state ][ index ]; } - inline AsciiString getRepairedToFXString( BodyDamageType state, Int index ) { return m_repairedToFXString[ state ][ index ]; } - inline Real getTransitionEffectsHeight( void ) { return m_transitionEffectsHeight; } - inline Int getNumFXPerType( void ) { return m_numFXPerType; } - - // friend access methods to be used by the road collection only! - inline void friend_setName( AsciiString name ) { m_name = name; } - inline void friend_setTexture( AsciiString texture ) { m_texture = texture; } - inline void friend_setBridge( Bool isBridge ) { m_isBridge = isBridge; } - inline void friend_setID( UnsignedInt id ) { m_id = id; } - inline void friend_setNext( TerrainRoadType *next ) { m_next = next; } - inline TerrainRoadType *friend_getNext( void ) { return m_next; } - inline void friend_setRoadWidth( Real width ) { m_roadWidth = width; } - inline void friend_setRoadWidthInTexture( Real width ) { m_roadWidthInTexture = width; } - inline void friend_setBridgeScale( Real scale ) { m_bridgeScale = scale; } - inline void friend_setScaffoldObjectName( AsciiString name ) { m_scaffoldObjectName = name; } - inline void friend_setScaffoldSupportObjectName( AsciiString name ) { m_scaffoldSupportObjectName = name; } - inline void friend_setBridgeModelName( AsciiString name ) { m_bridgeModelName = name; } - inline void friend_setBridgeModelNameDamaged( AsciiString name ) { m_bridgeModelNameDamaged = name; } - inline void friend_setBridgeModelNameReallyDamaged( AsciiString name ) { m_bridgeModelNameReallyDamaged = name; } - inline void friend_setBridgeModelNameBroken( AsciiString name ) { m_bridgeModelNameBroken = name; } - inline void friend_setTextureDamaged( AsciiString texture ) { m_textureDamaged = texture; } - inline void friend_setTextureReallyDamaged( AsciiString texture ) { m_textureReallyDamaged = texture; } - inline void friend_setTextureBroken( AsciiString texture ) { m_textureBroken = texture; } - inline void friend_setTowerObjectName( BridgeTowerType tower, AsciiString name ) { m_towerObjectName[ tower ] = name; } - inline void friend_setDamageToSoundString( BodyDamageType state, AsciiString s ) { m_damageToSoundString[ state ] = s; } - inline void friend_setDamageToOCLString( BodyDamageType state, Int index, AsciiString s ) { m_damageToOCLString[ state ][ index ] = s; } - inline void friend_setDamageToFXString( BodyDamageType state, Int index, AsciiString s ) { m_damageToFXString[ state ][ index ] = s; } - inline void friend_setRepairedToSoundString( BodyDamageType state, AsciiString s ) { m_repairedToSoundString[ state ] = s; } - inline void friend_setRepairedToOCLString( BodyDamageType state, Int index, AsciiString s ) { m_repairedToOCLString[ state ][ index ] = s; } - inline void friend_setRepairedToFXString( BodyDamageType state, Int index, AsciiString s ) { m_repairedToFXString[ state ][ index ] = s; } - inline void friend_setTransitionEffectsHeight( Real height ) { m_transitionEffectsHeight = height; } - inline void friend_setNumFXPerType( Int num ) { m_numFXPerType = num; } - - /// get the parsing table for INI - const FieldParse *getRoadFieldParse( void ) { return m_terrainRoadFieldParseTable; } - const FieldParse *getBridgeFieldParse( void ) { return m_terrainBridgeFieldParseTable; } - -protected: - - AsciiString m_name; ///< entry name - Bool m_isBridge; ///< true if entry is for a bridge - UnsignedInt m_id; ///< unique id - TerrainRoadType *m_next; ///< next in road list - - // for parsing from INI - static const FieldParse m_terrainRoadFieldParseTable[]; ///< the parse table for INI definition - static const FieldParse m_terrainBridgeFieldParseTable[]; ///< the parse table for INI definition - static void parseTransitionToOCL( INI *ini, void *instance, void *store, const void *userData ); - static void parseTransitionToFX( INI *ini, void *instance, void *store, const void *userData ); - - // - // *note* I would union the road and bridge data, but unions can't have a copy - // constructor such as the AsciiString does - // - - // road data - Real m_roadWidth; ///< width of road - Real m_roadWidthInTexture; ///< width of road in the texture - - // bridge data - Real m_bridgeScale; ///< scale for bridge - - AsciiString m_scaffoldObjectName; ///< scaffold object name - AsciiString m_scaffoldSupportObjectName; ///< scaffold support object name - - RGBColor m_radarColor; ///< color for this bridge on the radar - - AsciiString m_bridgeModelName; ///< model name for bridge - AsciiString m_texture; ///< texture filename - - AsciiString m_bridgeModelNameDamaged; ///< model name for bridge - AsciiString m_textureDamaged; ///< model name for bridge - - AsciiString m_bridgeModelNameReallyDamaged; ///< model name for bridge - AsciiString m_textureReallyDamaged; ///< model name for bridge - - AsciiString m_bridgeModelNameBroken; ///< model name for bridge - AsciiString m_textureBroken; ///< model name for bridge - - AsciiString m_towerObjectName[ BRIDGE_MAX_TOWERS ]; ///< object names for the targetable towers on the bridge - - // - // the following strings are for repair/damage transition events, what sounds to - // play and a collection of OCL and FX lists to play over the bridge area - // - AsciiString m_damageToSoundString[ BODYDAMAGETYPE_COUNT ]; - AsciiString m_damageToOCLString[ BODYDAMAGETYPE_COUNT ][ MAX_BRIDGE_BODY_FX ]; - AsciiString m_damageToFXString[ BODYDAMAGETYPE_COUNT ][ MAX_BRIDGE_BODY_FX ]; - AsciiString m_repairedToSoundString[ BODYDAMAGETYPE_COUNT ]; - AsciiString m_repairedToOCLString[ BODYDAMAGETYPE_COUNT ][ MAX_BRIDGE_BODY_FX ]; - AsciiString m_repairedToFXString[ BODYDAMAGETYPE_COUNT ][ MAX_BRIDGE_BODY_FX ]; - Real m_transitionEffectsHeight; - Int m_numFXPerType; ///< for *each* fx/ocl we will make this many of them on the bridge area - -}; - -//------------------------------------------------------------------------------------------------- -/** Collection of all roads and bridges */ -//------------------------------------------------------------------------------------------------- -class TerrainRoadCollection : public SubsystemInterface -{ - -public: - - TerrainRoadCollection( void ); - ~TerrainRoadCollection( void ); - - void init() { } - void reset() { } - void update() { } - - TerrainRoadType *findRoad( AsciiString name ); ///< find road with matching name - TerrainRoadType *newRoad( AsciiString name ); ///< allocate new road, assing name, and link to list - TerrainRoadType *firstRoad( void ) { return m_roadList; } ///< return first road - TerrainRoadType *nextRoad( TerrainRoadType *road ); ///< get next road - - TerrainRoadType *findBridge( AsciiString name ); ///< find bridge with matching name - TerrainRoadType *newBridge( AsciiString name ); ///< allocate new bridge, assign name, and link - TerrainRoadType *firstBridge( void ) { return m_bridgeList; } ///< return first bridge - TerrainRoadType *nextBridge( TerrainRoadType *bridge ); ///< get next bridge - - TerrainRoadType *findRoadOrBridge( AsciiString name ); ///< search roads and bridges - -protected: - - TerrainRoadType *m_roadList; ///< list of available roads - TerrainRoadType *m_bridgeList; ///< list of available bridges - static UnsignedInt m_idCounter; ///< unique id counter when allocating roads/bridges - -}; - -// EXTERNAL //////////////////////////////////////////////////////////////////////////////////////// -extern TerrainRoadCollection *TheTerrainRoads; diff --git a/Generals/Code/GameEngine/Source/GameClient/DisplayStringManager.cpp b/Generals/Code/GameEngine/Source/GameClient/DisplayStringManager.cpp deleted file mode 100644 index fc7dd99c50..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/DisplayStringManager.cpp +++ /dev/null @@ -1,103 +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.cpp ///////////////////////////////////////////////////////////////// -// Created: Colin Day, July 2001 -// Desc: Access for creating game managed display strings -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/DisplayStringManager.h" - -// PUBLIC DATA //////////////////////////////////////////////////////////////////////////////////// -DisplayStringManager *TheDisplayStringManager = NULL; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DisplayStringManager::DisplayStringManager( void ) -{ - - m_stringList = NULL; - m_currentCheckpoint = NULL; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DisplayStringManager::~DisplayStringManager( void ) -{ - - // - // we only keep track of the strings, we do NOT de-allocate them, our - // list better be cleaned out before we destroy ourselves - // - assert( m_stringList == NULL ); - -} - -//------------------------------------------------------------------------------------------------- -/** Link a display string to the master list */ -//------------------------------------------------------------------------------------------------- -void DisplayStringManager::link( DisplayString *string ) -{ - - assert( string ); - assert( string->m_next == NULL ); - assert( string->m_prev == NULL ); - - string->m_next = m_stringList; - if( m_stringList ) - m_stringList->m_prev = string; - - m_stringList = string; - -} - -//------------------------------------------------------------------------------------------------- -/** Unlink a display string from the master list */ -//------------------------------------------------------------------------------------------------- -void DisplayStringManager::unLink( DisplayString *string ) -{ - - assert( string ); - assert( m_stringList ); - - if( string->m_next ) - string->m_next->m_prev = string->m_prev; - if( string->m_prev ) - string->m_prev->m_next = string->m_next; - else - { - - assert( string == m_stringList ); - m_stringList = string->m_next; - - } - -} diff --git a/Generals/Code/GameEngine/Source/GameClient/DrawGroupInfo.cpp b/Generals/Code/GameEngine/Source/GameClient/DrawGroupInfo.cpp deleted file mode 100644 index 1e4b399416..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/DrawGroupInfo.cpp +++ /dev/null @@ -1,55 +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. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// DrawGroupInfo.cpp ////////////////////////////////////////////////////////////////////////////// -// Author: John McDonald, October 2002 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/DrawGroupInfo.h" - -// Useful defaults. - -DrawGroupInfo::DrawGroupInfo() -{ - m_fontName = "Arial"; - m_fontSize = 10; - m_fontIsBold = FALSE; - - m_usePlayerColor = TRUE; - m_colorForText = GameMakeColor(255, 255, 255, 255); - m_colorForTextDropShadow = GameMakeColor(0, 0, 0, 255); - - m_dropShadowOffsetX = -1; - m_dropShadowOffsetY = -1; - - m_percentOffsetX = -0.05f; - m_usingPixelOffsetX = FALSE; - - m_pixelOffsetY = -10; - m_usingPixelOffsetY = TRUE; -} - -DrawGroupInfo *TheDrawGroupInfo = NULL; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp deleted file mode 100644 index adbe1332f0..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp +++ /dev/null @@ -1,104 +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: ControlBarPrintPositions.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Sep 2002 -// -// Filename: ControlBarPrintPositions.cpp -// -// author: Chris Huybregts -// -// purpose: Convience function for degayifying the whole squished control bar -// process -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameClient/GameWindowManager.h" -#include "GameClient/WindowLayout.h" -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -void PrintInfoRecursive( GameWindow *win, FILE *fp) -{ - if(!win) - return; - ICoord2D pos, size; - win->winGetSize(&size.x, &size.y); - win->winGetPosition(&pos.x, &pos.y); - fprintf(fp, "ControlBarResizer %s\n",win->winGetInstanceData()->m_decoratedNameString.str()); - fprintf(fp, " AltPosition = X:%d Y:%d\n",pos.x, pos.y); - fprintf(fp, " AltSize = X:%d Y:%d\n",size.x, size.y); - fprintf(fp, "END\n\n"); - - PrintInfoRecursive(win->winGetChild(),fp); - PrintInfoRecursive(win->winGetNext(),fp); - -} - -void PrintOffsetsFromControlBarParent( void ) -{ - GameWindow *controlBarParent = TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ControlBarParent" )); - if(!controlBarParent) - return; - - WindowLayout *layout = TheWindowManager->winCreateLayout("controlBarHidden.wnd"); - if(!layout) - return; - FILE *fp = fopen("ControlBarEasier.txt", "w"); - if(!fp) - return; - - PrintInfoRecursive(layout->getFirstWindow(), fp); - - fclose(fp); - layout->destroyWindows(); - deleteInstance(layout); -} - - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp deleted file mode 100644 index b00065aea0..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: GameFont.cpp ///////////////////////////////////////////////////////////////////////////// -// Created: Colin Day, June 2001 -// Desc: Access to our representation for fonts -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/GameFont.h" - -// PUBLIC DATA //////////////////////////////////////////////////////////////////////////////////// -FontLibrary *TheFontLibrary = NULL; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Link a font to the font list */ -//------------------------------------------------------------------------------------------------- -void FontLibrary::linkFont( GameFont *font ) -{ - - // sanity - if( font == NULL ) - return; - - // link it - font->next = m_fontList; - m_fontList = font; - - // increment linked count - m_count++; - -} - -//------------------------------------------------------------------------------------------------- -/** Unlink a font from the font list */ -//------------------------------------------------------------------------------------------------- -void FontLibrary::unlinkFont( GameFont *font ) -{ - GameFont *other = NULL; - - // sanity - if( font == NULL ) - return; - - // sanity check and make sure this font is actually in this library - for( other = m_fontList; other; other = other->next ) - if( other == font ) - break; - if( other == NULL ) - { - - DEBUG_CRASH(( "Font '%s' not found in library", font->nameString.str() )); - return; - - } - - // scan for the font pointing to the one we're going to unlink - for( other = m_fontList; other; other = other->next ) - if( other->next == font ) - break; - - // - // if nothing was fount this was at the head of the list, otherwise - // remove from chain - // - if( other == NULL ) - m_fontList = font->next; - else - other->next = font->next; - - // clean up this font we just unlinked just to be cool! - font->next = NULL; - - // we now have one less font on the list - m_count--; - -} - -//------------------------------------------------------------------------------------------------- -/** Delete all font data, DO NOT throw an exception ... the destructor uses this */ -//------------------------------------------------------------------------------------------------- -void FontLibrary::deleteAllFonts( void ) -{ - GameFont *font; - - // release all the fonts - while( m_fontList ) - { - - // get temp pointer to this font - font = m_fontList; - - // remove font fron the list, this will change m_fontList - unlinkFont( font ); - - // release font data - releaseFontData( font ); - - // delete the font list element - deleteInstance(font); - - } - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FontLibrary::FontLibrary( void ) -{ - - m_fontList = NULL; - m_count = 0; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FontLibrary::~FontLibrary( void ) -{ - - // delete all font data - deleteAllFonts(); - -} - -//------------------------------------------------------------------------------------------------- -/** Initialize what we need to in the font library */ -//------------------------------------------------------------------------------------------------- -void FontLibrary::init( void ) -{ - -} - -//------------------------------------------------------------------------------------------------- -/** Reset the fonts for this font library */ -//------------------------------------------------------------------------------------------------- -void FontLibrary::reset( void ) -{ - - // delete all font data - deleteAllFonts(); - -} - -//------------------------------------------------------------------------------------------------- -/** Get a font from our list, if we don't have that font loaded we will - * attempt to load it */ -//------------------------------------------------------------------------------------------------- -GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) -{ - GameFont *font; - - // search for font in list - for( font = m_fontList; font; font = font->next ) - { - - if( font->pointSize == pointSize && - font->bold == bold && - font->nameString == name - ) - return font; // found - - } - - // font not found, allocate a new font element - font = newInstance(GameFont); - if( font == NULL ) - { - - DEBUG_CRASH(( "getFont: Unable to allocate new font list element" )); - return NULL; - - } - - // copy font data over to new element - font->nameString = name; - font->pointSize = pointSize; - font->bold = bold; - font->fontData = NULL; - - //DEBUG_LOG(("Font: Loading font '%s' %d point", font->nameString.str(), font->pointSize)); - // load the device specific data pointer - if( loadFontData( font ) == FALSE ) - { - - DEBUG_CRASH(( "getFont: Unable to load font data pointer '%s'", name.str() )); - deleteInstance(font); - return NULL; - - } - - // tie font into list - linkFont( font ); - - // all is done and loaded - return font; - -} diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp deleted file mode 100644 index 1e0028dbe2..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: WindowLayout.cpp ///////////////////////////////////////////////////////////////////////// -// Created: Colin Day, September 2001 -// Desc: Layouts for grouping windows together -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/WindowLayout.h" -#include "GameClient/Shell.h" -#include "GameClient/GameWindowManager.h" - -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WindowLayout::WindowLayout( void ) -{ - m_filenameString.set("EmptyLayout"); - - m_windowList = NULL; - m_windowTail = NULL; - m_windowCount = 0; - - m_hidden = FALSE; - - m_init = NULL; - m_update = NULL; - m_shutdown = NULL; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WindowLayout::~WindowLayout( void ) -{ - - // - // it is the users responsability to remove windows from the layout beforing destroying the - // layout itself. This allows for maximum flexibility of the window layouts and you can - // use them in any you see fit, as long as they are clean when they go away - // - DEBUG_ASSERTCRASH( m_windowList == NULL, ("Window layout being destroyed still has window references") ); - DEBUG_ASSERTCRASH( m_windowTail == NULL, ("Window layout being destroyed still has window references") ); - -} - -//------------------------------------------------------------------------------------------------- -/** Set the hidden/visible status of all the windows in this layout */ -//------------------------------------------------------------------------------------------------- -void WindowLayout::hide( Bool hide ) -{ - GameWindow *window; - - // hide or unhide all windows in this layout - for( window = m_windowList; window; window = window->winGetNextInLayout() ) - { - - window->winHide( hide ); - - } - - // save the new visible state of the system - m_hidden = hide; - -} - -//------------------------------------------------------------------------------------------------- -/** Add window to this layout */ -//------------------------------------------------------------------------------------------------- -void WindowLayout::addWindow( GameWindow *window ) -{ - GameWindow *win = findWindow( window ); - - // only add window if window is not in this layout already - if( win == NULL ) - { - - DEBUG_ASSERTCRASH( window->winGetNextInLayout() == NULL, - ("NextInLayout should be NULL before adding") ); - DEBUG_ASSERTCRASH( window->winGetPrevInLayout() == NULL, - ("PrevInLayout should be NULL before adding") ); - - window->winSetPrevInLayout( NULL ); - window->winSetNextInLayout( m_windowList ); - if( m_windowList ) - m_windowList->winSetPrevInLayout( window ); - m_windowList = window; - - // set layout into window - window->winSetLayout( this ); - - // if no tail pointer, this is it - if( m_windowTail == NULL ) - m_windowTail = window; - - // we gots another window now - m_windowCount++; - - } - -} - -//------------------------------------------------------------------------------------------------- -/** Remove window from this layout */ -//------------------------------------------------------------------------------------------------- -void WindowLayout::removeWindow( GameWindow *window ) -{ - GameWindow *win = findWindow( window ); - - // can't remove window unless it's really part of this layout - if( win ) - { - GameWindow *prev, *next; - - prev = win->winGetPrevInLayout(); - next = win->winGetNextInLayout(); - - if( next ) - next->winSetPrevInLayout( prev ); - if( prev ) - prev->winSetNextInLayout( next ); - else - m_windowList = next; - - // set window as having no layout info - win->winSetLayout( NULL ); - win->winSetNextInLayout( NULL ); - win->winSetPrevInLayout( NULL ); - - // if we removed the tail, set the new tail - if( m_windowTail == win ) - m_windowTail = prev; - - // we lost one sir! - m_windowCount--; - - } - -} - -//------------------------------------------------------------------------------------------------- -/** Destroy all the windows in a layout */ -//------------------------------------------------------------------------------------------------- -void WindowLayout::destroyWindows( void ) -{ - GameWindow *window; - - while( (window = getFirstWindow()) != 0 ) - { - - // remove window from this layout - removeWindow( window ); - - // destroy window in window system - TheWindowManager->winDestroy( window ); - - } - -} - -//------------------------------------------------------------------------------------------------- -/** Create the windows using the .wnd file script and load all windows into - * this layout */ -//------------------------------------------------------------------------------------------------- -Bool WindowLayout::load( AsciiString filename ) -{ - - // sanity - if( filename.isEmpty() ) - return FALSE; - - // - // when we create new windows they are always placed on the top - // of the window stack. The load layout from script will return the - // FIRST window loaded from the script, if we traverse from the head of - // the window list till we see that window returned from the layout - // loader, that will be all the root windows loaded from the .wnd file - // - GameWindow *target; - WindowLayoutInfo info; - - target = TheWindowManager->winCreateFromScript( filename, &info ); - if( target == NULL ) - { - - DEBUG_ASSERTCRASH( target, ("WindowLayout::load - Failed to load layout") ); - DEBUG_LOG(( "WindowLayout::load - Unable to load layout file '%s'", filename.str() )); - return FALSE; - - } - - // - // add windows loaded from .wnd file to the layout, via info.windows. - // - std::list::iterator it; - for (it = info.windows.begin(); it != info.windows.end(); ++it) - { - // add window to this layout - addWindow( *it ); - } - - /* MDC - can't do this, as modal windows will be at the head... - // - // add windows loaded from .wnd file to the layout, note we start at - // target and go backwards as the layout->addWindow() puts at top - // of list and will therefore reverse the order - // - GameWindow *window; - for( window = target; window; window = window->winGetPrev() ) - { - - // add window to this layout - addWindow( window ); - - } - */ - - // copy filename - m_filenameString = filename; - - // assign script info to the layout - setInit( info.init ); - setUpdate( info.update ); - setShutdown( info.shutdown ); - - return TRUE; // success - -} - -//------------------------------------------------------------------------------------------------- -/** Bring all windows in this layout forward */ -//------------------------------------------------------------------------------------------------- -void WindowLayout::bringForward( void ) -{ - - // - // loop through all our windows and bring each of them to the top of - // the window stack, note that we are getting a prev pointer because the - // action of bringing a window to the top of the stack does detach it - // from the window list and the layout window list ... it is then - // re-attached at the top. Also note, to preserve the ordering of - // the windows we pull from the tail and add to the top - // - GameWindow *window, *prev; - Int countLeft = m_windowCount; - - for( window = m_windowTail; countLeft; window = prev ) - { - - DEBUG_ASSERTCRASH( window, ("Must have window: m_windowCount is off") ); - prev = window->winGetPrevInLayout(); - window->winBringToTop(); - countLeft--; - - } - -} - - -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////////////////////////// -//------------------------------------------------------------------------------------------------- -/** Find window within this layout */ -//------------------------------------------------------------------------------------------------- -GameWindow *WindowLayout::findWindow( GameWindow *window ) -{ - GameWindow *win; - - for( win = m_windowList; win; win = win->winGetNextInLayout() ) - if( win == window ) - return win; - - return NULL; // window not found - -} diff --git a/Generals/Code/GameEngine/Source/GameClient/GameText.cpp b/Generals/Code/GameEngine/Source/GameClient/GameText.cpp deleted file mode 100644 index 5b617b793c..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GameText.cpp +++ /dev/null @@ -1,1464 +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: RTS3 -// -// File name: GameText.cpp -// -// Created: 11/07/01 -// -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/GameText.h" -#include "Common/Language.h" -#include "Common/Registry.h" -#include "GameClient/LanguageFilter.h" -#include "Common/Debug.h" -#include "Common/UnicodeString.h" -#include "Common/AsciiString.h" -#include "Common/GlobalData.h" -#include "Common/file.h" -#include "Common/FileSystem.h" -#include "Common/version.h" - - - - -//---------------------------------------------------------------------------- -// Externals -//---------------------------------------------------------------------------- - -#if defined(RTS_DEBUG) -Bool g_useStringFile = TRUE; -#endif - - -//---------------------------------------------------------------------------- -// Defines -//---------------------------------------------------------------------------- - -#define CSF_ID ( ('C'<<24) | ('S'<<16) | ('F'<<8) | (' ') ) -#define CSF_LABEL ( ('L'<<24) | ('B'<<16) | ('L'<<8) | (' ') ) -#define CSF_STRING ( ('S'<<24) | ('T'<<16) | ('R'<<8) | (' ') ) -#define CSF_STRINGWITHWAVE ( ('S'<<24) | ('T'<<16) | ('R'<<8) | ('W') ) -#define CSF_VERSION 3 - -#define STRING_FILE 0 -#define CSF_FILE 1 -#define MAX_UITEXT_LENGTH (10*1024) -//---------------------------------------------------------------------------- -// Private Types -//---------------------------------------------------------------------------- - -//=============================== -// StringInfo -//=============================== - -struct StringInfo -{ - AsciiString label; - UnicodeString text; - AsciiString speech; -}; - -struct StringLookUp -{ - AsciiString *label; - StringInfo *info; -}; - -//=============================== -// CSFHeader -//=============================== - -struct CSFHeader -{ - Int id; - Int version; - Int num_labels; - Int num_strings; - Int skip; - Int langid; - -}; - -//=============================== -// struct NoString -//=============================== - -struct NoString -{ - struct NoString *next; - UnicodeString text; -}; - - -//=============================== -// GameTextManager -//=============================== - -class GameTextManager : public GameTextInterface -{ - public: - - GameTextManager(); - virtual ~GameTextManager(); - - virtual void init( void ); ///< Initializes the text system - virtual void deinit( void ); ///< Shuts down the text system - virtual void update( void ) {}; ///< update text manager - virtual void reset( void ); ///< Resets the text system - - virtual UnicodeString fetch( const Char *label, Bool *exists = NULL ); ///< Returns the associated labeled unicode text - virtual UnicodeString fetch( AsciiString label, Bool *exists = NULL ); ///< Returns the associated labeled unicode text - virtual UnicodeString fetchFormat( const Char *label, ... ); - virtual UnicodeString fetchOrSubstitute( const Char *label, const WideChar *substituteText ); - virtual UnicodeString fetchOrSubstituteFormat( const Char *label, const WideChar *substituteFormat, ... ); - virtual UnicodeString fetchOrSubstituteFormatVA( const Char *label, const WideChar *substituteFormat, va_list args ); - - virtual AsciiStringVec& getStringsWithLabelPrefix(AsciiString label); - - virtual void initMapStringFile( const AsciiString& filename ); - - protected: - - Int m_textCount; - Int m_maxLabelLen; - Char m_buffer[MAX_UITEXT_LENGTH]; - Char m_buffer2[MAX_UITEXT_LENGTH]; - Char m_buffer3[MAX_UITEXT_LENGTH]; - WideChar m_tbuffer[MAX_UITEXT_LENGTH*2]; - - StringInfo *m_stringInfo; - StringLookUp *m_stringLUT; - Bool m_initialized; -#if defined(RTS_DEBUG) - Bool m_jabberWockie; - Bool m_munkee; -#endif - NoString *m_noStringList; - Int m_useStringFile; - LanguageID m_language; - UnicodeString m_failed; - - StringInfo *m_mapStringInfo; - StringLookUp *m_mapStringLUT; - Int m_mapTextCount; - - /// m_asciiStringVec will be altered every time that getStringsWithLabelPrefix is called, - /// so don't simply store a pointer to it. - AsciiStringVec m_asciiStringVec; - - void stripSpaces ( WideChar *string ); - void removeLeadingAndTrailing ( Char *m_buffer ); - void readToEndOfQuote( File *file, Char *in, Char *out, Char *wavefile, Int maxBufLen ); - void reverseWord ( Char *file, Char *lp ); - void translateCopy( WideChar *outbuf, Char *inbuf ); - Bool getStringCount( const Char *filename, Int& textCount ); - Bool getCSFInfo ( const Char *filename ); - Bool parseCSF( const Char *filename ); - Bool parseStringFile( const char *filename ); - Bool parseMapStringFile( const char *filename ); - Bool readLine( char *buffer, Int max, File *file ); - Char readChar( File *file ); -}; - -static int _cdecl compareLUT ( const void *, const void*); -//---------------------------------------------------------------------------- -// Private Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Data -//---------------------------------------------------------------------------- - -GameTextInterface *TheGameText = NULL; - -//---------------------------------------------------------------------------- -// Private Prototypes -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Functions -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Functions -//---------------------------------------------------------------------------- - -//============================================================================ -// CreateGameTextInterface -//============================================================================ - -GameTextInterface* CreateGameTextInterface( void ) -{ - return NEW GameTextManager; -} - - -//============================================================================ -// GameTextManager::GameTextManager -//============================================================================ - -GameTextManager::GameTextManager() -: m_textCount(0), - m_maxLabelLen(0), - m_stringInfo(NULL), - m_stringLUT(NULL), - m_initialized(FALSE), - m_noStringList(NULL), -#if defined(RTS_DEBUG) - m_jabberWockie(FALSE), - m_munkee(FALSE), - m_useStringFile(g_useStringFile), -#else - m_useStringFile(TRUE), -#endif - m_mapStringInfo(NULL), - m_mapStringLUT(NULL), - m_failed(L"***FATAL*** String Manager failed to initilaize properly") -{ - // Added By Sadullah Nader - // Initializations missing and needed - - for(Int i=0; i < MAX_UITEXT_LENGTH; i++) - { - m_buffer[i] = 0; - m_buffer2[i] = 0; - m_buffer3[i] = 0; - } - // -} - -//============================================================================ -// GameTextManager::~GameTextManager -//============================================================================ - -GameTextManager::~GameTextManager() -{ - deinit(); -} - -//============================================================================ -// GameTextManager::init -//============================================================================ - -extern const Char *g_strFile; -extern const Char *g_csfFile; - -void GameTextManager::init( void ) -{ - AsciiString csfFile; - csfFile.format(g_csfFile, GetRegistryLanguage().str()); - Int format; - - if ( m_initialized ) - { - return; - } - - m_initialized = TRUE; - - m_maxLabelLen = 0; -#if defined(RTS_DEBUG) - if(TheGlobalData) - { - m_jabberWockie = TheGlobalData->m_jabberOn; - m_munkee = TheGlobalData->m_munkeeOn; - } -#endif - - if ( m_useStringFile && getStringCount( g_strFile, m_textCount ) ) - { - format = STRING_FILE; - } - else if ( getCSFInfo ( csfFile.str() ) ) - { - format = CSF_FILE; - } - else - { - return; - } - - if( m_textCount == 0 ) - { - return; - } - - //Allocate StringInfo Array - - m_stringInfo = NEW StringInfo[m_textCount]; - - if( m_stringInfo == NULL ) - { - deinit(); - return; - } - - if ( format == STRING_FILE ) - { - if( parseStringFile( g_strFile ) == FALSE ) - { - deinit(); - return; - } - } - else - { - if ( !parseCSF ( csfFile.str() ) ) - { - deinit(); - return; - } - } - - m_stringLUT = NEW StringLookUp[m_textCount]; - - StringLookUp *lut = m_stringLUT; - StringInfo *info = m_stringInfo; - - for ( Int i = 0; i < m_textCount; i++ ) - { - lut->info = info; - lut->label = &info->label; - lut++; - info++; - } - - qsort( m_stringLUT, m_textCount, sizeof(StringLookUp), compareLUT ); - -} - -//============================================================================ -// GameTextManager::deinit -//============================================================================ - -void GameTextManager::deinit( void ) -{ - - delete [] m_stringInfo; - m_stringInfo = NULL; - - delete [] m_stringLUT; - m_stringLUT = NULL; - - m_textCount = 0; - - NoString *noString = m_noStringList; - - DEBUG_LOG_RAW(("\n")); - DEBUG_LOG(("*** Missing strings ***")); - while ( noString ) - { - DEBUG_LOG(("*** %ls ***", noString->text.str())); - NoString *next = noString->next; - delete noString; - noString = next; - } - DEBUG_LOG(("*** End missing strings ***")); - DEBUG_LOG_RAW(("\n")); - - m_noStringList = NULL; - - m_initialized = FALSE; -} - -//============================================================================ -// GameTextManager::reset -//============================================================================ - -void GameTextManager::reset( void ) -{ - delete [] m_mapStringInfo; - m_mapStringInfo = NULL; - - delete [] m_mapStringLUT; - m_mapStringLUT = NULL; -} - - -//============================================================================ -// GameTextManager::stripSpaces -//============================================================================ - -void GameTextManager::stripSpaces ( WideChar *string ) -{ - WideChar *str, *ptr; - WideChar ch, last = 0; - Int skipall = TRUE; - - str = ptr = string; - - while ( (ch = *ptr++) != 0 ) - { - if ( ch == ' ' ) - { - if ( last == ' ' || skipall ) - { - continue; - } - } - - if ( ch == '\n' || ch == '\t' ) - { - // remove last space - if ( last == ' ' ) - { - str--; - } - - skipall = TRUE; // skip all spaces - last = *str++ = ch; - continue; - } - - last = *str++ = ch; - skipall = FALSE; - } - - if ( last == ' ' ) - { - str--; - } - - *str = 0; -} - -//============================================================================ -// GameTextManager::removeLeadingAndTrailing -//============================================================================ - -void GameTextManager::removeLeadingAndTrailing ( Char *buffer ) -{ - Char *first, *ptr; - Char ch; - - ptr = first = buffer; - - while ( (ch = *first) != 0 && iswspace ( ch )) - { - first++; - } - - while ( (*ptr++ = *first++) != 0 ); - - ptr -= 2;; - - while ( (ptr > buffer) && (ch = *ptr) != 0 && iswspace ( ch ) ) - { - ptr--; - } - - ptr++; - *ptr = 0; -} - -//============================================================================ -// GameTextManager::readToEndOfQuote -//============================================================================ - -void GameTextManager::readToEndOfQuote( File *file, Char *in, Char *out, Char *wavefile, Int maxBufLen ) -{ - Int slash = FALSE; - Int state = 0; - Int line_start = FALSE; - Char ch; - Int ccount = 0; - Int len = 0; - Int done = FALSE; - - while ( maxBufLen ) - { - // get next Char - - if ( in ) - { - if ( (ch = *in++) == 0 ) - { - in = NULL; // have exhausted the input m_buffer - ch = readChar ( file ); - } - } - else - { - ch = readChar ( file ); - } - - if ( ch == EOF ) - { - return ; - } - - if ( ch == '\n' ) - { - line_start = TRUE; - slash = FALSE; - ccount = 0; - ch = ' '; - } - else if ( ch == '\\' && !slash) - { - slash = TRUE; - } - else if ( ch == '\\' && slash) - { - slash = FALSE; - } - else if ( ch == '"' && !slash ) - { - break; // done - } - else - { - slash = FALSE; - } - - if ( iswspace ( ch )) - { - ch = ' '; - } - - *out++ = ch; - maxBufLen--; - } - - *out = 0; - - while ( !done ) - { - // get next Char - - if ( in ) - { - if ( (ch = *in++) == 0 ) - { - in = NULL; // have exhausted the input m_buffer - ch = readChar ( file ); - } - } - else - { - ch = readChar ( file ); - } - - if ( ch == '\n' || ch == EOF ) - { - break; - } - - switch ( state ) - { - - case 0: - if ( iswspace ( ch ) || ch == '=' ) - { - break; - } - - state = 1; - FALLTHROUGH; - case 1: - if ( ( ch >= 'a' && ch <= 'z') || ( ch >= 'A' && ch <='Z') || (ch >= '0' && ch <= '9') || ch == '_' ) - { - *wavefile++ = ch; - len++; - break; - } - state = 2; - FALLTHROUGH; - case 2: - break; - } - } - - *wavefile = 0; - - if ( len ) - { - if ( ( ch = *(wavefile-1)) >= '0' && ch <= '9' ) - { - *wavefile++ = 'e'; - *wavefile = 0; - } - } - -} - - -//============================================================================ -// GameTextManager::reverseWord -//============================================================================ - -void GameTextManager::reverseWord ( Char *file, Char *lp ) -{ - Int first = TRUE; - Char f, l; - Int ok = TRUE ; - - while ( ok ) - { - if ( file >= lp ) - { - return; - } - - f = *file; - l = *lp; - - if ( first ) - { - if ( f >= 'A' && f <= 'Z' ) - { - if ( l >= 'a' && l <= 'z' ) - { - f = (f - 'A') + 'a'; - l = (l - 'a') + 'A'; - } - } - - first = FALSE; - } - - *lp-- = f; - *file++ = l; - - } - -} - -//============================================================================ -// GameTextManager::translateCopy -//============================================================================ - -void GameTextManager::translateCopy( WideChar *outbuf, Char *inbuf ) -{ - Int slash = FALSE; - -#if defined(RTS_DEBUG) - if ( m_jabberWockie ) - { - static Char buffer[MAX_UITEXT_LENGTH*2]; - Char *firstLetter = NULL, *lastLetter; - Char *b = buffer; - Int formatWord = FALSE; - Char ch; - - while ( (ch = *inbuf++) != 0 ) - { - if ( ! (( ch >= 'a' && ch <= 'z') || ( ch >= 'A' && ch <= 'Z' ))) - { - if ( firstLetter ) - { - if ( !formatWord ) - { - lastLetter = b-1; - reverseWord ( firstLetter, lastLetter ); - } - firstLetter = NULL; - formatWord = FALSE; - } - *b++ = ch; - if ( ch == '\\' ) - { - *b++ = *inbuf++; - } - if ( ch == '%' ) - { - while ( (ch = *inbuf++) != 0 && !( (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))) - { - *b++ = ch; - } - *b++ = ch; - } - } - else - { - if ( !firstLetter ) - { - firstLetter = b; - } - - *b++ = ch; - - } - } - - if ( firstLetter ) - { - lastLetter = b-1; - reverseWord ( firstLetter, lastLetter ); - } - - *b++ = 0; - inbuf = buffer; - } - else if( m_munkee ) - { - wcscpy(outbuf, L"Munkee"); - return; - } -#endif - - while( *inbuf != '\0' ) - { - if( slash == TRUE ) - { - slash = FALSE; - - switch( *inbuf ) - { - // in case end of string is reached - // should never happen!!! - case '\0': - return; - - case '\\': - *outbuf++ = '\\'; - break; - - case '\'': - *outbuf++ = '\''; - break; - - case '\"': - *outbuf++ = '\"'; - break; - - case '\?': - *outbuf++ = '\?'; - break; - - case 't': - *outbuf++ = '\t'; - break; - - case 'n': - *outbuf++ = '\n'; - break; - - default: - *outbuf++ = *inbuf & 0x00FF; - break; - } - } - else if( *inbuf != '\\' ) - { - *outbuf++ = *inbuf & 0x00FF; - } - else - slash = TRUE; - - inbuf++; - } - *outbuf= 0; -} - -//============================================================================ -// GameTextManager::getStringCount -//============================================================================ - -Bool GameTextManager::getStringCount( const char *filename, Int& textCount ) -{ - Int ok = TRUE; - - textCount = 0; - - File *file; - file = TheFileSystem->openFile(filename, File::READ | File::TEXT); - DEBUG_LOG(("Looking in %s for string file", filename)); - - if ( file == NULL ) - { - return FALSE; - } - - while(ok) - { - if( !readLine( m_buffer, sizeof( m_buffer) -1, file ) ) - break; - removeLeadingAndTrailing ( m_buffer ); - - if( m_buffer[0] == '"' ) - { - Int len = strlen(m_buffer); - m_buffer[ len ] = '\n'; - m_buffer[ len+1] = 0; - readToEndOfQuote( file, &m_buffer[1], m_buffer2, m_buffer3, MAX_UITEXT_LENGTH ); - } - else if( !stricmp( m_buffer, "END") ) - { - textCount++; - } - } - - textCount += 500; - file->close(); - file = NULL; - return TRUE; -} - -//============================================================================ -// GameTextManager::getCSFInfo -//============================================================================ - -Bool GameTextManager::getCSFInfo ( const Char *filename ) -{ - CSFHeader header; - Int ok = FALSE; - File *file = TheFileSystem->openFile(filename, File::READ | File::BINARY); - DEBUG_LOG(("Looking in %s for compiled string file", filename)); - - if ( file != NULL ) - { - if ( file->read( &header, sizeof ( header )) == sizeof ( header ) ) - { - if ( header.id == CSF_ID ) - { - m_textCount = header.num_labels; - - if ( header.version >= 2 ) - { - m_language = (LanguageID) header.langid; - } - else - { - m_language = LANGUAGE_ID_US; - } - - ok = TRUE; - } - } - - file->close(); - file = NULL; - } - - return ok; -} - -//============================================================================ -// GameTextManager::parseCSF -//============================================================================ - -Bool GameTextManager::parseCSF( const Char *filename ) -{ - File *file; - Int id; - Int len; - Int listCount = 0; - Bool ok = FALSE; - CSFHeader header; - - file = TheFileSystem->openFile(filename, File::READ | File::BINARY); - - if ( file == NULL ) - { - return FALSE; - } - - if ( file->read ( &header, sizeof ( CSFHeader)) != sizeof ( CSFHeader) ) - { - return FALSE; - } - - while( file->read ( &id, sizeof (id)) == sizeof ( id) ) - { - Int num; - Int num_strings; - - if ( id != CSF_LABEL ) - { - goto quit; - } - - file->read ( &num_strings, sizeof ( Int )); - - file->read ( &len, sizeof ( Int ) ); - - if ( len ) - { - file->read ( m_buffer, len ); - } - - m_buffer[len] = 0; - - m_stringInfo[listCount].label = m_buffer; - - - if ( len > m_maxLabelLen ) - { - m_maxLabelLen = len; - } - - num = 0; - - while ( num < num_strings ) - { - file->read ( &id, sizeof ( Int ) ); - - if ( id != CSF_STRING && id != CSF_STRINGWITHWAVE ) - { - goto quit; - } - - file->read ( &len, sizeof ( Int ) ); - - if ( len ) - { - file->read ( m_tbuffer, len*sizeof(WideChar) ); - } - - if ( num == 0 ) - { - // only use the first string found - m_tbuffer[len] = 0; - - { - WideChar *ptr; - - ptr = m_tbuffer; - - while ( *ptr ) - { - *ptr = ~*ptr; - ptr++; - } - } - - stripSpaces ( m_tbuffer ); - m_stringInfo[listCount].text = m_tbuffer; - } - - if ( id == CSF_STRINGWITHWAVE ) - { - file->read ( &len, sizeof ( Int ) ); - if ( len ) - { - file->read ( m_buffer, len ); - } - m_buffer[len] = 0; - - if ( num == 0 && len ) - { - // only use the first string found - m_stringInfo[listCount].speech = m_buffer; - } - - } - - num++; - } - - listCount++; - } - - ok = TRUE; - -quit: - - file->close(); - file = NULL; - - return ok; -} - - -//============================================================================ -// GameTextManager::parseStringFile -//============================================================================ - -Bool GameTextManager::parseStringFile( const char *filename ) -{ - Int listCount = 0; - Int ok = TRUE; - - File *file = TheFileSystem->openFile(filename, File::READ | File::TEXT); - - if ( file == NULL ) - { - return FALSE; - } - - while( ok ) - { - Int len; - if( !readLine( m_buffer, MAX_UITEXT_LENGTH, file )) - { - break; - } - - removeLeadingAndTrailing ( m_buffer ); - - if( ( *(unsigned short *)m_buffer == 0x2F2F) || !m_buffer[0]) // 0x2F2F is Hex for // - continue; - - // make sure label is unique - - for ( Int i = 0; i < listCount; i++ ) - { - if ( !stricmp ( m_stringInfo[i].label.str(), m_buffer )) - { - DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' multiply defined!", m_buffer )); - } - } - - m_stringInfo[listCount].label = m_buffer; - len = strlen ( m_buffer ); - - - if ( len > m_maxLabelLen ) - { - m_maxLabelLen = len; - } - - Bool readString = FALSE; - while( ok ) - { - if (!readLine ( m_buffer, sizeof(m_buffer)-1, file )) - { - DEBUG_ASSERTCRASH (FALSE, ("Unexpected end of string file")); - ok = FALSE; - goto quit; - } - - removeLeadingAndTrailing ( m_buffer ); - - if( m_buffer[0] == '"' ) - { - len = strlen(m_buffer); - m_buffer[ len ] = '\n'; - m_buffer[ len+1] = 0; - readToEndOfQuote( file, &m_buffer[1], m_buffer2, m_buffer3, MAX_UITEXT_LENGTH ); - - - 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())); - } - else - { - // Copy string into new home - translateCopy( m_tbuffer, m_buffer2 ); - stripSpaces ( m_tbuffer ); - - m_stringInfo[listCount].text = m_tbuffer ; - m_stringInfo[listCount].speech = m_buffer3; - readString = TRUE; - } - } - else if ( !stricmp ( m_buffer, "END" )) - { - break; - } - } - - listCount++; - } - -quit: - - file->close(); - file = NULL; - - return ok; -} - -//============================================================================ -// GameTextManager::initMapStringFile -//============================================================================ - -void GameTextManager::initMapStringFile( const AsciiString& filename ) -{ - m_mapTextCount = 0; - getStringCount( filename.str(), m_mapTextCount ); - - m_mapStringInfo = NEW StringInfo[m_mapTextCount]; - - parseMapStringFile( filename.str() ); - - m_mapStringLUT = NEW StringLookUp[m_mapTextCount]; - - StringLookUp *lut = m_mapStringLUT; - StringInfo *info = m_mapStringInfo; - - for ( Int i = 0; i < m_mapTextCount; i++ ) - { - lut->info = info; - lut->label = &info->label; - lut++; - info++; - } - - qsort( m_mapStringLUT, m_mapTextCount, sizeof(StringLookUp), compareLUT ); -} - -//============================================================================ -// GameTextManager::parseMapStringFile -//============================================================================ - -Bool GameTextManager::parseMapStringFile( const char *filename ) -{ - Int listCount = 0; - Int ok = TRUE; - - File *file; - - file = TheFileSystem->openFile(filename, File::READ | File::TEXT); - if ( file == NULL ) - { - return FALSE; - } - - while( ok ) - { - Int len; - if( !readLine( m_buffer, MAX_UITEXT_LENGTH, file )) - { - break; - } - - removeLeadingAndTrailing ( m_buffer ); - - if( ( *(unsigned short *)m_buffer == 0x2F2F) || !m_buffer[0]) // 0x2F2F is Hex for // - continue; - - // make sure label is unique - - for ( Int i = 0; i < listCount; i++ ) - { - if ( !stricmp ( m_mapStringInfo[i].label.str(), m_buffer )) - { - DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' multiply defined!", m_buffer )); - } - } - - m_mapStringInfo[listCount].label = m_buffer; - len = strlen ( m_buffer ); - - - if ( len > m_maxLabelLen ) - { - m_maxLabelLen = len; - } - - Bool readString = FALSE; - while( ok ) - { - if (!readLine ( m_buffer, sizeof(m_buffer)-1, file )) - { - DEBUG_ASSERTCRASH (FALSE, ("Unexpected end of string file")); - ok = FALSE; - goto quit; - } - - removeLeadingAndTrailing ( m_buffer ); - - if( m_buffer[0] == '"' ) - { - len = strlen(m_buffer); - m_buffer[ len ] = '\n'; - m_buffer[ len+1] = 0; - readToEndOfQuote( file, &m_buffer[1], m_buffer2, m_buffer3, MAX_UITEXT_LENGTH ); - - - 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())); - } - else - { - // Copy string into new home - translateCopy( m_tbuffer, m_buffer2 ); - stripSpaces ( m_tbuffer ); - - UnicodeString text = UnicodeString(m_tbuffer); - if (TheLanguageFilter) - TheLanguageFilter->filterLine(text); - - m_mapStringInfo[listCount].text = text; - m_mapStringInfo[listCount].speech = m_buffer3; - readString = TRUE; - } - } - else if ( !stricmp ( m_buffer, "END" )) - { - break; - } - } - - listCount++; - } - -quit: - - file->close(); - file = NULL; - - return ok; -} - -//============================================================================ -// *GameTextManager::fetch -//============================================================================ - -UnicodeString GameTextManager::fetch( const Char *label, Bool *exists ) -{ - DEBUG_ASSERTCRASH ( m_initialized, ("String Manager has not been m_initialized") ); - - if( m_stringInfo == NULL ) - { - if( exists ) - *exists = FALSE; - return m_failed; - } - - StringLookUp *lookUp; - StringLookUp key; - AsciiString lb; - lb = label; - key.info = NULL; - key.label = &lb; - - lookUp = (StringLookUp *) bsearch( &key, (void*) m_stringLUT, m_textCount, sizeof(StringLookUp), compareLUT ); - - if ( lookUp == NULL && m_mapStringLUT && m_mapTextCount ) - { - lookUp = (StringLookUp *) bsearch( &key, (void*) m_mapStringLUT, m_mapTextCount, sizeof(StringLookUp), compareLUT ); - } - - if( lookUp == NULL ) - { - - // string not found - if( exists ) - *exists = FALSE; - - // See if we already have the missing string - UnicodeString missingString; - missingString.format(L"MISSING: '%hs'", label); - - NoString *noString = m_noStringList; - - while ( noString ) - { - if (noString->text == missingString) - return missingString; - - noString = noString->next; - } - - //DEBUG_LOG(("*** MISSING:'%s' ***", label)); - // Remember file could have been altered at this point. - noString = NEW NoString; - noString->text = missingString; - noString->next = m_noStringList; - m_noStringList = noString; - return noString->text; - } - if( exists ) - *exists = TRUE; - return lookUp->info->text; -} - -//============================================================================ -// *GameTextManager::fetch -//============================================================================ - -UnicodeString GameTextManager::fetch( AsciiString label, Bool *exists ) -{ - return fetch(label.str(), exists); -} - -//============================================================================ -// *GameTextManager::fetchFormat -//============================================================================ - -UnicodeString GameTextManager::fetchFormat( const Char *label, ... ) -{ - Bool exists; - UnicodeString str = fetch(label, &exists); - if (exists) - { - UnicodeString strFormat; - - va_list args; - va_start(args, label); - strFormat.format_va(str.str(), args); - va_end(args); - - str = strFormat; - } - return str; -} - -//============================================================================ -// GameTextManager::fetchOrSubstitute -//============================================================================ - -UnicodeString GameTextManager::fetchOrSubstitute( const Char *label, const WideChar *substituteText ) -{ - Bool exists; - UnicodeString str = fetch(label, &exists); - if (!exists) - str = substituteText; - return str; -} - -//============================================================================ -// GameTextManager::fetchOrSubstituteFormat -//============================================================================ - -UnicodeString GameTextManager::fetchOrSubstituteFormat( const Char *label, const WideChar *substituteFormat, ... ) -{ - va_list args; - va_start(args, substituteFormat); - UnicodeString str = fetchOrSubstituteFormatVA(label, substituteFormat, args); - va_end(args); - - return str; -} - -//============================================================================ -// GameTextManager::fetchOrSubstituteFormatVA -//============================================================================ - -UnicodeString GameTextManager::fetchOrSubstituteFormatVA( const Char *label, const WideChar *substituteFormat, va_list args ) -{ - Bool exists; - UnicodeString str = fetch(label, &exists); - if (exists) - { - UnicodeString strFormat; - strFormat.format_va(strFormat.str(), args); - str = strFormat; - } - else - { - str.format_va(substituteFormat, args); - } - - return str; -} - -//============================================================================ -// GameTextManager::getStringsWithLabelPrefix -//============================================================================ - -AsciiStringVec& GameTextManager::getStringsWithLabelPrefix(AsciiString label) -{ - m_asciiStringVec.clear(); - if (m_stringLUT) { - for (int i = 0; i < m_textCount; ++i) { - if (strstr(m_stringLUT[i].label->str(), label.str()) == m_stringLUT[i].label->str()) { - m_asciiStringVec.push_back(*m_stringLUT[i].label); - } - } - } - if (m_mapStringLUT) { - for (int i = 0; i < m_mapTextCount; ++i) { - if (strstr(m_mapStringLUT[i].label->str(), label.str()) == m_mapStringLUT[i].label->str()) { - m_asciiStringVec.push_back(*m_mapStringLUT[i].label); - } - } - } - return m_asciiStringVec; -} - -//============================================================================ -// GameTextManager::readLine -//============================================================================ - -Bool GameTextManager::readLine( char *buffer, Int max, File *file ) -{ - Int ok = FALSE; - - while ( max && file->read( buffer, 1 ) == 1 ) - { - ok = TRUE; - - if ( *buffer == '\n' ) - { - break; - } - - buffer++; - max--; - } - - *buffer = 0; - - return ok; -} - -//============================================================================ -// GameTextManager::readChar -//============================================================================ - -Char GameTextManager::readChar( File *file ) -{ - Char ch; - - if ( file->read( &ch, 1 ) == 1 ) - { - return ch; - } - - return 0; -} - -//============================================================================ -// compareLUT -//============================================================================ - -static int __cdecl compareLUT ( const void *i1, const void*i2) -{ - StringLookUp *lut1 = (StringLookUp*) i1; - StringLookUp *lut2 = (StringLookUp*) i2; - - return stricmp( lut1->label->str(), lut2->label->str()); -} diff --git a/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp b/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp deleted file mode 100644 index 3b6d485e6b..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp +++ /dev/null @@ -1,193 +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. // -// // -//////////////////////////////////////////////////////////////////////////////// - - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/LanguageFilter.h" -#include "Common/FileSystem.h" -#include "Common/file.h" - - - -LanguageFilter *TheLanguageFilter = NULL; - -LanguageFilter::LanguageFilter() -{ - //Modified by Saad - //Unnecessary - //m_wordList.clear(); -} - -LanguageFilter::~LanguageFilter() { - m_wordList.clear(); -} - -void LanguageFilter::init() { - m_wordList.clear(); - - // read in the file already. - File *file1 = TheFileSystem->openFile(BadWordFileName, File::READ | File::BINARY); - if (file1 == NULL) { - return; - } - - wchar_t word[128]; - while (readWord(file1, word)) { - Int wordLen = wcslen(word); - if (wordLen == 0) { - continue; - } - for (Int i = 0; i < wordLen; ++i) { - word[i] = word[i] ^ LANGUAGE_XOR_KEY; - } - UnicodeString uniword(word); - unHaxor(uniword); - //DEBUG_LOG(("Just read %ls from the bad word file. Entered as %ls", word, uniword.str())); - m_wordList[uniword] = true; - } - - file1->close(); - file1 = NULL; -} - -void LanguageFilter::reset() { - init(); -} - -void LanguageFilter::update() { -} - -wchar_t ignoredChars[] = L"-_*'\""; - -void LanguageFilter::filterLine(UnicodeString &line) -{ - WideChar *buf = NEW WideChar[line.getLength()+1]; - wcscpy(buf, line.str()); - - UnicodeString newLine(line); - UnicodeString token(L""); - - while (newLine.nextToken(&token, UnicodeString(L" ;,.!?:=\\/><`~()&^%#\n\t"))) { - wchar_t *pos = wcsstr(buf, token.str()); - if (pos == NULL) { - DEBUG_CRASH(("Couldn't find the token in its own string.")); - continue; - } - - Int len = token.getLength(); // need to get the length of the original word, not the unhaxor'd word. - - unHaxor(token); - LangMapIter iter = m_wordList.find(token); - if (iter != m_wordList.end()) { - DEBUG_LOG(("Found word %ls in bad word list. Token was %ls", (*iter).first.str(), token.str())); - for (Int i = 0; i < len; ++i) { - *pos = L'*'; - ++pos; - } - } - } - - line.set(buf); - delete[] buf; -} - -void LanguageFilter::unHaxor(UnicodeString &word) { - Int len = word.getLength(); - UnicodeString newWord(L""); - for (Int i = 0; i < len; ++i) { - wchar_t c = word.getCharAt(i); - if ((c == L'p') || (c == L'P')) { - if (((i + 1) < len) && ((word.getCharAt(i+1) == L'h') || (word.getCharAt(i+1) == L'H'))) { - newWord.concat(L'f'); - ++i; // skip the h - } else { - // not a problem at all. - newWord.concat(c); - } - } else if (c == L'1') { - newWord.concat(L'l'); - } else if (c == L'3') { - newWord.concat(L'e'); - } else if (c == L'4') { - newWord.concat(L'a'); - } else if (c == L'5') { - newWord.concat(L's'); - } else if (c == L'6') { - newWord.concat(L'b'); - } else if (c == L'7') { - newWord.concat(L't'); - } else if (c == L'0') { - newWord.concat(L'o'); - } else if (c == L'@') { - newWord.concat(L'a'); - } else if (c == L'$') { - newWord.concat(L's'); - } else if (c == L'+') { - newWord.concat(L't'); - } else if (wcsrchr(ignoredChars, c) == NULL) { - newWord.concat(c); - } - } - word.set(newWord); -} - -// returning true means that there are more words in the file. -Bool LanguageFilter::readWord(File *file1, WideChar *buf) { - Int index = 0; - Bool retval = TRUE; - Int val = 0; - - WideChar c; - - val = file1->read(&c, sizeof(WideChar)); - if ((val == -1) || (val == 0)) { - buf[index] = 0; - return FALSE; - } - buf[index] = c; - - while (buf[index] != L' ') { - ++index; - val = file1->read(&c, sizeof(WideChar)); - if ((val == -1) || (val == 0)) { - c = WEOF; - } - - if ((c == WEOF) || (c == L' ')) { - buf[index] = 0; - if (c == WEOF) { - retval = FALSE; - } - break; - } - buf[index] = c; - } - return retval; -} - -LanguageFilter * createLanguageFilter() -{ - return NEW LanguageFilter; -} diff --git a/Generals/Code/GameEngine/Source/GameClient/Line2D.cpp b/Generals/Code/GameEngine/Source/GameClient/Line2D.cpp deleted file mode 100644 index 3fc220d77d..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/Line2D.cpp +++ /dev/null @@ -1,423 +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: Line2D.cpp /////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, January 2002 -// Desc: Some helpful 2D stuff -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Lib/BaseType.h" -#include "GameClient/Line2D.h" - -// PRIVATE //////////////////////////////////////////////////////////////////////////////////////// -#define CLIP_LEFT 0x01 -#define CLIP_RIGHT 0x02 -#define CLIP_BOTTOM 0x04 -#define CLIP_TOP 0x08 - -// PUBLIC ///////////////////////////////////////////////////////////////////////////////////////// - - -// STATIC ///////////////////////////////////////////////////////////////////////////////////////// -const static Coord2D reallyFarPoint = { 1000000.0, 1000000.0 }; - -//------------------------------------------------------------------------------------------------- -/** Clip a line to the region provided. The source line runs from p1 to p2, and is clipped - * using the clipRegion. The resulting line goes from c1 to c2 - * - * Return values: - * TRUE - Line is visible - * FALSE - Line is not visible - */ -//------------------------------------------------------------------------------------------------- -Bool ClipLine2D( ICoord2D *p1, ICoord2D *p2, ICoord2D *c1, ICoord2D *c2, - IRegion2D *clipRegion ) -{ - Int x1, y1, x2, y2; - Int clipLeft; - Int clipRight; - Int clipTop; - Int clipBottom; - Int clipCode1; - Int clipCode2; - Int diff; - - // Use clip window that includes bottom right pixel - clipLeft = clipRegion->lo.x; - clipRight = clipRegion->hi.x; - clipTop = clipRegion->lo.y; - clipBottom = clipRegion->hi.y; -/* - clipLeft = gfxCurrentContext->clipRect1.left; - clipRight = gfxCurrentContext->clipRect1.right; - clipTop = gfxCurrentContext->clipRect1.top; - clipBottom = gfxCurrentContext->clipRect1.bottom; - - x1 = *px1; - y1 = *py1; - x2 = *px2; - y2 = *py2; -*/ - - x1 = p1->x; - y1 = p1->y; - x2 = p2->x; - y2 = p2->y; - - // Test first point - clipCode1 = 0; - - if (x1 < clipLeft) - clipCode1 = CLIP_LEFT; - else - if (x1 > clipRight) - clipCode1 = CLIP_RIGHT; - - if (y1 < clipTop) - clipCode1 |= CLIP_TOP; - else - if (y1 > clipBottom) - clipCode1 |= CLIP_BOTTOM; - - - // Test second point - clipCode2 = 0; - - if (x2 < clipLeft) - clipCode2 = CLIP_LEFT; - else - if (x2 > clipRight) - clipCode2 = CLIP_RIGHT; - - if (y2 < clipTop) - clipCode2 |= CLIP_TOP; - else - if (y2 > clipBottom) - clipCode2 |= CLIP_BOTTOM; - - - // Both points inside window? - if ((clipCode1 | clipCode2) == 0) - { - - *c1 = *p1; - *c2 = *p2; - return TRUE; - - } - - // Both points outside window? - if (clipCode1 & clipCode2) - return FALSE; - - // First point outside window? - if (clipCode1) - { - if (clipCode1 & CLIP_TOP) - { - if ((diff = (y2 - y1)) == 0) - return FALSE; - x1 += (x2 - x1) * (clipTop - y1) / diff; - y1 = clipTop; - } - else - if (clipCode1 & CLIP_BOTTOM) - { - if ((diff = (y2 - y1)) == 0) - return FALSE; - x1 += (x2 - x1) * (clipBottom - y1) / diff; - y1 = clipBottom; - } - - if (x1 > clipRight) - { - if ((diff = (x2 - x1)) == 0) - return FALSE; - y1 += (y2 - y1) * (clipRight - x1) / diff; - x1 = clipRight; - } - else - if (x1 < clipLeft) - { - if ((diff = (x2 - x1)) == 0) - return FALSE; - y1 += (y2 - y1) * (clipLeft - x1) / diff; - x1 = clipLeft; - } - } - - // Second point outside window? - if (clipCode2) - { - if (clipCode2 & CLIP_TOP) - { - if ((diff = (y2 - y1)) == 0) - return FALSE; - x2 += (x2 - x1) * (clipTop - y2) / diff; - y2 = clipTop; - } - else - if (clipCode2 & CLIP_BOTTOM) - { - if ((diff = (y2 - y1)) == 0) - return FALSE; - x2 += (x2 - x1) * (clipBottom - y2) / diff; - y2 = clipBottom; - } - - if (x2 > clipRight) - { - if ((diff = (x2 - x1)) == 0) - return FALSE; - y2 += (y2 - y1) * (clipRight - x2) / diff; - x2 = clipRight; - } - else - if (x2 < clipLeft) - { - if ((diff = (x2 - x1)) == 0) - return FALSE; - y2 += (y2 - y1) * (clipLeft - x2) / diff; - x2 = clipLeft; - } - } - - c1->x = x1; - c1->y = y1; - c2->x = x2; - c2->y = y2; - -/* - *px1 = x1; - *py1 = y1; - *px2 = x2; - *py2 = y2; -*/ - - // Line is visible - return (x1 >= clipLeft && x1 <= clipRight && - y1 >= clipTop && y1 <= clipBottom && - x2 >= clipLeft && x2 <= clipRight && - y2 >= clipTop && y2 <= clipBottom); - -} - - -// This solution uses the -// http://www.faqs.org/faqs/graphics/algorithms-faq/ -// Subject 1.03 -Bool IntersectLine2D( const Coord2D *a, const Coord2D *b, - const Coord2D *c, const Coord2D *d, - Coord2D *intersection) -{ - if (!a || !b || !c || !d) { - // sanity. Lines that do not have endpoints do not intersect. - return false; - } - - Real r, s, denom; - - denom = ((b->x - a->x) * (d->y - c->y) - (b->y - a->y) * (d->x - c->x)); - if (denom == 0) { - // the lines are parallel. - return false; - } - - r = ((a->y - c->y) * (d->x - c->x) - (a->x - c->x) * (d->y - c->y) ) / denom; - s = ((a->y - c->y) * (b->x - a->x) - (a->x - c->x) * (b->y - a->y) ) / denom; - - if (0 <= r && r <= 1 && 0 <= s && s <= 1) { - // The lines intersect. - if (intersection) { - intersection->x = a->x + r * (b->x - a->x); - intersection->y = a->y + r * (b->y - a->y); - } - - return true; - } - - return false; -} - -// determines whether a point lies within a rectangle. Doesnt' determine whether the shape is -// actually a rectangle or not. -Bool PointInsideRect2D(const Coord2D *bl, const Coord2D *tl, const Coord2D *br, const Coord2D *tr, - const Coord2D *inputPoint) -{ - if (!(bl && br && tl && tr && inputPoint)) { - return FALSE; - } - - Real uVal; - // we're actually only interested in if the U value is (0,1) - ShortestDistancePointToSegment2D(bl, tl, inputPoint, NULL, NULL, &uVal); - if (uVal <= 0.0f || uVal >= 1.0f) { - return false; - } - - ShortestDistancePointToSegment2D(bl, br, inputPoint, NULL, NULL, &uVal); - - return (uVal > 0.0f && uVal < 1.0f); -} - -// convenience. Just prunes out the Z coordinate for a call to PointInsideRect2D -Bool PointInsideRect3D(const Coord3D *bl, const Coord3D *tl, const Coord3D *br, const Coord3D *tr, - const Coord3D *inputPoint) -{ - Coord2D bl2d, tl2d, br2d, tr2d, pt; - bl2d.x = bl->x; - bl2d.y = bl->y; - tl2d.x = tl->x; - tl2d.y = tl->y; - br2d.x = br->x; - br2d.y = br->y; - tr2d.x = tr->x; - tr2d.y = tr->y; - - pt.x = inputPoint->x; - pt.y = inputPoint->y; - - return PointInsideRect2D(&bl2d, &br2d, &tl2d, &tr2d, &pt); -} - - -// This function uses even-odd winding to determine whether a point is inside an area. -Bool PointInsideArea2D(const Coord2D *ptToTest, const Coord2D *area, const Int numPointsInArea) -{ - int numIntersections = 0; - for (int i = 0; i < numPointsInArea; ++i) { - if (IntersectLine2D(ptToTest, &reallyFarPoint, &area[i], &area[(i + 1) % numPointsInArea])) { - ++numIntersections; - } - } - return (numIntersections % 2 == 1); -} - -// This function uses even-odd winding to determine whether a point is inside an area. -Bool PointInsideArea2D( const Coord3D *ptToTest, const Coord3D *area, Int numPointsInArea) -{ - int numIntersections = 0; - Coord2D pt2D, area2D1, area2D2; - pt2D.x = ptToTest->x; - pt2D.y = ptToTest->y; - - for (int i = 0; i < numPointsInArea; ++i) { - area2D1.x = area[i].x; - area2D1.y = area[i].y; - area2D2.x = area[(i + 1) % numPointsInArea].x; - area2D2.y = area[(i + 1) % numPointsInArea].y; - if (IntersectLine2D(&pt2D, &reallyFarPoint, &area2D1, &area2D2)) { - ++numIntersections; - } - } - return (numIntersections % 2 == 1); -} - -///< Checks if a point is inside a perfect rectangle (top left and bottom right) -Bool Coord3DInsideRect2D( const Coord3D *inputPoint, const Coord2D *tl, const Coord2D *br ) -{ - if( inputPoint->x >= tl->x && inputPoint->x <= br->x ) - { - if( inputPoint->y >= tl->y && inputPoint->y <= br->y ) - { - return TRUE; - } - } - return FALSE; -} - -///< Scales a rect by a factor either growing or shrinking it. -void ScaleRect2D( Coord2D *tl, Coord2D *br, Real scaleFactor ) -{ - scaleFactor = scaleFactor-1.0f; // We are starting with tl,br, so scaling it by 1 means adding 0 to it. - - Real deltaWidth = (br->x - tl->x) * scaleFactor * 0.5f; - Real deltaHeight = (br->y - tl->y) * scaleFactor * 0.5f; - - tl->x -= deltaWidth; - tl->y -= deltaHeight; - - br->x += deltaWidth; - br->y += deltaHeight; -} - - -// Solution taken from http://astronomy.swin.edu.au/~pbourke/geometry/pointline/ -void ShortestDistancePointToSegment2D( const Coord2D *a, const Coord2D *b, const Coord2D *pt, - Real *outDistance, Coord2D *outPosition, Real *outU ) -{ - if (!a || !b || !pt) { - return; - } - - if (a->x == b->x && a->y == b->y) { - // special case, its simply pt to pt. - Coord2D segment; - segment.x = pt->x - a->x; - segment.y = pt->y - a->y; - if (outDistance) { - (*outDistance) = segment.length(); - } - - if (outPosition) { - (*outPosition).x = a->x; - (*outPosition).y = a->y; - } - - if (outU) { - (*outU) = 0.5; - } - return; - } - - Coord2D segAB; - segAB.x = b->x - a->x; - segAB.y = b->y - a->y; - - // General case - Real u = ((pt->x - a->x) * (b->x - a->x) + (pt->y - a->y) * (b->y - a->y)) / - sqr(segAB.length()); - - Coord2D intersectSegment; - - intersectSegment.x = a->x + u * (b->x - a->x); - intersectSegment.y = a->y + u * (b->y - a->y); - - - if (outPosition) { - (*outPosition) = intersectSegment; - } - - if (outDistance) { - (*outDistance) = intersectSegment.length(); - } - - if (outU) { - (*outU) = u; - } - -} diff --git a/Generals/Code/GameEngine/Source/GameClient/Statistics.cpp b/Generals/Code/GameEngine/Source/GameClient/Statistics.cpp deleted file mode 100644 index 3290a581a9..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/Statistics.cpp +++ /dev/null @@ -1,62 +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: Statistics.cpp -/*---------------------------------------------------------------------------*/ -/* EA Pacific */ -/* Confidential Information */ -/* Copyright (C) 2001 - All Rights Reserved */ -/* DO NOT DISTRIBUTE */ -/*---------------------------------------------------------------------------*/ -/* Project: RTS3 */ -/* File name: Statistics.cpp */ -/* Created: John K. McDonald, Jr., 4/2/2002 */ -/* Desc: Statistical functions should live here */ -/* Revision History: */ -/* 4/2/2002 : Initial creation */ -/*---------------------------------------------------------------------------*/ - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/Statistics.h" - -// Solution taken from http://www.epanorama.net/documents/telecom/ulaw_alaw.html -Real MuLaw(Real valueToRun, Real maxValueForVal, Real mu) -{ - Real testVal = (valueToRun - maxValueForVal / 2) / (maxValueForVal / 2); - return (sign(testVal) * log(1 + mu * fabs(testVal)) / - log(1 + mu)); -} - -// from my head. jkmcd -Real Normalize(Real valueToNormalize, Real minRange, Real maxRange) -{ - return ((valueToNormalize - minRange) / (maxRange - minRange)); -} - -// from my head again. jkmcd -Real NormalizeToRange(Real valueToNormalize, Real minRange, Real maxRange, Real outRangeMin, Real outRangeMax) -{ - return (Normalize(valueToNormalize, minRange, maxRange) * (outRangeMax - outRangeMin)) + outRangeMin; -} diff --git a/Generals/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp b/Generals/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp deleted file mode 100644 index c101461162..0000000000 --- a/Generals/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: Generals -// -// Module: Debug -// -// File name: DebugDisplay.cpp -// -// Created: 11/13/01 TR -// -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/DebugDisplay.h" - -//---------------------------------------------------------------------------- -// Externals -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Defines -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Types -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Prototypes -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Functions -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Functions -//---------------------------------------------------------------------------- - - -//============================================================================ -// DebugDisplay::DebugDisplay -//============================================================================ - -DebugDisplay::DebugDisplay() -: m_width(0), - m_height(0) -{ - reset(); -} - -//============================================================================ -// DebugDisplay::reset -//============================================================================ - -void DebugDisplay::reset( void ) -{ - setCursorPos( 0, 0 ); - setTextColor( WHITE ); - setRightMargin( 0 ); - setLeftMargin( getWidth() ); -} -//============================================================================ -// DebugDisplay::setCursorPos -//============================================================================ - -void DebugDisplay::setCursorPos( Int x, Int y ) -{ - m_xPos = x; - m_yPos = y; -} - -//============================================================================ -// DebugDisplay::getCursorXPos -//============================================================================ - -Int DebugDisplay::getCursorXPos( void ) -{ - return m_xPos; -} - -//============================================================================ -// DebugDisplay::getCursorYPos -//============================================================================ - -Int DebugDisplay::getCursorYPos( void ) -{ - return m_yPos; -} - -//============================================================================ -// DebugDisplay::getWidth -//============================================================================ - -Int DebugDisplay::getWidth( void ) -{ - return m_width; -} - -//============================================================================ -// DebugDisplay::getHeight -//============================================================================ - -Int DebugDisplay::getHeight( void ) -{ - return m_height; -} - -//============================================================================ -// DebugDisplay::setTextColor -//============================================================================ - -void DebugDisplay::setTextColor( Color color ) -{ - m_textColor = color; -} - -//============================================================================ -// DebugDisplay::setRightMargin -//============================================================================ - -void DebugDisplay::setRightMargin( Int rightPos ) -{ - m_rightMargin = rightPos; -} - -//============================================================================ -// DebugDisplay::setLeftMargin -//============================================================================ - -void DebugDisplay::setLeftMargin( Int leftPos ) -{ - m_leftMargin = leftPos; -} - -//============================================================================ -// DebugDisplay::printf -//============================================================================ - -void DebugDisplay::printf( const Char *format, ...) -{ - va_list args; - int result; - static char text[5*1024]; - - va_start( args, format ); - result = vsprintf( text, format, args ); - va_end( args ); - - if ( result < 0 ) - { - // error while printing string - return; - } - - DEBUG_ASSERTCRASH( result < sizeof(text), ("text overflow in DebugDisplay::printf() - string too long")); - - // find every line and print it - Char *ptr = text;; - Char *lineStart = ptr; - Int lineLen = 0; - Char ch; - - while ( (ch = *ptr++) != 0 ) - { - switch ( ch ) - { - case '\n': - { - if ( lineLen > 0 ) - { - *(ptr -1) = 0; // replace '/n' with null - drawText( m_rightMargin + m_xPos, m_yPos, lineStart ); - lineLen = 0; - } - lineStart = ptr; - m_yPos++; - m_xPos = 0; - break; - } - - default: - { - lineLen++; - break; - } - } - } - - if ( lineLen > 0 ) - { - drawText( m_rightMargin + m_xPos, m_yPos, lineStart ); - m_xPos += lineLen; - } -} diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt index 5546c7bc91..403a379dd0 100644 --- a/GeneralsMD/Code/GameEngine/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt @@ -136,31 +136,31 @@ set(GAMEENGINE_SRC # Include/Common/XferDeepCRC.h # Include/Common/XferLoad.h # Include/Common/XferSave.h - Include/GameClient/Anim2D.h - Include/GameClient/AnimateWindowManager.h + #Include/GameClient/Anim2D.h + #Include/GameClient/AnimateWindowManager.h Include/GameClient/CampaignManager.h - Include/GameClient/CDCheck.h + #Include/GameClient/CDCheck.h Include/GameClient/ChallengeGenerals.h Include/GameClient/ClientInstance.h # Include/GameClient/ClientRandomValue.h Include/GameClient/Color.h Include/GameClient/CommandXlat.h Include/GameClient/ControlBar.h - Include/GameClient/ControlBarResizer.h + #Include/GameClient/ControlBarResizer.h Include/GameClient/ControlBarScheme.h - Include/GameClient/Credits.h - Include/GameClient/DebugDisplay.h - Include/GameClient/Diplomacy.h - Include/GameClient/DisconnectMenu.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/EstablishConnectionsMenu.h + #Include/GameClient/DrawGroupInfo.h + #Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h - Include/GameClient/ExtendedMessageBox.h + #Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h Include/GameClient/FXList.h Include/GameClient/Gadget.h @@ -173,14 +173,14 @@ set(GAMEENGINE_SRC Include/GameClient/GadgetSlider.h Include/GameClient/GadgetStaticText.h Include/GameClient/GadgetTabControl.h - Include/GameClient/GadgetTextEntry.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/GameText.h Include/GameClient/GameWindow.h Include/GameClient/GameWindowGlobal.h - Include/GameClient/GameWindowID.h + #Include/GameClient/GameWindowID.h Include/GameClient/GameWindowManager.h Include/GameClient/GameWindowTransitions.h Include/GameClient/GlobalLanguage.h @@ -189,39 +189,39 @@ set(GAMEENGINE_SRC Include/GameClient/GUICommandTranslator.h Include/GameClient/HeaderTemplate.h Include/GameClient/HintSpy.h - Include/GameClient/HotKey.h + #Include/GameClient/HotKey.h Include/GameClient/Image.h - Include/GameClient/IMEManager.h + #Include/GameClient/IMEManager.h Include/GameClient/InGameUI.h - Include/GameClient/Keyboard.h - Include/GameClient/KeyDefs.h + #Include/GameClient/Keyboard.h + #Include/GameClient/KeyDefs.h Include/GameClient/LanguageFilter.h - Include/GameClient/Line2D.h + #Include/GameClient/Line2D.h Include/GameClient/LoadScreen.h Include/GameClient/LookAtXlat.h Include/GameClient/MapUtil.h - Include/GameClient/MessageBox.h + #Include/GameClient/MessageBox.h Include/GameClient/MetaEvent.h - Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h - Include/GameClient/Module/BeaconClientUpdate.h - Include/GameClient/Module/SwayClientUpdate.h + #Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h + #Include/GameClient/Module/BeaconClientUpdate.h + #Include/GameClient/Module/SwayClientUpdate.h Include/GameClient/Mouse.h Include/GameClient/ParabolicEase.h Include/GameClient/ParticleSys.h Include/GameClient/PlaceEventTranslator.h - Include/GameClient/ProcessAnimateWindow.h + #Include/GameClient/ProcessAnimateWindow.h Include/GameClient/RadiusDecal.h - Include/GameClient/RayEffect.h + #Include/GameClient/RayEffect.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/Shadow.h + #Include/GameClient/Shell.h + #Include/GameClient/ShellHooks.h + #Include/GameClient/ShellMenuScheme.h Include/GameClient/Smudge.h Include/GameClient/Snow.h - Include/GameClient/Statistics.h - Include/GameClient/TerrainRoads.h + #Include/GameClient/Statistics.h + #Include/GameClient/TerrainRoads.h Include/GameClient/TerrainVisual.h # Include/GameClient/VideoPlayer.h Include/GameClient/View.h @@ -685,17 +685,17 @@ set(GAMEENGINE_SRC Source/GameClient/Credits.cpp Source/GameClient/Display.cpp Source/GameClient/DisplayString.cpp - Source/GameClient/DisplayStringManager.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/GameClient.cpp Source/GameClient/GameClientDispatch.cpp - Source/GameClient/GameText.cpp + #Source/GameClient/GameText.cpp Source/GameClient/GlobalLanguage.cpp Source/GameClient/GraphDraw.cpp Source/GameClient/GUI/AnimateWindowManager.cpp @@ -707,7 +707,7 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp - Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp + #Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp @@ -725,7 +725,7 @@ 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/GameFont.cpp Source/GameClient/GUI/GameWindow.cpp Source/GameClient/GUI/GameWindowGlobal.cpp Source/GameClient/GUI/GameWindowManager.cpp @@ -789,14 +789,14 @@ set(GAMEENGINE_SRC 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/InGameUI.cpp Source/GameClient/Input/Keyboard.cpp Source/GameClient/Input/Mouse.cpp - Source/GameClient/LanguageFilter.cpp - Source/GameClient/Line2D.cpp + #Source/GameClient/LanguageFilter.cpp + #Source/GameClient/Line2D.cpp Source/GameClient/MapUtil.cpp Source/GameClient/MessageStream/CommandXlat.cpp Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -811,11 +811,11 @@ set(GAMEENGINE_SRC 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 Displayers/AudioDebugDisplay.cpp" - Source/GameClient/System/DebugDisplay.cpp + #Source/GameClient/System/DebugDisplay.cpp Source/GameClient/System/Image.cpp Source/GameClient/System/ParticleSys.cpp Source/GameClient/System/RayEffect.cpp