diff --git a/CMakeLists.txt b/CMakeLists.txt index 4988ed2cd41..98bc8ca8bde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,7 @@ endif() include(cmake/config.cmake) include(cmake/gamespy.cmake) include(cmake/lzhl.cmake) +include(cmake/stb.cmake) # GeneralsX @bugfix fbraz 10/03/2026 Include openal.cmake here (before Core subdirectory) # so OpenAL::OpenAL target is available when Core/GameEngineDevice/CMakeLists.txt processes. diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt index 69fd5e02ef0..caab99d6a10 100644 --- a/Core/GameEngine/CMakeLists.txt +++ b/Core/GameEngine/CMakeLists.txt @@ -197,6 +197,7 @@ set(GAMEENGINE_SRC Include/GameClient/Image.h Include/GameClient/IMEManager.h # Include/GameClient/InGameUI.h + Include/GameClient/Intro.h Include/GameClient/Keyboard.h # Include/GameClient/KeyDefs.h Include/GameClient/LanguageFilter.h @@ -583,33 +584,33 @@ set(GAMEENGINE_SRC Source/Common/GameUtility.cpp # Source/Common/GlobalData.cpp Source/Common/INI/INI.cpp -# Source/Common/INI/INIAiData.cpp -# Source/Common/INI/INIAnimation.cpp + Source/Common/INI/INIAiData.cpp + Source/Common/INI/INIAnimation.cpp Source/Common/INI/INIAudioEventInfo.cpp -# Source/Common/INI/INICommandButton.cpp -# Source/Common/INI/INICommandSet.cpp -# Source/Common/INI/INIControlBarScheme.cpp -# Source/Common/INI/INICrate.cpp -# Source/Common/INI/INIDamageFX.cpp -# Source/Common/INI/INIDrawGroupInfo.cpp -# Source/Common/INI/INIGameData.cpp -# Source/Common/INI/INIMapCache.cpp -# Source/Common/INI/INIMapData.cpp -# Source/Common/INI/INIMappedImage.cpp + Source/Common/INI/INICommandButton.cpp + Source/Common/INI/INICommandSet.cpp + Source/Common/INI/INIControlBarScheme.cpp + Source/Common/INI/INICrate.cpp + Source/Common/INI/INIDamageFX.cpp + Source/Common/INI/INIDrawGroupInfo.cpp + Source/Common/INI/INIGameData.cpp + Source/Common/INI/INIMapCache.cpp + Source/Common/INI/INIMapData.cpp + Source/Common/INI/INIMappedImage.cpp Source/Common/INI/INIMiscAudio.cpp -# Source/Common/INI/INIModel.cpp -# Source/Common/INI/INIMultiplayer.cpp -# Source/Common/INI/INIObject.cpp -# Source/Common/INI/INIParticleSys.cpp -# Source/Common/INI/INISpecialPower.cpp -# Source/Common/INI/INITerrain.cpp -# Source/Common/INI/INITerrainBridge.cpp -# Source/Common/INI/INITerrainRoad.cpp -# Source/Common/INI/INIUpgrade.cpp + Source/Common/INI/INIModel.cpp + Source/Common/INI/INIMultiplayer.cpp + Source/Common/INI/INIObject.cpp + Source/Common/INI/INIParticleSys.cpp + Source/Common/INI/INISpecialPower.cpp + Source/Common/INI/INITerrain.cpp + Source/Common/INI/INITerrainBridge.cpp + Source/Common/INI/INITerrainRoad.cpp + Source/Common/INI/INIUpgrade.cpp Source/Common/INI/INIVideo.cpp -# Source/Common/INI/INIWater.cpp -# Source/Common/INI/INIWeapon.cpp -# Source/Common/INI/INIWebpageURL.cpp + Source/Common/INI/INIWater.cpp + Source/Common/INI/INIWeapon.cpp + Source/Common/INI/INIWebpageURL.cpp # Source/Common/Language.cpp # Source/Common/MessageStream.cpp # Source/Common/MiniLog.cpp @@ -806,6 +807,7 @@ set(GAMEENGINE_SRC # Source/GameClient/InGameUI.cpp Source/GameClient/Input/Keyboard.cpp Source/GameClient/Input/Mouse.cpp + Source/GameClient/Intro.cpp Source/GameClient/LanguageFilter.cpp Source/GameClient/Line2D.cpp Source/GameClient/MapUtil.cpp diff --git a/Core/GameEngine/Include/Common/CRCDebug.h b/Core/GameEngine/Include/Common/CRCDebug.h index 5fee31b43d3..b4bda92b2c6 100644 --- a/Core/GameEngine/Include/Common/CRCDebug.h +++ b/Core/GameEngine/Include/Common/CRCDebug.h @@ -103,23 +103,23 @@ #else // DEBUG_CRC - #define DUMPVEL {} - #define DUMPACCEL {} - #define DUMPVECTOR3(x) {} - #define DUMPVECTOR3NAMED(x, y) {} - #define DUMPCOORD3D(x) {} - #define DUMPCOORD3DNAMED(x, y) {} - #define DUMPMATRIX3D(x) {} - #define DUMPMATRIX3DNAMED(x, y) {} - - #define DUMPREAL(x) {} - #define DUMPREALNAMED(x, y) {} - - #define CRCDEBUG_LOG(x) {} - #define CRCDUMP_LOG(x) {} - #define CRCGEN_LOG(x) {} - - #define VERIFY_CRC {} + #define DUMPVEL + #define DUMPACCEL + #define DUMPVECTOR3(x) + #define DUMPVECTOR3NAMED(x, y) + #define DUMPCOORD3D(x) + #define DUMPCOORD3DNAMED(x, y) + #define DUMPMATRIX3D(x) + #define DUMPMATRIX3DNAMED(x, y) + + #define DUMPREAL(x) + #define DUMPREALNAMED(x, y) + + #define CRCDEBUG_LOG(x) + #define CRCDUMP_LOG(x) + #define CRCGEN_LOG(x) + + #define VERIFY_CRC #endif diff --git a/Core/GameEngine/Include/Common/DynamicAudioEventInfo.h b/Core/GameEngine/Include/Common/DynamicAudioEventInfo.h index 038ba2bbfff..044c1983b96 100644 --- a/Core/GameEngine/Include/Common/DynamicAudioEventInfo.h +++ b/Core/GameEngine/Include/Common/DynamicAudioEventInfo.h @@ -98,7 +98,7 @@ class DynamicAudioEventInfo : public AudioEventInfo }; // Warning: update xferNoName if you modify the enum list! - BitFlags< OVERRIDE_COUNT > m_overriddenFields; + BitFlags< OVERRIDE_COUNT, struct OverriddenTag > m_overriddenFields; // Retain the original name so we can look it up later AsciiString m_originalName; diff --git a/Core/GameEngine/Include/Common/FileSystem.h b/Core/GameEngine/Include/Common/FileSystem.h index 322780017a5..2aaa30a61f1 100644 --- a/Core/GameEngine/Include/Common/FileSystem.h +++ b/Core/GameEngine/Include/Common/FileSystem.h @@ -53,7 +53,7 @@ #include -#include "mutex.h" +#include "WWLib/mutex.h" //---------------------------------------------------------------------------- // Forward References diff --git a/Core/GameEngine/Include/Common/GameCommon.h b/Core/GameEngine/Include/Common/GameCommon.h index 8bc108e793d..acb074b00a6 100644 --- a/Core/GameEngine/Include/Common/GameCommon.h +++ b/Core/GameEngine/Include/Common/GameCommon.h @@ -51,7 +51,7 @@ // ---------------------------------------------------------------------------------------------- #include "Lib/BaseType.h" -#include "WWCommon.h" +#include "WWLib/WWCommon.h" #include "Common/GameDefines.h" // ---------------------------------------------------------------------------------------------- diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 08006281a4a..480e920c503 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -18,7 +18,7 @@ #pragma once -#include "WWDefines.h" +#include "WWLib/WWDefines.h" // Note: Retail compatibility must not be broken before this project officially does. // Use RETAIL_COMPATIBLE_CRC and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes. diff --git a/Core/GameEngine/Include/Common/INI.h b/Core/GameEngine/Include/Common/INI.h index 746a2e60395..e53b8b9bc6c 100644 --- a/Core/GameEngine/Include/Common/INI.h +++ b/Core/GameEngine/Include/Common/INI.h @@ -160,8 +160,8 @@ typedef void (*BuildMultiIniFieldProc)(MultiIniFieldParse& p); //------------------------------------------------------------------------------------------------- class INI { - INI(const INI&) CPP_11(= delete); - INI& operator=(const INI&) CPP_11(= delete); + INI(const INI&) FUNCTION_DELETE; + INI& operator=(const INI&) FUNCTION_DELETE; public: INI(); diff --git a/Core/GameEngine/Include/Common/MiniDumper.h b/Core/GameEngine/Include/Common/MiniDumper.h index 44c03e96ef1..5ec34029512 100644 --- a/Core/GameEngine/Include/Common/MiniDumper.h +++ b/Core/GameEngine/Include/Common/MiniDumper.h @@ -19,7 +19,7 @@ #pragma once #ifdef RTS_ENABLE_CRASHDUMP -#include "DbgHelpLoader.h" +#include "WWLib/DbgHelpLoader.h" enum DumpType CPP_11(: Char) { diff --git a/Core/GameEngine/Include/Common/ObjectStatusTypes.h b/Core/GameEngine/Include/Common/ObjectStatusTypes.h index affa254c9e0..3e76faaede8 100644 --- a/Core/GameEngine/Include/Common/ObjectStatusTypes.h +++ b/Core/GameEngine/Include/Common/ObjectStatusTypes.h @@ -95,7 +95,7 @@ enum ObjectStatusTypes CPP_11(: Int) }; -typedef BitFlags ObjectStatusMaskType; +typedef BitFlags ObjectStatusMaskType; #define MAKE_OBJECT_STATUS_MASK(k) ObjectStatusMaskType(ObjectStatusMaskType::kInit, (k)) #define MAKE_OBJECT_STATUS_MASK2(k,a) ObjectStatusMaskType(ObjectStatusMaskType::kInit, (k), (a)) diff --git a/Core/GameEngine/Include/Common/OptionPreferences.h b/Core/GameEngine/Include/Common/OptionPreferences.h index 0ed1cb6f177..a94a457c0bd 100644 --- a/Core/GameEngine/Include/Common/OptionPreferences.h +++ b/Core/GameEngine/Include/Common/OptionPreferences.h @@ -30,8 +30,8 @@ #pragma once -#include "ww3d.h" -#include "texturefilter.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/texturefilter.h" #include "Common/UserPreferences.h" @@ -72,6 +72,7 @@ class OptionPreferences : public UserPreferences Bool getRightMouseScrollWithAlternateMouseEnabled() const; Bool getRetaliationModeEnabled(); Bool getDoubleClickAttackMoveEnabled(); + Int getJpegQuality() const; Real getScrollFactor(); Bool getDrawScrollAnchor(); Bool getMoveScrollAnchor(); diff --git a/Core/GameEngine/Include/GameClient/Display.h b/Core/GameEngine/Include/GameClient/Display.h index 1a740e1edff..713141e1d52 100644 --- a/Core/GameEngine/Include/GameClient/Display.h +++ b/Core/GameEngine/Include/GameClient/Display.h @@ -33,6 +33,16 @@ #include "GameClient/GameFont.h" #include "GameClient/View.h" +enum ScreenshotFormat +{ + SCREENSHOT_JPEG, + SCREENSHOT_PNG, + + SCREENSHOT_FORMAT_COUNT +}; + +constexpr const Int DEFAULT_JPEG_QUALITY = 80; + struct ShroudLevel { Short m_currentShroud; ///< A Value of 1 means shrouded. 0 is not. Negative is the count of people looking. @@ -154,7 +164,6 @@ class Display : public SubsystemInterface Int endX, Int endY ) = 0; /// FullScreen video playback - virtual void playLogoMovie( AsciiString movieName, Int minMovieLength, Int minCopyrightLength ); virtual void playMovie( AsciiString movieName ); virtual void stopMovie(); virtual Bool isMoviePlaying(); @@ -173,7 +182,7 @@ class Display : public SubsystemInterface virtual void preloadModelAssets( AsciiString model ) = 0; ///< preload model asset virtual void preloadTextureAssets( AsciiString texture ) = 0; ///< preload texture asset - virtual void takeScreenShot() = 0; ///< saves screenshot to a file + virtual void takeScreenShot(ScreenshotFormat format, Int jpegQuality = DEFAULT_JPEG_QUALITY) = 0; ///< saves screenshot in specified format virtual void toggleMovieCapture() = 0; ///< starts saving frames to an avi or frame sequence virtual void toggleLetterBox() = 0; ///< enabled letter-boxed display virtual void enableLetterBox(Bool enable) = 0; ///< forces letter-boxed display on/off @@ -217,11 +226,6 @@ class Display : public SubsystemInterface Real m_letterBoxFadeLevel; ///. +*/ + +#pragma once + +class Intro +{ + enum IntroState + { + IntroState_Start, + IntroState_EALogoMovie, + IntroState_SizzleMovieWait, + IntroState_SizzleMovie, + IntroState_Done, + }; + +public: + + Intro(); + + void update(); + + Bool isDone() const { return m_currentState == IntroState_Done; } + +private: + + void enterNextState(); + + void doEALogoMovie(); + void doSizzleMovie(); + void doPostIntro(); + void doAsyncWait(UnsignedInt milliseconds); + + IntroState m_currentState; + UnsignedInt m_allowedStateFlags; + UnsignedInt m_waitUntilMs; +}; diff --git a/Core/GameEngine/Include/GameClient/TerrainVisual.h b/Core/GameEngine/Include/GameClient/TerrainVisual.h index 5c679b58b43..98a49f77d8b 100644 --- a/Core/GameEngine/Include/GameClient/TerrainVisual.h +++ b/Core/GameEngine/Include/GameClient/TerrainVisual.h @@ -160,10 +160,7 @@ typedef enum _TerrainLOD CPP_11(: Int) { TERRAIN_LOD_INVALID, TERRAIN_LOD_MIN, // note that this is less than max - TERRAIN_LOD_STRETCH_NO_CLOUDS, - TERRAIN_LOD_HALF_CLOUDS, TERRAIN_LOD_NO_CLOUDS, - TERRAIN_LOD_STRETCH_CLOUDS, TERRAIN_LOD_NO_WATER, TERRAIN_LOD_MAX, // note that this is larger than min TERRAIN_LOD_AUTOMATIC, @@ -177,10 +174,7 @@ static const char *const TerrainLODNames[] = { "NONE", "MIN", - "STRETCH_NO_CLOUDS", - "HALF_CLOUDS", "NO_CLOUDS", - "STRETCH_CLOUDS", "NO_WATER", "MAX", "AUTOMATIC", diff --git a/Core/GameEngine/Include/GameLogic/Damage.h b/Core/GameEngine/Include/GameLogic/Damage.h index f0c7cabc11e..dded429d27b 100644 --- a/Core/GameEngine/Include/GameLogic/Damage.h +++ b/Core/GameEngine/Include/GameLogic/Damage.h @@ -96,7 +96,7 @@ enum DamageType CPP_11(: Int) //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- -typedef BitFlags DamageTypeFlags; +typedef BitFlags DamageTypeFlags; inline Bool getDamageTypeFlag(DamageTypeFlags flags, DamageType dt) { diff --git a/Core/GameEngine/Include/GameNetwork/GameSpyThread.h b/Core/GameEngine/Include/GameNetwork/GameSpyThread.h index b36b864f718..f2de9fe3dfe 100644 --- a/Core/GameEngine/Include/GameNetwork/GameSpyThread.h +++ b/Core/GameEngine/Include/GameNetwork/GameSpyThread.h @@ -28,8 +28,8 @@ #pragma once -#include "mutex.h" -#include "thread.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" class GameSpyThreadClass : public ThreadClass { diff --git a/Core/GameEngine/Include/GameNetwork/NetCommandMsg.h b/Core/GameEngine/Include/GameNetwork/NetCommandMsg.h index f49377eedc7..7bc2d173a91 100644 --- a/Core/GameEngine/Include/GameNetwork/NetCommandMsg.h +++ b/Core/GameEngine/Include/GameNetwork/NetCommandMsg.h @@ -36,6 +36,56 @@ class GameMessageArgument; class NetCommandRef; +//----------------------------------------------------------------------------- +class NetCommandDataChunk +{ + NetCommandDataChunk(const NetCommandDataChunk&) FUNCTION_DELETE; + void operator=(const NetCommandDataChunk&) FUNCTION_DELETE; + +public: + NetCommandDataChunk(UnsignedByte *data, UnsignedInt size) + : m_data(data) + , m_size(size) + {} + + NetCommandDataChunk(UnsignedInt size) + : m_data(NEW UnsignedByte[size]) + , m_size(size) + {} + + ~NetCommandDataChunk() + { + delete[] m_data; + } + + const UnsignedByte *data() const + { + return m_data; + } + + UnsignedByte *data() + { + return m_data; + } + + UnsignedInt size() const + { + return m_size; + } + + UnsignedByte *release() + { + UnsignedByte *ret = m_data; + m_data = nullptr; + m_size = 0; + return ret; + } + +private: + UnsignedByte *m_data; + UnsignedInt m_size; +}; + //----------------------------------------------------------------------------- class NetCommandMsg : public MemoryPoolObject { diff --git a/Core/GameEngine/Include/GameNetwork/NetPacketStructs.h b/Core/GameEngine/Include/GameNetwork/NetPacketStructs.h index 2913d07456b..4a2ab674503 100644 --- a/Core/GameEngine/Include/GameNetwork/NetPacketStructs.h +++ b/Core/GameEngine/Include/GameNetwork/NetPacketStructs.h @@ -19,6 +19,7 @@ #pragma once #include "GameNetwork/NetworkDefs.h" +#include "WWLib/stringex.h" class AsciiString; class UnicodeString; diff --git a/Core/GameEngine/Include/GameNetwork/networkutil.h b/Core/GameEngine/Include/GameNetwork/networkutil.h index 944e2ce0a60..fa2c85f3199 100644 --- a/Core/GameEngine/Include/GameNetwork/networkutil.h +++ b/Core/GameEngine/Include/GameNetwork/networkutil.h @@ -42,7 +42,7 @@ void dumpBufferToLog(const void *vBuf, Int len, const char *fname, Int line); }; #define LOGBUFFER(buf, len) dumpBufferToLog(buf, len, __FILE__, __LINE__) #else -#define LOGBUFFER(buf, len) {} +#define LOGBUFFER(buf, len) #endif // DEBUG_LOGGING inline UnsignedInt AssembleIp(UnsignedByte a, UnsignedByte b, UnsignedByte c, UnsignedByte d) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAiData.cpp b/Core/GameEngine/Source/Common/INI/INIAiData.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIAiData.cpp rename to Core/GameEngine/Source/Common/INI/INIAiData.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp b/Core/GameEngine/Source/Common/INI/INIAnimation.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp rename to Core/GameEngine/Source/Common/INI/INIAnimation.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandButton.cpp b/Core/GameEngine/Source/Common/INI/INICommandButton.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandButton.cpp rename to Core/GameEngine/Source/Common/INI/INICommandButton.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandSet.cpp b/Core/GameEngine/Source/Common/INI/INICommandSet.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandSet.cpp rename to Core/GameEngine/Source/Common/INI/INICommandSet.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp b/Core/GameEngine/Source/Common/INI/INIControlBarScheme.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp rename to Core/GameEngine/Source/Common/INI/INIControlBarScheme.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INICrate.cpp b/Core/GameEngine/Source/Common/INI/INICrate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INICrate.cpp rename to Core/GameEngine/Source/Common/INI/INICrate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIDamageFX.cpp b/Core/GameEngine/Source/Common/INI/INIDamageFX.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIDamageFX.cpp rename to Core/GameEngine/Source/Common/INI/INIDamageFX.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp b/Core/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp rename to Core/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIGameData.cpp b/Core/GameEngine/Source/Common/INI/INIGameData.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIGameData.cpp rename to Core/GameEngine/Source/Common/INI/INIGameData.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapCache.cpp b/Core/GameEngine/Source/Common/INI/INIMapCache.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapCache.cpp rename to Core/GameEngine/Source/Common/INI/INIMapCache.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapData.cpp b/Core/GameEngine/Source/Common/INI/INIMapData.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapData.cpp rename to Core/GameEngine/Source/Common/INI/INIMapData.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp b/Core/GameEngine/Source/Common/INI/INIMappedImage.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp rename to Core/GameEngine/Source/Common/INI/INIMappedImage.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIModel.cpp b/Core/GameEngine/Source/Common/INI/INIModel.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIModel.cpp rename to Core/GameEngine/Source/Common/INI/INIModel.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMultiplayer.cpp b/Core/GameEngine/Source/Common/INI/INIMultiplayer.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIMultiplayer.cpp rename to Core/GameEngine/Source/Common/INI/INIMultiplayer.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIObject.cpp b/Core/GameEngine/Source/Common/INI/INIObject.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIObject.cpp rename to Core/GameEngine/Source/Common/INI/INIObject.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp b/Core/GameEngine/Source/Common/INI/INIParticleSys.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp rename to Core/GameEngine/Source/Common/INI/INIParticleSys.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INISpecialPower.cpp b/Core/GameEngine/Source/Common/INI/INISpecialPower.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INISpecialPower.cpp rename to Core/GameEngine/Source/Common/INI/INISpecialPower.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrain.cpp b/Core/GameEngine/Source/Common/INI/INITerrain.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrain.cpp rename to Core/GameEngine/Source/Common/INI/INITerrain.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp b/Core/GameEngine/Source/Common/INI/INITerrainBridge.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp rename to Core/GameEngine/Source/Common/INI/INITerrainBridge.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp b/Core/GameEngine/Source/Common/INI/INITerrainRoad.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp rename to Core/GameEngine/Source/Common/INI/INITerrainRoad.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIUpgrade.cpp b/Core/GameEngine/Source/Common/INI/INIUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIUpgrade.cpp rename to Core/GameEngine/Source/Common/INI/INIUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWater.cpp b/Core/GameEngine/Source/Common/INI/INIWater.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIWater.cpp rename to Core/GameEngine/Source/Common/INI/INIWater.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWeapon.cpp b/Core/GameEngine/Source/Common/INI/INIWeapon.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIWeapon.cpp rename to Core/GameEngine/Source/Common/INI/INIWeapon.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp b/Core/GameEngine/Source/Common/INI/INIWebpageURL.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp rename to Core/GameEngine/Source/Common/INI/INIWebpageURL.cpp diff --git a/Core/GameEngine/Source/Common/OptionPreferences.cpp b/Core/GameEngine/Source/Common/OptionPreferences.cpp index 8c20de5e4d9..19dfaf0da58 100644 --- a/Core/GameEngine/Source/Common/OptionPreferences.cpp +++ b/Core/GameEngine/Source/Common/OptionPreferences.cpp @@ -38,6 +38,7 @@ #include "Common/OptionPreferences.h" #include "GameClient/ClientInstance.h" +#include "GameClient/Display.h" #include "GameClient/LookAtXlat.h" #include "GameClient/Mouse.h" @@ -239,6 +240,18 @@ Bool OptionPreferences::getDoubleClickAttackMoveEnabled() return FALSE; } +Int OptionPreferences::getJpegQuality() const +{ + OptionPreferences::const_iterator it = find("JpegQuality"); + if (it == end()) + return DEFAULT_JPEG_QUALITY; + + // TheSuperHackers @info bobtista 14/07/2026 Clamp the quality to 50-95: above 95 the file + // size increases significantly with no visible benefit, below 50 the image degrades visibly. + const Int quality = atoi(it->second.str()); + return clamp(50, quality, 95); +} + Real OptionPreferences::getScrollFactor() { OptionPreferences::const_iterator it = find("ScrollFactor"); diff --git a/Core/GameEngine/Source/GameClient/Display.cpp b/Core/GameEngine/Source/GameClient/Display.cpp index 41acb4d0003..eef868d4dbc 100644 --- a/Core/GameEngine/Source/GameClient/Display.cpp +++ b/Core/GameEngine/Source/GameClient/Display.cpp @@ -58,11 +58,6 @@ Display::Display() m_cinematicText = AsciiString::TheEmptyString; m_cinematicFont = nullptr; m_cinematicTextFrames = 0; - m_movieHoldTime = -1; - m_copyrightHoldTime = -1; - m_elapsedMovieTime = 0; - m_elapsedCopywriteTime = 0; - m_copyrightDisplayString = nullptr; m_currentlyPlayingMovie.clear(); m_letterBoxFadeStartTime = 0; @@ -200,41 +195,6 @@ void Display::setHeight( UnsignedInt height ) } -//============================================================================ -// Display::playLogoMovie -// minMovieLength is in milliseconds -// minCopyrightLength -//============================================================================ - -void Display::playLogoMovie( AsciiString movieName, Int minMovieLength, Int minCopyrightLength ) -{ - - stopMovie(); - - m_videoStream = TheVideoPlayer->open( movieName ); - - if ( m_videoStream == nullptr ) - { - return; - } - - m_currentlyPlayingMovie = movieName; - m_movieHoldTime = minMovieLength; - m_copyrightHoldTime = minCopyrightLength; - m_elapsedMovieTime = timeGetTime(); // we're using time get time because legal wants actual "Seconds" - - m_videoBuffer = createVideoBuffer(); - if ( m_videoBuffer == nullptr || - !m_videoBuffer->allocate( m_videoStream->width(), - m_videoStream->height()) - ) - { - stopMovie(); - return; - } - -} - //============================================================================ // Display::playMovie //============================================================================ @@ -286,13 +246,6 @@ void Display::stopMovie() //TheScriptEngine->notifyOfCompletedVideo(m_currentlyPlayingMovie); // Removing this sync-error cause MDC m_currentlyPlayingMovie = AsciiString::TheEmptyString; } - if(m_copyrightDisplayString) - { - TheDisplayStringManager->freeDisplayString(m_copyrightDisplayString); - m_copyrightDisplayString = nullptr; - } - m_copyrightHoldTime = -1; - m_movieHoldTime = -1; } //============================================================================ @@ -308,34 +261,8 @@ void Display::update() m_videoStream->frameDecompress(); m_videoStream->frameRender( m_videoBuffer ); if( m_videoStream->frameIndex() != m_videoStream->frameCount() - 1) - m_videoStream->frameNext(); - else if( m_copyrightHoldTime >= 0 ||m_movieHoldTime >= 0 ) { - if( m_elapsedCopywriteTime == 0 && m_elapsedCopywriteTime >= 0) - { - //display the copyrighttext; - deleteInstance(m_copyrightDisplayString); - m_copyrightDisplayString = TheDisplayStringManager->newDisplayString(); - m_copyrightDisplayString->setText(TheGameText->fetch("GUI:EACopyright")); - if (TheGlobalLanguageData && TheGlobalLanguageData->m_copyrightFont.name.isNotEmpty()) - { FontDesc *fontdesc=&TheGlobalLanguageData->m_copyrightFont; - m_copyrightDisplayString->setFont(TheFontLibrary->getFont(fontdesc->name, - TheGlobalLanguageData->adjustFontSize(fontdesc->size), - fontdesc->bold)); - } - else - m_copyrightDisplayString->setFont(TheFontLibrary->getFont("Courier", - TheGlobalLanguageData->adjustFontSize(12), TRUE)); - m_elapsedCopywriteTime = timeGetTime(); - } - if(m_movieHoldTime + m_elapsedMovieTime < timeGetTime() && - m_copyrightHoldTime + m_elapsedCopywriteTime < timeGetTime()) - { - m_movieHoldTime = -1; - m_elapsedMovieTime = 0; - m_elapsedCopywriteTime = 0; - m_copyrightHoldTime = -1; - } + m_videoStream->frameNext(); } else { diff --git a/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp index 3ab6fded8bc..814e9de84ed 100644 --- a/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp @@ -97,7 +97,7 @@ WindowMsgHandledType BeaconWindowInput( GameWindow *window, UnsignedInt msg, { if (msg == GWM_CHAR && mData1 == KEY_ESC) { - TheInGameUI->deselectAllDrawables(TRUE); // there should only be one beacon and nothing else selected + TheInGameUI->deselectAllDrawables(); // there should only be one beacon and nothing else selected return MSG_HANDLED; } diff --git a/Core/GameEngine/Source/GameClient/Intro.cpp b/Core/GameEngine/Source/GameClient/Intro.cpp new file mode 100644 index 00000000000..21134523e6f --- /dev/null +++ b/Core/GameEngine/Source/GameClient/Intro.cpp @@ -0,0 +1,103 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2026 TheSuperHackers +** +** 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 . +*/ + +#include "PreRTS.h" +#include "GameClient/Intro.h" + +#include "Common/GameLOD.h" + +#include "GameClient/Display.h" +#include "GameClient/GameWindowManager.h" + + +Intro::Intro() + : m_currentState(IntroState_Start) + , m_allowedStateFlags(0) + , m_waitUntilMs(0) +{ + if (TheGlobalData->m_playIntro) + { + m_allowedStateFlags |= 1u << IntroState_EALogoMovie; + } + + if (TheGlobalData->m_playSizzle) + { + if (TheGlobalData->m_playIntro) + m_allowedStateFlags |= 1u << IntroState_SizzleMovieWait; + + m_allowedStateFlags |= 1u << IntroState_SizzleMovie; + } +} + +void Intro::enterNextState() +{ + Int currentState = m_currentState; + while (currentState < IntroState_Done) + { + ++currentState; + if (m_allowedStateFlags & (1u << currentState)) + break; + } + + m_currentState = static_cast(currentState); +} + +void Intro::update() +{ + if (!TheDisplay->isMoviePlaying() && m_waitUntilMs < timeGetTime()) + { + enterNextState(); + + switch (m_currentState) + { + case IntroState_EALogoMovie: doEALogoMovie(); break; + case IntroState_SizzleMovieWait: doAsyncWait(1000); break; + case IntroState_SizzleMovie: doSizzleMovie(); break; + case IntroState_Done: doPostIntro(); break; + } + } +} + +void Intro::doEALogoMovie() +{ + TheWritableGlobalData->m_allowExitOutOfMovies = FALSE; + if (TheGameLODManager && TheGameLODManager->didMemPass()) + TheDisplay->playMovie("EALogoMovie"); + else + TheDisplay->playMovie("EALogoMovie640"); +} + +void Intro::doSizzleMovie() +{ + TheWritableGlobalData->m_allowExitOutOfMovies = TRUE; + if (TheGameLODManager && TheGameLODManager->didMemPass()) + TheDisplay->playMovie("Sizzle"); + else + TheDisplay->playMovie("Sizzle640"); +} + +void Intro::doPostIntro() +{ + TheWritableGlobalData->m_breakTheMovie = TRUE; + TheWritableGlobalData->m_allowExitOutOfMovies = TRUE; +} + +void Intro::doAsyncWait(UnsignedInt milliseconds) +{ + m_waitUntilMs = timeGetTime() + milliseconds; +} diff --git a/Core/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/Core/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 6cb3d335d9c..5981a386b4e 100644 --- a/Core/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/Core/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -89,7 +89,7 @@ #include "GameNetwork/GameSpyOverlay.h" #include "GameNetwork/GameSpy/BuddyThread.h" -#include "ww3d.h" +#include "WW3D2/ww3d.h" #if defined(RTS_DEBUG) /*non-static*/ Real TheSkateDistOverride = 0.0f; @@ -2590,9 +2590,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage // create a new group. GameMessage *teamMsg = TheMessageStream->appendMessage( GameMessage::MSG_CREATE_SELECTED_GROUP ); - //New group or add to group? Passed in value is true if we are creating a new group. + //New group so pass in value true teamMsg->appendBooleanArgument( TRUE ); - teamMsg->appendObjectIDArgument( newDrawable->getObject()->getID() ); // select the unit @@ -2702,16 +2701,15 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage { //deselect other units TheInGameUI->deselectAllDrawables(); - // select the unit // create a new group. GameMessage *teamMsg = TheMessageStream->appendMessage( GameMessage::MSG_CREATE_SELECTED_GROUP ); - //New group or add to group? Passed in value is true if we are creating a new group. + //New group so pass in value true teamMsg->appendBooleanArgument( TRUE ); - teamMsg->appendObjectIDArgument( newDrawable->getObject()->getID() ); + // select the unit TheInGameUI->selectDrawable( newDrawable ); // center on the unit @@ -2816,13 +2814,14 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //deselect other units TheInGameUI->deselectAllDrawables(); - // select the unit // create a new group. GameMessage *teamMsg = TheMessageStream->appendMessage( GameMessage::MSG_CREATE_SELECTED_GROUP ); //New group so pass in value true teamMsg->appendBooleanArgument( TRUE ); teamMsg->appendObjectIDArgument( newDrawable->getObject()->getID() ); + + // select the unit TheInGameUI->selectDrawable( newDrawable ); // center on the unit @@ -2930,16 +2929,15 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage { //deselect other units TheInGameUI->deselectAllDrawables(); - // select the unit // create a new group. GameMessage *teamMsg = TheMessageStream->appendMessage( GameMessage::MSG_CREATE_SELECTED_GROUP ); - //New group so passed in value true + //New group so pass in value true teamMsg->appendBooleanArgument( TRUE ); - teamMsg->appendObjectIDArgument( newDrawable->getObject()->getID() ); + // select the unit TheInGameUI->selectDrawable( newDrawable ); // center on the unit @@ -2982,6 +2980,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage if ( heroDraw == nullptr ) break; + //deselect other units TheInGameUI->deselectAllDrawables(); // create a new group. @@ -2990,6 +2989,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //New group so pass in value true teamMsg->appendBooleanArgument( TRUE ); teamMsg->appendObjectIDArgument( hero->getID() ); + + // select the unit TheInGameUI->selectDrawable( heroDraw ); // center on the unit @@ -3740,7 +3741,15 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage case GameMessage::MSG_META_TAKE_SCREENSHOT: { if (TheDisplay) - TheDisplay->takeScreenShot(); + TheDisplay->takeScreenShot(SCREENSHOT_JPEG, TheGlobalData->m_jpegQuality); + disp = DESTROY_MESSAGE; + break; + } + + case GameMessage::MSG_META_TAKE_SCREENSHOT_PNG: + { + if (TheDisplay) + TheDisplay->takeScreenShot(SCREENSHOT_PNG); disp = DESTROY_MESSAGE; break; } diff --git a/Core/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/Core/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index 28f0fa8a247..20d89aeb645 100644 --- a/Core/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/Core/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -171,6 +171,7 @@ static const LookupListRec GameMessageMetaTypeNames[] = { "END_PREFER_SELECTION", GameMessage::MSG_META_END_PREFER_SELECTION }, { "TAKE_SCREENSHOT", GameMessage::MSG_META_TAKE_SCREENSHOT }, + { "TAKE_SCREENSHOT_PNG", GameMessage::MSG_META_TAKE_SCREENSHOT_PNG }, { "ALL_CHEER", GameMessage::MSG_META_ALL_CHEER }, { "BEGIN_CAMERA_ROTATE_LEFT", GameMessage::MSG_META_BEGIN_CAMERA_ROTATE_LEFT }, @@ -887,6 +888,26 @@ void MetaMap::generateMetaMap() map->m_usableIn = COMMANDUSABLE_GAME; } } + { + MetaMapRec *map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_TAKE_SCREENSHOT); + if (map->m_key == MK_NONE) + { + map->m_key = MK_F12; + map->m_transition = DOWN; + map->m_modState = NONE; + map->m_usableIn = COMMANDUSABLE_EVERYWHERE; + } + } + { + MetaMapRec *map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_TAKE_SCREENSHOT_PNG); + if (map->m_key == MK_NONE) + { + map->m_key = MK_F12; + map->m_transition = DOWN; + map->m_modState = CTRL; + map->m_usableIn = COMMANDUSABLE_EVERYWHERE; + } + } #if defined(RTS_DEBUG) { diff --git a/Core/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Core/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index d6216c00151..9bea5b26d4d 100644 --- a/Core/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Core/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -210,18 +210,6 @@ static Bool canSelectWrapper( Drawable *draw, void *userData ) return CanSelectDrawable( draw, dragSelecting ); } -//----------------------------------------------------------------------------- -/** - * Deselect all drawables, and emit a "TEAM_DESTROY" message, since - * the "team" was the group of currently selected units. - */ -static void deselectAll() -{ - - // deselect it all - TheInGameUI->deselectAllDrawables(); -} - //----------------------------------------------------------------------------- /** * Select the given drawable, without playing its sound. @@ -230,14 +218,14 @@ static void deselectAll() static Bool selectSingleDrawableWithoutSound( Drawable *draw ) { - // since we are single selecting a drawable, unselect everything else - deselectAll(); - - // do the drawable selection - TheInGameUI->selectDrawable( draw ); - Object *obj = draw->getObject(); if (obj != nullptr) { + // since we are single selecting a drawable, unselect everything else + TheInGameUI->deselectAllDrawables(); + + // do the drawable selection + TheInGameUI->selectDrawable(draw); + GameMessage *msg = TheMessageStream->appendMessage(GameMessage::MSG_CREATE_SELECTED_GROUP_NO_SOUND); msg->appendBooleanArgument(TRUE); msg->appendObjectIDArgument(obj->getID()); @@ -893,7 +881,7 @@ GameMessageDisposition SelectionTranslator::onMouseLeftClick(MAYBE_UNUSED const { if (!addToGroup) { - deselectAll(); + TheInGameUI->deselectAllDrawables(); } GameMessage *newMsg = TheMessageStream->appendMessage(GameMessage::MSG_CREATE_SELECTED_GROUP); @@ -1063,7 +1051,7 @@ GameMessageDisposition SelectionTranslator::onRawMouseLeftButtonUp(MAYBE_UNUSED { if( !TheInGameUI->getPreventLeftClickDeselectionInAlternateMouseModeForOneClick() ) { - deselectAll(); + TheInGameUI->deselectAllDrawables(); m_lastGroupSelGroup = -1; } else @@ -1130,7 +1118,7 @@ GameMessageDisposition SelectionTranslator::onRawMouseRightButtonUp(MAYBE_UNUSED else if (!TheGlobalData->m_useAlternateMouse) { //No GUI command mode, so deselect everyone if we're in regular mouse mode. - deselectAll(); + TheInGameUI->deselectAllDrawables(); } } } @@ -1203,7 +1191,7 @@ GameMessageDisposition SelectionTranslator::onMetaSelectTeam(MAYBE_UNUSED const if ( performSelection ) { - TheInGameUI->deselectAllDrawables( false ); //No need to post message because we're just creating a new group! + TheInGameUI->deselectAllDrawables(); // no need to send two messages for selecting the same group. TheMessageStream->appendMessage((GameMessage::Type)(GameMessage::MSG_SELECT_TEAM0 + group)); diff --git a/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp index cd1b4d46403..25bd74ae41f 100644 --- a/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -26,7 +26,7 @@ #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine #include "Compression.h" -#include "strtok_r.h" +#include "WWLib/strtok_r.h" #include "Common/AudioEventRTS.h" #include "Common/CRCDebug.h" #include "Common/Debug.h" @@ -53,7 +53,7 @@ #include "GameLogic/VictoryConditions.h" #include "GameClient/DisconnectMenu.h" #include "GameClient/InGameUI.h" -#include "TARGA.h" +#include "WWLib/TARGA.h" static Bool hasValidTransferFileExtension(const AsciiString& filePath) { diff --git a/Core/GameEngine/Source/GameNetwork/GameInfo.cpp b/Core/GameEngine/Source/GameNetwork/GameInfo.cpp index 79cee60d0fa..83531102a3c 100644 --- a/Core/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -43,7 +43,7 @@ #include "GameNetwork/GameSpy/StagingRoomGameInfo.h" #include "GameNetwork/LANAPI.h" // for testing packet size #include "GameNetwork/LANAPICallbacks.h" // for testing packet size -#include "strtok_r.h" +#include "WWLib/strtok_r.h" diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp index 6ef0e2b987f..6e20717686d 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp @@ -36,8 +36,8 @@ #include "GameNetwork/GameSpy/PersistentStorageThread.h" #include "GameNetwork/GameSpy/ThreadUtils.h" -#include "mutex.h" -#include "thread.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" //------------------------------------------------------------------------- diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp index 93e454fe4b8..cf4c0bcb12f 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp @@ -39,8 +39,8 @@ #endif #include "GameNetwork/GameSpy/GameResultsThread.h" -#include "mutex.h" -#include "thread.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" #include "Common/SubsystemInterface.h" diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 51dbcd6a181..d680973d9f6 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -41,9 +41,9 @@ #include "GameNetwork/GameSpy/PersistentStorageThread.h" #include "GameNetwork/GameSpy/ThreadUtils.h" -#include "strtok_r.h" -#include "mutex.h" -#include "thread.h" +#include "WWLib/strtok_r.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" #include "Common/MiniLog.h" @@ -59,7 +59,7 @@ void CheckServers(PEER peer); static LogClass s_pingLog("Ping.txt"); #define PING_LOG(x) s_pingLog.log x #else // DEBUG_LOGGING -#define PING_LOG(x) {} +#define PING_LOG(x) #endif // DEBUG_LOGGING #ifdef DEBUG_LOGGING @@ -69,7 +69,7 @@ static LogClass s_stateChangedLog("StateChanged.txt"); #else // DEBUG_LOGGING -#define STATECHANGED_LOG(x) {} +#define STATECHANGED_LOG(x) #endif // DEBUG_LOGGING diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp index a59587533f8..5636a1069dd 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp @@ -36,8 +36,8 @@ #include "GameNetwork/GameSpy/PersistentStorageThread.h" #include "GameNetwork/GameSpy/PeerDefs.h" -#include "mutex.h" -#include "thread.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" #include "Common/SubsystemInterface.h" diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp index 1f54cc19507..233671a7e86 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp @@ -39,8 +39,8 @@ #endif #include "GameNetwork/GameSpy/PingThread.h" -#include "mutex.h" -#include "thread.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" #include "Common/SubsystemInterface.h" diff --git a/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index 499a4cbc6b1..2445271916f 100644 --- a/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -30,7 +30,7 @@ #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine #include -#include "strtok_r.h" +#include "WWLib/strtok_r.h" #include "Common/GameEngine.h" #include "Common/GlobalData.h" #include "Common/MessageStream.h" diff --git a/Core/GameEngine/Source/GameNetwork/LANGameInfo.cpp b/Core/GameEngine/Source/GameNetwork/LANGameInfo.cpp index 24c995e2525..6fec7cd323b 100644 --- a/Core/GameEngine/Source/GameNetwork/LANGameInfo.cpp +++ b/Core/GameEngine/Source/GameNetwork/LANGameInfo.cpp @@ -34,7 +34,7 @@ #include "GameNetwork/LANGameInfo.h" #include "GameNetwork/LANAPICallbacks.h" #include "Common/MultiplayerSettings.h" -#include "strtok_r.h" +#include "WWLib/strtok_r.h" /* #include "GameNetwork/LAN.h" #include "GameNetwork/LANGame.h" diff --git a/Core/GameEngine/Source/GameNetwork/Network.cpp b/Core/GameEngine/Source/GameNetwork/Network.cpp index bac56e153b6..f45ff04812f 100644 --- a/Core/GameEngine/Source/GameNetwork/Network.cpp +++ b/Core/GameEngine/Source/GameNetwork/Network.cpp @@ -39,7 +39,7 @@ #include "GameNetwork/NetworkInterface.h" #include "GameNetwork/udp.h" #include "GameNetwork/Transport.h" -#include "strtok_r.h" +#include "WWLib/strtok_r.h" #include "GameClient/Shell.h" #include "Common/CRCDebug.h" #include "GameLogic/GameLogic.h" diff --git a/Core/GameEngineDevice/CMakeLists.txt b/Core/GameEngineDevice/CMakeLists.txt index 8a67c9fa07f..72f9fb1b30b 100644 --- a/Core/GameEngineDevice/CMakeLists.txt +++ b/Core/GameEngineDevice/CMakeLists.txt @@ -74,6 +74,7 @@ set(GAMEENGINEDEVICE_SRC Include/W3DDevice/GameClient/W3DTreeBuffer.h Include/W3DDevice/GameClient/W3DVideoBuffer.h Include/W3DDevice/GameClient/W3DView.h + Include/W3DDevice/GameClient/W3DScreenshot.h # Include/W3DDevice/GameClient/W3DVolumetricShadow.h Include/W3DDevice/GameClient/W3DWater.h Include/W3DDevice/GameClient/W3DWaterTracks.h @@ -174,6 +175,8 @@ set(GAMEENGINEDEVICE_SRC Source/W3DDevice/GameClient/W3DTreeBuffer.cpp Source/W3DDevice/GameClient/W3DVideoBuffer.cpp Source/W3DDevice/GameClient/W3DView.cpp + Source/W3DDevice/GameClient/W3DScreenshot.cpp + Source/W3DDevice/GameClient/stb_image_write_impl.cpp # Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp # Source/W3DDevice/GameClient/W3DWebBrowser.cpp Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -228,6 +231,7 @@ target_include_directories(corei_gameenginedevice_public INTERFACE target_link_libraries(corei_gameenginedevice_private INTERFACE corei_always corei_main + stb ) # GeneralsX @build BenderAI 13/02/2026 Platform-specific multimedia stubs diff --git a/Core/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h b/Core/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h index 32ea80a3498..3f4d62bbd62 100644 --- a/Core/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h +++ b/Core/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h @@ -23,7 +23,7 @@ #include "Common/AsciiString.h" #include "Common/GameAudio.h" #include "mss/mss.h" -#include "mutex.h" +#include "WWLib/mutex.h" class AudioEventRTS; diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/BaseHeightMap.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/BaseHeightMap.h index d5a4645eae2..119acd38e3f 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/BaseHeightMap.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/BaseHeightMap.h @@ -24,14 +24,14 @@ #pragma once -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "dx8wrapper.h" -#include "shader.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" #include "Lib/BaseType.h" #include "Common/GameType.h" #include "W3DDevice/GameClient/WorldHeightMap.h" diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/CameraShakeSystem.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/CameraShakeSystem.h index 5ce2c0b8464..a5dd7e04b75 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/CameraShakeSystem.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/CameraShakeSystem.h @@ -38,10 +38,10 @@ #pragma once -#include "always.h" -#include "vector3.h" -#include "multilist.h" -#include "mempool.h" +#include "WWLib/always.h" +#include "WWMath/vector3.h" +#include "WWLib/multilist.h" +#include "WWLib/mempool.h" class CameraClass; diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/FlatHeightMap.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/FlatHeightMap.h index 84a5f17dc59..814865040c8 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/FlatHeightMap.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/FlatHeightMap.h @@ -24,14 +24,14 @@ #pragma once -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "dx8wrapper.h" -#include "shader.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" #include "Lib/BaseType.h" #include "Common/GameType.h" #include "W3DDevice/GameClient/WorldHeightMap.h" diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/HeightMap.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/HeightMap.h index 1f20a4db26e..d4dae8a5c84 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/HeightMap.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/HeightMap.h @@ -24,14 +24,14 @@ #pragma once -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "dx8wrapper.h" -#include "shader.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" #include "Lib/BaseType.h" #include "Common/GameType.h" #include "W3DDevice/GameClient/WorldHeightMap.h" @@ -94,6 +94,8 @@ class HeightMapRenderObjClass : public BaseHeightMapRenderObjClass VERTEX_FORMAT *m_vertexBufferBackup; ///< In memory copy of the vertex buffer data for quick update of dynamic lighting. Int m_originX; ///< Origin point in the grid. Slides around. Int m_originY; ///< Origin point in the grid. Slides around. + Int m_desiredDrawWidth; // Regular draw width requested by the view system. + Int m_desiredDrawHeight; // Regular draw height requested by the view system. Int m_oversizeDrawWidth; // Oversize draw width required by mission scripts for cinematic sequences. Int m_oversizeDrawHeight; // Oversize draw height required by mission scripts for cinematic sequences. DX8IndexBufferClass *m_indexBuffer; ///. +*/ + +#pragma once + +#include "GameClient/Display.h" + +void W3D_TakeCompressedScreenshot(ScreenshotFormat format, Int jpegQuality); + +// Called once per frame on the main thread to show messages for screenshots +// that the screenshot thread has finished writing. +void W3D_UpdateScreenshotMessages(); + diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DSmudge.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DSmudge.h index cb7ea3da538..e93f6ccbb71 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DSmudge.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DSmudge.h @@ -21,7 +21,7 @@ #pragma once #include "GameClient/Smudge.h" -#include "sharebuf.h" +#include "WWLib/sharebuf.h" class SmudgeGroupClass; //forward reference. class Vector3; diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h index 1efbf5e5c00..cc3f7fabee3 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h @@ -47,13 +47,13 @@ //----------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------- -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "shader.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" #include "Lib/BaseType.h" #include "Common/GameType.h" #include "Common/AsciiString.h" diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainTracks.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainTracks.h index e13a96e7ee4..9c6e427b4e8 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainTracks.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainTracks.h @@ -24,13 +24,13 @@ #pragma once -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "shader.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" #include "Lib/BaseType.h" #define MAX_TRACK_EDGE_COUNT 100 //maximum number of edges or divisions in track mark diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h index db2abe59ed2..86e03ea05c8 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h @@ -47,14 +47,14 @@ //----------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------- -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "texture.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "shader.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/texture.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" #include "Lib/BaseType.h" #include "Common/GameType.h" #include "Common/AsciiString.h" diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h index df899b086f4..1e8546c82a6 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h @@ -327,6 +327,7 @@ class W3DView : public View, public SubsystemInterface void pitchCameraOneFrame(); ///< Do one frame of a pitch camera movement. void getAxisAlignedViewRegion(Region3D &axisAlignedRegion); ///< Find 3D Region enclosing all possible drawables. void calcDeltaScroll(Coord2D &screenDelta); + bool getDesiredTerrainDrawSize(ICoord2D &dimensions) const; void updateTerrain(); // (gth) C&C3 animation controlled camera feature diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h index 284eeff3fec..b0074fa734a 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h @@ -26,14 +26,14 @@ #pragma once -#include "always.h" -#include "rendobj.h" -#include "w3d_file.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "shader.h" -#include "vertmaterial.h" -#include "light.h" +#include "WWLib/always.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/shader.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/light.h" #include "Lib/BaseType.h" #include "Common/GameType.h" #include "Common/Snapshot.h" diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h index 66c03dd25ea..3973080637a 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h @@ -123,8 +123,6 @@ class WorldHeightMap : public RefCountClass, enum { NORMAL_DRAW_WIDTH = 1 + 4*VERTEX_BUFFER_TILE_LENGTH, NORMAL_DRAW_HEIGHT = 1 + 4*VERTEX_BUFFER_TILE_LENGTH, - STRETCH_DRAW_WIDTH = 1 + 2*VERTEX_BUFFER_TILE_LENGTH, - STRETCH_DRAW_HEIGHT = 1 + 2*VERTEX_BUFFER_TILE_LENGTH, LOW_ANGLE_DRAW_WIDTH = 1 + (NORMAL_DRAW_WIDTH-1) * 2, LOW_ANGLE_DRAW_HEIGHT = 1 + (NORMAL_DRAW_HEIGHT-1) * 2, }; @@ -244,8 +242,8 @@ class WorldHeightMap : public RefCountClass, UnsignedByte *getDataPtr() {return m_data;} - Int getXExtent() {return m_width;} /// -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "Common/GlobalData.h" @@ -340,7 +340,7 @@ void BaseHeightMapRenderObjClass::adjustTerrainLOD(Int adj) m_shroud->reset(); //need reset here since initHeightData will load new shroud. BaseHeightMapRenderObjClass *newROBJ = nullptr; - if (TheGlobalData->m_terrainLOD==7) { + if (TheGlobalData->m_terrainLOD == TERRAIN_LOD_MAX) { newROBJ = TheHeightMap; if (newROBJ==nullptr) { newROBJ = NEW_REF( HeightMapRenderObjClass, () ); @@ -351,8 +351,7 @@ void BaseHeightMapRenderObjClass::adjustTerrainLOD(Int adj) newROBJ = NEW_REF( FlatHeightMapRenderObjClass, () ); } } - if (TheGlobalData->m_terrainLOD == 5) - newROBJ = nullptr; + RTS3DScene *pMyScene = (RTS3DScene *)Scene; if (pMyScene) { pMyScene->Remove_Render_Object(this); diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/CameraShakeSystem.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/CameraShakeSystem.cpp index 4d17d6eb417..771a47a6581 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/CameraShakeSystem.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/CameraShakeSystem.cpp @@ -37,13 +37,13 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "Common/GlobalData.h" #include "Common/PerfTimer.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index ddcf34c2296..1d2db2be3f8 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -181,11 +181,11 @@ LogClass BonePosLog("bonePositions.txt"); #else // DEBUG_CRC -#define BONEPOS_LOG(x) {} -#define BONEPOS_DUMPMATRIX3D(x) {} -#define BONEPOS_DUMPMATRIX3DNAMED(x, y) {} -#define BONEPOS_DUMPREAL(x) {} -#define BONEPOS_DUMPREALNAMED(x, y) {} +#define BONEPOS_LOG(x) +#define BONEPOS_DUMPMATRIX3D(x) +#define BONEPOS_DUMPMATRIX3DNAMED(x, y) +#define BONEPOS_DUMPREAL(x) +#define BONEPOS_DUMPREALNAMED(x, y) #endif // DEBUG_CRC diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp index e1ccad4a3ef..c2daacdf927 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp @@ -49,13 +49,13 @@ #include "W3DDevice/GameClient/FlatHeightMap.h" #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "Common/GlobalData.h" #include "Common/PerfTimer.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp index 0789177cf81..4987a8071c1 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp @@ -50,13 +50,13 @@ #ifndef USE_FLAT_HEIGHT_MAP // Flat height map uses flattened textures. jba. [3/20/2003] #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "Common/GlobalData.h" #include "Common/PerfTimer.h" @@ -1048,6 +1048,8 @@ m_vertexBufferTiles(nullptr), m_vertexBufferBackup(nullptr), m_originX(0), m_originY(0), +m_desiredDrawWidth(WorldHeightMap::NORMAL_DRAW_WIDTH), +m_desiredDrawHeight(WorldHeightMap::NORMAL_DRAW_HEIGHT), m_oversizeDrawWidth(0), m_oversizeDrawHeight(0), m_indexBuffer(nullptr), @@ -1081,45 +1083,19 @@ void HeightMapRenderObjClass::adjustTerrainLOD(Int adj) case TERRAIN_LOD_MIN: TheWritableGlobalData->m_useCloudMap = false; TheWritableGlobalData->m_useLightMap = false ; TheWritableGlobalData->m_useWaterPlane = false; - TheWritableGlobalData->m_stretchTerrain = false; - TheWritableGlobalData->m_useHalfHeightMap = true; - break; - case TERRAIN_LOD_HALF_CLOUDS: TheWritableGlobalData->m_useCloudMap = true; - TheWritableGlobalData->m_useLightMap = true; - TheWritableGlobalData->m_useWaterPlane = false; - TheWritableGlobalData->m_stretchTerrain = false; - TheWritableGlobalData->m_useHalfHeightMap = true; - break; - case TERRAIN_LOD_STRETCH_NO_CLOUDS: TheWritableGlobalData->m_useCloudMap = false; - TheWritableGlobalData->m_useLightMap = false; - TheWritableGlobalData->m_useWaterPlane = false; - TheWritableGlobalData->m_stretchTerrain = true; - TheWritableGlobalData->m_useHalfHeightMap = false; - break; - case TERRAIN_LOD_STRETCH_CLOUDS: TheWritableGlobalData->m_useCloudMap = true; - TheWritableGlobalData->m_useLightMap = true; - TheWritableGlobalData->m_useWaterPlane = false; - TheWritableGlobalData->m_stretchTerrain = true; - TheWritableGlobalData->m_useHalfHeightMap = false; break; case TERRAIN_LOD_NO_CLOUDS: TheWritableGlobalData->m_useCloudMap = false; TheWritableGlobalData->m_useLightMap = false; TheWritableGlobalData->m_useWaterPlane = false; - TheWritableGlobalData->m_stretchTerrain = false; - TheWritableGlobalData->m_useHalfHeightMap = false; break; default: case TERRAIN_LOD_NO_WATER: TheWritableGlobalData->m_useCloudMap = true; TheWritableGlobalData->m_useLightMap = true; TheWritableGlobalData->m_useWaterPlane = false; - TheWritableGlobalData->m_stretchTerrain = false; - TheWritableGlobalData->m_useHalfHeightMap = false; break; case TERRAIN_LOD_MAX: TheWritableGlobalData->m_useCloudMap = true; TheWritableGlobalData->m_useLightMap = true; TheWritableGlobalData->m_useWaterPlane = true; - TheWritableGlobalData->m_stretchTerrain = false; - TheWritableGlobalData->m_useHalfHeightMap = false; break; } if (m_map==nullptr) return; @@ -1178,17 +1154,13 @@ void HeightMapRenderObjClass::oversizeTerrain(Int tilesToOversize) { m_oversizeDrawWidth = WorldHeightMap::NORMAL_DRAW_WIDTH + VERTEX_BUFFER_TILE_LENGTH * tilesToOversize; m_oversizeDrawHeight = WorldHeightMap::NORMAL_DRAW_HEIGHT + VERTEX_BUFFER_TILE_LENGTH * tilesToOversize; - m_oversizeDrawWidth = std::min(m_oversizeDrawWidth, m_map->getXExtent()); - m_oversizeDrawHeight = std::min(m_oversizeDrawHeight, m_map->getYExtent()); - setTerrainDrawSize(m_oversizeDrawWidth, m_oversizeDrawHeight); + setTerrainDrawSize(0, 0); } else { m_oversizeDrawWidth = 0; m_oversizeDrawHeight = 0; - Int width = std::min((Int)WorldHeightMap::NORMAL_DRAW_WIDTH, m_map->getXExtent()); - Int height = std::min((Int)WorldHeightMap::NORMAL_DRAW_HEIGHT, m_map->getYExtent()); - setTerrainDrawSize(width, height); + setTerrainDrawSize(m_desiredDrawWidth, m_desiredDrawHeight); } } @@ -1197,15 +1169,17 @@ void HeightMapRenderObjClass::setTerrainDrawSize(Int width, Int height) if (m_map == nullptr) return; - if (m_oversizeDrawWidth != 0) - width = m_oversizeDrawWidth; - else - width = std::min(width, m_map->getXExtent()); + if (width > 0) + m_desiredDrawWidth = width; - if (m_oversizeDrawHeight != 0) - height = m_oversizeDrawHeight; - else - height = std::min(height, m_map->getYExtent()); + if (height > 0) + m_desiredDrawHeight = height; + + width = std::max(m_oversizeDrawWidth, m_desiredDrawWidth); + height = std::max(m_oversizeDrawHeight, m_desiredDrawHeight); + + width = std::min(width, m_map->getXExtent()); + height = std::min(height, m_map->getYExtent()); if (width == m_map->getDrawWidth() && height == m_map->getDrawHeight()) return; @@ -1670,8 +1644,17 @@ void HeightMapRenderObjClass::updateCenter(CameraClass *camera, const Vector3 *c BaseHeightMapRenderObjClass::updateCenter(camera, cameraPivot, pLightsIterator); + m_updating = true; + if (m_x >= m_map->getXExtent() && m_y >= m_map->getYExtent()) - { + { + if (m_needFullUpdate) + { + m_needFullUpdate = false; + updateBlock(0, 0, m_x-1, m_y-1, m_map, pLightsIterator); + } + + m_updating = false; return; // no need to center. } @@ -1792,7 +1775,6 @@ void HeightMapRenderObjClass::updateCenter(CameraClass *camera, const Vector3 *c WorldHeightMap::DrawArea newDrawArea = m_map->createDrawArea(newOrgX, newOrgY); - m_updating = true; if (m_needFullUpdate) { m_needFullUpdate = false; diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp index a8abfd453a1..4c95863b2bb 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp @@ -34,7 +34,7 @@ #include "WW3D2/hanim.h" #include "WW3D2/camera.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "W3DDevice/Common/W3DConvert.h" #include "W3DDevice/GameClient/W3DMouse.h" @@ -44,8 +44,8 @@ #include "GameClient/Display.h" #include "GameClient/Image.h" #include "GameClient/InGameUI.h" -#include "mutex.h" -#include "thread.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" //Since there can't be more than 1 mouse, might as well keep these static. diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp index 5696e8fdc62..089908ba5d8 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp @@ -48,7 +48,7 @@ #include "W3DDevice/GameClient/W3DPropBuffer.h" -#include +#include #include "Common/GameUtility.h" #include "Common/Geometry.h" #include "Common/PerfTimer.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp new file mode 100644 index 00000000000..b42ee1b7e9d --- /dev/null +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp @@ -0,0 +1,258 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2025 TheSuperHackers +** +** 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 . +*/ + +#include "W3DDevice/GameClient/W3DScreenshot.h" +#include "Common/GlobalData.h" +#include "GameClient/GameText.h" +#include "GameClient/InGameUI.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/surfaceclass.h" +#include "WWLib/mpsc_intrusive_queue.h" +#include + +#ifndef _WIN32 +#include +#include +#endif + +struct ScreenshotThreadData +{ + ScreenshotThreadData() + : pixelData(nullptr) + { + } + + ~ScreenshotThreadData() + { + delete[] pixelData; + } + + unsigned char* pixelData; // is owner + unsigned int width; + unsigned int height; + unsigned int pitch; + bool is16Bit; + char userDataDirectory[_MAX_PATH]; + char leafname[_MAX_FNAME]; + int quality; + ScreenshotFormat format; +}; + +// TheInGameUI is not thread safe, so the screenshot threads cannot show the success message +// themselves. Each thread pushes the written filename onto this queue and the main thread +// shows all pending messages in W3D_UpdateScreenshotMessages, so no message is lost when +// multiple screenshot threads finish within the same frame. +struct ScreenshotWrittenMessage +{ + ScreenshotWrittenMessage* next; + char leafname[_MAX_FNAME]; +}; +static MPSCIntrusiveQueue s_screenshotWrittenQueue; + +#ifdef _WIN32 +static DWORD WINAPI screenshotThreadFunc(LPVOID param) +{ + ScreenshotThreadData* data = static_cast(param); +#else +static void screenshotThreadFunc(ScreenshotThreadData* data) +{ +#endif + + // TheSuperHackers @feature bobtista 08/07/2026 Save screenshots into a Screenshots subfolder + // to keep the user data root folder tidy. + char pathname[_MAX_PATH]; + strlcpy(pathname, data->userDataDirectory, ARRAY_SIZE(pathname)); + strlcat(pathname, "Screenshots\\", ARRAY_SIZE(pathname)); +#ifdef _WIN32 + CreateDirectory(pathname, nullptr); +#else + std::error_code ec; + std::filesystem::create_directory(pathname, ec); +#endif + strlcat(pathname, data->leafname, ARRAY_SIZE(pathname)); + + const unsigned int width = data->width; + const unsigned int height = data->height; + + // Convert to R8G8B8 for stb_image_write. + unsigned char* image = new unsigned char[3 * width * height]; + + if (!data->is16Bit) + { + // Convert A8R8G8B8/X8R8G8B8 to R8G8B8 + for (unsigned int y = 0; y < height; ++y) + { + const unsigned int* srcLine = reinterpret_cast(data->pixelData + y * data->pitch); + for (unsigned int x = 0; x < width; ++x) + { + const unsigned int argb = srcLine[x]; + const unsigned int index = 3 * (x + y * width); + image[index + 0] = (unsigned char)(argb >> 16); // r + image[index + 1] = (unsigned char)(argb >> 8); // g + image[index + 2] = (unsigned char)(argb >> 0); // b + } + } + } + else + { + // Convert R5G6B5 to R8G8B8 + for (unsigned int y = 0; y < height; ++y) + { + const unsigned short* srcLine = reinterpret_cast(data->pixelData + y * data->pitch); + for (unsigned int x = 0; x < width; ++x) + { + const unsigned short rgb = srcLine[x]; + const unsigned int index = 3 * (x + y * width); + image[index + 0] = (unsigned char)((rgb & 0xF800) >> 8); // r + image[index + 1] = (unsigned char)((rgb & 0x07E0) >> 3); // g + image[index + 2] = (unsigned char)((rgb & 0x001F) << 3); // b + } + } + } + + int success = 0; + switch (data->format) + { + case SCREENSHOT_JPEG: + success = stbi_write_jpg(pathname, width, height, 3, image, data->quality); + break; + case SCREENSHOT_PNG: + success = stbi_write_png(pathname, width, height, 3, image, width * 3); + break; + } + + if (success) + { + ScreenshotWrittenMessage* message = new ScreenshotWrittenMessage; + strlcpy(message->leafname, data->leafname, ARRAY_SIZE(message->leafname)); + s_screenshotWrittenQueue.Push(message); + } + else + { + DEBUG_LOG(("Failed to write screenshot %s", pathname)); + } + + delete[] image; + delete data; + +#ifdef _WIN32 + return success; +#endif +} + +void W3D_UpdateScreenshotMessages() +{ + ScreenshotWrittenMessage* message = s_screenshotWrittenQueue.Flush(); + while (message != nullptr) + { + UnicodeString ufileName; + ufileName.translate(message->leafname); + TheInGameUI->message(TheGameText->fetch("GUI:ScreenCapture"), ufileName.str()); + ScreenshotWrittenMessage* next = message->next; + delete message; + message = next; + } +} + +void W3D_TakeCompressedScreenshot(ScreenshotFormat format, Int jpegQuality) +{ + static constexpr const char* const ScreenshotFormatExtensions[] = { "jpg", "png" }; + static_assert(ARRAY_SIZE(ScreenshotFormatExtensions) == SCREENSHOT_FORMAT_COUNT, "Incorrect array size"); + + // The filename is created here so the timestamp matches the capture time. + char leafname[_MAX_FNAME]; + const char* extension = ScreenshotFormatExtensions[format]; + + SYSTEMTIME st; + GetLocalTime(&st); + sprintf(leafname, "sshot_%04d%02d%02d_%02d%02d%02d_%03d.%s", + st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, extension); + + // TheSuperHackers @bugfix xezon 21/05/2025 Get the back buffer and create a copy of the surface. + // Originally this code took the front buffer and tried to lock it. This does not work when the + // render view clips outside the desktop boundaries. It crashed the game. + SurfaceClass* surface = DX8Wrapper::_Get_DX8_Back_Buffer(); + SurfaceClass::SurfaceDescription surfaceDesc; + surface->Get_Description(surfaceDesc); + + // TheSuperHackers @bugfix bobtista 08/07/2026 Support the 16 bit back buffer format that the + // game uses when running in 16 bit color mode. Reading it with the 32 bit stride read garbage. + const bool is32Bit = surfaceDesc.Format == WW3D_FORMAT_A8R8G8B8 || surfaceDesc.Format == WW3D_FORMAT_X8R8G8B8; + const bool is16Bit = surfaceDesc.Format == WW3D_FORMAT_R5G6B5; + + if (!is32Bit && !is16Bit) + { + DEBUG_LOG(("Screenshot does not support back buffer format %d", (int)surfaceDesc.Format)); + surface->Release_Ref(); + return; + } + + SurfaceClass* surfaceCopy = NEW_REF(SurfaceClass, (DX8Wrapper::_Create_DX8_Surface(surfaceDesc.Width, surfaceDesc.Height, surfaceDesc.Format))); + DX8Wrapper::_Copy_DX8_Rects(surface->Peek_D3D_Surface(), nullptr, 0, surfaceCopy->Peek_D3D_Surface(), nullptr); + + surface->Release_Ref(); + surface = nullptr; + + struct Rect + { + int Pitch; + void* pBits; + } lrect; + + lrect.pBits = surfaceCopy->Lock(&lrect.Pitch); + if (lrect.pBits == nullptr) + { + surfaceCopy->Release_Ref(); + return; + } + + ScreenshotThreadData* threadData = new ScreenshotThreadData(); + threadData->width = surfaceDesc.Width; + threadData->height = surfaceDesc.Height; + threadData->pitch = lrect.Pitch; + threadData->is16Bit = is16Bit; + threadData->quality = jpegQuality; + threadData->format = format; + strlcpy(threadData->userDataDirectory, TheGlobalData->getPath_UserData().str(), ARRAY_SIZE(threadData->userDataDirectory)); + strlcpy(threadData->leafname, leafname, ARRAY_SIZE(threadData->leafname)); + + // Copy the locked surface with a single memcpy, including any row padding. The pixel + // conversion and all file operations are done on the screenshot thread to keep the + // main thread cheap. + threadData->pixelData = new unsigned char[threadData->pitch * threadData->height]; + memcpy(threadData->pixelData, lrect.pBits, threadData->pitch * threadData->height); + + surfaceCopy->Unlock(); + surfaceCopy->Release_Ref(); + surfaceCopy = nullptr; + +#ifdef _WIN32 + const HANDLE hThread = CreateThread(nullptr, 0, screenshotThreadFunc, threadData, 0, nullptr); + if (hThread) + { + CloseHandle(hThread); + } + else + { + delete threadData; + } +#else + std::thread t(screenshotThreadFunc, threadData); + t.detach(); +#endif +} diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp index 6d3568c35ec..80c4154e66b 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp @@ -53,8 +53,8 @@ // //----------------------------------------------------------------------------- -#include "dx8wrapper.h" -#include "assetmgr.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/assetmgr.h" #include "Lib/BaseType.h" #include "Common/file.h" #include "Common/FileSystem.h" @@ -71,7 +71,7 @@ #include "Common/GlobalData.h" #include "Common/GameLOD.h" #include "d3dx8tex.h" -#include "dx8caps.h" +#include "WW3D2/dx8caps.h" // Turn this on to turn off pixel shaders. jba[4/3/2003] diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp index ff627c558f7..f29f9803365 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp @@ -28,7 +28,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #include "Lib/BaseType.h" -#include "always.h" +#include "WWLib/always.h" #include "W3DDevice/GameClient/W3DSmudge.h" #include "W3DDevice/GameClient/W3DShaderManager.h" #include "Common/GameMemory.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp index 2ae0eedbd89..04e637acd33 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp @@ -48,8 +48,8 @@ #include "W3DDevice/GameClient/W3DTerrainBackground.h" -#include -#include +#include +#include #include "Common/GlobalData.h" #include "GameClient/View.h" #include "W3DDevice/GameClient/TerrainTex.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp index 8d14b156fe6..c5c557d2d2c 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp @@ -48,12 +48,12 @@ #include "Common/PerfTimer.h" #include "Common/GlobalData.h" #include "Common/Debug.h" -#include "texture.h" -#include "colmath.h" -#include "coltest.h" -#include "rinfo.h" -#include "camera.h" -#include "assetmgr.h" +#include "WW3D2/texture.h" +#include "WWMath/colmath.h" +#include "WW3D2/coltest.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/camera.h" +#include "WW3D2/assetmgr.h" #include "WW3D2/dx8wrapper.h" #include "WW3D2/scene.h" #include "GameLogic/TerrainLogic.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp index fa63226ed0f..e184c79865f 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp @@ -57,8 +57,8 @@ enum #include "W3DDevice/GameClient/W3DTreeBuffer.h" -#include -#include +#include +#include #include "Common/FramePacer.h" #include "Common/GameUtility.h" #include "Common/MapReaderWriterInfo.h" @@ -811,73 +811,7 @@ void W3DTreeBuffer::loadTreesInVertexAndIndexBuffers(RefRenderObjListIterator *p Vector3 normal(0.0f,0.0f,1.0f); diffuse = doLighting(&normal, objectLighting, &emissive, 0xFFFFFFFF, 1.0f); } - /* - * - // If we are doing reduced resolution terrain, do reduced - // poly trees. - Bool doPanel = (TheGlobalData->m_useHalfHeightMap || TheGlobalData->m_stretchTerrain); - - if (doPanel) { - if (m_trees[curTree].rotates) { - theSin = -lookAtVector.X; - theCos = lookAtVector.Y; - } - // panel start is index offset, there are 3 index per triangle. - if (m_trees[curTree].panelStart/3 + 2 > numIndex) { - continue; // not enough polygons for the offset. jba. - } - for (j=0; j<6; j++) { - i = ((Int *)pPoly)[j+m_trees[curTree].panelStart]; - if (m_curNumTreeVertices >= MAX_TREE_VERTEX) - break; - // Update the uv values. The W3D models each have their own texture, and - // we use one texture with all images in one, so we have to change the uvs to - // match. - Real U, V; - if (type==SHRUB) { - // shrub texture is tucked in the corner - U = ((512-64)+uvs[i].U*64.0f)/512.0f; - V = ((256-64)+uvs[i].V*64.0f)/256.0f; - } else if (type==FENCE) { - U = uvs[i].U*0.5f; - V = 1.0f + uvs[i].V; - } else { - U = typeOffset+uvs[i].U*0.5f; - V = uvs[i].V; - } - - curVb->u1 = U; - curVb->v1 = V/2.0; - Vector3 vLoc; - vLoc.X = pVert[i].X*scale*theCos - pVert[i].Y*scale*theSin; - vLoc.Y = pVert[i].Y*scale*theCos + pVert[i].X*scale*theSin; - - vLoc.X += loc.X; - vLoc.Y += loc.Y; - vLoc.Z = loc.Z + pVert[i].Z*scale; - - curVb->x = vLoc.X; - curVb->y = vLoc.Y; - curVb->z = vLoc.Z; - if (doVertexLighting) { - curVb->diffuse = doLighting(&vLoc, shadeR, shadeG, shadeB, m_trees[curTree].bounds, pDynamicLightsIterator); - } else { - curVb->diffuse = diffuse; - } - curVb++; - m_curNumTreeVertices++; - } - - for (i=0; i<6; i++) { - if (m_curNumTreeIndices+4 > MAX_TREE_INDEX) - break; - curIb--; - *curIb = startVertex + i; - m_curNumTreeIndices++; - } - } else { - */ Real Uscale = m_treeTypes[type].m_tileWidth * (Real)TILE_PIXEL_EXTENT / (Real)m_textureWidth; Real Vscale = m_treeTypes[type].m_tileWidth * (Real)TILE_PIXEL_EXTENT / (Real)m_textureHeight; Real UOffset = m_treeTypes[type].m_textureOrigin.x/(Real)m_textureWidth; diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index c63969bbc55..becc93b699d 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -3767,37 +3767,61 @@ void W3DView::Add_Camera_Shake (const Coord3D & position,float radius,float dura CameraShakerSystem.Add_Camera_Shake(vpos,radius,duration,power); } -void W3DView::updateTerrain() +bool W3DView::getDesiredTerrainDrawSize(ICoord2D &dimensions) const { - DEBUG_ASSERTCRASH(TheTerrainRenderObject != nullptr, ("TheTerrainRenderObject is null")); + if (TheGlobalData && TheGlobalData->m_drawEntireTerrain) + { + DEBUG_ASSERTCRASH(TheTerrainRenderObject != nullptr, ("TheTerrainRenderObject is null")); - RefRenderObjListIterator *it = W3DDisplay::m_3DScene->createLightsIterator(); - const Vector3 cameraPivot(m_pos.x, m_pos.y, m_pos.z); - const Real cameraPitch = asin(fabs(m_3DCamera->Get_Forward_Dir().Z)); - Int drawWidth; - Int drawHeight; + if (const WorldHeightMap *heightMap = TheTerrainRenderObject->getMap()) + { + dimensions.x = heightMap->getXExtent(); + dimensions.y = heightMap->getYExtent(); + return true; + } - if (cameraPitch > ViewDefaultLowPitchRadians) - { - drawWidth = WorldHeightMap::NORMAL_DRAW_WIDTH; - drawHeight = WorldHeightMap::NORMAL_DRAW_HEIGHT; + return false; } - else + + const Real cameraPitch = asin(fabs(m_3DCamera->Get_Forward_Dir().Z)); + + if (cameraPitch > ViewDefaultLowPitchRadians || !m_isUserControlled) { - // TheSuperHackers @tweak xezon 31/12/2025 Increases visible terrain area when lowering the camera pitch. - // Note: The default camera pitch in Generals was 37.5, which we prefer to keep the normal draw size for. - drawWidth = WorldHeightMap::LOW_ANGLE_DRAW_WIDTH; - drawHeight = WorldHeightMap::LOW_ANGLE_DRAW_HEIGHT; + // TheSuperHackers @info The scripted camera always uses the regular draw sizes + // and uses terrain oversize if it needs to enlarge. + dimensions.x = WorldHeightMap::NORMAL_DRAW_WIDTH; + dimensions.y = WorldHeightMap::NORMAL_DRAW_HEIGHT; + return true; } - const Real terrainScale = TheGlobalData->m_terrainDrawDistanceScale; - if (terrainScale != 1.0f) + // TheSuperHackers @tweak xezon 31/12/2025 Increases visible terrain area when lowering the camera pitch. + // Note: The default camera pitch in Generals was 37.5, which we prefer to keep the normal draw size for. + dimensions.x = WorldHeightMap::LOW_ANGLE_DRAW_WIDTH; + dimensions.y = WorldHeightMap::LOW_ANGLE_DRAW_HEIGHT; + return true; +} + +void W3DView::updateTerrain() +{ + DEBUG_ASSERTCRASH(TheTerrainRenderObject != nullptr, ("TheTerrainRenderObject is null")); + + ICoord2D drawSize; + + if (getDesiredTerrainDrawSize(drawSize)) { - drawWidth = static_cast(drawWidth * terrainScale); - drawHeight = static_cast(drawHeight * terrainScale); + const Real terrainScale = TheGlobalData->m_terrainDrawDistanceScale; + if (terrainScale != 1.0f) + { + drawSize.x = static_cast(drawSize.x * terrainScale); + drawSize.y = static_cast(drawSize.y * terrainScale); + } + TheTerrainRenderObject->setTerrainDrawSize(drawSize.x, drawSize.y); } - TheTerrainRenderObject->setTerrainDrawSize(drawWidth, drawHeight); + RefRenderObjListIterator *it = W3DDisplay::m_3DScene->createLightsIterator(); + + const Vector3 cameraPivot(m_pos.x, m_pos.y, m_pos.z); + TheTerrainRenderObject->updateCenter(m_3DCamera, &cameraPivot, it); if (it) diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index 949302c17f1..2baac653ac1 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -37,19 +37,19 @@ #include "W3DDevice/GameClient/W3DShroud.h" #include "W3DDevice/GameClient/W3DWaterTracks.h" #include "W3DDevice/GameClient/W3DAssetManager.h" -#include "texture.h" -#include "assetmgr.h" -#include "rinfo.h" -#include "camera.h" -#include "scene.h" -#include "dx8wrapper.h" -#include "light.h" +#include "WW3D2/texture.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/camera.h" +#include "WW3D2/scene.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/light.h" #include "d3dx8math.h" // GeneralsX @bugfix BenderAI 13/02/2026 Include d3dx8core.h for LPD3DXBUFFER #include "d3dx8core.h" -#include "simplevec.h" -#include "mesh.h" -#include "matinfo.h" +#include "WWLib/simplevec.h" +#include "WW3D2/mesh.h" +#include "WW3D2/matinfo.h" #include "Common/FramePacer.h" #include "Common/GameState.h" diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp index c8838bb59b0..b394ca0203a 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp @@ -55,12 +55,12 @@ #include "Common/UnicodeString.h" #include "Common/file.h" #include "Common/FileSystem.h" -#include "texture.h" -#include "colmath.h" -#include "coltest.h" -#include "rinfo.h" -#include "camera.h" -#include "assetmgr.h" +#include "WW3D2/texture.h" +#include "WWMath/colmath.h" +#include "WW3D2/coltest.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/camera.h" +#include "WW3D2/assetmgr.h" #include "WW3D2/dx8wrapper.h" //number of vertex pages allocated - allows double buffering of vertex updates. diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index b9cedbcab75..811fe34ca21 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -487,10 +487,6 @@ WorldHeightMap::WorldHeightMap(ChunkInputStream *pStrm, Bool logicalDataOnly): m_sourceTiles[i]=nullptr; m_edgeTiles[i]=nullptr; } - if (TheGlobalData && TheGlobalData->m_stretchTerrain) { - m_drawWidthX=STRETCH_DRAW_WIDTH; - m_drawHeightY=STRETCH_DRAW_HEIGHT; - } DataChunkInput file( pStrm ); @@ -529,10 +525,7 @@ WorldHeightMap::WorldHeightMap(ChunkInputStream *pStrm, Bool logicalDataOnly): } } } - if (TheGlobalData && TheGlobalData->m_drawEntireTerrain) { - m_drawWidthX=m_width; - m_drawHeightY=m_height; - } + if (m_drawWidthX > m_width) { m_drawWidthX = m_width; } @@ -2307,19 +2300,8 @@ Region2D WorldHeightMap::getDrawRegion2D() WorldHeightMap::DrawArea WorldHeightMap::createDrawArea(Int xOrg, Int yOrg) { DrawArea area; - area.sizeX = m_drawWidthX; - area.sizeY = m_drawHeightY; - - if (TheGlobalData && TheGlobalData->m_stretchTerrain) { - area.sizeX = STRETCH_DRAW_WIDTH; - area.sizeY = STRETCH_DRAW_HEIGHT; - } - if (TheGlobalData && TheGlobalData->m_drawEntireTerrain) { - area.sizeX = m_width; - area.sizeY = m_height; - } - area.sizeX = std::min(area.sizeX, m_width); - area.sizeY = std::min(area.sizeY, m_height); + area.sizeX = std::min(m_drawWidthX, m_width); + area.sizeY = std::min(m_drawHeightY, m_height); area.originX = clamp(0, xOrg, m_width - area.sizeX); area.originY = clamp(0, yOrg, m_height - area.sizeY); diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/stb_image_write_impl.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/stb_image_write_impl.cpp new file mode 100644 index 00000000000..2264ba2c403 --- /dev/null +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/stb_image_write_impl.cpp @@ -0,0 +1,21 @@ +/* +** Command & Conquer Generals(tm) +** Copyright 2025 TheSuperHackers +** +** 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 . +*/ + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include + diff --git a/Core/Libraries/Source/Compression/CompressionManager.cpp b/Core/Libraries/Source/Compression/CompressionManager.cpp index 975f731f01d..00e7d91ead7 100644 --- a/Core/Libraries/Source/Compression/CompressionManager.cpp +++ b/Core/Libraries/Source/Compression/CompressionManager.cpp @@ -34,7 +34,7 @@ // TheSuperHackers @todo Recover debug logging in this file? -#define DEBUG_LOG(x) {} +#define DEBUG_LOG(x) const char *CompressionManager::getCompressionNameByType( CompressionType compType ) { diff --git a/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp b/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp index 25d454c0b87..01d072a2581 100644 --- a/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp +++ b/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp @@ -30,7 +30,7 @@ #define NoxRead fread #define DbgMalloc malloc #define DbgFree free -#define DEBUG_LOG(x) {} +#define DEBUG_LOG(x) Bool DecompressFile (char *infile, char *outfile) { diff --git a/Core/Libraries/Source/WWVegas/WW3D2/aabtree.cpp b/Core/Libraries/Source/WWVegas/WW3D2/aabtree.cpp index 3978cc5b7c9..c0ded889965 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/aabtree.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/aabtree.cpp @@ -63,15 +63,15 @@ #include "aabtree.h" -#include "aabtreebuilder.h" -#include "wwdebug.h" -#include "tri.h" -#include "meshgeometry.h" +#include "WW3D2/aabtreebuilder.h" +#include "WWDebug/wwdebug.h" +#include "WWMath/tri.h" +#include "WW3D2/meshgeometry.h" #include "coltest.h" #include "inttest.h" -#include "colmathinlines.h" -#include "w3d_file.h" -#include "chunkio.h" +#include "WWMath/colmathinlines.h" +#include "WW3D2/w3d_file.h" +#include "WWLib/chunkio.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/aabtree.h b/Core/Libraries/Source/WWVegas/WW3D2/aabtree.h index 8521736b726..54c21044598 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/aabtree.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/aabtree.h @@ -39,17 +39,17 @@ #pragma once -#include "always.h" -#include "simplevec.h" -#include "vector3.h" -#include "Vector3i.h" -#include "aaplane.h" -#include "bittype.h" -#include "colmath.h" -#include "wwdebug.h" -#include "aabtreebuilder.h" -#include "obbox.h" -#include +#include "WWLib/always.h" +#include "WWLib/simplevec.h" +#include "WWMath/vector3.h" +#include "WWMath/Vector3i.h" +#include "WWMath/aaplane.h" +#include "WWLib/bittype.h" +#include "WWMath/colmath.h" +#include "WWDebug/wwdebug.h" +#include "WW3D2/aabtreebuilder.h" +#include "WWMath/obbox.h" +#include #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp index 1821c4b213b..99a68de586a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp @@ -36,12 +36,12 @@ #include "agg_def.h" #include "htree.h" #include "w3derr.h" -#include "chunkio.h" -#include "wwdebug.h" -#include "assetmgr.h" +#include "WWLib/chunkio.h" +#include "WWDebug/wwdebug.h" +#include "WW3D2/assetmgr.h" #include "matinfo.h" #include "texture.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" // GeneralsX @build BenderAI 10/02/2026 - guard Windows headers #ifdef _WIN32 diff --git a/Core/Libraries/Source/WWVegas/WW3D2/agg_def.h b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.h index 987d423a8f4..97228dfb374 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/agg_def.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.h @@ -36,10 +36,10 @@ #include "proto.h" #include "rendobj.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "w3derr.h" -#include "Vector.h" -#include "bittype.h" +#include "WWLib/Vector.h" +#include "WWLib/bittype.h" #ifdef _UNIX #include "osdep.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp index bf89eb93e77..be3d790d3ba 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp @@ -38,20 +38,20 @@ // #include "animatedsoundmgr.h" -#include "INI.h" -#include "inisup.h" -#include "ffactory.h" -#include "WWFILE.h" -#include "definition.h" -#include "definitionmgr.h" -#include "definitionclassids.h" -#include "WWAudio.h" -#include "AudibleSound.h" +#include "WWLib/INI.h" +#include "WWLib/inisup.h" +#include "WWLib/ffactory.h" +#include "WWLib/WWFILE.h" +#include "WWSaveLoad/definition.h" +#include "WWSaveLoad/definitionmgr.h" +#include "WWSaveLoad/definitionclassids.h" +#include "WWAudio/WWAudio.h" +#include "WWAudio/AudibleSound.h" #include "htree.h" #include "hanim.h" #include "soundlibrarybridge.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" ////////////////////////////////////////////////////////////////////// // Static member initialization diff --git a/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h index 1ea067fc463..34aeb811a38 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h @@ -39,9 +39,9 @@ #pragma once -#include "simplevec.h" -#include "Vector.h" -#include "hashtemplate.h" +#include "WWLib/simplevec.h" +#include "WWLib/Vector.h" +#include "WWLib/hashtemplate.h" ////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp index 22d67d5c716..2423f17c67c 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp @@ -17,9 +17,9 @@ */ #include "assetstatus.h" -#include "hashtemplate.h" -#include "wwstring.h" -#include "RAWFILE.h" +#include "WWLib/hashtemplate.h" +#include "WWLib/wwstring.h" +#include "WWLib/RAWFILE.h" AssetStatusClass AssetStatusClass::Instance; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.h b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.h index bb25aa729ce..f5ea1e4d630 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.h @@ -18,8 +18,8 @@ #pragma once -#include "always.h" -#include "hashtemplate.h" +#include "WWLib/always.h" +#include "WWLib/hashtemplate.h" class AssetStatusClass { diff --git a/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp b/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp index 9bba18e5f34..a4e695f408e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp @@ -17,7 +17,7 @@ */ #include "bitmaphandler.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "colorspace.h" void Bitmap_Assert(bool condition) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h b/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h index d12ceb63c5d..aeada33dc28 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h @@ -18,9 +18,9 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "ww3dformat.h" -#include "vector3.h" +#include "WWMath/vector3.h" #include "colorspace.h" void Bitmap_Assert(bool condition); diff --git a/Core/Libraries/Source/WWVegas/WW3D2/bmp2d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/bmp2d.cpp index 50c02411181..27090e0293b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/bmp2d.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/bmp2d.cpp @@ -38,11 +38,11 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "bmp2d.h" -#include "pot.h" -#include "ww3d.h" +#include "WWMath/pot.h" +#include "WW3D2/ww3d.h" #include "texture.h" #include "surfaceclass.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "textureloader.h" #include "ww3dformat.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/bwrender.cpp b/Core/Libraries/Source/WWVegas/WW3D2/bwrender.cpp index 9f8f9dbfca1..4b508def314 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/bwrender.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/bwrender.cpp @@ -38,7 +38,7 @@ #include "bwrender.h" -#include "vp.h" +#include "WWMath/vp.h" BWRenderClass::Buffer::Buffer(unsigned char* buffer_, int scale_) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/bwrender.h b/Core/Libraries/Source/WWVegas/WW3D2/bwrender.h index 0c6db33b9de..806097cf657 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/bwrender.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/bwrender.h @@ -38,10 +38,10 @@ #pragma once -#include "always.h" -#include "vector2.h" -#include "vector3.h" -#include "Vector3i.h" +#include "WWLib/always.h" +#include "WWMath/vector2.h" +#include "WWMath/vector3.h" +#include "WWMath/Vector3i.h" /** ** BWRenderClass diff --git a/Core/Libraries/Source/WWVegas/WW3D2/classid.h b/Core/Libraries/Source/WWVegas/WW3D2/classid.h index a734133cfb3..31908e043bf 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/classid.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/classid.h @@ -34,7 +34,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" /* ** enum of all the WW3D class IDs. diff --git a/Core/Libraries/Source/WWVegas/WW3D2/collect.cpp b/Core/Libraries/Source/WWVegas/WW3D2/collect.cpp index 9d35c5931cb..21263e451b4 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/collect.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/collect.cpp @@ -72,12 +72,12 @@ #include "collect.h" -#include "chunkio.h" -#include "camera.h" -#include "wwdebug.h" +#include "WWLib/chunkio.h" +#include "WW3D2/camera.h" +#include "WWDebug/wwdebug.h" #include "snapPts.h" -#include "assetmgr.h" -#include "ww3d.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/ww3d.h" #include "w3derr.h" //#include "sr.hpp" @@ -809,7 +809,7 @@ void CollectionClass::Update_Obj_Space_Bounding_Volumes() { int i; if (SubObjects.Count() <= 0) { - BoundSphere = SphereClass(Vector3(0,0,0),0); + BoundSphere = SphereClass(); BoundBox.Center.Set(0,0,0); BoundBox.Extent.Set(0,0,0); return; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/collect.h b/Core/Libraries/Source/WWVegas/WW3D2/collect.h index 8fcc589542d..676a4a97157 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/collect.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/collect.h @@ -38,10 +38,10 @@ #include "rendobj.h" #include "composite.h" -#include "Vector.h" +#include "WWLib/Vector.h" #include "proto.h" -#include "w3d_file.h" -#include "wwstring.h" +#include "WW3D2/w3d_file.h" +#include "WWLib/wwstring.h" #include "proxy.h" class CollectionDefClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/colorspace.h b/Core/Libraries/Source/WWVegas/WW3D2/colorspace.h index e4974a00545..4b366e6f895 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/colorspace.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/colorspace.h @@ -39,7 +39,7 @@ #pragma once #include "dx8wrapper.h" -#include +#include void RGB_To_HSV(Vector3 &hsv,const Vector3 &rgb); void HSV_To_RGB(Vector3 &rgb, const Vector3 &hsv); diff --git a/Core/Libraries/Source/WWVegas/WW3D2/coltest.h b/Core/Libraries/Source/WWVegas/WW3D2/coltest.h index 5d86e248b33..7ebc2bce00e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/coltest.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/coltest.h @@ -39,13 +39,13 @@ #pragma once -#include "always.h" -#include "castres.h" -#include "lineseg.h" -#include "aabox.h" -#include "obbox.h" -#include "tri.h" -#include "colmath.h" +#include "WWLib/always.h" +#include "WWMath/castres.h" +#include "WWMath/lineseg.h" +#include "WWMath/aabox.h" +#include "WWMath/obbox.h" +#include "WWMath/tri.h" +#include "WWMath/colmath.h" #include "coltype.h" class RenderObjClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/composite.cpp b/Core/Libraries/Source/WWVegas/WW3D2/composite.cpp index 6a0d7b0811e..181547c3013 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/composite.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/composite.cpp @@ -56,7 +56,7 @@ #include "composite.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/composite.h b/Core/Libraries/Source/WWVegas/WW3D2/composite.h index e5a72d73bbc..66762ddde81 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/composite.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/composite.h @@ -37,7 +37,7 @@ #pragma once #include "rendobj.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" /* ** CompositeRenderObjClass diff --git a/Core/Libraries/Source/WWVegas/WW3D2/decalsys.cpp b/Core/Libraries/Source/WWVegas/WW3D2/decalsys.cpp index ff6e93eb84d..a7b54dc0b7b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/decalsys.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/decalsys.cpp @@ -49,9 +49,9 @@ #include "decalsys.h" #include "rendobj.h" -#include "mesh.h" -#include "decalmsh.h" -#include "matrixmapper.h" +#include "WW3D2/mesh.h" +#include "WW3D2/decalmsh.h" +#include "WW3D2/matrixmapper.h" #include "texture.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/decalsys.h b/Core/Libraries/Source/WWVegas/WW3D2/decalsys.h index 3d48a36426e..4042aad9d9b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/decalsys.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/decalsys.h @@ -38,10 +38,10 @@ #pragma once -#include "always.h" -#include "matrix3d.h" -#include "matrix4.h" -#include "obbox.h" +#include "WWLib/always.h" +#include "WWMath/matrix3d.h" +#include "WWMath/matrix4.h" +#include "WWMath/obbox.h" #include "robjlist.h" #include "matpass.h" #include "projector.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp b/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp index 9e6c66846bf..ce5a900357f 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp @@ -78,15 +78,15 @@ #include "distlod.h" -#include "nstrdup.h" -#include "ww3d.h" -#include "assetmgr.h" -#include "camera.h" +#include "WWLib/nstrdup.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/camera.h" #include "w3derr.h" -#include "wwdebug.h" -#include "chunkio.h" -#include "hlod.h" -#include "rinfo.h" +#include "WWDebug/wwdebug.h" +#include "WWLib/chunkio.h" +#include "WW3D2/hlod.h" +#include "WW3D2/rinfo.h" #include "coltest.h" #include "inttest.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp index 7a921f68d65..48e368a31c5 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp @@ -37,7 +37,7 @@ * Functions: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "always.h" +#include "WWLib/always.h" #include "dx8caps.h" #include "dx8wrapper.h" #include "formconv.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.h index 5637d847a86..a03bd541327 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8caps.h @@ -39,7 +39,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "ww3dformat.h" // GeneralsX @build fbraz 10/02/2026 Include DXVK d3d8.h on Linux #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.cpp index eb8a22d5730..a96d99c130b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.cpp @@ -40,7 +40,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "dx8fvf.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" #include static unsigned Get_FVF_Vertex_Size(unsigned FVF) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.h index f49b07886b4..43aa057b92a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8fvf.h @@ -41,12 +41,12 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" // GeneralsX @refactor BenderAI 10/02/2026 // Removed platform guards - DXVK provides d3d8.h on Linux #include #ifdef WWDEBUG -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #endif class StringClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp index 9245837f95b..578c6b82aec 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp @@ -41,9 +41,9 @@ #include "dx8indexbuffer.h" #include "dx8wrapper.h" #include "dx8caps.h" -#include "sphere.h" -#include "thread.h" -#include "wwmemlog.h" +#include "WWMath/sphere.h" +#include "WWLib/thread.h" +#include "WWDebug/wwmemlog.h" #define DEFAULT_IB_SIZE 5000 diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.h index 7b20cd3db73..3ae18aabe10 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.h @@ -38,9 +38,9 @@ #pragma once -#include "always.h" -#include "wwdebug.h" -#include "sphere.h" +#include "WWLib/always.h" +#include "WWDebug/wwdebug.h" +#include "WWMath/sphere.h" class DX8Wrapper; class SortingRendererClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8list.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8list.h index 38facb816f7..fdfa2431d12 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8list.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8list.h @@ -39,8 +39,8 @@ #pragma once -#include "always.h" -#include "multilist.h" +#include "WWLib/always.h" +#include "WWLib/multilist.h" /* diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h index 0d9a7a716ac..17b7558049a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h @@ -38,11 +38,11 @@ #pragma once -#include "always.h" -#include "meshmdl.h" +#include "WWLib/always.h" +#include "WW3D2/meshmdl.h" #include "dx8list.h" #include "sortingrenderer.h" -#include "mesh.h" +#include "WW3D2/mesh.h" #include "dx8wrapper.h" class DX8PolygonRendererClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index fe2ce1d75df..5cd19d90357 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -48,18 +48,18 @@ #include "dx8fvf.h" #include "dx8caps.h" #include "dx8rendererdebugger.h" -#include "wwdebug.h" -#include "wwprofile.h" -#include "wwmemlog.h" -#include "rinfo.h" +#include "WWDebug/wwdebug.h" +#include "WWDebug/wwprofile.h" +#include "WWDebug/wwmemlog.h" +#include "WW3D2/rinfo.h" #include "statistics.h" -#include "meshmdl.h" -#include "vp.h" -#include "decalmsh.h" +#include "WW3D2/meshmdl.h" +#include "WWMath/vp.h" +#include "WW3D2/decalmsh.h" #include "matpass.h" -#include "camera.h" +#include "WW3D2/camera.h" #include "stripoptimizer.h" -#include "meshgeometry.h" +#include "WW3D2/meshgeometry.h" /* ** Global Instance of the DX8MeshRender diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.h index 78b7a465d25..eb9e9f5dfb4 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.h @@ -39,14 +39,14 @@ #pragma once -#include "always.h" -#include "wwstring.h" -#include "simplevec.h" -#include "Vector.h" +#include "WWLib/always.h" +#include "WWLib/wwstring.h" +#include "WWLib/simplevec.h" +#include "WWLib/Vector.h" #include "dx8list.h" -#include "shader.h" +#include "WW3D2/shader.h" #include "dx8wrapper.h" -#include "meshmatdesc.h" +#include "WW3D2/meshmatdesc.h" class IndexBufferClass; class VertexBufferClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.cpp index 5cb7d0e27cc..bb0b3b0fb6f 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.cpp @@ -17,9 +17,9 @@ */ #include "dx8rendererdebugger.h" -#include "hashtemplate.h" -#include "mesh.h" -#include "meshmdl.h" +#include "WWLib/hashtemplate.h" +#include "WW3D2/mesh.h" +#include "WW3D2/meshmdl.h" static HashTemplateClass MeshHash; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.h index 555e654d70c..905d92d7eaf 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8rendererdebugger.h @@ -38,7 +38,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" class StringClass; class MeshClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8texman.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8texman.h index 84b8ebd4e25..c01001cb074 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8texman.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8texman.h @@ -39,12 +39,12 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "texture.h" #include "dx8wrapper.h" #include "ww3dformat.h" #include "dx8list.h" -#include "multilist.h" +#include "WWLib/multilist.h" class DX8TextureManagerClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp index 027d1c3cf36..a6551553239 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp @@ -43,8 +43,8 @@ #include "dx8wrapper.h" #include "dx8fvf.h" #include "dx8caps.h" -#include "thread.h" -#include "wwmemlog.h" +#include "WWLib/thread.h" +#include "WWDebug/wwmemlog.h" #include #define DEFAULT_VB_SIZE 5000 diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.h index 264caa33840..08ec118931b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.h @@ -39,8 +39,8 @@ #pragma once -#include "always.h" -#include "wwdebug.h" +#include "WWLib/always.h" +#include "WWDebug/wwdebug.h" #include "dx8fvf.h" const unsigned dynamic_fvf_type=D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX2|D3DFVF_DIFFUSE; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp index 0c0c5950016..d2f8efa1297 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp @@ -31,7 +31,7 @@ //****************************************************************************************** #include "dx8webbrowser.h" -#include "ww3d.h" +#include "WW3D2/ww3d.h" #include "dx8wrapper.h" #if ENABLE_EMBEDDED_BROWSER diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index f7bba15c55e..365260f3ada 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -65,34 +65,34 @@ #include "dx8vertexbuffer.h" #include "dx8indexbuffer.h" #include "dx8renderer.h" -#include "ww3d.h" -#include "camera.h" -#include "wwstring.h" -#include "matrix4.h" -#include "vertmaterial.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/camera.h" +#include "WWLib/wwstring.h" +#include "WWMath/matrix4.h" +#include "WW3D2/vertmaterial.h" #include "rddesc.h" -#include "lightenvironment.h" +#include "WW3D2/lightenvironment.h" #include "statistics.h" -#include "registry.h" -#include "boxrobj.h" +#include "WWLib/registry.h" +#include "WW3D2/boxrobj.h" #include "pointgr.h" -#include "render2d.h" +#include "WW3D2/render2d.h" #include "sortingrenderer.h" #include "shattersystem.h" -#include "light.h" -#include "assetmgr.h" +#include "WW3D2/light.h" +#include "WW3D2/assetmgr.h" #include "textureloader.h" #include "missingtexture.h" -#include "thread.h" +#include "WWLib/thread.h" #include -#include "pot.h" -#include "wwprofile.h" -#include "ffactory.h" +#include "WWMath/pot.h" +#include "WWDebug/wwprofile.h" +#include "WWLib/ffactory.h" #include "dx8caps.h" #include "formconv.h" #include "dx8texman.h" -#include "bound.h" -#include "DbgHelpGuard.h" +#include "WWLib/bound.h" +#include "WWLib/DbgHelpGuard.h" #include "shdlib.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h index bfc378ef077..a4abaa5ddcc 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h @@ -41,25 +41,25 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "dllist.h" // GeneralsX @build BenderAI 10/02/2026 // Use angle brackets (not quotes) to skip local d3d8.h stub and get DXVK headers // DXVK's d3d8.h includes d3d8types.h internally - no manual includes needed #include -#include "matrix4.h" +#include "WWMath/matrix4.h" #include "statistics.h" -#include "wwstring.h" -#include "lightenvironment.h" -#include "shader.h" -#include "vector4.h" -#include "cpudetect.h" +#include "WWLib/wwstring.h" +#include "WW3D2/lightenvironment.h" +#include "WW3D2/shader.h" +#include "WWMath/vector4.h" +#include "WWLib/cpudetect.h" #include "dx8caps.h" #include "texture.h" #include "dx8vertexbuffer.h" #include "dx8indexbuffer.h" -#include "vertmaterial.h" +#include "WW3D2/vertmaterial.h" /* ** Registry value names diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp index 03412bce96b..74276b2aecd 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp @@ -39,8 +39,8 @@ #include "dx8indexbuffer.h" #include "dx8wrapper.h" #include "sortingrenderer.h" -#include "rinfo.h" -#include "camera.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/camera.h" #include "dx8fvf.h" @@ -323,7 +323,7 @@ void DynamicMeshModel::Render(RenderInfoClass & rinfo) DX8Wrapper::Set_Shader(MatDesc->Get_Single_Shader(pass)); } - SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f); + SphereClass sphere; Get_Bounding_Sphere(&sphere); // If no texture, shader or material arrays for this pass just draw and go to next pass diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.h b/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.h index e024ab5d68f..0fcd9c29554 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.h @@ -34,8 +34,8 @@ #pragma once -#include "meshgeometry.h" -#include "meshmatdesc.h" +#include "WW3D2/meshgeometry.h" +#include "WW3D2/meshmatdesc.h" #include "matinfo.h" #include "rendobj.h" #include "polyinfo.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp index 1eb8462ac3c..b9ef97b93e7 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp @@ -38,13 +38,13 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "font3d.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "texture.h" #include -#include +#include #include "surfaceclass.h" #include "texture.h" -#include "vector2i.h" +#include "WWMath/vector2i.h" static SurfaceClass *_surface; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/font3d.h b/Core/Libraries/Source/WWVegas/WW3D2/font3d.h index 5d90c75de5f..4105e1ccb37 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/font3d.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/font3d.h @@ -34,10 +34,10 @@ #pragma once -#include "always.h" -#include "vector4.h" -#include "widestring.h" -#include "rect.h" +#include "WWLib/always.h" +#include "WWMath/vector4.h" +#include "WWLib/widestring.h" +#include "WWMath/rect.h" class TextureClass; class SurfaceClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/framgrab.h b/Core/Libraries/Source/WWVegas/WW3D2/framgrab.h index e3824cfa2ad..710b2c64d10 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/framgrab.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/framgrab.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #if defined (_MSC_VER) #pragma warning (push, 3) // (gth) system headers complain at warning level 4... diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hanim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hanim.cpp index 89a64a8f369..3770dc0ba95 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hanim.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/hanim.cpp @@ -37,13 +37,13 @@ #include "hanim.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "htree.h" -#include "motchan.h" -#include "chunkio.h" -#include "w3d_file.h" -#include "wwdebug.h" -#include +#include "WW3D2/motchan.h" +#include "WWLib/chunkio.h" +#include "WW3D2/w3d_file.h" +#include "WWDebug/wwdebug.h" +#include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hanim.h b/Core/Libraries/Source/WWVegas/WW3D2/hanim.h index 440551eaa41..3a47500c2e2 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hanim.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/hanim.h @@ -37,13 +37,13 @@ #pragma once -#include "always.h" -#include "quat.h" -#include "w3d_file.h" -#include "hash.h" -#include "mempool.h" -#include -#include +#include "WWLib/always.h" +#include "WWMath/quat.h" +#include "WW3D2/w3d_file.h" +#include "WWLib/hash.h" +#include "WWLib/mempool.h" +#include +#include struct NodeMotionStruct; class MotionChannelClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp index 3bc866b7517..ace4a88c04d 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp @@ -50,13 +50,13 @@ #include "hcanim.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "htree.h" -#include "motchan.h" -#include "chunkio.h" -#include "w3d_file.h" -#include "wwdebug.h" -#include +#include "WW3D2/motchan.h" +#include "WWLib/chunkio.h" +#include "WW3D2/w3d_file.h" +#include "WWDebug/wwdebug.h" +#include struct NodeCompressedMotionStruct diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hcanim.h b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.h index a64805d00fd..b7c85029c57 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hcanim.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.h @@ -37,11 +37,11 @@ #pragma once -#include "always.h" -#include "quat.h" -#include "w3d_file.h" -#include "SLIST.h" -#include "Vector.h" +#include "WWLib/always.h" +#include "WWMath/quat.h" +#include "WW3D2/w3d_file.h" +#include "WWLib/SLIST.h" +#include "WWLib/Vector.h" #include "hanim.h" struct NodeCompressedMotionStruct; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp index caf8039a474..7dcbe793b2e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp @@ -38,8 +38,8 @@ #include "hmdldef.h" #include -#include "w3d_file.h" -#include "chunkio.h" +#include "WW3D2/w3d_file.h" +#include "WWLib/chunkio.h" #include "snapPts.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.h b/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.h index 2f0835819d6..47570b209fe 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.h @@ -36,8 +36,8 @@ #pragma once -#include "always.h" -#include "w3d_file.h" +#include "WWLib/always.h" +#include "WW3D2/w3d_file.h" class FileClass; class ChunkLoadClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp b/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp index 15158407861..1f04fa29ba0 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp @@ -55,13 +55,13 @@ #include "hanim.h" #include "hcanim.h" #include -#include "wwmath.h" -#include "chunkio.h" -#include "w3d_file.h" -#include "wwmemlog.h" -#include "hrawanim.h" -#include "motchan.h" -#include "ww3d.h" +#include "WWMath/wwmath.h" +#include "WWLib/chunkio.h" +#include "WW3D2/w3d_file.h" +#include "WWDebug/wwmemlog.h" +#include "WW3D2/hrawanim.h" +#include "WW3D2/motchan.h" +#include "WW3D2/ww3d.h" /*********************************************************************************************** * HTreeClass::HTreeClass -- constructor * diff --git a/Core/Libraries/Source/WWVegas/WW3D2/htree.h b/Core/Libraries/Source/WWVegas/WW3D2/htree.h index 080968c10f9..7bbdb383160 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/htree.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/htree.h @@ -37,13 +37,13 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "pivot.h" -#include "quat.h" -#include "matrix3d.h" -#include "vector3.h" -#include "w3d_file.h" -#include "wwdebug.h" +#include "WWMath/quat.h" +#include "WWMath/matrix3d.h" +#include "WWMath/vector3.h" +#include "WW3D2/w3d_file.h" +#include "WWDebug/wwdebug.h" class HAnimClass; class HAnimComboClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp b/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp index 1709f956bb0..f4cd4b15d2e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp @@ -37,8 +37,8 @@ #include "intersec.h" -#include "camera.h" -#include "scene.h" +#include "WW3D2/camera.h" +#include "WW3D2/scene.h" #include "intersec.inl" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/intersec.h b/Core/Libraries/Source/WWVegas/WW3D2/intersec.h index 75b49640bd1..0914394f27f 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/intersec.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/intersec.h @@ -49,10 +49,10 @@ #pragma once -#include "always.h" -#include "matrix3d.h" +#include "WWLib/always.h" +#include "WWMath/matrix3d.h" #include "layer.h" -#include "sphere.h" +#include "WWMath/sphere.h" #include "coltype.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/intersec.inl b/Core/Libraries/Source/WWVegas/WW3D2/intersec.inl index 3fc05e586fb..b9ca0b9ff41 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/intersec.inl +++ b/Core/Libraries/Source/WWVegas/WW3D2/intersec.inl @@ -22,7 +22,7 @@ #ifndef INTERSEC_INL #define INTERSEC_INL -#include "camera.h" +#include "WW3D2/camera.h" /// debug code that will be tossed diff --git a/Core/Libraries/Source/WWVegas/WW3D2/inttest.h b/Core/Libraries/Source/WWVegas/WW3D2/inttest.h index 11b189f3e73..de97249bcd1 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/inttest.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/inttest.h @@ -38,11 +38,11 @@ #pragma once -#include "always.h" -#include "aabox.h" -#include "obbox.h" -#include "tri.h" -#include "colmath.h" +#include "WWLib/always.h" +#include "WWMath/aabox.h" +#include "WWMath/obbox.h" +#include "WWMath/tri.h" +#include "WWMath/colmath.h" #include "coltype.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/layer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/layer.cpp index 2ea246a4f76..65cf42df756 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/layer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/layer.cpp @@ -46,8 +46,8 @@ #include "layer.h" -#include "scene.h" -#include "camera.h" +#include "WW3D2/scene.h" +#include "WW3D2/camera.h" /*********************************************************************************************** diff --git a/Core/Libraries/Source/WWVegas/WW3D2/layer.h b/Core/Libraries/Source/WWVegas/WW3D2/layer.h index b92316b7abb..449db660d3a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/layer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/layer.h @@ -36,9 +36,9 @@ #pragma once -#include "always.h" -#include "LISTNODE.h" -#include "vector3.h" +#include "WWLib/always.h" +#include "WWLib/LISTNODE.h" +#include "WWMath/vector3.h" class SceneClass; class CameraClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp index efd53cb0372..0bfaa121587 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp @@ -48,11 +48,11 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "line3d.h" -#include "vertmaterial.h" -#include "shader.h" -#include "wwdebug.h" -#include "ww3d.h" -#include "rinfo.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/shader.h" +#include "WWDebug/wwdebug.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/rinfo.h" #include "dx8wrapper.h" #include "dx8vertexbuffer.h" #include "dx8indexbuffer.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/line3d.h b/Core/Libraries/Source/WWVegas/WW3D2/line3d.h index a1a325a91dd..7fb2be1fad8 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/line3d.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/line3d.h @@ -36,11 +36,11 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "rendobj.h" -#include "vector3.h" -#include "vector4.h" -#include "shader.h" +#include "WWMath/vector3.h" +#include "WWMath/vector4.h" +#include "WW3D2/shader.h" class VertexMaterialClass; class RenderInfoClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/matinfo.cpp b/Core/Libraries/Source/WWVegas/WW3D2/matinfo.cpp index e8c35fcc087..7113e636137 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/matinfo.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/matinfo.cpp @@ -36,8 +36,8 @@ #include "matinfo.h" -#include "wwdebug.h" -#include "meshmdl.h" +#include "WWDebug/wwdebug.h" +#include "WW3D2/meshmdl.h" #include "texture.h" MaterialInfoClass::MaterialInfoClass() diff --git a/Core/Libraries/Source/WWVegas/WW3D2/matinfo.h b/Core/Libraries/Source/WWVegas/WW3D2/matinfo.h index 61cda2a4278..a8fe13450ed 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/matinfo.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/matinfo.h @@ -36,12 +36,12 @@ #pragma once -#include "always.h" -#include "wwdebug.h" -#include "Vector.h" -#include "vertmaterial.h" +#include "WWLib/always.h" +#include "WWDebug/wwdebug.h" +#include "WWLib/Vector.h" +#include "WW3D2/vertmaterial.h" #include "texture.h" -#include "shader.h" +#include "WW3D2/shader.h" #ifdef _UNIX #include "osdep.h" #endif diff --git a/Core/Libraries/Source/WWVegas/WW3D2/matpass.cpp b/Core/Libraries/Source/WWVegas/WW3D2/matpass.cpp index f0a6dbb72b9..d300e5ffe36 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/matpass.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/matpass.cpp @@ -47,8 +47,8 @@ #include "matpass.h" -#include "vertmaterial.h" -#include "shader.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/shader.h" #include "texture.h" #include "statistics.h" #include "dx8wrapper.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/matpass.h b/Core/Libraries/Source/WWVegas/WW3D2/matpass.h index 2d969892480..53dd32afb62 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/matpass.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/matpass.h @@ -39,8 +39,8 @@ #pragma once -#include "always.h" -#include "shader.h" +#include "WWLib/always.h" +#include "WW3D2/shader.h" class TextureClass; class VertexMaterialClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/meshdam.cpp b/Core/Libraries/Source/WWVegas/WW3D2/meshdam.cpp index e8487eec36f..e05282725ac 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/meshdam.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/meshdam.cpp @@ -39,9 +39,9 @@ #include "meshdam.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "w3derr.h" -#include "chunkio.h" +#include "WWLib/chunkio.h" //#include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/meshdam.h b/Core/Libraries/Source/WWVegas/WW3D2/meshdam.h index 8386f751d61..aadb1944b56 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/meshdam.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/meshdam.h @@ -38,9 +38,9 @@ #pragma once -#include "always.h" -#include "vector3.h" -#include "bittype.h" +#include "WWLib/always.h" +#include "WWMath/vector3.h" +#include "WWLib/bittype.h" #include "w3derr.h" class MeshModelClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/metalmap.cpp b/Core/Libraries/Source/WWVegas/WW3D2/metalmap.cpp index 9f917fbe3f4..ba9a32ca3f0 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/metalmap.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/metalmap.cpp @@ -49,13 +49,13 @@ #include "metalmap.h" #include "texture.h" #include "ww3dformat.h" -#include "ww3d.h" -#include -#include -#include -#include -#include -#include +#include "WW3D2/ww3d.h" +#include +#include +#include +#include +#include +#include /* ** Class static members: diff --git a/Core/Libraries/Source/WWVegas/WW3D2/metalmap.h b/Core/Libraries/Source/WWVegas/WW3D2/metalmap.h index c0d78d41b79..a2d3992e2d6 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/metalmap.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/metalmap.h @@ -36,7 +36,7 @@ #pragma once -#include +#include class TextureClass; class INIClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.h b/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.h index 106ca115125..56081d7a8aa 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.h @@ -18,7 +18,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" struct IDirect3DTexture8; struct IDirect3DSurface8; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pivot.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pivot.cpp index 50dbd7ffa0d..80342b1562e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pivot.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pivot.cpp @@ -39,7 +39,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "pivot.h" -#include "wwmath.h" +#include "WWMath/wwmath.h" /*********************************************************************************************** diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pivot.h b/Core/Libraries/Source/WWVegas/WW3D2/pivot.h index 241a204df13..167c0094610 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pivot.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/pivot.h @@ -37,11 +37,11 @@ #pragma once -#include "always.h" -#include "vector3.h" -#include "matrix3d.h" -#include "quat.h" -#include "w3d_file.h" +#include "WWLib/always.h" +#include "WWMath/vector3.h" +#include "WWMath/matrix3d.h" +#include "WWMath/quat.h" +#include "WW3D2/w3d_file.h" /* diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 07d9943ece5..4bbbd6f0534 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -71,20 +71,20 @@ * PointGroupClass::Peek_Texture -- Peeks texture * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "pointgr.h" -#include "vertmaterial.h" -#include "ww3d.h" -#include "aabox.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/ww3d.h" +#include "WWMath/aabox.h" #include "statistics.h" -#include "simplevec.h" +#include "WWLib/simplevec.h" #include "texture.h" -#include "Vector.h" -#include "vp.h" -#include "matrix4.h" +#include "WWLib/Vector.h" +#include "WWMath/vp.h" +#include "WWMath/matrix4.h" #include "dx8wrapper.h" #include "dx8vertexbuffer.h" #include "dx8indexbuffer.h" -#include "rinfo.h" -#include "camera.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/camera.h" #include "dx8fvf.h" #include "d3dx8math.h" #include "sortingrenderer.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.h b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.h index f2a098c19b3..5b1a23d1413 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.h @@ -36,12 +36,12 @@ #pragma once -#include "sharebuf.h" -#include "shader.h" -#include "vector4.h" -#include "vector3.h" -#include "vector2.h" -#include "Vector.h" +#include "WWLib/sharebuf.h" +#include "WW3D2/shader.h" +#include "WWMath/vector4.h" +#include "WWMath/vector3.h" +#include "WWMath/vector2.h" +#include "WWLib/Vector.h" class VertexMaterialClass; class RenderInfoClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp b/Core/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp index 0e5751d1939..c4409d4ae4e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp @@ -39,8 +39,8 @@ #include "polyinfo.h" #include "texture.h" -#include "vertmaterial.h" -#include "shader.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/shader.h" void PolygonInfoClass::Set_Texture(TextureClass *texture) { diff --git a/Core/Libraries/Source/WWVegas/WW3D2/predlod.h b/Core/Libraries/Source/WWVegas/WW3D2/predlod.h index 543b6aa50b8..787c3c7b209 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/predlod.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/predlod.h @@ -45,7 +45,7 @@ #include "rendobj.h" #include "float.h" -#include "Vector.h" +#include "WWLib/Vector.h" class LODHeapNode; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp index 6777e027479..74e8ddd1c31 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp @@ -36,5 +36,5 @@ #include "prim_anim.h" -#include "chunkio.h" +#include "WWLib/chunkio.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.h b/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.h index f542011cc01..6724ef1421d 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.h @@ -36,8 +36,8 @@ #pragma once -#include "simplevec.h" -#include "chunkio.h" +#include "WWLib/simplevec.h" +#include "WWLib/chunkio.h" // Forward declarations diff --git a/Core/Libraries/Source/WWVegas/WW3D2/projector.cpp b/Core/Libraries/Source/WWVegas/WW3D2/projector.cpp index aea6a1777ee..c1b70e7ae89 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/projector.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/projector.cpp @@ -46,7 +46,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "projector.h" -#include "matrixmapper.h" +#include "WW3D2/matrixmapper.h" /*********************************************************************************************** diff --git a/Core/Libraries/Source/WWVegas/WW3D2/projector.h b/Core/Libraries/Source/WWVegas/WW3D2/projector.h index afcb2ec9cd4..49dc8dd43af 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/projector.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/projector.h @@ -39,11 +39,11 @@ #pragma once -#include "always.h" -#include "matrix3d.h" -#include "matrix4.h" -#include "aabox.h" -#include "obbox.h" +#include "WWLib/always.h" +#include "WWMath/matrix3d.h" +#include "WWMath/matrix4.h" +#include "WWMath/aabox.h" +#include "WWMath/obbox.h" class MatrixMapperClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/proto.cpp b/Core/Libraries/Source/WWVegas/WW3D2/proto.cpp index d8ef8aa5cd6..50529d3a135 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/proto.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/proto.cpp @@ -41,9 +41,9 @@ #include "proto.h" -#include "mesh.h" +#include "WW3D2/mesh.h" #include "hmdldef.h" -#include "hlod.h" +#include "WW3D2/hlod.h" #include "w3derr.h" /* diff --git a/Core/Libraries/Source/WWVegas/WW3D2/proto.h b/Core/Libraries/Source/WWVegas/WW3D2/proto.h index 5a363e2458d..07861b87f7b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/proto.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/proto.h @@ -36,9 +36,9 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" class RenderObjClass; class ChunkLoadClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/proxy.h b/Core/Libraries/Source/WWVegas/WW3D2/proxy.h index cbff57eb6cd..966768c9646 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/proxy.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/proxy.h @@ -36,8 +36,8 @@ #pragma once -#include "wwstring.h" -#include "matrix3d.h" +#include "WWLib/wwstring.h" +#include "WWMath/matrix3d.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WW3D2/rddesc.h b/Core/Libraries/Source/WWVegas/WW3D2/rddesc.h index 7a2ebcc14d9..1e4c2f6c78b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/rddesc.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/rddesc.h @@ -36,8 +36,8 @@ #pragma once -#include "Vector.h" -#include "wwstring.h" +#include "WWLib/Vector.h" +#include "WWLib/wwstring.h" #include #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp b/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp index 50ef5c6ec8f..f053558f2fa 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp @@ -37,8 +37,8 @@ #include "render2dsentence.h" #include "surfaceclass.h" #include "texture.h" -#include "wwprofile.h" -#include "wwmemlog.h" +#include "WWDebug/wwprofile.h" +#include "WWDebug/wwmemlog.h" #include "dx8wrapper.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h b/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h index f9b0e5920df..c8f4fa12eef 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h @@ -36,12 +36,12 @@ #pragma once -#include "always.h" -#include "render2d.h" -#include "Vector.h" -#include "vector2i.h" -#include "wwstring.h" -#include "win.h" +#include "WWLib/always.h" +#include "WW3D2/render2d.h" +#include "WWLib/Vector.h" +#include "WWMath/vector2i.h" +#include "WWLib/wwstring.h" +#include "WWLib/win.h" // GeneralsX @build fbraz 11/02/2026 BenderAI - FreeType2 for Linux text rendering (Phase 1.5) #if defined(SAGE_USE_FREETYPE) && !defined(_WIN32) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp b/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp index 733a4d08941..a11b783fdc5 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp @@ -43,9 +43,9 @@ #include "renderobjectrecycler.h" #include "rendobj.h" -#include "assetmgr.h" -#include "part_emt.h" -#include "matrix3d.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/part_emt.h" +#include "WWMath/matrix3d.h" /*********************************************************************************************** diff --git a/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h b/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h index 4d54f37659c..20a1904e8f2 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h @@ -38,7 +38,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "robjlist.h" class RenderObjClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp index 88b50f7bc3e..be20233d3c6 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp @@ -73,22 +73,22 @@ #include "rendobj.h" -#include "assetmgr.h" -#include "win.h" -#include "pot.h" -#include "scene.h" -#include "colmath.h" +#include "WW3D2/assetmgr.h" +#include "WWLib/win.h" +#include "WWMath/pot.h" +#include "WW3D2/scene.h" +#include "WWMath/colmath.h" #include "coltest.h" #include "inttest.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "matinfo.h" #include "htree.h" #include "predlod.h" -#include "camera.h" -#include "ww3d.h" -#include "chunkio.h" -#include "persistfactory.h" -#include "saveload.h" +#include "WW3D2/camera.h" +#include "WW3D2/ww3d.h" +#include "WWLib/chunkio.h" +#include "WWSaveLoad/persistfactory.h" +#include "WWSaveLoad/saveload.h" #include "ww3dids.h" #include "intersec.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/rendobj.h b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.h index 65b6e139810..31a986f08c4 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/rendobj.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.h @@ -40,12 +40,12 @@ #pragma once -#include "always.h" -#include "sphere.h" +#include "WWLib/always.h" +#include "WWMath/sphere.h" #include "coltype.h" -#include "aabox.h" -#include "persist.h" -#include "multilist.h" +#include "WWMath/aabox.h" +#include "WWSaveLoad/persist.h" +#include "WWLib/multilist.h" #include "robjlist.h" #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp index 84b80c13a98..7f246b51432 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp @@ -73,26 +73,26 @@ #include "ringobj.h" #include "w3d_util.h" -#include "wwdebug.h" -#include "vertmaterial.h" -#include "ww3d.h" -#include "chunkio.h" -#include "rinfo.h" +#include "WWDebug/wwdebug.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/ww3d.h" +#include "WWLib/chunkio.h" +#include "WW3D2/rinfo.h" #include "coltest.h" #include "inttest.h" -#include "matrix3.h" -#include "wwmath.h" -#include "assetmgr.h" -#include "wwstring.h" -#include "bound.h" -#include "camera.h" +#include "WWMath/matrix3.h" +#include "WWMath/wwmath.h" +#include "WW3D2/assetmgr.h" +#include "WWLib/wwstring.h" +#include "WWLib/bound.h" +#include "WW3D2/camera.h" #include "statistics.h" #include "predlod.h" #include "dx8wrapper.h" #include "dx8indexbuffer.h" #include "dx8vertexbuffer.h" #include "sortingrenderer.h" -#include "Vector3i.h" +#include "WWMath/Vector3i.h" #include "visrasterizer.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ringobj.h b/Core/Libraries/Source/WWVegas/WW3D2/ringobj.h index c11a3c87d53..b997bd0c385 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ringobj.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/ringobj.h @@ -36,15 +36,15 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "rendobj.h" -#include "w3d_file.h" -#include "shader.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/shader.h" #include "proto.h" -#include "obbox.h" -#include "quat.h" -#include "vector3.h" -#include "vector2.h" +#include "WWMath/obbox.h" +#include "WWMath/quat.h" +#include "WWMath/vector3.h" +#include "WWMath/vector2.h" #include "prim_anim.h" class VertexMaterialClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/robjlist.h b/Core/Libraries/Source/WWVegas/WW3D2/robjlist.h index fc24a6ad78b..e41fb946f5e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/robjlist.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/robjlist.h @@ -36,9 +36,9 @@ #pragma once -#include "always.h" -#include "multilist.h" -#include "wwdebug.h" +#include "WWLib/always.h" +#include "WWLib/multilist.h" +#include "WWDebug/wwdebug.h" class RenderObjClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/segline.cpp b/Core/Libraries/Source/WWVegas/WW3D2/segline.cpp index 60c1a12a33c..4cec2125f36 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/segline.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/segline.cpp @@ -35,17 +35,17 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "segline.h" -#include "ww3d.h" -#include "rinfo.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/rinfo.h" #include "predlod.h" -#include "v3_rnd.h" +#include "WWMath/v3_rnd.h" #include "texture.h" #include "coltest.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "texture.h" #include "dx8wrapper.h" -#include "vp.h" -#include "Vector3i.h" +#include "WWMath/vp.h" +#include "WWMath/Vector3i.h" #include "sortingrenderer.h" static SegLineRendererClass _LineRenderer; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/segline.h b/Core/Libraries/Source/WWVegas/WW3D2/segline.h index 86ac8b635d1..e934adca877 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/segline.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/segline.h @@ -37,8 +37,8 @@ #pragma once #include "rendobj.h" -#include "shader.h" -#include "simplevec.h" +#include "WW3D2/shader.h" +#include "WWLib/simplevec.h" #include "seglinerenderer.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp index 9b5970062ee..0d96c6b3a70 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp @@ -38,15 +38,15 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "seglinerenderer.h" -#include "ww3d.h" -#include "rinfo.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/rinfo.h" #include "dx8wrapper.h" #include "sortingrenderer.h" -#include "vp.h" -#include "Vector3i.h" -#include "RANDOM.h" -#include "v3_rnd.h" -#include "meshgeometry.h" +#include "WWMath/vp.h" +#include "WWMath/Vector3i.h" +#include "WWLib/RANDOM.h" +#include "WWMath/v3_rnd.h" +#include "WW3D2/meshgeometry.h" /* We have chunking logic which handles N segments at a time. To simplify the subdivision logic, diff --git a/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h index 2a800068efd..8053adbf223 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h @@ -38,11 +38,11 @@ #pragma once -#include "always.h" -#include "shader.h" +#include "WWLib/always.h" +#include "WW3D2/shader.h" #include "texture.h" -#include "matrix3d.h" -#include "vector2.h" +#include "WWMath/matrix3d.h" +#include "WWMath/vector2.h" class RenderInfoClass; class SphereClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp index c06d1dc1dcf..f216f34d64a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp @@ -37,16 +37,16 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "shattersystem.h" -#include "assetmgr.h" -#include "mesh.h" -#include "meshmdl.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/mesh.h" +#include "WW3D2/meshmdl.h" #include "dynamesh.h" #include "htree.h" -#include "plane.h" -#include "simplevec.h" -#include "wwstring.h" -#include "vp.h" -#include "meshmatdesc.h" +#include "WWMath/plane.h" +#include "WWLib/simplevec.h" +#include "WWLib/wwstring.h" +#include "WWMath/vp.h" +#include "WW3D2/meshmatdesc.h" #include /* diff --git a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.h b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.h index 1389493d1bd..2e135df3f1d 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.h @@ -38,7 +38,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" class MeshClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/snapPts.h b/Core/Libraries/Source/WWVegas/WW3D2/snapPts.h index d787c45a503..ebe0f693719 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/snapPts.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/snapPts.h @@ -36,9 +36,9 @@ #pragma once -#include "always.h" -#include "Vector.h" -#include "vector3.h" +#include "WWLib/always.h" +#include "WWLib/Vector.h" +#include "WWMath/vector3.h" #include "w3derr.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/snappts.cpp b/Core/Libraries/Source/WWVegas/WW3D2/snappts.cpp index 814459f04be..13d453474f8 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/snappts.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/snappts.cpp @@ -35,8 +35,8 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "snapPts.h" -#include "chunkio.h" -#include "w3d_file.h" +#include "WWLib/chunkio.h" +#include "WW3D2/w3d_file.h" #include "w3derr.h" WW3DErrorType SnapPointsClass::Load_W3D(ChunkLoadClass & cload) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp index 7de76b29115..14b51020152 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp @@ -42,12 +42,12 @@ #include "dx8vertexbuffer.h" #include "dx8indexbuffer.h" #include "dx8wrapper.h" -#include "vertmaterial.h" +#include "WW3D2/vertmaterial.h" #include "texture.h" #include "d3d8.h" #include "d3dx8math.h" #include "statistics.h" -#include +#include #include #include @@ -240,13 +240,7 @@ void SortingRendererClass::Insert_Triangles( state->min_vertex_index=min_vertex_index; state->vertex_count=vertex_count; - if (bounding_sphere.Radius <= 0.0) - { - // TheSuperHackers @perf stephanmeesters 04/07/2026 Nodes without bounding information do not require sorting. - state->transformed_center = Vector3(0.0f, 0.0f, 0.0f); - unsorted_list.push_back(state); - } - else + if (bounding_sphere.Is_Valid()) { D3DXMATRIX mtx=(D3DXMATRIX&)state->sorting_state.world*(D3DXMATRIX&)state->sorting_state.view; D3DXVECTOR3 vec=(D3DXVECTOR3&)bounding_sphere.Center; @@ -259,6 +253,12 @@ void SortingRendererClass::Insert_Triangles( Insert_To_Sorted_List(state); } + else + { + // TheSuperHackers @perf stephanmeesters 04/07/2026 Nodes without bounding information do not require sorting. + state->transformed_center = Vector3(0.0f, 0.0f, 0.0f); + unsorted_list.push_back(state); + } #ifdef WWDEBUG SortingVertexBufferClass* vertex_buffer=static_cast(state->sorting_state.vertex_buffers[0]); @@ -296,8 +296,7 @@ void SortingRendererClass::Insert_Triangles( unsigned short min_vertex_index, unsigned short vertex_count) { - SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f); - Insert_Triangles(sphere,start_index,polygon_count,min_vertex_index,vertex_count); + Insert_Triangles(SphereClass(),start_index,polygon_count,min_vertex_index,vertex_count); } // ---------------------------------------------------------------------------- diff --git a/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.h index 6e304f0da7d..14be254b6d4 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.h @@ -18,7 +18,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" class SortingNodeStruct; class SphereClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp index f18c5b44282..ce7269dc048 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp @@ -38,13 +38,13 @@ #if noWWAUDIO //(gth) removing dependency on wwaudio -#include "AudibleSound.h" -#include "Sound3D.h" -#include "WWAudio.h" -#include "ffactory.h" -#include "WWFILE.h" -#include "chunkio.h" -#include "scene.h" +#include "WWAudio/AudibleSound.h" +#include "WWAudio/Sound3D.h" +#include "WWAudio/WWAudio.h" +#include "WWLib/ffactory.h" +#include "WWLib/WWFILE.h" +#include "WWLib/chunkio.h" +#include "WW3D2/scene.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.h b/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.h index 4ece0237ac2..4ca84795fc0 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.h @@ -42,11 +42,11 @@ #if noWWAUDIO // (gth) removing dependency on WWAUDIO #include "rendobj.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" #include "proto.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "w3derr.h" -#include "AudibleSound.h" +#include "WWAudio/AudibleSound.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp index e3e927e86b0..ad4bb0bc549 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp @@ -70,20 +70,20 @@ #include "sphereobj.h" #include "w3d_util.h" -#include "wwdebug.h" -#include "vertmaterial.h" -#include "ww3d.h" -#include "chunkio.h" -#include "rinfo.h" +#include "WWDebug/wwdebug.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/ww3d.h" +#include "WWLib/chunkio.h" +#include "WW3D2/rinfo.h" #include "coltest.h" -#include "bound.h" +#include "WWLib/bound.h" #include "inttest.h" #include "predlod.h" -#include "matrix3.h" -#include "wwmath.h" -#include "assetmgr.h" -#include "wwstring.h" -#include "camera.h" +#include "WWMath/matrix3.h" +#include "WWMath/wwmath.h" +#include "WW3D2/assetmgr.h" +#include "WWLib/wwstring.h" +#include "WW3D2/camera.h" #include "statistics.h" #include "dx8wrapper.h" #include "dx8vertexbuffer.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.h b/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.h index 4222b6b9988..76328bc3e04 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.h @@ -36,16 +36,16 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "rendobj.h" -#include "w3d_file.h" -#include "shader.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/shader.h" #include "proto.h" -#include "obbox.h" -#include "Vector3i.h" -#include "quat.h" +#include "WWMath/obbox.h" +#include "WWMath/Vector3i.h" +#include "WWMath/quat.h" #include "prim_anim.h" -#include "meshgeometry.h" +#include "WW3D2/meshgeometry.h" class TextureClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.h b/Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.h index 0095b60a746..5dd640d8c58 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.h @@ -39,7 +39,7 @@ #pragma once #include "robjlist.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" class RenderInfoClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp b/Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp index e703c89e67b..0c6d2311e1e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp @@ -17,8 +17,8 @@ */ #include "statistics.h" -#include "wwstring.h" -#include "simplevec.h" +#include "WWLib/wwstring.h" +#include "WWLib/simplevec.h" #include "dx8renderer.h" #include "dx8wrapper.h" #include "dx8caps.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/statistics.h b/Core/Libraries/Source/WWVegas/WW3D2/statistics.h index 1b89610cbc5..c7d1f26a00a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/statistics.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/statistics.h @@ -18,7 +18,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" //#include "wwstring.h" class TextureClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/streak.cpp b/Core/Libraries/Source/WWVegas/WW3D2/streak.cpp index 035ea56ff19..aec9cd74c56 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/streak.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/streak.cpp @@ -35,17 +35,17 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "streak.h" -#include "ww3d.h" -#include "rinfo.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/rinfo.h" #include "predlod.h" -#include "v3_rnd.h" +#include "WWMath/v3_rnd.h" #include "texture.h" #include "coltest.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "texture.h" #include "dx8wrapper.h" -#include "vp.h" -#include "Vector3i.h" +#include "WWMath/vp.h" +#include "WWMath/Vector3i.h" #include "sortingrenderer.h" static SegLineRendererClass _LineRenderer; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/streak.h b/Core/Libraries/Source/WWVegas/WW3D2/streak.h index c80432d7314..77a242689e0 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/streak.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/streak.h @@ -37,8 +37,8 @@ #pragma once #include "rendobj.h" -#include "shader.h" -#include "simplevec.h" +#include "WW3D2/shader.h" +#include "WWLib/simplevec.h" #include "seglinerenderer.h" #include "streakRender.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp index b03eafb7c74..4341c24d7b2 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp @@ -26,14 +26,14 @@ #include "streakRender.h" -#include "ww3d.h" -#include "rinfo.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/rinfo.h" #include "dx8wrapper.h" #include "sortingrenderer.h" -#include "vp.h" -#include "Vector3i.h" -#include "RANDOM.h" -#include "v3_rnd.h" +#include "WWMath/vp.h" +#include "WWMath/Vector3i.h" +#include "WWLib/RANDOM.h" +#include "WWMath/v3_rnd.h" /* We have chunking logic which handles N segments at a time. To simplify the subdivision logic, diff --git a/Core/Libraries/Source/WWVegas/WW3D2/streakRender.h b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.h index 02203218d47..46337fea7db 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/streakRender.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.h @@ -38,11 +38,11 @@ #pragma once -#include "always.h" -#include "shader.h" +#include "WWLib/always.h" +#include "WW3D2/shader.h" #include "texture.h" -#include "matrix3d.h" -#include "vector2.h" +#include "WWMath/matrix3d.h" +#include "WWMath/vector2.h" class RenderInfoClass; class SphereClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp index 813ca0b1cbc..7afdefc3c45 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp @@ -17,8 +17,8 @@ */ #include "stripoptimizer.h" -#include "hashtemplate.h" -#include "wwdebug.h" +#include "WWLib/hashtemplate.h" +#include "WWDebug/wwdebug.h" template inline void swap (T& a, T& b) { diff --git a/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h b/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h index 001840bb37e..88c004a419f 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h @@ -18,7 +18,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" // strip data = diff --git a/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp index bbbb34d30d9..0397215dec1 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp @@ -53,9 +53,9 @@ #include "surfaceclass.h" #include "formconv.h" #include "dx8wrapper.h" -#include "vector2i.h" +#include "WWMath/vector2i.h" #include "colorspace.h" -#include "bound.h" +#include "WWLib/bound.h" #include void Convert_Pixel(Vector3 &rgb, const SurfaceClass::SurfaceDescription &sd, const unsigned char * pixel) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h index 37b4b3aed4c..d68868ebd25 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h @@ -38,7 +38,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "ww3dformat.h" struct IDirect3DSurface8; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp b/Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp index 59068d97f2d..c0d3b1fd71c 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp @@ -75,20 +75,20 @@ #include "texproject.h" -#include "vertmaterial.h" -#include "shader.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/shader.h" #include "texture.h" #include "rendobj.h" -#include "rinfo.h" -#include "camera.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/camera.h" #include "matpass.h" #include "bwrender.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "dx8wrapper.h" // DEBUG DEBUG -#include "MPU.h" +#include "WWLib/MPU.h" #define DEBUG_SHADOW_RENDERING 0 //#define DEFAULT_TEXTURE_SIZE 64 diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texproject.h b/Core/Libraries/Source/WWVegas/WW3D2/texproject.h index d8a7fa3caeb..368a1584a59 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texproject.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/texproject.h @@ -39,14 +39,14 @@ #pragma once -#include "always.h" -#include "matrix3d.h" -#include "matrix4.h" -#include "obbox.h" +#include "WWLib/always.h" +#include "WWMath/matrix3d.h" +#include "WWMath/matrix4.h" +#include "WWMath/obbox.h" #include "matpass.h" -#include "matrixmapper.h" -#include "cullsys.h" -#include "multilist.h" +#include "WW3D2/matrixmapper.h" +#include "WWMath/cullsys.h" +#include "WWLib/multilist.h" #include "projector.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textdraw.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textdraw.cpp index 1cae1544bd8..3f8c1d96d26 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textdraw.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/textdraw.cpp @@ -36,7 +36,7 @@ #include "textdraw.h" #include "font3d.h" -#include "simplevec.h" +#include "WWLib/simplevec.h" /*********************************************************************************************** * * diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textdraw.h b/Core/Libraries/Source/WWVegas/WW3D2/textdraw.h index 767e93625a8..6d733165602 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textdraw.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/textdraw.h @@ -34,7 +34,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "dynamesh.h" // sgc : wwlib and wwmath contain different rect.h files... diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texture.cpp b/Core/Libraries/Source/WWVegas/WW3D2/texture.cpp index 6f63b8d155e..35993b849bf 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texture.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/texture.cpp @@ -44,19 +44,19 @@ #include #include #include "dx8wrapper.h" -#include "TARGA.h" -#include -#include "w3d_file.h" -#include "assetmgr.h" +#include "WWLib/TARGA.h" +#include +#include "WW3D2/w3d_file.h" +#include "WW3D2/assetmgr.h" #include "formconv.h" #include "textureloader.h" #include "missingtexture.h" -#include "ffactory.h" +#include "WWLib/ffactory.h" #include "dx8caps.h" #include "dx8texman.h" -#include "meshmatdesc.h" +#include "WW3D2/meshmatdesc.h" #include "texturethumbnail.h" -#include "wwprofile.h" +#include "WWDebug/wwprofile.h" const unsigned DEFAULT_INACTIVATION_TIME=20000; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texture.h b/Core/Libraries/Source/WWVegas/WW3D2/texture.h index 9d98c7b6ba6..0ce681ce531 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texture.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/texture.h @@ -41,12 +41,12 @@ #pragma once -#include "always.h" -#include "chunkio.h" +#include "WWLib/always.h" +#include "WWLib/chunkio.h" #include "surfaceclass.h" #include "ww3dformat.h" -#include "wwstring.h" -#include "vector3.h" +#include "WWLib/wwstring.h" +#include "WWMath/vector3.h" #include "texturefilter.h" struct IDirect3DBaseTexture8; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index b3945403398..bb6810d1dae 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -39,26 +39,26 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "textureloader.h" -#include "mutex.h" -#include "thread.h" -#include "wwdebug.h" +#include "WWLib/mutex.h" +#include "WWLib/thread.h" +#include "WWDebug/wwdebug.h" #include "texture.h" -#include "ffactory.h" -#include "wwstring.h" -#include "bufffile.h" -#include "ww3d.h" -#include "assetmgr.h" +#include "WWLib/ffactory.h" +#include "WWLib/wwstring.h" +#include "WWLib/bufffile.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/assetmgr.h" #include "dx8wrapper.h" #include "dx8caps.h" #include "missingtexture.h" -#include "TARGA.h" +#include "WWLib/TARGA.h" #include -#include "wwmemlog.h" +#include "WWDebug/wwmemlog.h" #include "formconv.h" #include "texturethumbnail.h" -#include "ddsfile.h" +#include "WW3D2/ddsfile.h" #include "bitmaphandler.h" -#include "wwprofile.h" +#include "WWDebug/wwprofile.h" bool TextureLoader::TextureLoadSuspended; int TextureLoader::TextureInactiveOverrideTime = 0; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h index 338fff7cbed..b7d1f20b9ab 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h @@ -39,7 +39,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "texture.h" class StringClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp b/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp index 5d05da9d44b..0fee1ed70bd 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp @@ -17,16 +17,16 @@ */ #include "texturethumbnail.h" -#include "hashtemplate.h" +#include "WWLib/hashtemplate.h" #include "missingtexture.h" -#include "TARGA.h" +#include "WWLib/TARGA.h" #include "ww3dformat.h" -#include "ddsfile.h" +#include "WW3D2/ddsfile.h" #include "textureloader.h" #include "bitmaphandler.h" -#include "ffactory.h" -#include "RAWFILE.h" -#include "wwprofile.h" +#include "WWLib/ffactory.h" +#include "WWLib/RAWFILE.h" +#include "WWDebug/wwprofile.h" #include static DLListClass ThumbnailManagerList; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.h b/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.h index 91ba3037d18..afd06cd9132 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.h @@ -20,9 +20,9 @@ #pragma once -#include "always.h" -#include "wwstring.h" -#include "hashtemplate.h" +#include "WWLib/always.h" +#include "WWLib/wwstring.h" +#include "WWLib/hashtemplate.h" #include "dllist.h" #include "ww3dformat.h" diff --git a/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp index 89bc691f2f1..6f2f39a666a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp @@ -37,9 +37,9 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "visrasterizer.h" -#include "camera.h" -#include "plane.h" -#include "vp.h" +#include "WW3D2/camera.h" +#include "WWMath/plane.h" +#include "WWMath/vp.h" /** diff --git a/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.h b/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.h index 2754cf3200e..be4f732fd5e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.h @@ -38,15 +38,15 @@ #pragma once -#include "always.h" -#include "matrix3d.h" -#include "matrix4.h" -#include "Vector3i.h" -#include "vector3.h" -#include "simplevec.h" -#include "bittype.h" -#include "plane.h" -#include "meshgeometry.h" +#include "WWLib/always.h" +#include "WWMath/matrix3d.h" +#include "WWMath/matrix4.h" +#include "WWMath/Vector3i.h" +#include "WWMath/vector3.h" +#include "WWLib/simplevec.h" +#include "WWLib/bittype.h" +#include "WWMath/plane.h" +#include "WW3D2/meshgeometry.h" class CameraClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp b/Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp index 8b86a3e38b8..b4dc3fdd977 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp @@ -63,10 +63,10 @@ class STLSpecialAlloc #include "w3d_dep.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include -#include -#include "ffactory.h" +#include +#include "WWLib/ffactory.h" /* diff --git a/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp b/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp index d44420978a1..a2f1c35476b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp @@ -36,10 +36,10 @@ #include "w3d_util.h" -#include "vector3.h" -#include "vector4.h" -#include "quat.h" -#include "shader.h" +#include "WWMath/vector3.h" +#include "WWMath/vector4.h" +#include "WWMath/quat.h" +#include "WW3D2/shader.h" void W3dUtilityClass::Convert_Vector(const W3dVectorStruct & v,Vector3 * set) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.h b/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.h index 90b3da3e16f..39808bb18df 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.h @@ -36,8 +36,8 @@ #pragma once -#include "always.h" -#include "w3d_file.h" +#include "WWLib/always.h" +#include "WW3D2/w3d_file.h" class Vector3; class Vector4; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/w3derr.h b/Core/Libraries/Source/WWVegas/WW3D2/w3derr.h index c600f8ca708..fbf2d6f8cc6 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/w3derr.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/w3derr.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" /* ** These are the error codes which should be returned by all WW3D functions that can fail diff --git a/Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h b/Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h index 2014e2281c1..8232123b792 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h @@ -37,10 +37,10 @@ #pragma once -#include "always.h" -#include "Vector.h" -#include "wwstring.h" -#include "hashtemplate.h" +#include "WWLib/always.h" +#include "WWLib/Vector.h" +#include "WWLib/wwstring.h" +#include "WWLib/hashtemplate.h" class PrototypeClass; class HTreeClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp index 05ee0723849..c874570aced 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp @@ -38,9 +38,9 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "ww3dformat.h" -#include "vector4.h" -#include "wwdebug.h" -#include "TARGA.h" +#include "WWMath/vector4.h" +#include "WWDebug/wwdebug.h" +#include "WWLib/TARGA.h" #include "dx8wrapper.h" #include "dx8caps.h" #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.h b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.h index 74c3a9d52bb..28b7eb8cd84 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.h @@ -41,8 +41,8 @@ #pragma once -#include "always.h" -#include "wwstring.h" +#include "WWLib/always.h" +#include "WWLib/wwstring.h" class Vector4; class Targa; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ww3dids.h b/Core/Libraries/Source/WWVegas/WW3D2/ww3dids.h index d6609919bfc..7fc696a8650 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ww3dids.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/ww3dids.h @@ -36,7 +36,7 @@ #pragma once -#include "saveloadids.h" +#include "WWSaveLoad/saveloadids.h" /* ** These are the chunk-id's used by all persistent objects in WW3D. The persistent object diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AABTreeSoundCullClass.h b/Core/Libraries/Source/WWVegas/WWAudio/AABTreeSoundCullClass.h index 5721e4a3c09..ebd6acc4feb 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AABTreeSoundCullClass.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/AABTreeSoundCullClass.h @@ -36,7 +36,7 @@ #pragma once -#include "aabtreecull.h" +#include "WWMath/aabtreecull.h" ///////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.cpp b/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.cpp index 7cb459dc77f..7e9bdc689d0 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.cpp @@ -37,17 +37,17 @@ #include "AudibleSound.h" #include "WWAudio.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "SoundBuffer.h" #include "Utils.h" #include "SoundScene.h" #include "FilteredSound.h" #include "Threads.h" #include "SoundChunkIDs.h" -#include "simpledefinitionfactory.h" -#include "persistfactory.h" +#include "WWSaveLoad/simpledefinitionfactory.h" +#include "WWSaveLoad/persistfactory.h" #include "LogicalSound.h" -#include "definitionclassids.h" +#include "WWSaveLoad/definitionclassids.h" #include "soundstreamhandle.h" #include "sound2dhandle.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.h b/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.h index 7860f84b502..43c3678afab 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.h @@ -47,14 +47,14 @@ #endif //#include -#include "always.h" -#include "vector3.h" -#include "matrix3d.h" -#include "RAWFILE.h" +#include "WWLib/always.h" +#include "WWMath/vector3.h" +#include "WWMath/matrix3d.h" +#include "WWLib/RAWFILE.h" #include "SoundSceneObj.h" -#include "Vector.h" -#include "wwstring.h" -#include "definition.h" +#include "WWLib/Vector.h" +#include "WWLib/wwstring.h" +#include "WWSaveLoad/definition.h" ///////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h b/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h index 4f45017c96f..155076f5b71 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h @@ -36,8 +36,8 @@ #pragma once -#include "simplevec.h" -#include "bittype.h" +#include "WWLib/simplevec.h" +#include "WWLib/bittype.h" ///////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.cpp b/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.cpp index 77f666ea87c..e5d5375f109 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.cpp @@ -34,15 +34,15 @@ * Functions: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "always.h" +#include "WWLib/always.h" #include "AudioSaveLoad.h" -#include "persist.h" -#include "persistfactory.h" -#include "definition.h" +#include "WWSaveLoad/persist.h" +#include "WWSaveLoad/persistfactory.h" +#include "WWSaveLoad/definition.h" #include "SoundChunkIDs.h" -#include "chunkio.h" +#include "WWLib/chunkio.h" #include "SoundScene.h" -#include "wwmemlog.h" +#include "WWDebug/wwmemlog.h" /////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.h b/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.h index 6bba83f32e9..04a8cc416f1 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/AudioSaveLoad.h @@ -36,9 +36,9 @@ #pragma once -#include "saveloadsubsystem.h" -#include "Vector.h" -#include "bittype.h" +#include "WWSaveLoad/saveloadsubsystem.h" +#include "WWLib/Vector.h" +#include "WWLib/bittype.h" // Singleton instances diff --git a/Core/Libraries/Source/WWVegas/WWAudio/FilteredSound.cpp b/Core/Libraries/Source/WWVegas/WWAudio/FilteredSound.cpp index 80516c5c0c0..912620df148 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/FilteredSound.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/FilteredSound.cpp @@ -39,7 +39,7 @@ #include "WWAudio.h" #include "SoundScene.h" #include "SoundChunkIDs.h" -#include "persistfactory.h" +#include "WWSaveLoad/persistfactory.h" #include "soundhandle.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.cpp b/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.cpp index b5b7910c667..eace51dfbb1 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.cpp @@ -36,7 +36,7 @@ #include "WWAudio.h" #include "SoundScene.h" #include "SoundChunkIDs.h" -#include "persistfactory.h" +#include "WWSaveLoad/persistfactory.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.h b/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.h index 125d9330414..875b87a7020 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/LogicalListener.h @@ -33,9 +33,9 @@ #pragma once #include "SoundSceneObj.h" -#include "bittype.h" -#include "vector3.h" -#include "matrix3d.h" +#include "WWLib/bittype.h" +#include "WWMath/vector3.h" +#include "WWMath/matrix3d.h" ///////////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.cpp b/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.cpp index 7653b1d16d2..00894d97b17 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.cpp @@ -34,7 +34,7 @@ #include "WWAudio.h" #include "SoundScene.h" #include "SoundChunkIDs.h" -#include "persistfactory.h" +#include "WWSaveLoad/persistfactory.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.h b/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.h index 7fba4283030..5eb7b013db3 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/LogicalSound.h @@ -33,9 +33,9 @@ #pragma once #include "SoundSceneObj.h" -#include "bittype.h" -#include "vector3.h" -#include "matrix3d.h" +#include "WWLib/bittype.h" +#include "WWMath/vector3.h" +#include "WWMath/matrix3d.h" ///////////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWAudio/PriorityVector.h b/Core/Libraries/Source/WWVegas/WWAudio/PriorityVector.h index 0649522a9b1..22652449dbb 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/PriorityVector.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/PriorityVector.h @@ -32,7 +32,7 @@ #pragma once -#include "Vector.h" +#include "WWLib/Vector.h" //////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp b/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp index 63ccd2b70f1..20e019930c4 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp @@ -41,8 +41,8 @@ #include "SoundScene.h" #include "Utils.h" #include "SoundChunkIDs.h" -#include "persistfactory.h" -#include "chunkio.h" +#include "WWSaveLoad/persistfactory.h" +#include "WWLib/chunkio.h" #include "sound3dhandle.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.h b/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.h index d8b53c5cc5b..1891c2e8570 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.h @@ -37,7 +37,7 @@ #pragma once #include "AudibleSound.h" -#include "mempool.h" +#include "WWLib/mempool.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.cpp b/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.cpp index cf647adde73..15471a46fb7 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.cpp @@ -36,11 +36,11 @@ #include "SoundBuffer.h" -#include "RAWFILE.h" -#include "wwdebug.h" +#include "WWLib/RAWFILE.h" +#include "WWDebug/wwdebug.h" #include "Utils.h" -#include "ffactory.h" -#include "win.h" +#include "WWLib/ffactory.h" +#include "WWLib/win.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.h b/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.h index 48fa4e4f173..822cdc167c0 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.h @@ -46,7 +46,7 @@ #include "MilesStub.h" #endif -#include "always.h" +#include "WWLib/always.h" // Forward declarations diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundChunkIDs.h b/Core/Libraries/Source/WWVegas/WWAudio/SoundChunkIDs.h index 1d215304146..5437f2f1135 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundChunkIDs.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundChunkIDs.h @@ -36,8 +36,8 @@ #pragma once -#include "saveloadids.h" -#include "definitionclassids.h" +#include "WWSaveLoad/saveloadids.h" +#include "WWSaveLoad/definitionclassids.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundCullObj.h b/Core/Libraries/Source/WWVegas/WWAudio/SoundCullObj.h index de3d5647b24..0ae12db85bf 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundCullObj.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundCullObj.h @@ -36,11 +36,11 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "SoundSceneObj.h" -#include "cullsys.h" -#include "mempool.h" -#include "multilist.h" +#include "WWMath/cullsys.h" +#include "WWLib/mempool.h" +#include "WWLib/multilist.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundPseudo3D.cpp b/Core/Libraries/Source/WWVegas/WWAudio/SoundPseudo3D.cpp index 8de1e8ffda4..3805659b907 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundPseudo3D.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundPseudo3D.cpp @@ -40,7 +40,7 @@ #include "SoundScene.h" #include "Utils.h" #include "SoundChunkIDs.h" -#include "persistfactory.h" +#include "WWSaveLoad/persistfactory.h" #include "soundhandle.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp b/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp index ba241fdfd5f..4427f3d7bff 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp @@ -39,11 +39,11 @@ #include "SoundCullObj.h" #include "LogicalSound.h" #include "LogicalListener.h" -#include "chunkio.h" -#include "persistfactory.h" -#include "wwprofile.h" +#include "WWLib/chunkio.h" +#include "WWSaveLoad/persistfactory.h" +#include "WWDebug/wwprofile.h" #include "Threads.h" -#include "wwmemlog.h" +#include "WWDebug/wwmemlog.h" DEFINE_AUTO_POOL(SoundSceneClass::AudibleInfoClass, 64); diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.h b/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.h index 495ca31fd29..d25a5a87069 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundScene.h @@ -36,14 +36,14 @@ #pragma once -#include "aabtreecull.h" -#include "gridcull.h" +#include "WWMath/aabtreecull.h" +#include "WWMath/gridcull.h" #include "Listener.h" -#include "Vector.h" +#include "WWLib/Vector.h" #include "PriorityVector.h" #include "SoundCullObj.h" #include "LogicalListener.h" -#include "multilist.h" +#include "WWLib/multilist.h" // Forward declarations class RenderObjClass; diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.cpp b/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.cpp index 59b0ecde88b..7a0bd0ad12a 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.cpp @@ -34,9 +34,9 @@ #include "SoundSceneObj.h" -#include "camera.h" -#include "rendobj.h" -#include "persistfactory.h" +#include "WW3D2/camera.h" +#include "WW3D2/rendobj.h" +#include "WWSaveLoad/persistfactory.h" #include "SoundChunkIDs.h" #include "Utils.h" diff --git a/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h b/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h index 3f85a5566fb..a5d6f7d0b0a 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h @@ -34,12 +34,12 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "WWAudio.h" -#include "bittype.h" -#include "persist.h" -#include "multilist.h" -#include "mutex.h" +#include "WWLib/bittype.h" +#include "WWSaveLoad/persist.h" +#include "WWLib/multilist.h" +#include "WWLib/mutex.h" ///////////////////////////////////////////////////////////////////////////////// // Forward declarations diff --git a/Core/Libraries/Source/WWVegas/WWAudio/Threads.cpp b/Core/Libraries/Source/WWVegas/WWAudio/Threads.cpp index 26be223af22..97a061a3e31 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/Threads.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/Threads.cpp @@ -30,7 +30,7 @@ * Functions: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "always.h" +#include "WWLib/always.h" #include "Threads.h" #include "Utils.h" #include diff --git a/Core/Libraries/Source/WWVegas/WWAudio/Threads.h b/Core/Libraries/Source/WWVegas/WWAudio/Threads.h index e1d79fead10..b277c14fd30 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/Threads.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/Threads.h @@ -33,8 +33,8 @@ #pragma once #include "windows.h" -#include "Vector.h" -#include "mutex.h" +#include "WWLib/Vector.h" +#include "WWLib/mutex.h" // Forward declarations class RefCountClass; diff --git a/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp b/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp index 0c3744342c7..5deef46192c 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp @@ -35,26 +35,26 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "always.h" +#include "WWLib/always.h" #include #include "WWAudio.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "Utils.h" -#include "realcrc.h" +#include "WWLib/realcrc.h" #include "SoundBuffer.h" #include "AudibleSound.h" #include "Sound3D.h" -#include "RAWFILE.h" +#include "WWLib/RAWFILE.h" #include "SoundScene.h" #include "SoundPseudo3D.h" -#include "ffactory.h" -#include "registry.h" +#include "WWLib/ffactory.h" +#include "WWLib/registry.h" #include "Threads.h" #include "LogicalSound.h" #include "LogicalListener.h" -#include "definitionclassids.h" -#include "wwmemlog.h" -#include "wwprofile.h" +#include "WWSaveLoad/definitionclassids.h" +#include "WWDebug/wwmemlog.h" +#include "WWDebug/wwprofile.h" #ifdef G_CODE_BASE diff --git a/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.h b/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.h index 8d3e6e3343d..5a269aebd25 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" // TheSuperHackers @build 09/02/2026 Conditionally include Miles (Windows only) // GeneralsX @feature fbraz 11/06/2026 Also use MilesStub when MiniAudio is enabled @@ -48,10 +48,10 @@ #include "MilesStub.h" #endif -#include "Vector.h" +#include "WWLib/Vector.h" #include "SoundBuffer.h" #include "AudioEvents.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" ///////////////////////////////////////////////////////////////////////////////// // Forward declaration diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.cpp index aa1ce5d13b6..a2d59f6e482 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.cpp @@ -49,7 +49,7 @@ #include #include #include -#include "Except.h" +#include "WWLib/Except.h" #ifdef _WIN32 #include diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp index 0ae80a69579..869fa002d34 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp @@ -38,11 +38,11 @@ * WWMemoryLogClass::Release_Memory -- frees memory * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "always.h" +#include "WWLib/always.h" #include "wwmemlog.h" #include "wwdebug.h" -#include "Vector.h" -#include "FastAllocator.h" +#include "WWLib/Vector.h" +#include "WWLib/FastAllocator.h" #define USE_FAST_ALLOCATOR diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp index 3b1abebc421..76652ba4603 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp @@ -49,17 +49,17 @@ * WWProfileManager::Release_In_Order_Iterator -- Return an "in-order" iterator * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "always.h" +#include "WWLib/always.h" #include "wwprofile.h" -#include "FastAllocator.h" +#include "WWLib/FastAllocator.h" #include "wwdebug.h" //#include "systimer.h" -#include "systimer.h" -#include "RAWFILE.h" -#include "ffactory.h" -#include "simplevec.h" -#include "cpudetect.h" -#include "hashtemplate.h" +#include "WWLib/systimer.h" +#include "WWLib/RAWFILE.h" +#include "WWLib/ffactory.h" +#include "WWLib/simplevec.h" +#include "WWLib/cpudetect.h" +#include "WWLib/hashtemplate.h" #include static SimpleDynVecClass ProfileCollectVector; diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.h b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.h index 9c2fad93226..44aea85c0ce 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.h +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.h @@ -37,7 +37,7 @@ #pragma once //#define ENABLE_TIME_AND_MEMORY_LOG -#include "wwstring.h" +#include "WWLib/wwstring.h" #ifdef _UNIX typedef signed long long __int64; diff --git a/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp b/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp index 5928baffeb4..df52147a330 100644 --- a/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp +++ b/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp @@ -19,9 +19,9 @@ // Download.cpp : Implementation of CDownload #include "DownloadDebug.h" #include "Download.h" - // GeneralsX @refactor BenderAI 10/02/2026 // Added platform guards for Windows-specific headers +#include "WWLib/stringex.h" #include #include #include diff --git a/Core/Libraries/Source/WWVegas/WWDownload/FTP.cpp b/Core/Libraries/Source/WWVegas/WWDownload/FTP.cpp index a59e986ebf8..23a770e998e 100644 --- a/Core/Libraries/Source/WWVegas/WWDownload/FTP.cpp +++ b/Core/Libraries/Source/WWVegas/WWDownload/FTP.cpp @@ -50,6 +50,8 @@ // TODO: Implement _splitpath for Linux (currently no-op) #define _splitpath(a,b,c,d,e) (void)0 #endif +#include +#include "WWLib/WWCommon.h" //#include "wlib/wstring.h" #include "DownloadDebug.h" diff --git a/Core/Libraries/Source/WWVegas/WWDownload/registry.cpp b/Core/Libraries/Source/WWVegas/WWDownload/registry.cpp index 7c056c6aaa9..93a2125b1d0 100644 --- a/Core/Libraries/Source/WWVegas/WWDownload/registry.cpp +++ b/Core/Libraries/Source/WWVegas/WWDownload/registry.cpp @@ -22,9 +22,8 @@ #include "Registry.h" #include - #ifdef _WIN32 -#include "win.h" +#include "WWLib/win.h" #else #include "registryini.h" #ifndef HKEY_LOCAL_MACHINE diff --git a/Core/Libraries/Source/WWVegas/WWLib/CMakeLists.txt b/Core/Libraries/Source/WWVegas/WWLib/CMakeLists.txt index 7fb2139f684..31141b4520d 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/CMakeLists.txt +++ b/Core/Libraries/Source/WWVegas/WWLib/CMakeLists.txt @@ -75,6 +75,7 @@ set(WWLIB_SRC #md5.h mempool.h mmsys.h + mpsc_intrusive_queue.h multilist.cpp multilist.h mutex.cpp diff --git a/Core/Libraries/Source/WWVegas/WWLib/DbgHelpLoader.h b/Core/Libraries/Source/WWVegas/WWLib/DbgHelpLoader.h index c96d4b6c6b3..ba50eb76bab 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/DbgHelpLoader.h +++ b/Core/Libraries/Source/WWVegas/WWLib/DbgHelpLoader.h @@ -20,13 +20,13 @@ #include "always.h" -#include +#include "WWLib/win.h" #ifdef _WIN32 #include // Must be included after Windows.h #endif #include #ifdef RTS_ENABLE_CRASHDUMP -#include +#include #endif #include "mutex.h" diff --git a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp index 35ecf90120b..be9c958cdf1 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp @@ -58,8 +58,8 @@ #include "MPU.h" //#include "commando\nat.h" #include "thread.h" -#include "wwdebug.h" -#include "wwmemlog.h" +#include "WWDebug/wwdebug.h" +#include "WWDebug/wwmemlog.h" #include #include diff --git a/Core/Libraries/Source/WWVegas/WWLib/FastAllocator.h b/Core/Libraries/Source/WWVegas/WWLib/FastAllocator.h index bdc702b4fd7..cb1f281f483 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/FastAllocator.h +++ b/Core/Libraries/Source/WWVegas/WWLib/FastAllocator.h @@ -37,7 +37,7 @@ // Include files // #include "always.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "mutex.h" // GeneralsX @bugfix BenderAI 24/02/2026 Phase 5 - macOS malloc.h compatibility diff --git a/Core/Libraries/Source/WWVegas/WWLib/bufffile.cpp b/Core/Libraries/Source/WWVegas/WWLib/bufffile.cpp index 9eef7f586ea..d4128f6ecd6 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/bufffile.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/bufffile.cpp @@ -36,7 +36,7 @@ #include "always.h" #include "bufffile.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" int BufferedFileClass::_DesiredBufferSize = 1024*16; diff --git a/Core/Libraries/Source/WWVegas/WWLib/cpudetect.cpp b/Core/Libraries/Source/WWVegas/WWLib/cpudetect.cpp index 31d6c02d2ba..c01e7f75254 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/cpudetect.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/cpudetect.cpp @@ -18,7 +18,7 @@ #include "cpudetect.h" #include "wwstring.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "thread.h" #pragma warning (disable : 4201) // Nonstandard extension - nameless struct #include "systimer.h" diff --git a/Core/Libraries/Source/WWVegas/WWLib/crandom.h b/Core/Libraries/Source/WWVegas/WWLib/crandom.h index ebf05e29ada..1b56babf281 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/crandom.h +++ b/Core/Libraries/Source/WWVegas/WWLib/crandom.h @@ -45,7 +45,7 @@ #endif #ifndef WWDEBUG_H - #include "wwdebug.h" + #include "WWDebug/wwdebug.h" #endif #define CRANDOM_FLOAT_RANGE 0x1000 diff --git a/Core/Libraries/Source/WWVegas/WWLib/hash.cpp b/Core/Libraries/Source/WWVegas/WWLib/hash.cpp index 5309e410135..b7969f68cf4 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/hash.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/hash.cpp @@ -36,7 +36,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "hash.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "realcrc.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWLib/lzo.cpp b/Core/Libraries/Source/WWVegas/WWLib/lzo.cpp index ba763b35e41..e37a94ace78 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/lzo.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/lzo.cpp @@ -38,7 +38,7 @@ #include "lzo.h" #include "mutex.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include /* diff --git a/Core/Libraries/Source/WWVegas/WWLib/lzo1x_c.cpp b/Core/Libraries/Source/WWVegas/WWLib/lzo1x_c.cpp index eee7ebdc1cf..3e1085495db 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/lzo1x_c.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/lzo1x_c.cpp @@ -63,7 +63,7 @@ #include "always.h" #include "lzo1x.h" #include "lzo_conf.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include #if !defined(LZO1X) && !defined(LZO1Y) diff --git a/Core/Libraries/Source/WWVegas/WWLib/mempool.h b/Core/Libraries/Source/WWVegas/WWLib/mempool.h index 0b1bb714e42..1670d81913c 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/mempool.h +++ b/Core/Libraries/Source/WWVegas/WWLib/mempool.h @@ -45,7 +45,7 @@ #pragma once #include "bittype.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "mutex.h" #include #include diff --git a/Core/Libraries/Source/WWVegas/WWLib/mpsc_intrusive_queue.h b/Core/Libraries/Source/WWVegas/WWLib/mpsc_intrusive_queue.h new file mode 100644 index 00000000000..11e3da740af --- /dev/null +++ b/Core/Libraries/Source/WWVegas/WWLib/mpsc_intrusive_queue.h @@ -0,0 +1,79 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2026 TheSuperHackers +** +** 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 . +*/ + +#pragma once + +// Requires to be included first for the Interlocked intrinsics. +#include "Utility/interlocked_adapter.h" +#include "Utility/CppMacros.h" + +// Lock-free intrusive queue for multiple producer threads and a single consumer thread, +// using the same algorithm as the Win32 InterlockedPushEntrySList/InterlockedFlushSList +// pair. The node type T must have a T* next member, which the queue owns while the node +// is queued. +template +class MPSCIntrusiveQueue +{ +public: + MPSCIntrusiveQueue() + : m_head(nullptr) + { + } + + // Pushes a node. Safe to call from multiple threads concurrently. The node is only + // published to the consumer when the compare exchange succeeds against an unchanged + // head, so its next pointer is never visible while stale. + void Push(T* node) + { + T* head; + do + { + head = m_head; + node->next = head; + } + while (InterlockedCompareExchangePointer( + reinterpret_cast(&m_head), node, head) != head); + } + + // Detaches all nodes and returns them linked in push order, or null if the queue is + // empty. Must only be called by the single consumer thread. The whole chain is taken + // with one exchange, so nodes are never popped individually and the push loop cannot + // suffer ABA. + T* Flush() + { + T* list = static_cast(InterlockedExchangePointer( + reinterpret_cast(&m_head), nullptr)); + + // The detached chain is in last-in-first-out order, so reverse it. + T* reversed = nullptr; + while (list != nullptr) + { + T* next = list->next; + list->next = reversed; + reversed = list; + list = next; + } + return reversed; + } + +private: + MPSCIntrusiveQueue(const MPSCIntrusiveQueue&) CPP_11(= delete); + MPSCIntrusiveQueue& operator=(const MPSCIntrusiveQueue&) CPP_11(= delete); + + T* volatile m_head; +}; diff --git a/Core/Libraries/Source/WWVegas/WWLib/multilist.cpp b/Core/Libraries/Source/WWVegas/WWLib/multilist.cpp index 771623cbf5f..f3464fb7d2e 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/multilist.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/multilist.cpp @@ -37,7 +37,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "multilist.h" -#include "wwmemlog.h" +#include "WWDebug/wwmemlog.h" /* ** Declare the pool for ListNodes diff --git a/Core/Libraries/Source/WWVegas/WWLib/mutex.cpp b/Core/Libraries/Source/WWVegas/WWLib/mutex.cpp index 765b1857083..2bd2624e172 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/mutex.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/mutex.cpp @@ -17,7 +17,7 @@ */ #include "mutex.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #ifdef _WIN32 #include #endif diff --git a/Core/Libraries/Source/WWVegas/WWLib/ref_ptr.h b/Core/Libraries/Source/WWVegas/WWLib/ref_ptr.h index 4318d1811c0..f9a57c7c1ef 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/ref_ptr.h +++ b/Core/Libraries/Source/WWVegas/WWLib/ref_ptr.h @@ -37,7 +37,7 @@ #pragma once #include "always.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" /* RefCountPtr is a smart pointer for reference counted objects. diff --git a/Core/Libraries/Source/WWVegas/WWLib/tgatodxt.cpp b/Core/Libraries/Source/WWVegas/WWLib/tgatodxt.cpp index 334fe55fc59..29b6da7d3be 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/tgatodxt.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/tgatodxt.cpp @@ -41,7 +41,7 @@ #include "nvdxtlib.h" #include "TARGA.h" #include "tgatodxt.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include #include diff --git a/Core/Libraries/Source/WWVegas/WWLib/thread.cpp b/Core/Libraries/Source/WWVegas/WWLib/thread.cpp index d3fa33e4e1f..e47b8d61ff2 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/thread.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/thread.cpp @@ -19,7 +19,7 @@ #include "thread.h" #include "Except.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #pragma warning ( push ) #pragma warning ( disable : 4201 ) #include "systimer.h" diff --git a/Core/Libraries/Source/WWVegas/WWLib/widestring.h b/Core/Libraries/Source/WWVegas/WWLib/widestring.h index ee5c52b8aa4..a6860c258f0 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/widestring.h +++ b/Core/Libraries/Source/WWVegas/WWLib/widestring.h @@ -38,7 +38,7 @@ #include #include "always.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include "win.h" #include "wwstring.h" #include "trim.h" diff --git a/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp b/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp index c2e80ec8443..c63bac45575 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp @@ -35,7 +35,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "wwstring.h" -#include "wwmemlog.h" +#include "WWDebug/wwmemlog.h" #include "mutex.h" diff --git a/Core/Libraries/Source/WWVegas/WWLib/wwstring.h b/Core/Libraries/Source/WWVegas/WWLib/wwstring.h index adcaf69cb41..f742426efc1 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/wwstring.h +++ b/Core/Libraries/Source/WWVegas/WWLib/wwstring.h @@ -41,7 +41,7 @@ #include "win.h" #include #include "trim.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #ifdef _WIN32 #include #endif diff --git a/Core/Libraries/Source/WWVegas/WWMath/Vector3i.h b/Core/Libraries/Source/WWVegas/WWMath/Vector3i.h index 3a7bd70a436..404e7e7ef8c 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/Vector3i.h +++ b/Core/Libraries/Source/WWVegas/WWMath/Vector3i.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" class Vector3i { diff --git a/Core/Libraries/Source/WWVegas/WWMath/aabox.h b/Core/Libraries/Source/WWVegas/WWMath/aabox.h index ac78b52c2b6..15ea5d80548 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/aabox.h +++ b/Core/Libraries/Source/WWVegas/WWMath/aabox.h @@ -54,7 +54,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "matrix3d.h" #include "lineseg.h" #include "colmath.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp index 079ac5aad87..37296f93892 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp @@ -36,8 +36,8 @@ #include "aabtreecull.h" -#include "chunkio.h" -#include "iostruct.h" +#include "WWLib/chunkio.h" +#include "WWLib/iostruct.h" #include "sphere.h" #include "colmath.h" #include "colmathinlines.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.h b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.h index 4385093a502..c190799d0a0 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.h +++ b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.h @@ -39,8 +39,8 @@ #include "cullsys.h" #include "aaplane.h" #include "wwmath.h" -#include "mempool.h" -#include "simplevec.h" +#include "WWLib/mempool.h" +#include "WWLib/simplevec.h" #include #include diff --git a/Core/Libraries/Source/WWVegas/WWMath/aaplane.h b/Core/Libraries/Source/WWVegas/WWMath/aaplane.h index 3cc8cad4c9a..58e074de7b6 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/aaplane.h +++ b/Core/Libraries/Source/WWVegas/WWMath/aaplane.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp b/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp index 69f9fc3b437..1717ff23a04 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp @@ -36,10 +36,10 @@ #include "cardinalspline.h" -#include "wwdebug.h" -#include "persistfactory.h" +#include "WWDebug/wwdebug.h" +#include "WWSaveLoad/persistfactory.h" #include "wwmathids.h" -#include "wwhack.h" +#include "WWDebug/wwhack.h" /* ** Force-Link this module because the linker can't detect that we actually need it... diff --git a/Core/Libraries/Source/WWVegas/WWMath/castres.h b/Core/Libraries/Source/WWVegas/WWMath/castres.h index 7b8330cf9a3..f0d9b3b4090 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/castres.h +++ b/Core/Libraries/Source/WWVegas/WWMath/castres.h @@ -36,9 +36,9 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" -#include "bittype.h" +#include "WWLib/bittype.h" /** diff --git a/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp b/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp index 2aa772205fd..9a593875d88 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp @@ -44,9 +44,9 @@ #include "catmullromspline.h" -#include "persistfactory.h" +#include "WWSaveLoad/persistfactory.h" #include "wwmathids.h" -#include "wwhack.h" +#include "WWDebug/wwhack.h" /* ** Force-Link this module because the linker can't detect that we actually need it... diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmath.h b/Core/Libraries/Source/WWVegas/WWMath/colmath.h index e6df1c14568..a8cf0ab3206 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmath.h +++ b/Core/Libraries/Source/WWVegas/WWMath/colmath.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" #include "castres.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp index decb97274f4..ba3927b829f 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp @@ -51,7 +51,7 @@ #include "sphere.h" #include "aabox.h" #include "obbox.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" /*********************************************************************************************** diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.h b/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.h index 70b8c50c0bb..11db1895db2 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.h +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.h @@ -40,7 +40,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "aabox.h" #include "vector3.h" #include "lineseg.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathaabtri.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathaabtri.cpp index e64265243a7..da1cc6c3ee4 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathaabtri.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathaabtri.cpp @@ -50,7 +50,7 @@ #include "colmath.h" #include "aabox.h" #include "tri.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.cpp index 261abc558ab..24e80c36367 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.cpp @@ -45,7 +45,7 @@ #include "aabox.h" #include "obbox.h" #include "frustum.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" // TODO: Most of these overlap functions actually do not catch all cases of when diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.h b/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.h index 528ac9b688a..fee4d428b6c 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.h +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathfrustum.h @@ -39,7 +39,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "aabox.h" #include "vector3.h" #include "lineseg.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathline.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathline.cpp index c55036b636d..726adee7e86 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathline.cpp @@ -43,7 +43,7 @@ #include "sphere.h" #include "aabox.h" #include "obbox.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathobbobb.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathobbobb.cpp index 9af3fd1e007..d1e01f2522e 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathobbobb.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathobbobb.cpp @@ -56,7 +56,7 @@ #include "colmath.h" #include "obbox.h" #include "aabox.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathobbox.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathobbox.cpp index 8dd15f3ad16..c7a71d2b87d 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathobbox.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathobbox.cpp @@ -46,7 +46,7 @@ #include "sphere.h" #include "aabox.h" #include "obbox.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathobbtri.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathobbtri.cpp index 1b3418efb59..18ea575286c 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathobbtri.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathobbtri.cpp @@ -54,7 +54,7 @@ #include "colmath.h" #include "obbox.h" #include "tri.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathplane.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathplane.cpp index 616e7263e07..48e3db7e954 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathplane.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathplane.cpp @@ -47,7 +47,7 @@ #include "sphere.h" #include "aabox.h" #include "obbox.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathplane.h b/Core/Libraries/Source/WWVegas/WWMath/colmathplane.h index 930af321784..f49169e3ee8 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathplane.h +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathplane.h @@ -41,7 +41,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "plane.h" #include "aabox.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathsphere.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathsphere.cpp index 1485c2efc19..fb024348cea 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathsphere.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathsphere.cpp @@ -51,7 +51,7 @@ #include "sphere.h" #include "aabox.h" #include "obbox.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" // Sphere Intersection functions. Does the sphere intersect the passed in object diff --git a/Core/Libraries/Source/WWVegas/WWMath/cullsys.cpp b/Core/Libraries/Source/WWVegas/WWMath/cullsys.cpp index fb2ba1d5f6d..8872828d1a9 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/cullsys.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/cullsys.cpp @@ -35,8 +35,8 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "cullsys.h" -#include "wwdebug.h" -#include "wwprofile.h" +#include "WWDebug/wwdebug.h" +#include "WWDebug/wwprofile.h" /************************************************************************* diff --git a/Core/Libraries/Source/WWVegas/WWMath/cullsys.h b/Core/Libraries/Source/WWVegas/WWMath/cullsys.h index 5539f7ed164..c3c8fba36a0 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/cullsys.h +++ b/Core/Libraries/Source/WWVegas/WWMath/cullsys.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "stdlib.h" #include "aabox.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/culltype.h b/Core/Libraries/Source/WWVegas/WWMath/culltype.h index 83ebc08b3a6..e4c19ca984a 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/culltype.h +++ b/Core/Libraries/Source/WWVegas/WWMath/culltype.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" /* ** CullType is an enumeration of the possible results of a culling diff --git a/Core/Libraries/Source/WWVegas/WWMath/curve.cpp b/Core/Libraries/Source/WWVegas/WWMath/curve.cpp index 11c186825b4..f230fb36cc2 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/curve.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/curve.cpp @@ -38,10 +38,10 @@ #include "curve.h" -#include "wwdebug.h" -#include "persistfactory.h" +#include "WWDebug/wwdebug.h" +#include "WWSaveLoad/persistfactory.h" #include "wwmathids.h" -#include "wwhack.h" +#include "WWDebug/wwhack.h" /* ** Force-Link this module because the linker can't detect that we actually need it... diff --git a/Core/Libraries/Source/WWVegas/WWMath/curve.h b/Core/Libraries/Source/WWVegas/WWMath/curve.h index 4e65d52e9b8..ffc8ee3b48c 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/curve.h +++ b/Core/Libraries/Source/WWVegas/WWMath/curve.h @@ -36,10 +36,10 @@ #pragma once -#include "always.h" -#include "Vector.h" +#include "WWLib/always.h" +#include "WWLib/Vector.h" #include "vector3.h" -#include "persist.h" +#include "WWSaveLoad/persist.h" class ChunkLoadClass; class ChunkSaveClass; diff --git a/Core/Libraries/Source/WWVegas/WWMath/euler.h b/Core/Libraries/Source/WWVegas/WWMath/euler.h index 938fc8d94bd..1de94097fc5 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/euler.h +++ b/Core/Libraries/Source/WWVegas/WWMath/euler.h @@ -37,7 +37,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "matrix3d.h" #include "quat.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/gridcull.cpp b/Core/Libraries/Source/WWVegas/WWMath/gridcull.cpp index 7774d58fa70..4bfdffac08d 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/gridcull.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/gridcull.cpp @@ -55,8 +55,8 @@ #include "gridcull.h" -#include "chunkio.h" -#include "iostruct.h" +#include "WWLib/chunkio.h" +#include "WWLib/iostruct.h" #include "colmath.h" #include "colmathinlines.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/gridcull.h b/Core/Libraries/Source/WWVegas/WWMath/gridcull.h index 11dfe80d769..bfa7ad2c845 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/gridcull.h +++ b/Core/Libraries/Source/WWVegas/WWMath/gridcull.h @@ -54,7 +54,7 @@ #pragma once #include "cullsys.h" -#include "mempool.h" +#include "WWLib/mempool.h" #include "frustum.h" #include "aabox.h" #include "lineseg.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp b/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp index 7d8ca055c91..8aecd6debab 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp @@ -37,8 +37,8 @@ #include "hermitespline.h" #include "wwmathids.h" -#include "persistfactory.h" -#include "wwhack.h" +#include "WWSaveLoad/persistfactory.h" +#include "WWDebug/wwhack.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/lineseg.h b/Core/Libraries/Source/WWVegas/WWMath/lineseg.h index d115a899918..9c1d5910ab6 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/lineseg.h +++ b/Core/Libraries/Source/WWVegas/WWMath/lineseg.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" #include "castres.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp b/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp index 718b5ee3069..5afc5d39a4c 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp @@ -38,10 +38,10 @@ #include "lookuptable.h" #include "curve.h" -#include "WWFILE.h" -#include "ffactory.h" -#include "chunkio.h" -#include "persistfactory.h" +#include "WWLib/WWFILE.h" +#include "WWLib/ffactory.h" +#include "WWLib/chunkio.h" +#include "WWSaveLoad/persistfactory.h" #include "vector2.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/lookuptable.h b/Core/Libraries/Source/WWVegas/WWMath/lookuptable.h index 468f8e57d4d..5cba6a0e2c2 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/lookuptable.h +++ b/Core/Libraries/Source/WWVegas/WWMath/lookuptable.h @@ -38,10 +38,10 @@ #pragma once -#include "always.h" -#include "simplevec.h" -#include "wwstring.h" -#include "multilist.h" +#include "WWLib/always.h" +#include "WWLib/simplevec.h" +#include "WWLib/wwstring.h" +#include "WWLib/multilist.h" #include "wwmath.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/matrix3.h b/Core/Libraries/Source/WWVegas/WWMath/matrix3.h index 57b6bccad0b..9c1b80f7cec 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/matrix3.h +++ b/Core/Libraries/Source/WWVegas/WWMath/matrix3.h @@ -58,9 +58,9 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #ifdef _UNIX #include "osdep.h" #endif diff --git a/Core/Libraries/Source/WWVegas/WWMath/matrix3d.h b/Core/Libraries/Source/WWVegas/WWMath/matrix3d.h index 3c085761163..cdefe1210b0 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/matrix3d.h +++ b/Core/Libraries/Source/WWVegas/WWMath/matrix3d.h @@ -84,7 +84,7 @@ #include "osdep.h" #endif -#include "always.h" +#include "WWLib/always.h" #include #include "vector2.h" #include "vector3.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/matrix4.h b/Core/Libraries/Source/WWVegas/WWMath/matrix4.h index 7883555556c..fd71cad48cb 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/matrix4.h +++ b/Core/Libraries/Source/WWVegas/WWMath/matrix4.h @@ -58,7 +58,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector4.h" #include "matrix3d.h" #include "matrix3.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/obbox.h b/Core/Libraries/Source/WWVegas/WWMath/obbox.h index 69625f9b056..83c3ff2686b 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/obbox.h +++ b/Core/Libraries/Source/WWVegas/WWMath/obbox.h @@ -43,7 +43,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" #include "matrix3.h" #include "matrix3d.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/ode.h b/Core/Libraries/Source/WWVegas/WWMath/ode.h index d0aca3825b3..6113ef9c074 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/ode.h +++ b/Core/Libraries/Source/WWVegas/WWMath/ode.h @@ -37,9 +37,9 @@ #pragma once -#include "always.h" -#include "Vector.h" -#include "wwdebug.h" +#include "WWLib/always.h" +#include "WWLib/Vector.h" +#include "WWDebug/wwdebug.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/plane.h b/Core/Libraries/Source/WWVegas/WWMath/plane.h index f2f6cf3e969..e5eae9d0fd2 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/plane.h +++ b/Core/Libraries/Source/WWVegas/WWMath/plane.h @@ -37,7 +37,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" #include "sphere.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/quat.h b/Core/Libraries/Source/WWVegas/WWMath/quat.h index 8cfad3e4c1a..6b9ef24e700 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/quat.h +++ b/Core/Libraries/Source/WWVegas/WWMath/quat.h @@ -37,7 +37,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "wwmath.h" #include "matrix3.h" #include "vector3.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/sphere.h b/Core/Libraries/Source/WWVegas/WWMath/sphere.h index a9fda957a41..a6cd3b577d0 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/sphere.h +++ b/Core/Libraries/Source/WWVegas/WWMath/sphere.h @@ -50,7 +50,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" #include "matrix3d.h" @@ -65,7 +65,7 @@ class SphereClass { public: - SphereClass() { }; + SphereClass() : Center(Vector3(0.0f, 0.0f, 0.0f)), Radius(0.0f) { } SphereClass(const Vector3 & center,float radius) { Init(center,radius); } SphereClass(const Matrix3D& mtx,const Vector3 & center,float radius) { Init(mtx,center,radius); } inline SphereClass(const Vector3 & center,const SphereClass & s0); @@ -77,6 +77,7 @@ class SphereClass inline void Add_Sphere(const SphereClass & s); inline void Transform(const Matrix3D & tm); inline float Volume() const; + inline bool Is_Valid() const; inline SphereClass & operator += (const SphereClass & s); inline SphereClass & operator *= (const Matrix3D & m); @@ -303,7 +304,7 @@ inline void SphereClass::Re_Center(const Vector3 & center) *=============================================================================================*/ inline void SphereClass::Add_Sphere(const SphereClass & s) { - if (s.Radius == 0.0f) return; + if (!s.Is_Valid()) return; float dist = (s.Center - Center).Length(); if (dist == 0.0f) { @@ -453,12 +454,12 @@ inline bool Spheres_Intersect(const SphereClass & s0,const SphereClass & s1) *=============================================================================================*/ inline SphereClass Add_Spheres(const SphereClass & s0, const SphereClass & s1) { - if (s0.Radius == 0.0f) { - return s1; - } else { + if (s0.Is_Valid()) { SphereClass result(s0); result.Add_Sphere(s1); return result; + } else { + return s1; } } @@ -540,3 +541,8 @@ inline SphereClass operator * (const Matrix3D & m, const SphereClass & s) { return Transform_Sphere(m,s); } + +inline bool SphereClass::Is_Valid() const +{ + return Radius > 0.0f; +} diff --git a/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp b/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp index f0fad77ef5e..27014851868 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp @@ -36,10 +36,10 @@ #include "tcbspline.h" -#include "wwdebug.h" -#include "persistfactory.h" +#include "WWDebug/wwdebug.h" +#include "WWSaveLoad/persistfactory.h" #include "wwmathids.h" -#include "wwhack.h" +#include "WWDebug/wwhack.h" /* diff --git a/Core/Libraries/Source/WWVegas/WWMath/tri.h b/Core/Libraries/Source/WWVegas/WWMath/tri.h index e2e60c692d0..dd2c9151cf3 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/tri.h +++ b/Core/Libraries/Source/WWVegas/WWMath/tri.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector4.h" #include "vector3.h" #include "vector2.h" diff --git a/Core/Libraries/Source/WWVegas/WWMath/v3_rnd.h b/Core/Libraries/Source/WWVegas/WWMath/v3_rnd.h index c2e6d055102..613582b56fa 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/v3_rnd.h +++ b/Core/Libraries/Source/WWVegas/WWMath/v3_rnd.h @@ -36,9 +36,9 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "vector3.h" -#include "RANDOM.h" +#include "WWLib/RANDOM.h" #include /* @@ -125,7 +125,7 @@ class Vector3SolidBoxRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3SolidBoxRandomizer & operator = (const Vector3SolidBoxRandomizer&) CPP_11(= delete); + Vector3SolidBoxRandomizer & operator = (const Vector3SolidBoxRandomizer&) FUNCTION_DELETE; Vector3 Extents; }; @@ -156,7 +156,7 @@ class Vector3SolidSphereRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3SolidSphereRandomizer & operator = (const Vector3SolidSphereRandomizer&) CPP_11(= delete); + Vector3SolidSphereRandomizer & operator = (const Vector3SolidSphereRandomizer&) FUNCTION_DELETE; float Radius; }; @@ -187,7 +187,7 @@ class Vector3HollowSphereRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3HollowSphereRandomizer & operator = (const Vector3HollowSphereRandomizer&) CPP_11(= delete); + Vector3HollowSphereRandomizer & operator = (const Vector3HollowSphereRandomizer&) FUNCTION_DELETE; float Radius; }; @@ -219,7 +219,7 @@ class Vector3SolidCylinderRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3SolidCylinderRandomizer & operator = (const Vector3SolidCylinderRandomizer&) CPP_11(= delete); + Vector3SolidCylinderRandomizer & operator = (const Vector3SolidCylinderRandomizer&) FUNCTION_DELETE; float Extent; float Radius; diff --git a/Core/Libraries/Source/WWVegas/WWMath/vector2.h b/Core/Libraries/Source/WWVegas/WWMath/vector2.h index 0d0035c73da..456e831a569 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vector2.h +++ b/Core/Libraries/Source/WWVegas/WWMath/vector2.h @@ -51,7 +51,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "wwmath.h" #include diff --git a/Core/Libraries/Source/WWVegas/WWMath/vector2i.h b/Core/Libraries/Source/WWVegas/WWMath/vector2i.h index 3e28f7ab882..f8d4db8aeab 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vector2i.h +++ b/Core/Libraries/Source/WWVegas/WWMath/vector2i.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" class Vector2i { diff --git a/Core/Libraries/Source/WWVegas/WWMath/vector3.h b/Core/Libraries/Source/WWVegas/WWMath/vector3.h index 3e371557d9a..3190eb2a636 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vector3.h +++ b/Core/Libraries/Source/WWVegas/WWMath/vector3.h @@ -65,7 +65,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "wwmath.h" #include #ifdef _UNIX diff --git a/Core/Libraries/Source/WWVegas/WWMath/vector4.h b/Core/Libraries/Source/WWVegas/WWMath/vector4.h index e6dc70b4abd..c0bc336ac9c 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vector4.h +++ b/Core/Libraries/Source/WWVegas/WWMath/vector4.h @@ -46,7 +46,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "wwmath.h" #include diff --git a/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.cpp b/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.cpp index a671ca700c5..ddacd48b50e 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.cpp @@ -37,9 +37,9 @@ #include "vehiclecurve.h" #include "vector3.h" #include "matrix3d.h" -#include "persistfactory.h" +#include "WWSaveLoad/persistfactory.h" #include "wwmathids.h" -#include "wwmemlog.h" +#include "WWDebug/wwmemlog.h" ////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.h b/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.h index 4ed393fec87..81e7fd120cc 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.h +++ b/Core/Libraries/Source/WWVegas/WWMath/vehiclecurve.h @@ -37,7 +37,7 @@ #pragma once #include "curve.h" -#include "Vector.h" +#include "WWLib/Vector.h" //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWMath/vp.cpp b/Core/Libraries/Source/WWVegas/WWMath/vp.cpp index 16346e380b7..65af31e8b4a 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/vp.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/vp.cpp @@ -41,8 +41,8 @@ #include "vector4.h" #include "matrix3d.h" #include "matrix4.h" -#include "wwdebug.h" -#include "cpudetect.h" +#include "WWDebug/wwdebug.h" +#include "WWLib/cpudetect.h" #include #define SHUFFLE(x, y, z, w) (((x)&3)<< 6|((y)&3)<<4|((z)&3)<< 2|((w)&3)) diff --git a/Core/Libraries/Source/WWVegas/WWMath/wwmath.cpp b/Core/Libraries/Source/WWVegas/WWMath/wwmath.cpp index ab5c0f91276..526d1556650 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/wwmath.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/wwmath.cpp @@ -36,11 +36,11 @@ #include "wwmath.h" -#include "wwhack.h" +#include "WWDebug/wwhack.h" #include "lookuptable.h" #include -#include "wwdebug.h" -#include "wwprofile.h" +#include "WWDebug/wwdebug.h" +#include "WWDebug/wwprofile.h" // TODO: convert to use loouptablemanager... float _FastAcosTable[ARC_TABLE_SIZE]; diff --git a/Core/Libraries/Source/WWVegas/WWMath/wwmath.h b/Core/Libraries/Source/WWVegas/WWMath/wwmath.h index 222a2f11683..152d939f84b 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/wwmath.h +++ b/Core/Libraries/Source/WWVegas/WWMath/wwmath.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include #include #include diff --git a/Core/Libraries/Source/WWVegas/WWMath/wwmathids.h b/Core/Libraries/Source/WWVegas/WWMath/wwmathids.h index 786757d8438..d6adb14b421 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/wwmathids.h +++ b/Core/Libraries/Source/WWVegas/WWMath/wwmathids.h @@ -38,7 +38,7 @@ #pragma once -#include "saveloadids.h" +#include "WWSaveLoad/saveloadids.h" /* ** Persist Factory ID's for WWMATH diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.cpp index 418a7089f74..a41095ab897 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.cpp @@ -35,7 +35,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "definition.h" -#include "chunkio.h" +#include "WWLib/chunkio.h" ////////////////////////////////////////////////////////////////////////////////// // Constants diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.h index eb14a0e448a..d7913a70f32 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definition.h @@ -36,12 +36,12 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" // SKB Remove because of G conflicts with CLASSID_?? #include "definitionclassids.h" #include "definitionmgr.h" #include "editable.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" // Forward declarations class ChunkSaveClass; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionclassids.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionclassids.h index 8d74a2d5a0a..91da59dd559 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionclassids.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionclassids.h @@ -36,8 +36,8 @@ #pragma once -#include "always.h" -#include "bittype.h" +#include "WWLib/always.h" +#include "WWLib/bittype.h" ////////////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactory.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactory.h index dd586a9717f..6b2c4221d6c 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactory.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactory.h @@ -36,8 +36,8 @@ #pragma once -#include "always.h" -#include "bittype.h" +#include "WWLib/always.h" +#include "WWLib/bittype.h" #include "definitionclassids.h" // Forward declarations diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.cpp index e87b19d4c15..d742ed7a3d7 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.cpp @@ -36,7 +36,7 @@ #include "definitionfactorymgr.h" #include "definitionfactory.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #ifdef _UNIX #include "osdep.h" diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.h index 2f15bf2dcae..cacef49f30c 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionfactorymgr.h @@ -36,8 +36,8 @@ #pragma once -#include "always.h" -#include "bittype.h" +#include "WWLib/always.h" +#include "WWLib/bittype.h" #include "definitionclassids.h" class DefinitionFactoryClass; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp index 997bd8085c1..468bab109ad 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp @@ -39,12 +39,12 @@ #include "definitionfactory.h" #include "definitionfactorymgr.h" #include "definitionclassids.h" -#include "chunkio.h" +#include "WWLib/chunkio.h" #include "persistfactory.h" -#include "wwdebug.h" -#include "wwmemlog.h" +#include "WWDebug/wwdebug.h" +#include "WWDebug/wwmemlog.h" #include "twiddler.h" -#include "wwprofile.h" +#include "WWDebug/wwprofile.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.h index 2f57c3c32f8..9a05209eacd 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.h @@ -36,14 +36,14 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "saveload.h" #include "saveloadsubsystem.h" #include "saveloadids.h" -#include "wwdebug.h" -#include "wwstring.h" -#include "hashtemplate.h" -#include "Vector.h" +#include "WWDebug/wwdebug.h" +#include "WWLib/wwstring.h" +#include "WWLib/hashtemplate.h" +#include "WWLib/Vector.h" // Forward declarations diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/editable.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/editable.h index 3bf6378f6e2..c29482ab843 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/editable.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/editable.h @@ -43,12 +43,12 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "persist.h" #include "parameter.h" #include "simpleparameter.h" #include "parameterlist.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" ////////////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.cpp index c947f3de843..26e8ef21ff0 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.cpp @@ -40,7 +40,7 @@ #include "parameter.h" #include "parametertypes.h" #include "simpleparameter.h" -#include "wwstring.h" +#include "WWLib/wwstring.h" #include "definitionclassids.h" diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.h index 0957c3593a5..18ba03ecf3a 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.h @@ -38,13 +38,13 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include #include "parametertypes.h" -#include "Vector.h" -#include "wwstring.h" -#include "bittype.h" -#include "obbox.h" +#include "WWLib/Vector.h" +#include "WWLib/wwstring.h" +#include "WWLib/bittype.h" +#include "WWMath/obbox.h" ////////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/parameterlist.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/parameterlist.h index 9af4e862c2a..cca68aff8ba 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/parameterlist.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/parameterlist.h @@ -36,10 +36,10 @@ #pragma once -#include "always.h" -#include "Vector.h" +#include "WWLib/always.h" +#include "WWLib/Vector.h" #include "parameter.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" ////////////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/parametertypes.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/parametertypes.h index 8964521f6fc..48f23362763 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/parametertypes.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/parametertypes.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" ////////////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/persist.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/persist.h index eb614390c52..7fa8e8ae7f8 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/persist.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/persist.h @@ -36,7 +36,7 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "postloadable.h" class PersistFactoryClass; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h index c4ee4038d88..bf394565f24 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h @@ -36,10 +36,10 @@ #pragma once -#include "always.h" -#include "bittype.h" -#include "chunkio.h" -#include "wwdebug.h" +#include "WWLib/always.h" +#include "WWLib/bittype.h" +#include "WWLib/chunkio.h" +#include "WWDebug/wwdebug.h" #include "saveload.h" #include "persist.h" diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp index 615c4c51c49..73301dfe1a5 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp @@ -36,7 +36,7 @@ #include "pointerremap.h" -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" const int POINTER_TABLES_GROWTH_STEP = 4096; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.h index 4d01f231e51..55b0cd142c6 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.h @@ -40,8 +40,8 @@ #include "../WWLib/osdep.h" // TheSuperHackers @build 08/02/2026 Fix include path #endif -#include "always.h" -#include "Vector.h" +#include "WWLib/always.h" +#include "WWLib/Vector.h" class RefCountClass; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.cpp index 3cef5e0e19a..cb7b8e1d803 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.cpp @@ -39,17 +39,17 @@ #include "saveloadsubsystem.h" #include "persist.h" #include "persistfactory.h" -#include "chunkio.h" -#include "wwdebug.h" +#include "WWLib/chunkio.h" +#include "WWDebug/wwdebug.h" #include "saveloadstatus.h" -#include "wwhack.h" -#include "wwprofile.h" +#include "WWDebug/wwhack.h" +#include "WWDebug/wwprofile.h" #pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union #ifdef _WIN32 #include #endif -#include "systimer.h" +#include "WWLib/systimer.h" SaveLoadSubSystemClass * SaveLoadSystemClass::SubSystemListHead = nullptr; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.h index 010cfe17db3..e33357b7680 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveload.h @@ -36,10 +36,10 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "pointerremap.h" -#include "bittype.h" -#include "SLIST.h" +#include "WWLib/bittype.h" +#include "WWLib/SLIST.h" class RefCountClass; class SaveLoadSubSystemClass; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.cpp index ed1b533bba6..11998389a39 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.cpp @@ -17,7 +17,7 @@ */ #include "saveloadstatus.h" -#include "mutex.h" +#include "WWLib/mutex.h" #define MAX_STATUS_TEXT_ID 2 diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.h index 825a2539c77..16c8addb67f 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadstatus.h @@ -18,8 +18,8 @@ #pragma once -#include "always.h" -#include "wwstring.h" +#include "WWLib/always.h" +#include "WWLib/wwstring.h" namespace SaveLoadStatus { diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadsubsystem.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadsubsystem.h index 0a1f2b975a7..01efb4eb727 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadsubsystem.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/saveloadsubsystem.h @@ -36,8 +36,8 @@ #pragma once -#include "always.h" -#include "bittype.h" +#include "WWLib/always.h" +#include "WWLib/bittype.h" #include "postloadable.h" class ChunkLoadClass; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/simpleparameter.h b/Core/Libraries/Source/WWVegas/WWSaveLoad/simpleparameter.h index dce65b5bec3..a08dd171996 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/simpleparameter.h +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/simpleparameter.h @@ -36,12 +36,12 @@ #pragma once -#include "always.h" +#include "WWLib/always.h" #include "parameter.h" -#include "vector2.h" -#include "vector3.h" -#include "matrix3d.h" -#include "rect.h" +#include "WWMath/vector2.h" +#include "WWMath/vector3.h" +#include "WWMath/matrix3d.h" +#include "WWMath/rect.h" #include diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/twiddler.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/twiddler.cpp index 9340de585ce..0ab0673f6d6 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/twiddler.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/twiddler.cpp @@ -36,13 +36,13 @@ #include "twiddler.h" -#include "RANDOM.h" +#include "WWLib/RANDOM.h" #include "saveloadids.h" #include "simpledefinitionfactory.h" #include "persistfactory.h" -#include "win.h" -#include "wwhack.h" -#include "systimer.h" +#include "WWLib/win.h" +#include "WWDebug/wwhack.h" +#include "WWLib/systimer.h" DECLARE_FORCE_LINK( Twiddler ) diff --git a/Core/Libraries/Source/WWVegas/WWStub/wwallocstub.cpp b/Core/Libraries/Source/WWVegas/WWStub/wwallocstub.cpp index eb4ea7ec38d..0a608705bf6 100644 --- a/Core/Libraries/Source/WWVegas/WWStub/wwallocstub.cpp +++ b/Core/Libraries/Source/WWVegas/WWStub/wwallocstub.cpp @@ -18,7 +18,7 @@ // TheSuperHackers @build feliwir 15/04/2025 Simple allocator implementation useful for tools -#include "always.h" +#include "WWLib/always.h" #include #ifdef _OPERATOR_NEW_DEFINED_ diff --git a/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp b/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp index 903b170c453..d3e912c3c61 100644 --- a/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp +++ b/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp @@ -18,7 +18,7 @@ // TheSuperHackers @build feliwir 15/04/2025 Simple debug implementation useful for tools -#include "wwdebug.h" +#include "WWDebug/wwdebug.h" #include #include #include diff --git a/Core/Libraries/Source/debug/debug_debug.cpp b/Core/Libraries/Source/debug/debug_debug.cpp index f0e25f90ec2..9da1c855f32 100644 --- a/Core/Libraries/Source/debug/debug_debug.cpp +++ b/Core/Libraries/Source/debug/debug_debug.cpp @@ -33,7 +33,7 @@ #include "internal_io.h" #include #include -#include +#include #include // needed for placement new prototype // a little dummy variable that makes the linker actually include diff --git a/Core/Libraries/Source/debug/debug_io_flat.cpp b/Core/Libraries/Source/debug/debug_io_flat.cpp index aae3e7f45cc..83fa54d2a21 100644 --- a/Core/Libraries/Source/debug/debug_io_flat.cpp +++ b/Core/Libraries/Source/debug/debug_io_flat.cpp @@ -33,7 +33,7 @@ #include "internal_io.h" #include #include -#include +#include #include // needed for placement new prototype DebugIOFlat::OutputStream::OutputStream(const char *filename, unsigned maxSize): diff --git a/Core/Libraries/Source/debug/debug_stack.cpp b/Core/Libraries/Source/debug/debug_stack.cpp index 396a2754da9..8e0aca49557 100644 --- a/Core/Libraries/Source/debug/debug_stack.cpp +++ b/Core/Libraries/Source/debug/debug_stack.cpp @@ -30,7 +30,7 @@ #include "debug.h" #include "debug_stack.h" #include -#include "stringex.h" +#include "WWLib/stringex.h" #include // Definitions to allow run-time linking to the dbghelp.dll functions. diff --git a/Core/Libraries/Source/debug/internal.h b/Core/Libraries/Source/debug/internal.h index f946080acee..3b5b8efc163 100644 --- a/Core/Libraries/Source/debug/internal.h +++ b/Core/Libraries/Source/debug/internal.h @@ -37,7 +37,7 @@ #ifdef _DEBUG # define __ASSERT(x) do { if (!(x)) DebugInternalAssert(__FILE__,__LINE__,#x); } while (0) #else -# define __ASSERT(x) do { } while(0) +# define __ASSERT(x) #endif /** \internal diff --git a/Core/Libraries/Source/profile/internal.h b/Core/Libraries/Source/profile/internal.h index 95bbcc0175b..7f55b53df68 100644 --- a/Core/Libraries/Source/profile/internal.h +++ b/Core/Libraries/Source/profile/internal.h @@ -47,8 +47,8 @@ class ProfileFastCS { - ProfileFastCS(const ProfileFastCS&) CPP_11(= delete); - ProfileFastCS& operator=(const ProfileFastCS&) CPP_11(= delete); + ProfileFastCS(const ProfileFastCS&) FUNCTION_DELETE; + ProfileFastCS& operator=(const ProfileFastCS&) FUNCTION_DELETE; #ifdef _WIN32 static HANDLE testEvent; @@ -118,8 +118,8 @@ class ProfileFastCS class Lock { - Lock(const Lock&) CPP_11(= delete); - Lock& operator=(const Lock&) CPP_11(= delete); + Lock(const Lock&) FUNCTION_DELETE; + Lock& operator=(const Lock&) FUNCTION_DELETE; ProfileFastCS& CriticalSection; diff --git a/Core/Libraries/Source/profile/profile_highlevel.cpp b/Core/Libraries/Source/profile/profile_highlevel.cpp index 271f088332e..91b09a4f4a5 100644 --- a/Core/Libraries/Source/profile/profile_highlevel.cpp +++ b/Core/Libraries/Source/profile/profile_highlevel.cpp @@ -32,7 +32,7 @@ #include // GeneralsX @build fbraz 03/02/2026 Add C string functions for Linux #include -#include +#include // our own fast critical section static ProfileFastCS cs; diff --git a/Core/Tools/Autorun/GameText.cpp b/Core/Tools/Autorun/GameText.cpp index d318b87ca1d..847598ca9bb 100644 --- a/Core/Tools/Autorun/GameText.cpp +++ b/Core/Tools/Autorun/GameText.cpp @@ -47,8 +47,8 @@ #include #include "GameText.h" -#define DEBUG_LOG(x) {} -#define DEBUG_ASSERTCRASH(x, y) {} +#define DEBUG_LOG(x) +#define DEBUG_ASSERTCRASH(x, y) //#include //#include diff --git a/Core/Tools/CRCDiff/debug.h b/Core/Tools/CRCDiff/debug.h index 1945b6ef99f..9efce5faa4d 100644 --- a/Core/Tools/CRCDiff/debug.h +++ b/Core/Tools/CRCDiff/debug.h @@ -31,6 +31,6 @@ void DebugLog( const char *fmt, ... ); #else // DEBUG -#define DEBUG_LOG(x) {} +#define DEBUG_LOG(x) #endif // DEBUG diff --git a/Core/Tools/ImagePacker/Source/ImagePacker.cpp b/Core/Tools/ImagePacker/Source/ImagePacker.cpp index d80ca888b61..30f6a43c931 100644 --- a/Core/Tools/ImagePacker/Source/ImagePacker.cpp +++ b/Core/Tools/ImagePacker/Source/ImagePacker.cpp @@ -43,7 +43,7 @@ // SYSTEM INCLUDES //////////////////////////////////////////////////////////// #include #include -#include +#include // USER INCLUDES ////////////////////////////////////////////////////////////// #include "Common/Debug.h" diff --git a/Core/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cpp b/Core/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cpp index 2d299b44d1e..184f807a4c9 100644 --- a/Core/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cpp +++ b/Core/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cpp @@ -39,7 +39,7 @@ // SYSTEM INCLUDES //////////////////////////////////////////////////////////// #include -#include +#include // USER INCLUDES ////////////////////////////////////////////////////////////// #include "ImagePacker.h" diff --git a/Core/Tools/Launcher/wdebug.h b/Core/Tools/Launcher/wdebug.h index 34a1db3bfd3..675fa0aecbe 100644 --- a/Core/Tools/Launcher/wdebug.h +++ b/Core/Tools/Launcher/wdebug.h @@ -122,10 +122,10 @@ will you be ready to leave grasshopper. // They are defined to {} for consistency when DEBUG is defined #define DBG(X) -#define DBGSTREAM(X) {} -#define PVAR(v) {} -#define DBGMSG(X) {} -#define VERBOSE(X) {} +#define DBGSTREAM(X) +#define PVAR(v) +#define DBGMSG(X) +#define VERBOSE(X) #else // DEBUG _is_ defined diff --git a/Core/Tools/MapCacheBuilder/Source/WinMain.cpp b/Core/Tools/MapCacheBuilder/Source/WinMain.cpp index f26f8952ee2..134f1465980 100644 --- a/Core/Tools/MapCacheBuilder/Source/WinMain.cpp +++ b/Core/Tools/MapCacheBuilder/Source/WinMain.cpp @@ -102,7 +102,7 @@ #include "Win32Device/GameClient/Win32Mouse.h" #include "Win32Device/Common/Win32LocalFileSystem.h" #include "Win32Device/Common/Win32BIGFileSystem.h" -#include "trim.h" +#include "WWLib/trim.h" // DEFINES //////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/PATCHGET/debug.h b/Core/Tools/PATCHGET/debug.h index 90eb764def5..c5697a33f50 100644 --- a/Core/Tools/PATCHGET/debug.h +++ b/Core/Tools/PATCHGET/debug.h @@ -32,7 +32,7 @@ void DebugLog( const char *fmt, ... ); #else // DEBUG -#define DEBUG_LOG(x) {} +#define DEBUG_LOG(x) #endif // DEBUG diff --git a/Core/Tools/W3DView/AddToLineupDialog.cpp b/Core/Tools/W3DView/AddToLineupDialog.cpp index 06feb6e3616..5ad9a9c9cb9 100644 --- a/Core/Tools/W3DView/AddToLineupDialog.cpp +++ b/Core/Tools/W3DView/AddToLineupDialog.cpp @@ -24,8 +24,8 @@ #include "AddToLineupDialog.h" #include "ViewerScene.h" -#include -#include +#include +#include #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/AdvancedAnimSheet.cpp b/Core/Tools/W3DView/AdvancedAnimSheet.cpp index c67a57ce727..52d8d6f7186 100644 --- a/Core/Tools/W3DView/AdvancedAnimSheet.cpp +++ b/Core/Tools/W3DView/AdvancedAnimSheet.cpp @@ -24,9 +24,9 @@ #include "W3DViewDoc.h" #include "AdvancedAnimSheet.h" -#include "assetmgr.h" -#include "hanim.h" -#include "htree.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/hanim.h" +#include "WW3D2/htree.h" #include "Utils.h" diff --git a/Core/Tools/W3DView/AggregateNameDialog.cpp b/Core/Tools/W3DView/AggregateNameDialog.cpp index 64478bb59b5..e4c71a8cfa0 100644 --- a/Core/Tools/W3DView/AggregateNameDialog.cpp +++ b/Core/Tools/W3DView/AggregateNameDialog.cpp @@ -34,7 +34,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "AggregateNameDialog.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/AnimMixingPage.cpp b/Core/Tools/W3DView/AnimMixingPage.cpp index ddb968c7a70..74b3653d99a 100644 --- a/Core/Tools/W3DView/AnimMixingPage.cpp +++ b/Core/Tools/W3DView/AnimMixingPage.cpp @@ -25,11 +25,11 @@ #include "AdvancedAnimSheet.h" #include "AnimMixingPage.h" -#include "rendobj.h" -#include "htree.h" -#include "hanim.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/htree.h" +#include "WW3D2/hanim.h" #include "Utils.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/AnimReportPage.cpp b/Core/Tools/W3DView/AnimReportPage.cpp index 17286668dae..23b095c0512 100644 --- a/Core/Tools/W3DView/AnimReportPage.cpp +++ b/Core/Tools/W3DView/AnimReportPage.cpp @@ -26,8 +26,8 @@ #include "AnimReportPage.h" -#include "hanim.h" -#include "htree.h" +#include "WW3D2/hanim.h" +#include "WW3D2/htree.h" #include "Utils.h" diff --git a/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp b/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp index 869a2ea88da..a0874d0eece 100644 --- a/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp +++ b/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp @@ -23,13 +23,13 @@ #include "W3DView.h" #include "Globals.h" #include "AnimatedSoundOptionsDialog.h" -#include "ffactory.h" -#include "animatedsoundmgr.h" -#include "wwsaveload.h" -#include "definitionmgr.h" -#include "WWFILE.h" -#include "chunkio.h" -#include "wwdebug.h" +#include "WWLib/ffactory.h" +#include "WW3D2/animatedsoundmgr.h" +#include "WWSaveLoad/wwsaveload.h" +#include "WWSaveLoad/definitionmgr.h" +#include "WWLib/WWFILE.h" +#include "WWLib/chunkio.h" +#include "WWDebug/wwdebug.h" #include "RestrictedFileDialog.h" #include "Utils.h" diff --git a/Core/Tools/W3DView/AnimationPropPage.cpp b/Core/Tools/W3DView/AnimationPropPage.cpp index 7e2cd5c3707..98676274f09 100644 --- a/Core/Tools/W3DView/AnimationPropPage.cpp +++ b/Core/Tools/W3DView/AnimationPropPage.cpp @@ -22,9 +22,9 @@ #include "StdAfx.h" #include "W3DView.h" #include "AnimationPropPage.h" -#include "rendobj.h" -#include "assetmgr.h" -#include "mesh.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/mesh.h" #include "W3DViewDoc.h" #include "Utils.h" diff --git a/Core/Tools/W3DView/AssetInfo.cpp b/Core/Tools/W3DView/AssetInfo.cpp index 4a4d7ee07b0..6a712d8402e 100644 --- a/Core/Tools/W3DView/AssetInfo.cpp +++ b/Core/Tools/W3DView/AssetInfo.cpp @@ -38,8 +38,8 @@ #include "StdAfx.h" #include "AssetInfo.h" //#include "HModel.h" -#include "assetmgr.h" -#include "htree.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/htree.h" ///////////////////////////////////////////////////////////////// // diff --git a/Core/Tools/W3DView/AssetInfo.h b/Core/Tools/W3DView/AssetInfo.h index 68fea267f27..73875689798 100644 --- a/Core/Tools/W3DView/AssetInfo.h +++ b/Core/Tools/W3DView/AssetInfo.h @@ -36,7 +36,7 @@ #pragma once -#include "rendobj.h" +#include "WW3D2/rendobj.h" #include "Utils.h" #include "AssetTypes.h" diff --git a/Core/Tools/W3DView/BackgroundObjectDialog.cpp b/Core/Tools/W3DView/BackgroundObjectDialog.cpp index 1486d58cf56..1ece2050f44 100644 --- a/Core/Tools/W3DView/BackgroundObjectDialog.cpp +++ b/Core/Tools/W3DView/BackgroundObjectDialog.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "BackgroundObjectDialog.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "Utils.h" #include "W3DViewDoc.h" diff --git a/Core/Tools/W3DView/BoneMgrDialog.cpp b/Core/Tools/W3DView/BoneMgrDialog.cpp index af6faf3150c..0a76720cfc5 100644 --- a/Core/Tools/W3DView/BoneMgrDialog.cpp +++ b/Core/Tools/W3DView/BoneMgrDialog.cpp @@ -22,8 +22,8 @@ #include "StdAfx.h" #include "W3DView.h" #include "BoneMgrDialog.h" -#include "htree.h" -#include "assetmgr.h" +#include "WW3D2/htree.h" +#include "WW3D2/assetmgr.h" #include "Utils.h" #include "MainFrm.h" #include "W3DViewDoc.h" diff --git a/Core/Tools/W3DView/BoneMgrDialog.h b/Core/Tools/W3DView/BoneMgrDialog.h index 5cc0d9458c4..4605398abbf 100644 --- a/Core/Tools/W3DView/BoneMgrDialog.h +++ b/Core/Tools/W3DView/BoneMgrDialog.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "Vector.h" +#include "WWLib/Vector.h" // Forward declarations class HModelClass; diff --git a/Core/Tools/W3DView/CameraSettingsDialog.cpp b/Core/Tools/W3DView/CameraSettingsDialog.cpp index 050273442df..bd03c805eb7 100644 --- a/Core/Tools/W3DView/CameraSettingsDialog.cpp +++ b/Core/Tools/W3DView/CameraSettingsDialog.cpp @@ -25,7 +25,7 @@ #include "GraphicView.h" #include "CameraSettingsDialog.h" #include "Utils.h" -#include "camera.h" +#include "WW3D2/camera.h" #include "ViewerScene.h" diff --git a/Core/Tools/W3DView/ColorSelectionDialog.h b/Core/Tools/W3DView/ColorSelectionDialog.h index ecc86dfe697..f13c661f3c8 100644 --- a/Core/Tools/W3DView/ColorSelectionDialog.h +++ b/Core/Tools/W3DView/ColorSelectionDialog.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "vector3.h" +#include "WWMath/vector3.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/DataTreeView.cpp b/Core/Tools/W3DView/DataTreeView.cpp index b7227ee149c..502c892b02f 100644 --- a/Core/Tools/W3DView/DataTreeView.cpp +++ b/Core/Tools/W3DView/DataTreeView.cpp @@ -38,23 +38,23 @@ #include "StdAfx.h" #include "W3DView.h" #include "DataTreeView.h" -#include "rendobj.h" +#include "WW3D2/rendobj.h" #include "ViewerAssetMgr.h" #include "Globals.h" #include "W3DViewDoc.h" #include "MainFrm.h" -#include "distlod.h" -#include "animobj.h" -#include "hcanim.h" +#include "WW3D2/distlod.h" +#include "WW3D2/animobj.h" +#include "WW3D2/hcanim.h" #include "AssetInfo.h" #include "Utils.h" -#include "Vector.h" -#include "part_emt.h" -#include "agg_def.h" -#include "bmp2d.h" -#include "hlod.h" +#include "WWLib/Vector.h" +#include "WW3D2/part_emt.h" +#include "WW3D2/agg_def.h" +#include "WW3D2/bmp2d.h" +#include "WW3D2/hlod.h" #include "ViewerScene.h" -#include "texture.h" +#include "WW3D2/texture.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/DataTreeView.h b/Core/Tools/W3DView/DataTreeView.h index 9528406d324..c5d3a88cfbb 100644 --- a/Core/Tools/W3DView/DataTreeView.h +++ b/Core/Tools/W3DView/DataTreeView.h @@ -23,7 +23,7 @@ #include "AfxCView.h" #include "AssetTypes.h" -#include "Vector.h" +#include "WWLib/Vector.h" // Forward declarations class RenderObjClass; diff --git a/Core/Tools/W3DView/DeviceSelectionDialog.cpp b/Core/Tools/W3DView/DeviceSelectionDialog.cpp index 6481ce2446a..cb5a3343e27 100644 --- a/Core/Tools/W3DView/DeviceSelectionDialog.cpp +++ b/Core/Tools/W3DView/DeviceSelectionDialog.cpp @@ -23,11 +23,11 @@ #include "W3DView.h" #include "DeviceSelectionDialog.h" -#include "ww3d.h" +#include "WW3D2/ww3d.h" #include "resource.h" #include "Globals.h" #include "Utils.h" -#include "rddesc.h" +#include "WW3D2/rddesc.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/EditLODDialog.cpp b/Core/Tools/W3DView/EditLODDialog.cpp index f9ca6313290..a415b017e55 100644 --- a/Core/Tools/W3DView/EditLODDialog.cpp +++ b/Core/Tools/W3DView/EditLODDialog.cpp @@ -22,9 +22,9 @@ #include "StdAfx.h" #include "W3DView.h" #include "EditLODDialog.h" -#include "distlod.h" +#include "WW3D2/distlod.h" #include "Utils.h" -#include "rendobj.h" +#include "WW3D2/rendobj.h" #include "W3DViewDoc.h" diff --git a/Core/Tools/W3DView/EmitterColorPropPage.cpp b/Core/Tools/W3DView/EmitterColorPropPage.cpp index f53e6d5ae51..1cfa69653a2 100644 --- a/Core/Tools/W3DView/EmitterColorPropPage.cpp +++ b/Core/Tools/W3DView/EmitterColorPropPage.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "EmitterColorPropPage.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" #include "Utils.h" #include "OpacitySettingsDialog.h" #include "ColorUtils.h" diff --git a/Core/Tools/W3DView/EmitterColorPropPage.h b/Core/Tools/W3DView/EmitterColorPropPage.h index 3f4a95b4739..e928e421fd7 100644 --- a/Core/Tools/W3DView/EmitterColorPropPage.h +++ b/Core/Tools/W3DView/EmitterColorPropPage.h @@ -22,9 +22,9 @@ // #include "resource.h" -#include "vector3.h" +#include "WWMath/vector3.h" #include "ColorBar.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" // Forward declarations class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterFramePropPage.h b/Core/Tools/W3DView/EmitterFramePropPage.h index 8cb0bb60b7c..f2f80553da2 100644 --- a/Core/Tools/W3DView/EmitterFramePropPage.h +++ b/Core/Tools/W3DView/EmitterFramePropPage.h @@ -22,7 +22,7 @@ // #include "ColorBar.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterGeneralPropPage.cpp b/Core/Tools/W3DView/EmitterGeneralPropPage.cpp index 01a1c79e930..256023722d0 100644 --- a/Core/Tools/W3DView/EmitterGeneralPropPage.cpp +++ b/Core/Tools/W3DView/EmitterGeneralPropPage.cpp @@ -23,10 +23,10 @@ #include "W3DView.h" #include "EmitterGeneralPropPage.h" #include "EmitterPropertySheet.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" #include "Utils.h" -#include "texture.h" -#include "shader.h" +#include "WW3D2/texture.h" +#include "WW3D2/shader.h" #include "EmitterInstanceList.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/EmitterGeneralPropPage.h b/Core/Tools/W3DView/EmitterGeneralPropPage.h index 1da75ac1447..1096611b810 100644 --- a/Core/Tools/W3DView/EmitterGeneralPropPage.h +++ b/Core/Tools/W3DView/EmitterGeneralPropPage.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "shader.h" +#include "WW3D2/shader.h" // Forward delcarations class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterInstanceList.h b/Core/Tools/W3DView/EmitterInstanceList.h index bb0ac949839..dd5453cd057 100644 --- a/Core/Tools/W3DView/EmitterInstanceList.h +++ b/Core/Tools/W3DView/EmitterInstanceList.h @@ -32,9 +32,9 @@ #pragma once -#include "Vector.h" -#include "part_ldr.h" -#include "part_emt.h" +#include "WWLib/Vector.h" +#include "WW3D2/part_ldr.h" +#include "WW3D2/part_emt.h" ///////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/EmitterLineGroupPropPage.cpp b/Core/Tools/W3DView/EmitterLineGroupPropPage.cpp index 88b2beaccab..d4fc7c76cfb 100644 --- a/Core/Tools/W3DView/EmitterLineGroupPropPage.cpp +++ b/Core/Tools/W3DView/EmitterLineGroupPropPage.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "EmitterLineGroupPropPage.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "EmitterInstanceList.h" #include "Utils.h" #include "ColorBar.h" diff --git a/Core/Tools/W3DView/EmitterLineGroupPropPage.h b/Core/Tools/W3DView/EmitterLineGroupPropPage.h index 6d9e44f6235..fd502f7ab1f 100644 --- a/Core/Tools/W3DView/EmitterLineGroupPropPage.h +++ b/Core/Tools/W3DView/EmitterLineGroupPropPage.h @@ -21,7 +21,7 @@ // EmitterLineGroupPropPage.h : header file // -#include "part_emt.h" +#include "WW3D2/part_emt.h" // Forward declarations diff --git a/Core/Tools/W3DView/EmitterLinePropPage.cpp b/Core/Tools/W3DView/EmitterLinePropPage.cpp index 7162e15b4c8..c6f45a26c24 100644 --- a/Core/Tools/W3DView/EmitterLinePropPage.cpp +++ b/Core/Tools/W3DView/EmitterLinePropPage.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "EmitterLinePropPage.h" -#include "w3d_file.h" +#include "WW3D2/w3d_file.h" #include "EmitterInstanceList.h" #include "Utils.h" diff --git a/Core/Tools/W3DView/EmitterParticlePropPage.cpp b/Core/Tools/W3DView/EmitterParticlePropPage.cpp index 41211f4054b..be8d5854719 100644 --- a/Core/Tools/W3DView/EmitterParticlePropPage.cpp +++ b/Core/Tools/W3DView/EmitterParticlePropPage.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "EmitterParticlePropPage.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" #include "Utils.h" #include "Vector3RndCombo.h" #include "VolumeRandomDialog.h" diff --git a/Core/Tools/W3DView/EmitterParticlePropPage.h b/Core/Tools/W3DView/EmitterParticlePropPage.h index bf635210846..b3a084d425c 100644 --- a/Core/Tools/W3DView/EmitterParticlePropPage.h +++ b/Core/Tools/W3DView/EmitterParticlePropPage.h @@ -22,8 +22,8 @@ // #include "resource.h" -#include "vector3.h" -#include "v3_rnd.h" +#include "WWMath/vector3.h" +#include "WWMath/v3_rnd.h" // Forward delcarations class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterPhysicsPropPage.cpp b/Core/Tools/W3DView/EmitterPhysicsPropPage.cpp index 95448a6bae3..f248dc2e732 100644 --- a/Core/Tools/W3DView/EmitterPhysicsPropPage.cpp +++ b/Core/Tools/W3DView/EmitterPhysicsPropPage.cpp @@ -23,7 +23,7 @@ #include "W3DView.h" #include "EmitterPhysicsPropPage.h" #include "Utils.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" #include "VolumeRandomDialog.h" #include "EmitterInstanceList.h" diff --git a/Core/Tools/W3DView/EmitterPhysicsPropPage.h b/Core/Tools/W3DView/EmitterPhysicsPropPage.h index af1c6945779..c94a0c44501 100644 --- a/Core/Tools/W3DView/EmitterPhysicsPropPage.h +++ b/Core/Tools/W3DView/EmitterPhysicsPropPage.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "vector3.h" +#include "WWMath/vector3.h" // Forward delcarations class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterPropertySheet.cpp b/Core/Tools/W3DView/EmitterPropertySheet.cpp index 7a283f78709..ae025549fd6 100644 --- a/Core/Tools/W3DView/EmitterPropertySheet.cpp +++ b/Core/Tools/W3DView/EmitterPropertySheet.cpp @@ -33,14 +33,14 @@ #include "StdAfx.h" #include "W3DView.h" #include "EmitterPropertySheet.h" -#include "part_emt.h" -#include "part_ldr.h" -#include "assetmgr.h" +#include "WW3D2/part_emt.h" +#include "WW3D2/part_ldr.h" +#include "WW3D2/assetmgr.h" #include "W3DViewDoc.h" #include "Utils.h" #include "DataTreeView.h" #include "AssetInfo.h" -#include "texture.h" +#include "WW3D2/texture.h" #include "EmitterInstanceList.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/EmitterRotationPropPage.h b/Core/Tools/W3DView/EmitterRotationPropPage.h index 1ac654ee7f7..977561c66dc 100644 --- a/Core/Tools/W3DView/EmitterRotationPropPage.h +++ b/Core/Tools/W3DView/EmitterRotationPropPage.h @@ -22,7 +22,7 @@ // #include "ColorBar.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" // Forward delcarations class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterSizePropPage.h b/Core/Tools/W3DView/EmitterSizePropPage.h index 75733ab3477..d53b5975dab 100644 --- a/Core/Tools/W3DView/EmitterSizePropPage.h +++ b/Core/Tools/W3DView/EmitterSizePropPage.h @@ -22,7 +22,7 @@ // #include "ColorBar.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" // Forward delcarations class EmitterInstanceListClass; diff --git a/Core/Tools/W3DView/EmitterUserPropPage.cpp b/Core/Tools/W3DView/EmitterUserPropPage.cpp index 8273b8650bc..ad405a1172f 100644 --- a/Core/Tools/W3DView/EmitterUserPropPage.cpp +++ b/Core/Tools/W3DView/EmitterUserPropPage.cpp @@ -22,8 +22,8 @@ #include "StdAfx.h" #include "W3DView.h" #include "EmitterUserPropPage.h" -#include "w3d_file.h" -#include "part_emt.h" +#include "WW3D2/w3d_file.h" +#include "WW3D2/part_emt.h" #include "EmitterInstanceList.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/GammaDialog.cpp b/Core/Tools/W3DView/GammaDialog.cpp index 600c36fcdf7..4b9467b11f9 100644 --- a/Core/Tools/W3DView/GammaDialog.cpp +++ b/Core/Tools/W3DView/GammaDialog.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "GammaDialog.h" -#include "dx8wrapper.h" +#include "WW3D2/dx8wrapper.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/Globals.cpp b/Core/Tools/W3DView/Globals.cpp index b0328e5920a..beef910e8a8 100644 --- a/Core/Tools/W3DView/Globals.cpp +++ b/Core/Tools/W3DView/Globals.cpp @@ -27,7 +27,7 @@ #include "StdAfx.h" #include "Globals.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "ViewerAssetMgr.h" // Main asset manager for the application. diff --git a/Core/Tools/W3DView/GraphicView.cpp b/Core/Tools/W3DView/GraphicView.cpp index baf95806645..d2fcaa341cf 100644 --- a/Core/Tools/W3DView/GraphicView.cpp +++ b/Core/Tools/W3DView/GraphicView.cpp @@ -22,31 +22,31 @@ #include "StdAfx.h" #include "W3DView.h" #include "GraphicView.h" -#include "ww3d.h" +#include "WW3D2/ww3d.h" #include "Globals.h" #include "W3DViewDoc.h" #include -#include "quat.h" +#include "WWMath/quat.h" #include "MainFrm.h" #include "Utils.h" #include "mmsystem.h" -#include "light.h" +#include "WW3D2/light.h" #include "ViewerAssetMgr.h" -#include "rcfile.h" -#include "part_emt.h" -#include "part_buf.h" -#include "hlod.h" +#include "WWLib/rcfile.h" +#include "WW3D2/part_emt.h" +#include "WW3D2/part_buf.h" +#include "WW3D2/hlod.h" #include "ViewerScene.h" #include "ScreenCursor.h" -#include "mesh.h" -#include "coltest.h" -#include "MPU.h" -#include "dazzle.h" -#include "SoundScene.h" -#include "WWAudio.h" -#include "metalmap.h" -#include "dx8wrapper.h" -#include "matrix3.h" +#include "WW3D2/mesh.h" +#include "WW3D2/coltest.h" +#include "WWLib/MPU.h" +#include "WW3D2/dazzle.h" +#include "WWAudio/SoundScene.h" +#include "WWAudio/WWAudio.h" +#include "WW3D2/metalmap.h" +#include "WW3D2/dx8wrapper.h" +#include "WWMath/matrix3.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/GraphicView.h b/Core/Tools/W3DView/GraphicView.h index b63fcd0649c..43c891df881 100644 --- a/Core/Tools/W3DView/GraphicView.h +++ b/Core/Tools/W3DView/GraphicView.h @@ -40,7 +40,7 @@ class ParticleEmitterClass; ///////////////////////////////////////////////////////////////////////////// // CGraphicView view -#include "camera.h" +#include "WW3D2/camera.h" class CGraphicView : public CView { diff --git a/Core/Tools/W3DView/HierarchyPropPage.cpp b/Core/Tools/W3DView/HierarchyPropPage.cpp index d04c3f285b9..c542ced3638 100644 --- a/Core/Tools/W3DView/HierarchyPropPage.cpp +++ b/Core/Tools/W3DView/HierarchyPropPage.cpp @@ -22,8 +22,8 @@ #include "StdAfx.h" #include "W3DView.h" #include "HierarchyPropPage.h" -#include "assetmgr.h" -#include "rendobj.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/rendobj.h" #include "AssetPropertySheet.h" #include "MeshPropPage.h" diff --git a/Core/Tools/W3DView/MainFrm.cpp b/Core/Tools/W3DView/MainFrm.cpp index d1f9ca87a6d..8ae83335304 100644 --- a/Core/Tools/W3DView/MainFrm.cpp +++ b/Core/Tools/W3DView/MainFrm.cpp @@ -34,28 +34,28 @@ #include "AnimationPropPage.h" #include "HierarchyPropPage.h" #include "resource.h" -#include "distlod.h" +#include "WW3D2/distlod.h" #include "AnimationSpeed.h" #include "AmbientLightDialog.h" #include "SceneLightDialog.h" #include "BackgroundColorDialog.h" #include "SaveSettingsDialog.h" #include "EditLODDialog.h" -#include "w3derr.h" +#include "WW3D2/w3derr.h" #include "BackgroundObjectDialog.h" #include "BackgroundBMPDialog.h" #include "Toolbar.h" #include "EmitterPropertySheet.h" -#include "part_ldr.h" -#include "agg_def.h" +#include "WW3D2/part_ldr.h" +#include "WW3D2/agg_def.h" #include "BoneMgrDialog.h" #include "Utils.h" -#include "light.h" +#include "WW3D2/light.h" #include "AggregateNameDialog.h" #include "LODDefs.h" -#include "part_emt.h" +#include "WW3D2/part_emt.h" #include "RestrictedFileDialog.h" -#include "hlod.h" +#include "WW3D2/hlod.h" #include "ViewerScene.h" #include "EmitterInstanceList.h" #include "mmsystem.h" @@ -69,16 +69,16 @@ #include "AddToLineupDialog.h" #include "CameraDistanceDialog.h" #include "SoundEditDialog.h" -#include "WWAudio.h" -#include "soundrobj.h" -#include "rddesc.h" +#include "WWAudio/WWAudio.h" +#include "WW3D2/soundrobj.h" +#include "WW3D2/rddesc.h" #include "ScaleDialog.h" #include "GammaDialog.h" #include "AnimatedSoundOptionsDialog.h" //#undef STRICT -#include "ww3d.h" +#include "WW3D2/ww3d.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/MeshPropPage.cpp b/Core/Tools/W3DView/MeshPropPage.cpp index dd598ab0bfc..dcec73c0950 100644 --- a/Core/Tools/W3DView/MeshPropPage.cpp +++ b/Core/Tools/W3DView/MeshPropPage.cpp @@ -22,11 +22,11 @@ #include "StdAfx.h" #include "W3DView.h" #include "MeshPropPage.h" -#include "rendobj.h" -#include "assetmgr.h" -#include "mesh.h" -#include "meshmdl.h" -#include "w3d_file.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/mesh.h" +#include "WW3D2/meshmdl.h" +#include "WW3D2/w3d_file.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/OpacityVectorDialog.cpp b/Core/Tools/W3DView/OpacityVectorDialog.cpp index b27bef0d41f..b72d530a510 100644 --- a/Core/Tools/W3DView/OpacityVectorDialog.cpp +++ b/Core/Tools/W3DView/OpacityVectorDialog.cpp @@ -22,13 +22,13 @@ #include "StdAfx.h" #include "W3DView.h" #include "OpacityVectorDialog.h" -#include "wwmath.h" -#include "vector3.h" -#include "sphereobj.h" -#include "ringobj.h" +#include "WWMath/wwmath.h" +#include "WWMath/vector3.h" +#include "WW3D2/sphereobj.h" +#include "WW3D2/ringobj.h" #include "ColorBar.h" -#include "euler.h" -#include "matrix3.h" +#include "WWMath/euler.h" +#include "WWMath/matrix3.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/OpacityVectorDialog.h b/Core/Tools/W3DView/OpacityVectorDialog.h index 5829f603aab..0d1a41737aa 100644 --- a/Core/Tools/W3DView/OpacityVectorDialog.h +++ b/Core/Tools/W3DView/OpacityVectorDialog.h @@ -19,7 +19,7 @@ #pragma once #include "resource.h" -#include "sphereobj.h" +#include "WW3D2/sphereobj.h" // Forward declarations class ColorBarClass; diff --git a/Core/Tools/W3DView/PlaySoundDialog.cpp b/Core/Tools/W3DView/PlaySoundDialog.cpp index 8037d793645..06b6f2c441e 100644 --- a/Core/Tools/W3DView/PlaySoundDialog.cpp +++ b/Core/Tools/W3DView/PlaySoundDialog.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "PlaySoundDialog.h" #include "Utils.h" -#include "AudibleSound.h" +#include "WWAudio/AudibleSound.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/PlaySoundDialog.h b/Core/Tools/W3DView/PlaySoundDialog.h index 265b8878942..31472f71e2a 100644 --- a/Core/Tools/W3DView/PlaySoundDialog.h +++ b/Core/Tools/W3DView/PlaySoundDialog.h @@ -19,7 +19,7 @@ #pragma once #include "resource.h" -#include "WWAudio.h" +#include "WWAudio/WWAudio.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/ResolutionDialog.cpp b/Core/Tools/W3DView/ResolutionDialog.cpp index 285db2e0e35..8f792ff9138 100644 --- a/Core/Tools/W3DView/ResolutionDialog.cpp +++ b/Core/Tools/W3DView/ResolutionDialog.cpp @@ -22,11 +22,11 @@ #include "StdAfx.h" #include "W3DView.h" #include "ResolutionDialog.h" -#include "ww3d.h" +#include "WW3D2/ww3d.h" #include "Globals.h" #include "GraphicView.h" #include "Utils.h" -#include "rddesc.h" +#include "WW3D2/rddesc.h" diff --git a/Core/Tools/W3DView/RingColorPropPage.h b/Core/Tools/W3DView/RingColorPropPage.h index 888c86d7fd8..4d2d6f67a28 100644 --- a/Core/Tools/W3DView/RingColorPropPage.h +++ b/Core/Tools/W3DView/RingColorPropPage.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "ringobj.h" +#include "WW3D2/ringobj.h" #include "ColorBar.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/RingGeneralPropPage.cpp b/Core/Tools/W3DView/RingGeneralPropPage.cpp index 5173d1fe089..0fba6f3a494 100644 --- a/Core/Tools/W3DView/RingGeneralPropPage.cpp +++ b/Core/Tools/W3DView/RingGeneralPropPage.cpp @@ -23,8 +23,8 @@ #include "W3DView.h" #include "RingGeneralPropPage.h" #include "Utils.h" -#include "assetmgr.h" -#include "texture.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/texture.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/RingGeneralPropPage.h b/Core/Tools/W3DView/RingGeneralPropPage.h index 98b06041256..66701ab910f 100644 --- a/Core/Tools/W3DView/RingGeneralPropPage.h +++ b/Core/Tools/W3DView/RingGeneralPropPage.h @@ -22,8 +22,8 @@ // #include "resource.h" -#include "ringobj.h" -#include "shader.h" +#include "WW3D2/ringobj.h" +#include "WW3D2/shader.h" ///////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Tools/W3DView/RingPropertySheet.cpp b/Core/Tools/W3DView/RingPropertySheet.cpp index 014e55e512b..891814b89e1 100644 --- a/Core/Tools/W3DView/RingPropertySheet.cpp +++ b/Core/Tools/W3DView/RingPropertySheet.cpp @@ -24,7 +24,7 @@ #include "RingPropertySheet.h" #include "Utils.h" #include "W3DViewDoc.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "DataTreeView.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/RingSizePropPage.h b/Core/Tools/W3DView/RingSizePropPage.h index c955006a4c0..820cd11e28d 100644 --- a/Core/Tools/W3DView/RingSizePropPage.h +++ b/Core/Tools/W3DView/RingSizePropPage.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "ringobj.h" +#include "WW3D2/ringobj.h" #include "ColorBar.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/SceneLightDialog.cpp b/Core/Tools/W3DView/SceneLightDialog.cpp index a2640389fdf..d3b32527586 100644 --- a/Core/Tools/W3DView/SceneLightDialog.cpp +++ b/Core/Tools/W3DView/SceneLightDialog.cpp @@ -25,8 +25,8 @@ #include "Utils.h" #include "MainFrm.h" #include "W3DViewDoc.h" -#include "scene.h" -#include "light.h" +#include "WW3D2/scene.h" +#include "WW3D2/light.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/ScreenCursor.cpp b/Core/Tools/W3DView/ScreenCursor.cpp index 32eb640dcc0..25d97e94d6c 100644 --- a/Core/Tools/W3DView/ScreenCursor.cpp +++ b/Core/Tools/W3DView/ScreenCursor.cpp @@ -34,16 +34,16 @@ #include "StdAfx.h" #include "ScreenCursor.h" #include "Utils.h" -#include "ww3d.h" -#include "vertmaterial.h" -#include "shader.h" -#include "scene.h" -#include "rinfo.h" -#include "texture.h" -#include "dx8wrapper.h" -#include "dx8vertexbuffer.h" -#include "dx8indexbuffer.h" -#include "sortingrenderer.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/vertmaterial.h" +#include "WW3D2/shader.h" +#include "WW3D2/scene.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/texture.h" +#include "WW3D2/dx8wrapper.h" +#include "WW3D2/dx8vertexbuffer.h" +#include "WW3D2/dx8indexbuffer.h" +#include "WW3D2/sortingrenderer.h" /////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/ScreenCursor.h b/Core/Tools/W3DView/ScreenCursor.h index 3ffacdda703..937cd462e1e 100644 --- a/Core/Tools/W3DView/ScreenCursor.h +++ b/Core/Tools/W3DView/ScreenCursor.h @@ -33,8 +33,8 @@ #pragma once #include "resource.h" -#include "rendobj.h" -#include "Vector3i.h" +#include "WW3D2/rendobj.h" +#include "WWMath/Vector3i.h" // Forward declarations class VertexMaterialClass; diff --git a/Core/Tools/W3DView/SoundEditDialog.cpp b/Core/Tools/W3DView/SoundEditDialog.cpp index ee66a62408d..dc3c8ada537 100644 --- a/Core/Tools/W3DView/SoundEditDialog.cpp +++ b/Core/Tools/W3DView/SoundEditDialog.cpp @@ -36,14 +36,14 @@ #include "StdAfx.h" #include "SoundEditDialog.h" -#include "soundrobj.h" -#include "AudibleSound.h" +#include "WW3D2/soundrobj.h" +#include "WWAudio/AudibleSound.h" #include "Utils.h" -#include "Sound3D.h" +#include "WWAudio/Sound3D.h" #include "PlaySoundDialog.h" #include "W3DViewDoc.h" #include "DataTreeView.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/SoundEditDialog.h b/Core/Tools/W3DView/SoundEditDialog.h index eb62ea3496f..6a962164c08 100644 --- a/Core/Tools/W3DView/SoundEditDialog.h +++ b/Core/Tools/W3DView/SoundEditDialog.h @@ -18,9 +18,9 @@ #pragma once -#include "wwstring.h" +#include "WWLib/wwstring.h" #include "resource.h" -#include "soundrobj.h" +#include "WW3D2/soundrobj.h" ///////////////////////////////////////////////////////////////////// // Forward declarations diff --git a/Core/Tools/W3DView/SphereColorPropPage.h b/Core/Tools/W3DView/SphereColorPropPage.h index 9e94ba12813..b0df952f9ee 100644 --- a/Core/Tools/W3DView/SphereColorPropPage.h +++ b/Core/Tools/W3DView/SphereColorPropPage.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "sphereobj.h" +#include "WW3D2/sphereobj.h" #include "ColorBar.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/SphereGeneralPropPage.cpp b/Core/Tools/W3DView/SphereGeneralPropPage.cpp index 8fee50ad663..272f83092a0 100644 --- a/Core/Tools/W3DView/SphereGeneralPropPage.cpp +++ b/Core/Tools/W3DView/SphereGeneralPropPage.cpp @@ -23,8 +23,8 @@ #include "W3DView.h" #include "SphereGeneralPropPage.h" #include "Utils.h" -#include "assetmgr.h" -#include "texture.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/texture.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/SphereGeneralPropPage.h b/Core/Tools/W3DView/SphereGeneralPropPage.h index cf9fcbb8bc5..868f1975b2c 100644 --- a/Core/Tools/W3DView/SphereGeneralPropPage.h +++ b/Core/Tools/W3DView/SphereGeneralPropPage.h @@ -22,8 +22,8 @@ // #include "resource.h" -#include "sphereobj.h" -#include "shader.h" +#include "WW3D2/sphereobj.h" +#include "WW3D2/shader.h" ///////////////////////////////////////////////////////////////////////////// // diff --git a/Core/Tools/W3DView/SpherePropertySheet.cpp b/Core/Tools/W3DView/SpherePropertySheet.cpp index b2996971638..656b994fed4 100644 --- a/Core/Tools/W3DView/SpherePropertySheet.cpp +++ b/Core/Tools/W3DView/SpherePropertySheet.cpp @@ -24,7 +24,7 @@ #include "SpherePropertySheet.h" #include "Utils.h" #include "W3DViewDoc.h" -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" #include "DataTreeView.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/SphereSizePropPage.h b/Core/Tools/W3DView/SphereSizePropPage.h index 23f7a977bac..3bbbe4123b2 100644 --- a/Core/Tools/W3DView/SphereSizePropPage.h +++ b/Core/Tools/W3DView/SphereSizePropPage.h @@ -22,7 +22,7 @@ // #include "resource.h" -#include "sphereobj.h" +#include "WW3D2/sphereobj.h" #include "ColorBar.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/SphereUtils.h b/Core/Tools/W3DView/SphereUtils.h index 7e8b2b1c1ea..ae8c9ff814d 100644 --- a/Core/Tools/W3DView/SphereUtils.h +++ b/Core/Tools/W3DView/SphereUtils.h @@ -36,7 +36,7 @@ #pragma once -#include "sphereobj.h" +#include "WW3D2/sphereobj.h" ///////////////////////////////////////////////////////////// // diff --git a/Core/Tools/W3DView/StdAfx.h b/Core/Tools/W3DView/StdAfx.h index c95bcb3a634..fdc0b57ff84 100644 --- a/Core/Tools/W3DView/StdAfx.h +++ b/Core/Tools/W3DView/StdAfx.h @@ -25,7 +25,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#include "always.h" +#include "WWLib/always.h" // TheSuperHackers @build jlallas384 05/04/2025 Prevent afxwin.h from loading d3d9types.h, colliding with our own DirectX library. #define _d3d9TYPES_H_ diff --git a/Core/Tools/W3DView/TextureMgrDialog.cpp b/Core/Tools/W3DView/TextureMgrDialog.cpp index 7336752729b..64b985acd37 100644 --- a/Core/Tools/W3DView/TextureMgrDialog.cpp +++ b/Core/Tools/W3DView/TextureMgrDialog.cpp @@ -38,11 +38,11 @@ #include "StdAfx.h" #include "W3DView.h" #include "TextureMgrDialog.h" -#include "Mesh.h" -#include "MatInfo.h" +#include "WW3D2/mesh.h" +#include "WW3D2/matinfo.h" #include "TextureSettingsDialog.h" -#include "AssetMgr.h" -#include "texture.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/texture.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/TextureMgrDialog.h b/Core/Tools/W3DView/TextureMgrDialog.h index f60d4dd2209..9e26e78879a 100644 --- a/Core/Tools/W3DView/TextureMgrDialog.h +++ b/Core/Tools/W3DView/TextureMgrDialog.h @@ -36,12 +36,12 @@ #pragma once -#include "Vector.h" -#include "RendObj.h" +#include "WWLib/Vector.h" +#include "WW3D2/rendobj.h" #include "Utils.h" #include "Resource.h" #include "DialogToolbar.h" -#include "texture.h" +#include "WW3D2/texture.h" // Forward declarations class MeshClass; diff --git a/Core/Tools/W3DView/TextureSettingsDialog.cpp b/Core/Tools/W3DView/TextureSettingsDialog.cpp index e805b211a9d..c725de73efb 100644 --- a/Core/Tools/W3DView/TextureSettingsDialog.cpp +++ b/Core/Tools/W3DView/TextureSettingsDialog.cpp @@ -32,11 +32,11 @@ #include "StdAfx.h" -#include "Texture.h" +#include "WW3D2/texture.h" #include "W3DView.h" #include "TextureSettingsDialog.h" #include "Utils.h" -#include "AssetMgr.h" +#include "WW3D2/assetmgr.h" /*#ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/Utils.cpp b/Core/Tools/W3DView/Utils.cpp index 46ae4cc991d..3481026ab9d 100644 --- a/Core/Tools/W3DView/Utils.cpp +++ b/Core/Tools/W3DView/Utils.cpp @@ -29,12 +29,12 @@ #include "MainFrm.h" #include "DataTreeView.h" #include "Utils.h" -#include "texture.h" -#include "assetmgr.h" -#include "agg_def.h" -#include "hlod.h" +#include "WW3D2/texture.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/agg_def.h" +#include "WW3D2/hlod.h" #include -#include "rcfile.h" +#include "WWLib/rcfile.h" //////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/Utils.h b/Core/Tools/W3DView/Utils.h index 8a23a38db66..82038f23e31 100644 --- a/Core/Tools/W3DView/Utils.h +++ b/Core/Tools/W3DView/Utils.h @@ -25,7 +25,7 @@ #pragma once -#include "Vector.h" +#include "WWLib/Vector.h" // Forward declarations class RenderObjClass; diff --git a/Core/Tools/W3DView/Vector3RndCombo.cpp b/Core/Tools/W3DView/Vector3RndCombo.cpp index 943db432cd2..3ec0a9e6a43 100644 --- a/Core/Tools/W3DView/Vector3RndCombo.cpp +++ b/Core/Tools/W3DView/Vector3RndCombo.cpp @@ -33,7 +33,7 @@ #include "StdAfx.h" #include "Vector3RndCombo.h" -#include "v3_rnd.h" +#include "WWMath/v3_rnd.h" const char * const RANDOMIZER_NAMES[Vector3Randomizer::CLASSID_MAXKNOWN] = { diff --git a/Core/Tools/W3DView/ViewerAssetMgr.cpp b/Core/Tools/W3DView/ViewerAssetMgr.cpp index 1ebbd852f3d..31c67f912e5 100644 --- a/Core/Tools/W3DView/ViewerAssetMgr.cpp +++ b/Core/Tools/W3DView/ViewerAssetMgr.cpp @@ -38,8 +38,8 @@ #include "StdAfx.h" #include "ViewerAssetMgr.h" -#include "texture.h" -#include "ww3d.h" +#include "WW3D2/texture.h" +#include "WW3D2/ww3d.h" #include "Utils.h" diff --git a/Core/Tools/W3DView/ViewerAssetMgr.h b/Core/Tools/W3DView/ViewerAssetMgr.h index e8e3235fc44..6c7e87d6f50 100644 --- a/Core/Tools/W3DView/ViewerAssetMgr.h +++ b/Core/Tools/W3DView/ViewerAssetMgr.h @@ -36,7 +36,7 @@ #pragma once -#include "assetmgr.h" +#include "WW3D2/assetmgr.h" ///////////////////////////////////////////////////////////////////////////// diff --git a/Core/Tools/W3DView/ViewerScene.cpp b/Core/Tools/W3DView/ViewerScene.cpp index 1ad15a42081..ae9486a097d 100644 --- a/Core/Tools/W3DView/ViewerScene.cpp +++ b/Core/Tools/W3DView/ViewerScene.cpp @@ -37,13 +37,13 @@ #include "StdAfx.h" #include "ViewerScene.h" -#include "camera.h" -#include "ww3d.h" +#include "WW3D2/camera.h" +#include "WW3D2/ww3d.h" -#include "rendobj.h" -#include "assetmgr.h" -#include "rinfo.h" -#include "lightenvironment.h" +#include "WW3D2/rendobj.h" +#include "WW3D2/assetmgr.h" +#include "WW3D2/rinfo.h" +#include "WW3D2/lightenvironment.h" /* ** ViewerSceneIterator @@ -226,7 +226,7 @@ ViewerSceneClass::Get_Bounding_Sphere () // Iterate through every object in the scene, adding its // bounding sphere to the current bounding sphere. The sum of // the bounding spheres will be the scene's bounding sphere. - SphereClass bounding_sphere(Vector3(0,0,0), 0.0f); + SphereClass bounding_sphere; SceneIterator *it = Create_Iterator(); assert(it); for (; !it->Is_Done(); it->Next()) diff --git a/Core/Tools/W3DView/ViewerScene.h b/Core/Tools/W3DView/ViewerScene.h index 61ec1b7e1f0..00b24cb366b 100644 --- a/Core/Tools/W3DView/ViewerScene.h +++ b/Core/Tools/W3DView/ViewerScene.h @@ -36,9 +36,9 @@ #pragma once -#include "scene.h" -#include "aabox.h" -#include "sphere.h" +#include "WW3D2/scene.h" +#include "WWMath/aabox.h" +#include "WWMath/sphere.h" class RenderObjIterator; diff --git a/Core/Tools/W3DView/VolumeRandomDialog.cpp b/Core/Tools/W3DView/VolumeRandomDialog.cpp index 8712a0c3324..64e25d552fb 100644 --- a/Core/Tools/W3DView/VolumeRandomDialog.cpp +++ b/Core/Tools/W3DView/VolumeRandomDialog.cpp @@ -34,7 +34,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "VolumeRandomDialog.h" -#include "v3_rnd.h" +#include "WWMath/v3_rnd.h" #include "Utils.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/W3DView.cpp b/Core/Tools/W3DView/W3DView.cpp index f127e1d6f47..552740b4937 100644 --- a/Core/Tools/W3DView/W3DView.cpp +++ b/Core/Tools/W3DView/W3DView.cpp @@ -27,18 +27,18 @@ #include "W3DViewView.h" #include "Utils.h" #include "ColorUtils.h" -#include "verchk.h" -#include "wwmath.h" -#include "WWAudio.h" +#include "WWLib/verchk.h" +#include "WWMath/wwmath.h" +#include "WWAudio/WWAudio.h" #include "ViewerAssetMgr.h" #include "Globals.h" #include "AnimatedSoundOptionsDialog.h" -#include "animatedsoundmgr.h" +#include "WW3D2/animatedsoundmgr.h" #undef STRICT -#include "ww3d.h" -#include "assetmgr.h" +#include "WW3D2/ww3d.h" +#include "WW3D2/assetmgr.h" #ifdef RTS_DEBUG #define new DEBUG_NEW diff --git a/Core/Tools/W3DView/W3DViewDoc.cpp b/Core/Tools/W3DView/W3DViewDoc.cpp index 6fa783c8dd0..4cdb0d23a5a 100644 --- a/Core/Tools/W3DView/W3DViewDoc.cpp +++ b/Core/Tools/W3DView/W3DViewDoc.cpp @@ -23,43 +23,43 @@ #include "W3DView.h" #include "W3DViewDoc.h" -#include "ffactory.h" +#include "WWLib/ffactory.h" #include "Globals.h" #include "ViewerAssetMgr.h" #include "Globals.h" -#include "rendobj.h" +#include "WW3D2/rendobj.h" #include "GraphicView.h" #include "DataTreeView.h" #include "MainFrm.h" -#include "distlod.h" -#include "light.h" -#include "camera.h" -#include "w3d_file.h" -#include "WWFILE.h" -#include "bmp2d.h" -#include "part_emt.h" -#include "part_ldr.h" +#include "WW3D2/distlod.h" +#include "WW3D2/light.h" +#include "WW3D2/camera.h" +#include "WW3D2/w3d_file.h" +#include "WWLib/WWFILE.h" +#include "WW3D2/bmp2d.h" +#include "WW3D2/part_emt.h" +#include "WW3D2/part_ldr.h" #include "Utils.h" -#include "w3derr.h" -#include "chunkio.h" +#include "WW3D2/w3derr.h" +#include "WWLib/chunkio.h" #include "AssetInfo.h" -#include "meshmdl.h" -#include "agg_def.h" -#include "hlod.h" +#include "WW3D2/meshmdl.h" +#include "WW3D2/agg_def.h" +#include "WW3D2/hlod.h" #include "RestrictedFileDialog.h" #include "ViewerScene.h" -#include "INI.h" -#include "ww3d.h" +#include "WWLib/INI.h" +#include "WW3D2/ww3d.h" #include "EmitterInstanceList.h" -#include "mesh.h" +#include "WW3D2/mesh.h" #include "ScreenCursor.h" -#include "sphereobj.h" -#include "ringobj.h" -#include "textfile.h" -#include "hmorphanim.h" +#include "WW3D2/sphereobj.h" +#include "WW3D2/ringobj.h" +#include "WWLib/textfile.h" +#include "WW3D2/hmorphanim.h" #include "mmsystem.h" -#include "soundrobj.h" -#include "dazzle.h" +#include "WW3D2/soundrobj.h" +#include "WW3D2/dazzle.h" #ifdef RTS_DEBUG diff --git a/Core/Tools/W3DView/W3DViewDoc.h b/Core/Tools/W3DView/W3DViewDoc.h index e58bc3d5700..b92076e1a05 100644 --- a/Core/Tools/W3DView/W3DViewDoc.h +++ b/Core/Tools/W3DView/W3DViewDoc.h @@ -22,12 +22,12 @@ #pragma once -#include "scene.h" -#include "chunkio.h" -#include "hanim.h" -#include "hcanim.h" -#include "dynamesh.h" -#include "rendobj.h" +#include "WW3D2/scene.h" +#include "WWLib/chunkio.h" +#include "WW3D2/hanim.h" +#include "WW3D2/hcanim.h" +#include "WW3D2/dynamesh.h" +#include "WW3D2/rendobj.h" #include "LODDefs.h" diff --git a/Core/Tools/mangler/wlib/wdebug.h b/Core/Tools/mangler/wlib/wdebug.h index 5af0c8658f8..b3f5663a9dd 100644 --- a/Core/Tools/mangler/wlib/wdebug.h +++ b/Core/Tools/mangler/wlib/wdebug.h @@ -172,10 +172,10 @@ extern CritSec DebugLibSemaphore; // They are defined to {} for consistency when DEBUG is defined #define DBG(X) -#define DBGSTREAM(X) {} -#define PVAR(v) {} -#define DBGMSG(X) {} -#define VERBOSE(X) {} +#define DBGSTREAM(X) +#define PVAR(v) +#define DBGMSG(X) +#define VERBOSE(X) #else // DEBUG _is_ defined diff --git a/Core/Tools/matchbot/debug.h b/Core/Tools/matchbot/debug.h index 1df2a069478..07e29c00a72 100644 --- a/Core/Tools/matchbot/debug.h +++ b/Core/Tools/matchbot/debug.h @@ -37,6 +37,6 @@ void DebugLog( const char *fmt, ... ); #else // DEBUG -#define DEBUG_LOG(x) {} +#define DEBUG_LOG(x) #endif // DEBUG diff --git a/Core/Tools/matchbot/wlib/wdebug.h b/Core/Tools/matchbot/wlib/wdebug.h index 142a881fb29..057afbf093a 100644 --- a/Core/Tools/matchbot/wlib/wdebug.h +++ b/Core/Tools/matchbot/wlib/wdebug.h @@ -172,10 +172,10 @@ extern CritSec DebugLibSemaphore; // They are defined to {} for consistency when DEBUG is defined #define DBG(X) -#define DBGSTREAM(X) {} -#define PVAR(v) {} -#define DBGMSG(X) {} -#define VERBOSE(X) {} +#define DBGSTREAM(X) +#define PVAR(v) +#define DBGMSG(X) +#define VERBOSE(X) #else // DEBUG _is_ defined diff --git a/Core/Tools/textureCompress/textureCompress.cpp b/Core/Tools/textureCompress/textureCompress.cpp index b13a413c9ac..b48edbab68f 100644 --- a/Core/Tools/textureCompress/textureCompress.cpp +++ b/Core/Tools/textureCompress/textureCompress.cpp @@ -94,7 +94,7 @@ static void debugLog(const char *fmt, ...) #else -#define DEBUG_LOG(x) {} +#define DEBUG_LOG(x) #endif // RTS_DEBUG diff --git a/Dependencies/Utility/Utility/CppMacros.h b/Dependencies/Utility/Utility/CppMacros.h index 5cd7f5d8f00..541cb4cc6d2 100644 --- a/Dependencies/Utility/Utility/CppMacros.h +++ b/Dependencies/Utility/Utility/CppMacros.h @@ -27,8 +27,10 @@ #if __cplusplus >= 201103L #define CPP_11(code) code +#define FUNCTION_DELETE = delete #else #define CPP_11(code) +#define FUNCTION_DELETE #define static_assert(expr, msg) #define constexpr #define noexcept diff --git a/Dependencies/Utility/Utility/interlocked_adapter.h b/Dependencies/Utility/Utility/interlocked_adapter.h index 45da6a2f9cb..61211f525bc 100644 --- a/Dependencies/Utility/Utility/interlocked_adapter.h +++ b/Dependencies/Utility/Utility/interlocked_adapter.h @@ -25,4 +25,30 @@ inline long InterlockedCompareExchange(long volatile *Destination, long Exchange return (long)InterlockedCompareExchange((PVOID*)Destination, (PVOID)Exchange, (PVOID)Comparand); } +// The VC6 SDK signatures take non-volatile pointers, so the volatile qualifier +// must be removed with const_cast before reinterpret_cast can change the type. +inline PVOID InterlockedExchangePointer(PVOID volatile *Target, PVOID Value) +{ + return reinterpret_cast(InterlockedExchange(reinterpret_cast(const_cast(Target)), reinterpret_cast(Value))); +} + +inline PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination, PVOID Exchange, PVOID Comparand) +{ + return InterlockedCompareExchange(const_cast(Destination), Exchange, Comparand); +} + +#endif + +#if !defined(_WIN32) +inline void* InterlockedCompareExchangePointer(void* volatile* Destination, void* Exchange, void* Comparand) +{ + void* expected = Comparand; + __atomic_compare_exchange_n(Destination, &expected, Exchange, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); + return expected; +} + +inline void* InterlockedExchangePointer(void* volatile* Target, void* Value) +{ + return __atomic_exchange_n(Target, Value, __ATOMIC_SEQ_CST); +} #endif diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt index 96a14600fbe..76e651b0b37 100644 --- a/Generals/Code/GameEngine/CMakeLists.txt +++ b/Generals/Code/GameEngine/CMakeLists.txt @@ -531,33 +531,33 @@ set(GAMEENGINE_SRC Source/Common/GameMain.cpp Source/Common/GlobalData.cpp # Source/Common/INI/INI.cpp - Source/Common/INI/INIAiData.cpp - Source/Common/INI/INIAnimation.cpp +# Source/Common/INI/INIAiData.cpp +# Source/Common/INI/INIAnimation.cpp # Source/Common/INI/INIAudioEventInfo.cpp - Source/Common/INI/INICommandButton.cpp - Source/Common/INI/INICommandSet.cpp - Source/Common/INI/INIControlBarScheme.cpp - Source/Common/INI/INICrate.cpp - Source/Common/INI/INIDamageFX.cpp - Source/Common/INI/INIDrawGroupInfo.cpp - Source/Common/INI/INIGameData.cpp - Source/Common/INI/INIMapCache.cpp - Source/Common/INI/INIMapData.cpp - Source/Common/INI/INIMappedImage.cpp +# Source/Common/INI/INICommandButton.cpp +# Source/Common/INI/INICommandSet.cpp +# Source/Common/INI/INIControlBarScheme.cpp +# Source/Common/INI/INICrate.cpp +# Source/Common/INI/INIDamageFX.cpp +# Source/Common/INI/INIDrawGroupInfo.cpp +# Source/Common/INI/INIGameData.cpp +# Source/Common/INI/INIMapCache.cpp +# Source/Common/INI/INIMapData.cpp +# Source/Common/INI/INIMappedImage.cpp # Source/Common/INI/INIMiscAudio.cpp - Source/Common/INI/INIModel.cpp - Source/Common/INI/INIMultiplayer.cpp - Source/Common/INI/INIObject.cpp - Source/Common/INI/INIParticleSys.cpp - Source/Common/INI/INISpecialPower.cpp - Source/Common/INI/INITerrain.cpp - Source/Common/INI/INITerrainBridge.cpp - Source/Common/INI/INITerrainRoad.cpp - Source/Common/INI/INIUpgrade.cpp +# Source/Common/INI/INIModel.cpp +# Source/Common/INI/INIMultiplayer.cpp +# Source/Common/INI/INIObject.cpp +# Source/Common/INI/INIParticleSys.cpp +# Source/Common/INI/INISpecialPower.cpp +# Source/Common/INI/INITerrain.cpp +# Source/Common/INI/INITerrainBridge.cpp +# Source/Common/INI/INITerrainRoad.cpp +# Source/Common/INI/INIUpgrade.cpp # Source/Common/INI/INIVideo.cpp - Source/Common/INI/INIWater.cpp - Source/Common/INI/INIWeapon.cpp - Source/Common/INI/INIWebpageURL.cpp +# Source/Common/INI/INIWater.cpp +# Source/Common/INI/INIWeapon.cpp +# Source/Common/INI/INIWebpageURL.cpp Source/Common/Language.cpp Source/Common/MessageStream.cpp Source/Common/MiniLog.cpp diff --git a/Generals/Code/GameEngine/Include/Common/BitFlags.h b/Generals/Code/GameEngine/Include/Common/BitFlags.h index a03f7c1a9fc..15c0961873e 100644 --- a/Generals/Code/GameEngine/Include/Common/BitFlags.h +++ b/Generals/Code/GameEngine/Include/Common/BitFlags.h @@ -45,7 +45,7 @@ class AsciiString; So we wrap to correct this, but leave the bitset "exposed" so that we can use all the non-ctor functions on it directly (since it doesn't overload operator= to do the "wrong" thing, strangely enough) */ -template +template class BitFlags { private: diff --git a/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h b/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h index 333529510b8..1bcab2075d6 100644 --- a/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h +++ b/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h @@ -36,8 +36,8 @@ //------------------------------------------------------------------------------------------------- /* -template -void BitFlags::buildDescription( AsciiString* str ) const +template +void BitFlags::buildDescription( AsciiString* str ) const { if ( str == nullptr ) return;//sanity @@ -56,8 +56,8 @@ void BitFlags::buildDescription( AsciiString* str ) const */ //------------------------------------------------------------------------------------------------- -template -void BitFlags::parse(INI* ini, AsciiString* str) +template +void BitFlags::parse(INI* ini, AsciiString* str) { // m_bits.reset(); if (str) @@ -129,16 +129,16 @@ void BitFlags::parse(INI* ini, AsciiString* str) //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- -template -/*static*/ void BitFlags::parseFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) +template +/*static*/ void BitFlags::parseFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) { ((BitFlags*)store)->parse(ini, nullptr); } //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- -template -/*static*/ void BitFlags::parseSingleBitFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) +template +/*static*/ void BitFlags::parseSingleBitFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) { const char *token = ini->getNextToken(); Int bitIndex = INI::scanIndexList(token, s_bitNameList); // this throws if the token is not found @@ -152,8 +152,8 @@ template * Version Info: * 1: Initial version */ //------------------------------------------------------------------------------------------------- -template -void BitFlags::xfer(Xfer* xfer) +template +void BitFlags::xfer(Xfer* xfer) { // this deserves a version number XferVersion currentVersion = 1; diff --git a/Generals/Code/GameEngine/Include/Common/DisabledTypes.h b/Generals/Code/GameEngine/Include/Common/DisabledTypes.h index e158c2a32a7..11446e2181e 100644 --- a/Generals/Code/GameEngine/Include/Common/DisabledTypes.h +++ b/Generals/Code/GameEngine/Include/Common/DisabledTypes.h @@ -61,7 +61,7 @@ enum DisabledType CPP_11(: Int) DISABLED_ANY = 65535 ///< Do not use this value for setting disabled types (read-only) }; -typedef BitFlags DisabledMaskType; +typedef BitFlags DisabledMaskType; #define MAKE_DISABLED_MASK(k) DisabledMaskType(DisabledMaskType::kInit, (k)) #define MAKE_DISABLED_MASK2(k,a) DisabledMaskType(DisabledMaskType::kInit, (k), (a)) diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index 3583467aa5c..8344b6cc6c0 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -134,8 +134,8 @@ class GlobalData : public SubsystemInterface Bool m_trilinearTerrainTex; Bool m_multiPassTerrain; Bool m_adjustCliffTextures; - Bool m_stretchTerrain; - Bool m_useHalfHeightMap; + Bool m_stretchTerrain; // TheSuperHackers @info Legacy, unused + Bool m_useHalfHeightMap; // TheSuperHackers @info Legacy, unused Bool m_drawEntireTerrain; _TerrainLOD m_terrainLOD; Bool m_enableDynamicLOD; @@ -146,6 +146,7 @@ class GlobalData : public SubsystemInterface Bool m_clientRetaliationModeEnabled; Bool m_doubleClickAttackMove; Bool m_rightMouseAlwaysScrolls; + Int m_jpegQuality; // TheSuperHackers @feature Quality for JPEG screenshots. Bool m_useWaterPlane; Bool m_useCloudPlane; Bool m_useShadowVolumes; @@ -370,7 +371,6 @@ class GlobalData : public SubsystemInterface Bool m_shellMapOn; ///< User can set the shell map not to load Bool m_playIntro; ///< Flag to say if we're to play the intro or not Bool m_playSizzle; ///< Flag to say whether we play the sizzle movie after the logo movie. - Bool m_afterIntro; ///< we need to tell the game our intro is done Bool m_allowExitOutOfMovies; ///< flag to allow exit out of movies only after the Intro has played Bool m_loadScreenRender; ///< flag to disallow rendering of almost everything during a loadscreen diff --git a/Generals/Code/GameEngine/Include/Common/KindOf.h b/Generals/Code/GameEngine/Include/Common/KindOf.h index a7563273efa..6bcf42f36f0 100644 --- a/Generals/Code/GameEngine/Include/Common/KindOf.h +++ b/Generals/Code/GameEngine/Include/Common/KindOf.h @@ -176,7 +176,7 @@ enum KindOfType CPP_11(: Int) KINDOF_FIRST = 0, }; -typedef BitFlags KindOfMaskType; +typedef BitFlags KindOfMaskType; #define MAKE_KINDOF_MASK(k) KindOfMaskType(KindOfMaskType::kInit, (k)) diff --git a/Generals/Code/GameEngine/Include/Common/MessageStream.h b/Generals/Code/GameEngine/Include/Common/MessageStream.h index 19005255317..2f69ead4971 100644 --- a/Generals/Code/GameEngine/Include/Common/MessageStream.h +++ b/Generals/Code/GameEngine/Include/Common/MessageStream.h @@ -256,7 +256,8 @@ class GameMessage : public MemoryPoolObject MSG_META_BEGIN_PREFER_SELECTION, ///< The Shift key has been depressed alone MSG_META_END_PREFER_SELECTION, ///< The Shift key has been released. - MSG_META_TAKE_SCREENSHOT, ///< take screenshot + MSG_META_TAKE_SCREENSHOT, ///< take JPEG screenshot + MSG_META_TAKE_SCREENSHOT_PNG, ///< TheSuperHackers @feature Take lossless PNG screenshot MSG_META_ALL_CHEER, ///< Yay! :) MSG_META_TOGGLE_ATTACKMOVE, ///< enter attack-move mode @@ -601,8 +602,10 @@ class GameMessage : public MemoryPoolObject GameMessage( Type type ); - GameMessage *next() { return m_next; } ///< Return next message in the stream - GameMessage *prev() { return m_prev; } ///< Return prev message in the stream + GameMessage *next() { return m_next; } ///< Return next message in the stream + const GameMessage *next() const { return m_next; } ///< Return next message in the stream + GameMessage *prev() { return m_prev; } ///< Return prev message in the stream + const GameMessage *prev() const { return m_prev; } ///< Return prev message in the stream Type getType() const { return m_type; } ///< Return the message type @@ -737,6 +740,8 @@ class MessageStream : public GameMessageList protected: + Bool isRedundantMessage(const GameMessage *msg) const; + struct TranslatorData { TranslatorData *m_next, *m_prev; ///< List links for list of translators diff --git a/Generals/Code/GameEngine/Include/Common/ModelState.h b/Generals/Code/GameEngine/Include/Common/ModelState.h index b0eb182a2e0..f88eb244d84 100644 --- a/Generals/Code/GameEngine/Include/Common/ModelState.h +++ b/Generals/Code/GameEngine/Include/Common/ModelState.h @@ -215,7 +215,7 @@ enum ModelConditionFlagType CPP_11(: Int) //------------------------------------------------------------------------------------------------- -typedef BitFlags ModelConditionFlags; +typedef BitFlags ModelConditionFlags; #define MAKE_MODELCONDITION_MASK(k) ModelConditionFlags(ModelConditionFlags::kInit, (k)) #define MAKE_MODELCONDITION_MASK2(k,a) ModelConditionFlags(ModelConditionFlags::kInit, (k), (a)) diff --git a/Generals/Code/GameEngine/Include/Common/PlayerList.h b/Generals/Code/GameEngine/Include/Common/PlayerList.h index ec2fa02d5a1..67616168278 100644 --- a/Generals/Code/GameEngine/Include/Common/PlayerList.h +++ b/Generals/Code/GameEngine/Include/Common/PlayerList.h @@ -52,6 +52,7 @@ class DataChunkInput; struct DataChunkInfo; class DataChunkOutput; +class GameInfo; class Player; class Team; class TeamFactory; @@ -156,7 +157,7 @@ class PlayerList : public SubsystemInterface, */ PlayerMaskType getPlayersWithRelationship( Int srcPlayerIndex, UnsignedInt allowedRelationships ); - Byte getSlotIndex(Int playerIndex) const; + Int getSlotIndex(Int playerIndex) const; protected: @@ -166,13 +167,13 @@ class PlayerList : public SubsystemInterface, virtual void loadPostProcess() override; private: - void resolveSlotIndices(); - void setSlotIndex(Int playerIndex, Byte slotIndex); + void assignSlotIndices(const GameInfo& gameInfo); + void setSlotIndex(Int playerIndex, Int slotIndex); Player *m_local; Int m_playerCount; Player *m_players[MAX_PLAYER_COUNT]; - Byte m_slotIndices[MAX_PLAYER_COUNT]; + Int m_slotIndices[MAX_PLAYER_COUNT]; }; diff --git a/Generals/Code/GameEngine/Include/Common/SpecialPowerMaskType.h b/Generals/Code/GameEngine/Include/Common/SpecialPowerMaskType.h index f72371b0e82..1afe14a5647 100644 --- a/Generals/Code/GameEngine/Include/Common/SpecialPowerMaskType.h +++ b/Generals/Code/GameEngine/Include/Common/SpecialPowerMaskType.h @@ -32,4 +32,4 @@ #include "Common/BitFlagsIO.h" #include "Common/SpecialPowerType.h" -typedef BitFlags SpecialPowerMaskType; +typedef BitFlags SpecialPowerMaskType; diff --git a/Generals/Code/GameEngine/Include/Common/Upgrade.h b/Generals/Code/GameEngine/Include/Common/Upgrade.h index a847abed5b0..11d9cad91df 100644 --- a/Generals/Code/GameEngine/Include/Common/Upgrade.h +++ b/Generals/Code/GameEngine/Include/Common/Upgrade.h @@ -56,7 +56,7 @@ enum UpgradeStatusType CPP_11(: Int) // A value of 512 was chosen to allow room for plenty of upgrades while also conserving memory. #define UPGRADE_MAX_COUNT 512 -typedef BitFlags UpgradeMaskType; +typedef BitFlags UpgradeMaskType; #define MAKE_UPGRADE_MASK(k) UpgradeMaskType(UpgradeMaskType::kInit, (k)) #define MAKE_UPGRADE_MASK2(k,a) UpgradeMaskType(UpgradeMaskType::kInit, (k), (a)) diff --git a/Generals/Code/GameEngine/Include/GameClient/GameClient.h b/Generals/Code/GameEngine/Include/GameClient/GameClient.h index ec059aa6afb..d93a7e989ab 100644 --- a/Generals/Code/GameEngine/Include/GameClient/GameClient.h +++ b/Generals/Code/GameEngine/Include/GameClient/GameClient.h @@ -44,6 +44,7 @@ class Drawable; class FontLibrary; class GameWindowManager; class InGameUI; +class Intro; class Keyboard; class Mouse; class ParticleSystemManager; @@ -175,6 +176,7 @@ class GameClient : public SubsystemInterface, private: + Intro* m_intro; UnsignedInt m_renderedObjectCount; ///< Keeps track of the number of rendered objects -- resets each frame. //--------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameClient/InGameUI.h b/Generals/Code/GameEngine/Include/GameClient/InGameUI.h index e9df6827937..1e0fdda7f50 100644 --- a/Generals/Code/GameEngine/Include/GameClient/InGameUI.h +++ b/Generals/Code/GameEngine/Include/GameClient/InGameUI.h @@ -434,7 +434,7 @@ friend class Drawable; // for selection/deselection transactions // Drawable selection mechanisms virtual void selectDrawable( Drawable *draw ); ///< Mark given Drawable as "selected" virtual void deselectDrawable( Drawable *draw ); ///< Clear "selected" status from Drawable - virtual void deselectAllDrawables( Bool postMsg = true ); ///< Clear the "select" flag from all drawables + virtual void deselectAllDrawables(); ///< Clear the "select" flag from all drawables virtual Int getSelectCount() { return m_selectCount; } ///< Get count of currently selected drawables virtual Int getMaxSelectCount() { return m_maxSelectCount; } ///< Get the max number of selected drawables virtual UnsignedInt getFrameSelectionChanged() { return m_frameSelectionChanged; } ///< Get the max number of selected drawables diff --git a/Generals/Code/GameEngine/Include/GameLogic/ArmorSet.h b/Generals/Code/GameEngine/Include/GameLogic/ArmorSet.h index 9242375d903..1cc74048fbc 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/ArmorSet.h +++ b/Generals/Code/GameEngine/Include/GameLogic/ArmorSet.h @@ -52,7 +52,7 @@ enum ArmorSetType CPP_11(: Int) }; //------------------------------------------------------------------------------------------------- -typedef BitFlags ArmorSetFlags; +typedef BitFlags ArmorSetFlags; //------------------------------------------------------------------------------------------------- class ArmorTemplateSet diff --git a/Generals/Code/GameEngine/Include/GameLogic/Object.h b/Generals/Code/GameEngine/Include/GameLogic/Object.h index dc17b8eae67..8fe576c6b66 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Object.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Object.h @@ -777,7 +777,7 @@ class Object : public Thing, public Snapshot }; // deleteInstance is not meant to be used with Object in order to require the use of TheGameLogic->destroyObject() -void deleteInstance(Object* object) CPP_11(= delete); +void deleteInstance(Object* object) FUNCTION_DELETE; // describe an object as an AsciiString: e.g. "Object 102 (KillerBuggy) [GLARocketBuggy, owned by player 2 (GLAIntroPlayer)]" AsciiString DebugDescribeObject(const Object *obj); diff --git a/Generals/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h b/Generals/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h index f57263f6c05..48e1ba0228c 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h +++ b/Generals/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h @@ -30,4 +30,4 @@ #include "GameLogic/WeaponSetType.h" -typedef BitFlags WeaponSetFlags; +typedef BitFlags WeaponSetFlags; diff --git a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp index 0a297cf121d..77bb6309e24 100644 --- a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp @@ -417,7 +417,6 @@ Int parseHeadless(char *args[], int num) { TheWritableGlobalData->m_headless = TRUE; TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; TheWritableGlobalData->m_playSizzle = FALSE; // TheSuperHackers @fix bobtista 03/02/2026 Set DX8Wrapper_IsWindowed to false in headless @@ -442,7 +441,6 @@ Int parseReplay(char *args[], int num) TheWritableGlobalData->m_simulateReplays.push_back(filename); TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; TheWritableGlobalData->m_playSizzle = FALSE; TheWritableGlobalData->m_shellMapOn = FALSE; @@ -795,7 +793,6 @@ Int parseNoShaders(char *args[], int) Int parseNoLogo(char *args[], int) { TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; TheWritableGlobalData->m_playSizzle = FALSE; return 1; diff --git a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp index 0586440ca7c..6361bc18904 100644 --- a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp @@ -677,9 +677,6 @@ void GameEngine::init() } } - if(!TheGlobalData->m_playIntro) - TheWritableGlobalData->m_afterIntro = TRUE; - } catch (ErrorCode ec) { @@ -701,9 +698,6 @@ void GameEngine::init() RELEASE_CRASH(("Uncaught Exception during initialization.")); } - if(!TheGlobalData->m_playIntro) - TheWritableGlobalData->m_afterIntro = TRUE; - resetSubsystems(); HideControlBar(); @@ -796,7 +790,7 @@ Bool GameEngine::canUpdateRegularGameLogic(UnsignedInt logicTimeQueryFlags) } const Bool enabled = TheFramePacer->isLogicTimeScaleEnabled(); - const Int maxRenderFps = TheFramePacer->getFramesPerSecondLimit(); + const Int maxRenderFps = TheFramePacer->getActualFramesPerSecondLimit(); #if defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE) const Bool useFastMode = TheGlobalData->m_TiVOFastMode; diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 9ca5f68ebda..0ba8fc825fd 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -60,6 +60,7 @@ #include "GameLogic/Module/BodyModule.h" #include "GameClient/Color.h" +#include "GameClient/Display.h" #include "GameClient/TerrainVisual.h" #include "GameNetwork/FirewallHelper.h" @@ -659,6 +660,7 @@ GlobalData::GlobalData() m_enableDynamicLOD = TRUE; m_enableStaticLOD = TRUE; m_rightMouseAlwaysScrolls = FALSE; + m_jpegQuality = DEFAULT_JPEG_QUALITY; m_useWaterPlane = FALSE; m_useCloudPlane = FALSE; m_downwindAngle = ( -0.785f );//Northeast! @@ -1017,7 +1019,6 @@ GlobalData::GlobalData() m_shellMapOn =TRUE; m_playIntro = TRUE; m_playSizzle = TRUE; - m_afterIntro = FALSE; m_allowExitOutOfMovies = FALSE; m_loadScreenRender = FALSE; @@ -1209,6 +1210,7 @@ void GlobalData::parseGameDataDefinition( INI* ini ) TheWritableGlobalData->m_useRightMouseScrollWithAlternateMouse = optionPref.getRightMouseScrollWithAlternateMouseEnabled(); TheWritableGlobalData->m_clientRetaliationModeEnabled = optionPref.getRetaliationModeEnabled(); TheWritableGlobalData->m_doubleClickAttackMove = optionPref.getDoubleClickAttackMoveEnabled(); + TheWritableGlobalData->m_jpegQuality = optionPref.getJpegQuality(); TheWritableGlobalData->m_keyboardScrollFactor = optionPref.getScrollFactor(); TheWritableGlobalData->m_drawScrollAnchor = optionPref.getDrawScrollAnchor(); TheWritableGlobalData->m_moveScrollAnchor = optionPref.getMoveScrollAnchor(); diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIAiData.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIAiData.cpp deleted file mode 100644 index 98b2d4eb43e..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIAiData.cpp +++ /dev/null @@ -1,52 +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: INIAiData.cpp ////////////////////////////////////////////////////////////////////////// -// Author: John Ahlquist, March 2002 -// Desc: Parsing AIData INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameLogic/AI.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse GameData entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseAIDataDefinition( INI* ini ) -{ - AI::parseAiDataDefinition(ini); -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp deleted file mode 100644 index ad333937b18..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp +++ /dev/null @@ -1,88 +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: INIAnimation.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Colin Day, July 2002 -// Desc: Parsing animation INI entries for 2D image animations -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/Anim2D.h" - -//------------------------------------------------------------------------------------------------- -/** Parse animation entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseAnim2DDefinition( INI* ini ) -{ - AsciiString name; - Anim2DTemplate *animTemplate; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // - // find existing item if present, note that we do not support overrides - // in the animations like we do in systems that are more "design" oriented, images - // are assets as they are - // - if( !TheAnim2DCollection ) - { - - //We don't need it if we're in the builder... which doesn't have this. - return; - - } - - // find existing animation template if present - animTemplate = TheAnim2DCollection->findTemplate( name ); - if( animTemplate == nullptr ) - { - - // item not found, create a new one - animTemplate = TheAnim2DCollection->newTemplate( name ); - DEBUG_ASSERTCRASH( animTemplate, ("INI::parseAnim2DDefinition - unable to allocate animation template for '%s'", - name.str()) ); - - } - else - { - - // we're loading over an existing animation template ... something is probably wrong - DEBUG_CRASH(( "INI::parseAnim2DDefinition - Animation template '%s' already exists", - animTemplate->getName().str() )); - return; - - } - - // parse the ini definition - ini->initFromINI( animTemplate, animTemplate->getFieldParse() ); - -} - - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INICommandButton.cpp b/Generals/Code/GameEngine/Source/Common/INI/INICommandButton.cpp deleted file mode 100644 index 5b36e17893d..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INICommandButton.cpp +++ /dev/null @@ -1,109 +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: INICommandButton.cpp ///////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Command buttons are the atomic units we can configure into command sets to then -// display in the context sensitive user interface -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/SpecialPower.h" -#include "GameClient/ControlBar.h" - -//------------------------------------------------------------------------------------------------- -/** Parse a command button */ -//------------------------------------------------------------------------------------------------- -void INI::parseCommandButtonDefinition( INI *ini ) -{ - ControlBar::parseCommandButtonDefinition(ini); -} - -//------------------------------------------------------------------------------------------------- -/** Parse a command button */ -//------------------------------------------------------------------------------------------------- -void ControlBar::parseCommandButtonDefinition( INI *ini ) -{ - // read the name - AsciiString name = ini->getNextToken(); - - // find existing item if present - CommandButton *button = TheControlBar->findNonConstCommandButton( name ); - if( button == nullptr ) - { - // allocate a new item - button = TheControlBar->newCommandButton( name ); - if (ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES) - { - button->markAsOverride(); - } - } - else if( ini->getLoadType() != INI_LOAD_CREATE_OVERRIDES ) - { - DEBUG_CRASH(( "[LINE: %d in '%s'] Duplicate commandbutton %s found!", ini->getLineNum(), ini->getFilename().str(), name.str() )); - } - else - { - button = TheControlBar->newCommandButtonOverride( button ); - } - - // parse the ini definition - ini->initFromINI( button, button->getFieldParse() ); - - const SpecialPowerTemplate *spTemplate = button->getSpecialPowerTemplate(); - - // TheSuperHackers @tweak Make sure Special Power buttons have a Special Power template. - switch (button->getCommandType()) - { - case GUI_COMMAND_SPECIAL_POWER: - case GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT: - case GUI_COMMAND_SPECIAL_POWER_CONSTRUCT: - case GUI_COMMAND_SPECIAL_POWER_CONSTRUCT_FROM_SHORTCUT: - { - DEBUG_ASSERTCRASH(spTemplate != nullptr, - ("[LINE: %d in '%s'] CommandButton %s is a SPECIAL_POWER but is missing a SpecialPower field", - ini->getLineNum(), ini->getFilename().str(), name.str())); - break; - } - } - - //Make sure buttons with special power templates also have the appropriate option set. - Bool needsTemplate = BitIsSet( button->getOptions(), NEED_SPECIAL_POWER_SCIENCE ); - if( spTemplate && !needsTemplate ) - { - DEBUG_CRASH( ("[LINE: %d in '%s'] CommandButton %s has SpecialPower = %s but the button also requires Options = NEED_SPECIAL_POWER_SCIENCE. Failure to do so will cause bugs such as invisible side shortcut buttons", - ini->getLineNum(), ini->getFilename().str(), name.str(), spTemplate->getName().str() ) ); - } - else if( !spTemplate && needsTemplate ) - { - DEBUG_CRASH( ("[LINE: %d in '%s'] CommandButton %s has Options = NEED_SPECIAL_POWER_SCIENCE but doesn't specify a SpecialPower = xxxx. Please evaluate INI.", - ini->getLineNum(), ini->getFilename().str(), name.str() ) ); - } - -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INICommandSet.cpp b/Generals/Code/GameEngine/Source/Common/INI/INICommandSet.cpp deleted file mode 100644 index efe52f8123b..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INICommandSet.cpp +++ /dev/null @@ -1,43 +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: INICommandSet.cpp //////////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Command sets are a configurable set of CommandButtons, we will use the sets as -// part of the context sensitive user interface -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/ControlBar.h" - -//------------------------------------------------------------------------------------------------- -/** Parse a command set */ -//------------------------------------------------------------------------------------------------- -void INI::parseCommandSetDefinition( INI *ini ) -{ - ControlBar::parseCommandSetDefinition(ini); -} diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp deleted file mode 100644 index dbe467b7ba3..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp +++ /dev/null @@ -1,101 +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: INIControlBarScheme.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Apr 2002 -// -// Filename: INIControlBarScheme.cpp -// -// author: Chris Huybregts -// -// purpose: Parse a control Bar Scheme -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/ControlBar.h" -#include "GameClient/ControlBarScheme.h" -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -/** Parse a ControlBarScheme button */ -//------------------------------------------------------------------------------------------------- -void INI::parseControlBarSchemeDefinition( INI *ini ) -{ - AsciiString name; - ControlBarSchemeManager *CBSchemeManager; - ControlBarScheme *CBScheme; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // find existing item if present - CBSchemeManager = TheControlBar->getControlBarSchemeManager(); - DEBUG_ASSERTCRASH( CBSchemeManager, ("parseControlBarSchemeDefinition: Unable to Get CBSchemeManager") ); - if( !CBSchemeManager ) - return; - - // If we have a previously allocated control bar, this will return a cleared out pointer to it so we - // can overwrite it - CBScheme = CBSchemeManager->newControlBarScheme( name ); - - // sanity - DEBUG_ASSERTCRASH( CBScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) ); - - // parse the ini definition - ini->initFromINI( CBScheme, CBSchemeManager->getFieldParse() ); - -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INICrate.cpp b/Generals/Code/GameEngine/Source/Common/INI/INICrate.cpp deleted file mode 100644 index c4e7b75fe75..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INICrate.cpp +++ /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: INICrate.cpp ///////////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: Just passes the parse to the CrateSystem -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameLogic/CrateSystem.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse Weapon entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseCrateTemplateDefinition( INI* ini ) -{ - CrateSystem::parseCrateTemplateDefinition(ini); -} diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIDamageFX.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIDamageFX.cpp deleted file mode 100644 index 3033aaca763..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIDamageFX.cpp +++ /dev/null @@ -1,44 +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: INIDamageFX.cpp //////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, November 2001 -// Desc: Parsing DamageFX INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/DamageFX.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/*static */ void INI::parseDamageFXDefinition(INI* ini) -{ - DamageFXStore::parseDamageFXDefinition(ini); -} - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp deleted file mode 100644 index 5ca92f078fb..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp +++ /dev/null @@ -1,91 +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: INIDrawGroupInfo.cpp ///////////////////////////////////////////////////////////////////// -// Author: John McDonald, October 2002 -// Desc: Parsing DrawGroupInfo INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/DrawGroupInfo.h" - -void parseInt( INI* ini, void * /*instance*/, void *store, const void* userData ) -{ - DrawGroupInfo *dgi = (DrawGroupInfo*) store; - if (userData == nullptr) { - store = &dgi->m_pixelOffsetX; - dgi->m_usingPixelOffsetX = TRUE; - } else { - store = &dgi->m_pixelOffsetY; - dgi->m_usingPixelOffsetY = TRUE; - } - - INI::parseInt(ini, nullptr, store, nullptr); -} - -void parsePercentToReal( INI* ini, void * /*instance*/, void *store, const void* userData ) -{ - DrawGroupInfo *dgi = (DrawGroupInfo*) store; - if (userData == nullptr) { - store = &dgi->m_pixelOffsetX; - dgi->m_usingPixelOffsetX = FALSE; - } else { - store = &dgi->m_pixelOffsetY; - dgi->m_usingPixelOffsetY = FALSE; - } - - INI::parsePercentToReal(ini, nullptr, store, nullptr); -} - -const FieldParse DrawGroupInfo::s_fieldParseTable[] = -{ - { "UsePlayerColor", INI::parseBool, nullptr, offsetof( DrawGroupInfo, m_usePlayerColor) }, - { "ColorForText", INI::parseColorInt, nullptr, offsetof( DrawGroupInfo, m_colorForText ) }, - { "ColorForTextDropShadow", INI::parseColorInt, nullptr, offsetof( DrawGroupInfo, m_colorForTextDropShadow ) }, - - { "FontName", INI::parseQuotedAsciiString, nullptr, offsetof( DrawGroupInfo, m_fontName ) }, - { "FontSize", INI::parseInt, nullptr, offsetof( DrawGroupInfo, m_fontSize ) }, - { "FontIsBold", INI::parseBool, nullptr, offsetof( DrawGroupInfo, m_fontIsBold ) }, - { "DropShadowOffsetX", INI::parseInt, nullptr, offsetof( DrawGroupInfo, m_dropShadowOffsetX) }, - { "DropShadowOffsetY", INI::parseInt, nullptr, offsetof( DrawGroupInfo, m_dropShadowOffsetY) }, - { "DrawPositionXPixel", parseInt, (void*)nullptr, 0 }, - { "DrawPositionXPercent", parsePercentToReal, (void*)nullptr, 0 }, - { "DrawPositionYPixel", parseInt, (void*)1, 0 }, - { "DrawPositionYPercent", parsePercentToReal, (void*)1, 0 }, - - { nullptr, nullptr, nullptr, 0 } -}; - -/*static */ void INI::parseDrawGroupNumberDefinition(INI* ini) -{ - if (!TheDrawGroupInfo) { - throw INI_UNKNOWN_ERROR; - } - - ini->initFromINI(TheDrawGroupInfo, TheDrawGroupInfo->getFieldParse()); -} - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIGameData.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIGameData.cpp deleted file mode 100644 index ddb1f7b6702..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIGameData.cpp +++ /dev/null @@ -1,52 +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: INIGameData.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Parsing GameData INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/GlobalData.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse GameData entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseGameDataDefinition( INI* ini ) -{ - GlobalData::parseGameDataDefinition(ini); -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp deleted file mode 100644 index 63d6d854671..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp +++ /dev/null @@ -1,224 +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: INIMapCache.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, February 2002 -// Desc: Parsing MapCache INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Lib/BaseType.h" -#include "Common/INI.h" -#include "GameClient/MapUtil.h" -#include "GameClient/GameText.h" -#include "GameNetwork/NetworkDefs.h" -#include "Common/NameKeyGenerator.h" -#include "Common/WellKnownKeys.h" -#include "Common/QuotedPrintable.h" - -// GeneralsX @bugfix Copilot 27/04/2026 Support both POSIX and Windows separators when deriving map display names. -static const char *findLastPathSeparator(const AsciiString& path) -{ - const char *backslash = path.reverseFind('\\'); - const char *slash = path.reverseFind('/'); - - if (!backslash) - { - return slash; - } - - if (!slash) - { - return backslash; - } - - return slash > backslash ? slash : backslash; -} - - -class MapMetaDataReader -{ -public: - Region3D m_extent; - Int m_numPlayers; - Bool m_isMultiplayer; - AsciiString m_asciiDisplayName; - AsciiString m_asciiNameLookupTag; - - Bool m_isOfficial; - WinTimeStamp m_timestamp; - UnsignedInt m_filesize; - UnsignedInt m_CRC; - - Coord3D m_waypoints[MAX_SLOTS]; - Coord3D m_initialCameraPosition; - Coord3DList m_supplyPositions; - Coord3DList m_techPositions; - static const FieldParse m_mapFieldParseTable[]; ///< the parse table for INI definition - const FieldParse *getFieldParse() const { return m_mapFieldParseTable; } -}; - - -void parseSupplyPositionCoord3D( INI* ini, void * instance, void * /*store*/, const void* /*userData*/ ) -{ - MapMetaDataReader *mmdr = (MapMetaDataReader *)instance; - Coord3D coord3d; - INI::parseCoord3D(ini, nullptr, &coord3d,nullptr ); - mmdr->m_supplyPositions.push_front(coord3d); - -} - -void parseTechPositionsCoord3D( INI* ini, void * instance, void * /*store*/, const void* /*userData*/ ) -{ - MapMetaDataReader *mmdr = (MapMetaDataReader *)instance; - Coord3D coord3d; - INI::parseCoord3D(ini, nullptr, &coord3d,nullptr ); - mmdr->m_techPositions.push_front(coord3d); - -} - -const FieldParse MapMetaDataReader::m_mapFieldParseTable[] = -{ - - { "isOfficial", INI::parseBool, nullptr, offsetof( MapMetaDataReader, m_isOfficial ) }, - { "isMultiplayer", INI::parseBool, nullptr, offsetof( MapMetaDataReader, m_isMultiplayer ) }, - { "extentMin", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_extent.lo ) }, - { "extentMax", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_extent.hi ) }, - { "numPlayers", INI::parseInt, nullptr, offsetof( MapMetaDataReader, m_numPlayers ) }, - { "fileSize", INI::parseUnsignedInt, nullptr, offsetof( MapMetaDataReader, m_filesize ) }, - { "fileCRC", INI::parseUnsignedInt, nullptr, offsetof( MapMetaDataReader, m_CRC ) }, - { "timestampLo", INI::parseInt, nullptr, offsetof( MapMetaDataReader, m_timestamp.m_lowTimeStamp ) }, - { "timestampHi", INI::parseInt, nullptr, offsetof( MapMetaDataReader, m_timestamp.m_highTimeStamp ) }, - { "displayName", INI::parseAsciiString, nullptr, offsetof( MapMetaDataReader, m_asciiDisplayName ) }, - { "nameLookupTag", INI::parseAsciiString, nullptr, offsetof( MapMetaDataReader, m_asciiNameLookupTag ) }, - - { "supplyPosition", parseSupplyPositionCoord3D, nullptr, 0 }, - { "techPosition", parseTechPositionsCoord3D, nullptr, 0 }, - - { "Player_1_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) }, - { "Player_2_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 1 }, - { "Player_3_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 2 }, - { "Player_4_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 3 }, - { "Player_5_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 4 }, - { "Player_6_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 5 }, - { "Player_7_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 6 }, - { "Player_8_Start", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_waypoints ) + sizeof(Coord3D) * 7 }, - - { "InitialCameraPosition", INI::parseCoord3D, nullptr, offsetof( MapMetaDataReader, m_initialCameraPosition ) }, - - { nullptr, nullptr, nullptr, 0 } - -}; - -void INI::parseMapCacheDefinition( INI* ini ) -{ - const char *c; - AsciiString name; - MapMetaDataReader mdr; - MapMetaData md; - - // read the name - c = ini->getNextToken(" \n\r\t"); - name.set( c ); - name = QuotedPrintableToAsciiString(name); - md.m_waypoints.clear(); - - ini->initFromINI( &mdr, mdr.getFieldParse() ); - - md.m_extent = mdr.m_extent; - md.m_isOfficial = mdr.m_isOfficial != 0; - md.m_doesExist = TRUE; - md.m_isMultiplayer = mdr.m_isMultiplayer != 0; - md.m_numPlayers = mdr.m_numPlayers; - md.m_filesize = mdr.m_filesize; - md.m_CRC = mdr.m_CRC; - md.m_timestamp = mdr.m_timestamp; - - md.m_waypoints[TheNameKeyGenerator->keyToName(TheKey_InitialCameraPosition)] = mdr.m_initialCameraPosition; - -#if RTS_GENERALS - md.m_displayName = QuotedPrintableToUnicodeString(mdr.m_asciiDisplayName); -#else - md.m_nameLookupTag = QuotedPrintableToAsciiString(mdr.m_asciiNameLookupTag); - - if (md.m_nameLookupTag.isEmpty()) - { - // maps without localized name tags - AsciiString tempdisplayname; - const char *displayNameStart = findLastPathSeparator(name); - tempdisplayname = displayNameStart ? displayNameStart + 1 : name; - md.m_displayName.translate(tempdisplayname); - if (md.m_numPlayers >= 2) - { - UnicodeString extension; - extension.format(L" (%d)", md.m_numPlayers); - md.m_displayName.concat(extension); - } - } - else - { - // official maps with name tags - md.m_displayName = TheGameText->fetch(md.m_nameLookupTag); - if (md.m_numPlayers >= 2) - { - UnicodeString extension; - extension.format(L" (%d)", md.m_numPlayers); - md.m_displayName.concat(extension); - } - } -#endif - - AsciiString startingCamName; - for (Int i=0; i. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: INIMapData.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Parsing MapData INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse MapData entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseMapDataDefinition( INI* ini ) -{ -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp deleted file mode 100644 index 21d5bbda299..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp +++ /dev/null @@ -1,76 +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: INIMappedImage.cpp /////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Mapped image INI parsing -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/Image.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse mapped image entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseMappedImageDefinition( INI* ini ) -{ - // read the name - const char* name = ini->getNextToken(); - - // - // find existing item if present, note that we do not support overrides - // in the images like we do in systems that are more "design" oriented, images - // are assets as they are - // - if( !TheMappedImageCollection ) - { - //We don't need it if we're in the builder... which doesn't have this. - return; - } - Image *image = const_cast(TheMappedImageCollection->findImageByName( name )); - if(image) - DEBUG_ASSERTCRASH(!image->getRawTextureData(), ("We are trying to parse over an existing image that contains a non-null rawTextureData, you should fix that")); - - if( image == nullptr ) - { - - // image not found, create a new one - image = newInstance(Image); - image->setName( name ); - TheMappedImageCollection->addImage(image); - DEBUG_ASSERTCRASH( image, ("parseMappedImage: unable to allocate image for '%s'", name) ); - - } - - // parse the ini definition - ini->initFromINI( image, image->getFieldParse()); - -} diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIModel.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIModel.cpp deleted file mode 100644 index 3e7fc739f55..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIModel.cpp +++ /dev/null @@ -1,42 +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: INIModel.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Parsing Model INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIMultiplayer.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIMultiplayer.cpp deleted file mode 100644 index c5082372270..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIMultiplayer.cpp +++ /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: INIMultiplayer.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, January 2002 -// Desc: Parsing MultiplayerSettings and MultiplayerColor INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/MultiplayerSettings.h" - -void INI::parseMultiplayerSettingsDefinition( INI* ini ) -{ - if( TheMultiplayerSettings ) - { - // - // if the type of loading we're doing creates override data, we need to - // be loading into a new override item - // - if( ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES ) - { - DEBUG_CRASH(("Creating an override of MultiplayerSettings!")); - } - } - else - { - // we don't have any multiplayer settings instance at all yet, create one - TheMultiplayerSettings = NEW MultiplayerSettings; - } - - // parse the ini definition - ini->initFromINI( TheMultiplayerSettings, TheMultiplayerSettings->getFieldParse() ); -} - -void INI::parseMultiplayerColorDefinition( INI* ini ) -{ - const char *c; - AsciiString name; - MultiplayerColorDefinition *multiplayerColorDefinition; - - // read the name - c = ini->getNextToken(); - name.set( c ); - - // find existing item if present, but this type does not allow overrides, - //so if it exists just overwrite it. - multiplayerColorDefinition = TheMultiplayerSettings->findMultiplayerColorDefinitionByName( name ); - if( multiplayerColorDefinition == nullptr ) - multiplayerColorDefinition = TheMultiplayerSettings->newMultiplayerColorDefinition( name ); - - ini->initFromINI( multiplayerColorDefinition, multiplayerColorDefinition->getFieldParse() ); - - multiplayerColorDefinition->setColor(multiplayerColorDefinition->getRGBValue()); - multiplayerColorDefinition->setNightColor(multiplayerColorDefinition->getRGBNightValue()); -} - -void INI::parseMultiplayerStartingMoneyChoiceDefinition( INI* ini ) -{ -} diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIObject.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIObject.cpp deleted file mode 100644 index b847407e695..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIObject.cpp +++ /dev/null @@ -1,61 +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: INIObject.cpp //////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Parsing Object INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/ThingTemplate.h" -#include "Common/ThingFactory.h" -#include "GameLogic/Module/OpenContain.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse Object entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseObjectDefinition( INI* ini ) -{ - AsciiString name = ini->getNextToken(); - ThingFactory::parseObjectDefinition(ini, name, AsciiString::TheEmptyString); -} - -//------------------------------------------------------------------------------------------------- -/** Parse Object entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseObjectReskinDefinition( INI* ini ) -{ - AsciiString name = ini->getNextToken(); - AsciiString reskinFrom = ini->getNextToken(); - ThingFactory::parseObjectDefinition(ini, name, reskinFrom); -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp deleted file mode 100644 index 8e75daee046..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp +++ /dev/null @@ -1,57 +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: INIParticleSys.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Michael S. Booth, November 2001 -// Desc: Parsing Particle System INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/ParticleSys.h" - - -/** - * Parse entry - */ -void INI::parseParticleSystemDefinition( INI* ini ) -{ - AsciiString name; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // find existing item if present - ParticleSystemTemplate *sysTemplate = const_cast(TheParticleSystemManager->findTemplate( name )); - if (sysTemplate == nullptr) - { - // no item is present, create a new one - sysTemplate = TheParticleSystemManager->newTemplate( name ); - } - - // parse the ini definition - ini->initFromINI( sysTemplate, sysTemplate->getFieldParse() ); -} diff --git a/Generals/Code/GameEngine/Source/Common/INI/INISpecialPower.cpp b/Generals/Code/GameEngine/Source/Common/INI/INISpecialPower.cpp deleted file mode 100644 index f4f36ce6397..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INISpecialPower.cpp +++ /dev/null @@ -1,44 +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: INISpecialPower.cpp ////////////////////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: Special Power INI database -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/SpecialPower.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void INI::parseSpecialPowerDefinition( INI *ini ) -{ - SpecialPowerStore::parseSpecialPowerDefinition(ini); -} - - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INITerrain.cpp b/Generals/Code/GameEngine/Source/Common/INI/INITerrain.cpp deleted file mode 100644 index 1e4b0c1c945..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INITerrain.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: INITerrain.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Terrain type INI loading -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/TerrainTypes.h" - -//------------------------------------------------------------------------------------------------- -/** Parse Terrain type entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseTerrainDefinition( INI* ini ) -{ - AsciiString name; - TerrainType *terrainType; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // find existing item if present - terrainType = TheTerrainTypes->findTerrain( name ); - if( terrainType == nullptr ) - terrainType = TheTerrainTypes->newTerrain( name ); - - // sanity - DEBUG_ASSERTCRASH( terrainType, ("Unable to allocate terrain type '%s'", name.str()) ); - - // parse the ini definition - ini->initFromINI( terrainType, terrainType->getFieldParse() ); - -} - - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp b/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp deleted file mode 100644 index 65c614e5c55..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp +++ /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: INITerrainBridge.cpp ///////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Terrain bridge INI loading -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/TerrainRoads.h" - -//------------------------------------------------------------------------------------------------- -/** Parse Terrain Bridge entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseTerrainBridgeDefinition( INI* ini ) -{ - AsciiString name; - TerrainRoadType *bridge; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // find existing item if present or allocate new one - bridge = TheTerrainRoads->findBridge( name ); - - // if item is found it better already be a bridge - if( bridge ) - { - - // sanity - DEBUG_ASSERTCRASH( bridge->isBridge(), ("Redefining road '%s' as a bridge!", - bridge->getName().str()) ); - throw INI_INVALID_DATA; - - } - - if( bridge == nullptr ) - bridge = TheTerrainRoads->newBridge( name ); - - DEBUG_ASSERTCRASH( bridge, ("Unable to allocate bridge '%s'", name.str()) ); - - // parse the ini definition - ini->initFromINI( bridge, bridge->getBridgeFieldParse() ); - -} - - - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp b/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp deleted file mode 100644 index 94cbd4779fc..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp +++ /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: INITerrainRoad.cpp /////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Terrain road INI loading -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/TerrainRoads.h" - -//------------------------------------------------------------------------------------------------- -/** Parse Terrain Road entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseTerrainRoadDefinition( INI* ini ) -{ - AsciiString name; - TerrainRoadType *road; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // find existing item if present or allocate new one - road = TheTerrainRoads->findRoad( name ); - - // if item is found it better not already be a bridge - if( road ) - { - - // sanity - DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("Redefining bridge '%s' as a road!", - road->getName().str()) ); - throw INI_INVALID_DATA; - - } - - if( road == nullptr ) - road = TheTerrainRoads->newRoad( name ); - - DEBUG_ASSERTCRASH( road, ("Unable to allocate road '%s'", name.str()) ); - - // parse the ini definition - ini->initFromINI( road, road->getRoadFieldParse() ); - -} - - - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIUpgrade.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIUpgrade.cpp deleted file mode 100644 index be2956f743d..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIUpgrade.cpp +++ /dev/null @@ -1,45 +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: INIUpgrade.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Upgrade database -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/Upgrade.h" - -//------------------------------------------------------------------------------------------------- -/** Parse an upgrade definition */ -//------------------------------------------------------------------------------------------------- -void INI::parseUpgradeDefinition( INI *ini ) -{ - UpgradeCenter::parseUpgradeDefinition(ini); -} - - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIWater.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIWater.cpp deleted file mode 100644 index d6bdec167f1..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIWater.cpp +++ /dev/null @@ -1,144 +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: INIWater.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Water settings -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_TIME_OF_DAY_NAMES - -#include "Common/INI.h" -#include "Common/GameType.h" - -#include "GameClient/TerrainVisual.h" -#include "GameClient/Water.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Water setting, note that this does not support override situations. As the water - * system becomes more complex we may want to change this */ -//------------------------------------------------------------------------------------------------- -void INI::parseWaterSettingDefinition( INI* ini ) -{ - AsciiString name; - WaterSetting *waterSetting = nullptr; - - // read the name - const char* token = ini->getNextToken(); - - name.set( token ); - - // get the water setting we want to load based on name - const char *const *timeOfDayName = TimeOfDayNames; - Int timeOfDayIndex = 0; // TIME_OF_DAY_INVALID - while( timeOfDayName && *timeOfDayName ) - { - - if( stricmp( *timeOfDayName, name.str() ) == 0 ) - { - - waterSetting = &WaterSettings[ timeOfDayIndex ]; - break; - - } - - // next name - timeOfDayName++; - timeOfDayIndex++; - - } - - // check for no time of day match - if( waterSetting == nullptr ) - throw INI_INVALID_DATA; - - // parse the data - ini->initFromINI( waterSetting, waterSetting->getFieldParse() ); - -} - -//------------------------------------------------------------------------------------------------- -void INI::parseWaterTransparencyDefinition( INI *ini ) -{ - if (TheWaterTransparency == nullptr) { - TheWaterTransparency = newInstance(WaterTransparencySetting); - } else if (ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES) { - WaterTransparencySetting* wt = (WaterTransparencySetting*) (TheWaterTransparency.getNonOverloadedPointer()); - WaterTransparencySetting* wtOverride = newInstance(WaterTransparencySetting); - *wtOverride = *wt; - - // Mark that it is an override. - wtOverride->markAsOverride(); - - wt->friend_getFinalOverride()->setNextOverride(wtOverride); - } else { - throw INI_INVALID_DATA; - } - - WaterTransparencySetting* waterTrans = (WaterTransparencySetting*) (TheWaterTransparency.getNonOverloadedPointer()); - waterTrans = (WaterTransparencySetting*) (waterTrans->friend_getFinalOverride()); - // parse the data - ini->initFromINI( waterTrans, TheWaterTransparency->getFieldParse() ); - - // If we overrode any skybox textures, then call the W3D Water stuff. - if (ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES) { - // Check to see if we overrode any skybox textures. - // If we did, then we need to replace them in the model. - // Copy/Paste monkeys PLEASE TAKE NOTE. This technique only works for the skybox because we - // know that there will never be more than one sky box. If you were to use this technique for - // technicals, for instance, it would make all technicals in the level have the same new - // texture. - - const WaterTransparencySetting* wtOriginal = TheWaterTransparency.getNonOverloadedPointer(); - OVERRIDE wtOverride = TheWaterTransparency; - - if (wtOriginal == wtOverride) - return; - - const AsciiString *oldTextures[5],*newTextures[5]; - - //Copy current texture names into arrays - oldTextures[0]=&wtOriginal->m_skyboxTextureN; - newTextures[0]=&wtOverride->m_skyboxTextureN; - oldTextures[1]=&wtOriginal->m_skyboxTextureE; - newTextures[1]=&wtOverride->m_skyboxTextureE; - oldTextures[2]=&wtOriginal->m_skyboxTextureS; - newTextures[2]=&wtOverride->m_skyboxTextureS; - oldTextures[3]=&wtOriginal->m_skyboxTextureW; - newTextures[3]=&wtOverride->m_skyboxTextureW; - oldTextures[4]=&wtOriginal->m_skyboxTextureT; - newTextures[4]=&wtOverride->m_skyboxTextureT; - - TheTerrainVisual->replaceSkyboxTextures(oldTextures, newTextures); - } -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIWeapon.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIWeapon.cpp deleted file mode 100644 index 52006534e41..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIWeapon.cpp +++ /dev/null @@ -1,48 +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: INIWeapon.cpp //////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Parsing Weapon INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameLogic/Weapon.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -/** Parse Weapon entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseWeaponTemplateDefinition( INI* ini ) -{ - WeaponStore::parseWeaponTemplateDefinition(ini); -} - - diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp deleted file mode 100644 index 59388d9f854..00000000000 --- a/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp +++ /dev/null @@ -1,123 +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: INIWebpageURL.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Bryan Cleveland, November 2001 -// Desc: Parsing Webpage URL INI entries -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/Registry.h" -#include "GameNetwork/WOLBrowser/WebBrowser.h" - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -AsciiString encodeURL(AsciiString source) -{ - if (source.isEmpty()) - { - return AsciiString::TheEmptyString; - } - - AsciiString target; - AsciiString allowedChars = "$-_.+!*'(),\\"; - const char *ptr = source.str(); - while (*ptr) - { - if (isalnum(*ptr) || allowedChars.find(*ptr)) - { - target.concat(*ptr); - } - else - { - AsciiString tmp; - target.concat('%'); - tmp.format("%2.2x", ((int)*ptr)); - target.concat(tmp); - } - ++ptr; - } - - return target; -} - -//------------------------------------------------------------------------------------------------- -/** Parse Music entry */ -//------------------------------------------------------------------------------------------------- -void INI::parseWebpageURLDefinition( INI* ini ) -{ - AsciiString tag; - WebBrowserURL *url; - - // read the name - const char* c = ini->getNextToken(); - tag.set( c ); - - if (TheWebBrowser != nullptr) - { - url = TheWebBrowser->findURL(tag); - - if (url == nullptr) - { - url = TheWebBrowser->makeNewURL(tag); - } - } - - // find existing item if present -// track = TheAudio->Music->getTrack( name ); -// if( track == nullptr ) -// { - - // allocate a new track -// track = TheAudio->Music->newMusicTrack( name ); - -// } // end if - -// DEBUG_ASSERTCRASH( track, ("parseMusicTrackDefinition: Unable to allocate track '%s'", -// name.str()) ); - - // parse the ini definition - ini->initFromINI( url, url->getFieldParse() ); - - if (url->m_url.startsWith("file://")) - { - char cwd[_MAX_PATH] = "\\"; - getcwd(cwd, _MAX_PATH); - - url->m_url.format("file://%s\\Data\\%s\\%s", encodeURL(cwd).str(), GetRegistryLanguage().str(), url->m_url.str()+7); - DEBUG_LOG(("INI::parseWebpageURLDefinition() - converted URL to [%s]", url->m_url.str())); - } -} - - diff --git a/Generals/Code/GameEngine/Source/Common/MessageStream.cpp b/Generals/Code/GameEngine/Source/Common/MessageStream.cpp index 057a2e4f354..f2bf29a6cd8 100644 --- a/Generals/Code/GameEngine/Source/Common/MessageStream.cpp +++ b/Generals/Code/GameEngine/Source/Common/MessageStream.cpp @@ -337,6 +337,7 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_META_BEGIN_PREFER_SELECTION) CASE_LABEL(MSG_META_END_PREFER_SELECTION) CASE_LABEL(MSG_META_TAKE_SCREENSHOT) + CASE_LABEL(MSG_META_TAKE_SCREENSHOT_PNG) CASE_LABEL(MSG_META_ALL_CHEER) CASE_LABEL(MSG_META_TOGGLE_ATTACKMOVE) CASE_LABEL(MSG_META_BEGIN_CAMERA_ROTATE_LEFT) @@ -963,7 +964,7 @@ void MessageStream::removeTranslator( TranslatorID id ) // ------------------------------------------------------------------------------------------------ #if defined(RTS_DEBUG) -Bool isInvalidDebugCommand( GameMessage::Type t ) +static Bool isInvalidDebugCommand( GameMessage::Type t ) { // see if this is something that should be prevented in multiplayer games // Don't reject this stuff in skirmish games. @@ -1051,6 +1052,16 @@ void MessageStream::propagateMessages() { for( msg=m_firstMessage; msg; msg=next ) { + // TheSuperHackers @tweak Delete messages that we know are redundant. This can reduce network traffic. + // @info If there is a need to look back on previous messages, then first invalidate the messages in this loop + // before deleting them later. + if (isRedundantMessage(msg)) + { + next = msg->next(); + deleteInstance(msg); + continue; + } + if (ss->m_translator #if defined(RTS_DEBUG) && !isInvalidDebugCommand(msg->getType()) @@ -1058,16 +1069,15 @@ void MessageStream::propagateMessages() ) { GameMessageDisposition disp = ss->m_translator->translateGameMessage(msg); - next = msg->next(); if (disp == DESTROY_MESSAGE) { + next = msg->next(); deleteInstance(msg); + continue; } } - else - { - next = msg->next(); - } + + next = msg->next(); } } @@ -1081,6 +1091,47 @@ void MessageStream::propagateMessages() } +Bool MessageStream::isRedundantMessage(const GameMessage *msg) const +{ + switch (msg->getType()) + { + case GameMessage::MSG_DESTROY_SELECTED_GROUP: + { + const GameMessage* msgNext = msg->next(); + if (!msgNext) + break; + + switch (msgNext->getType()) + { + case GameMessage::MSG_CREATE_SELECTED_GROUP: + case GameMessage::MSG_CREATE_SELECTED_GROUP_NO_SOUND: + if (msgNext->getArgumentCount() >= 1) + { + const Bool newGroup = msgNext->getArgument(0)->boolean; + if (newGroup) + return true; + } + break; + case GameMessage::MSG_DESTROY_SELECTED_GROUP: + return true; + case GameMessage::MSG_SELECT_TEAM0: + case GameMessage::MSG_SELECT_TEAM1: + case GameMessage::MSG_SELECT_TEAM2: + case GameMessage::MSG_SELECT_TEAM3: + case GameMessage::MSG_SELECT_TEAM4: + case GameMessage::MSG_SELECT_TEAM5: + case GameMessage::MSG_SELECT_TEAM6: + case GameMessage::MSG_SELECT_TEAM7: + case GameMessage::MSG_SELECT_TEAM8: + case GameMessage::MSG_SELECT_TEAM9: + return true; + } + break; + } + } + + return false; +} //------------------------------------------------------------------------------------------------ // CommandList diff --git a/Generals/Code/GameEngine/Source/Common/MultiplayerSettings.cpp b/Generals/Code/GameEngine/Source/Common/MultiplayerSettings.cpp index 4f3de4c7180..a0ba147d010 100644 --- a/Generals/Code/GameEngine/Source/Common/MultiplayerSettings.cpp +++ b/Generals/Code/GameEngine/Source/Common/MultiplayerSettings.cpp @@ -117,6 +117,8 @@ MultiplayerSettings::MultiplayerSettings() // Ensure starting money choices are in ascending order for UI presentation std::sort(m_startingMoneyList.begin(), m_startingMoneyList.end(), [](const Money &a, const Money &b) { return a.countMoney() < b.countMoney(); }); + + m_gotDefaultStartingMoney = false; } MultiplayerColorDefinition::MultiplayerColorDefinition() diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp index fb1de456b3a..479c724c7f9 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -196,8 +196,8 @@ void dumpBattlePlanBonuses(const BattlePlanBonusesData *b, AsciiString name, con kindofMaskAsAsciiString(b->m_invalidKindOf).str())); } #else -#define DUMPBATTLEPLANBONUSES(x,y,z) {} -#define CRCDUMPBATTLEPLANBONUSES(x,y,z) {} +#define DUMPBATTLEPLANBONUSES(x,y,z) +#define CRCDUMPBATTLEPLANBONUSES(x,y,z) #endif // DEBUG_CRC // ------------------------------------------------------------------------------------------------ diff --git a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index 59cbd5d3e97..214cddcec23 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -58,8 +58,8 @@ #include "GameLogic/Object.h" #endif #include "GameLogic/SidesList.h" -#include "GameNetwork/NetworkDefs.h" #include "GameNetwork/GameInfo.h" +#include "GameNetwork/NetworkDefs.h" #include //----------------------------------------------------------------------------- @@ -242,7 +242,10 @@ void PlayerList::newGame() } // GeneralsX @bugfix felipebraz 05/07/2026 Pre-compute the network slot to player mapping - resolveSlotIndices(); + if (TheGameInfo) + { + assignSlotIndices(*TheGameInfo); + } } //----------------------------------------------------------------------------- @@ -254,7 +257,7 @@ void PlayerList::init() for (int i = 1; i < MAX_PLAYER_COUNT; i++) m_players[i]->init(nullptr); - std::fill(m_slotIndices, m_slotIndices + MAX_PLAYER_COUNT, -1); + std::fill(m_slotIndices, m_slotIndices + ARRAY_SIZE(m_slotIndices), -1); // call setLocalPlayer so that becomingLocalPlayer() gets called appropriately setLocalPlayer(m_players[0]); @@ -402,7 +405,6 @@ Player *PlayerList::getEachPlayerFromMask( PlayerMaskType& maskToAdjust ) return nullptr; // mask not found } - //------------------------------------------------------------------------------------------------- PlayerMaskType PlayerList::getPlayersWithRelationship( Int srcPlayerIndex, UnsignedInt allowedRelationships ) { @@ -502,7 +504,7 @@ void PlayerList::loadPostProcess() } //----------------------------------------------------------------------------- -void PlayerList::setSlotIndex(Int playerIndex, Byte slotIndex) +void PlayerList::setSlotIndex(Int playerIndex, Int slotIndex) { if (playerIndex >= 0 && playerIndex < ARRAY_SIZE(m_slotIndices)) { @@ -511,7 +513,7 @@ void PlayerList::setSlotIndex(Int playerIndex, Byte slotIndex) } //----------------------------------------------------------------------------- -Byte PlayerList::getSlotIndex(Int playerIndex) const +Int PlayerList::getSlotIndex(Int playerIndex) const { if (playerIndex >= 0 && playerIndex < ARRAY_SIZE(m_slotIndices)) { @@ -522,23 +524,19 @@ Byte PlayerList::getSlotIndex(Int playerIndex) const } //----------------------------------------------------------------------------- -void PlayerList::resolveSlotIndices() +void PlayerList::assignSlotIndices(const GameInfo& gameInfo) { - if (!TheGameInfo) - return; - AsciiString playerName; for (Int i = 0; i < MAX_SLOTS; ++i) { - const GameSlot* slot = TheGameInfo->getSlot(i); + const GameSlot* slot = gameInfo.getConstSlot(i); if (!slot || !slot->isOccupied()) continue; playerName.format("player%d", i); - Player* player = findPlayerWithNameKey(TheNameKeyGenerator->nameToKey(playerName)); - if (player) + if (Player* player = findPlayerWithNameKey(TheNameKeyGenerator->nameToKey(playerName))) { setSlotIndex(player->getPlayerIndex(), i); } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 3c46c0ef4aa..19f69221dad 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -829,6 +829,16 @@ static void saveOptions() TheWritableGlobalData->m_gameWindowTransitionSpeedMultiplier = speed; } + //------------------------------------------------------------------------------------------------- + // Set JPEG screenshot quality + { + Int quality = pref->getJpegQuality(); + AsciiString prefString; + prefString.format("%d", quality); + (*pref)["JpegQuality"] = prefString; + TheWritableGlobalData->m_jpegQuality = quality; + } + //------------------------------------------------------------------------------------------------- // Resolution // diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index e02a57755a9..0cf8ae97c20 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -78,7 +78,7 @@ void refreshPlayerList( Bool forceRefresh = FALSE ); static LogClass s_perfLog("Perf.txt"); #define PERF_LOG(x) s_perfLog.log x #else // DEBUG_LOGGING -#define PERF_LOG(x) {} +#define PERF_LOG(x) #endif // DEBUG_LOGGING // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index a9f8bbaea6f..772f7e20232 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -74,7 +74,7 @@ static LogClass s_perfLog("QMPerf.txt"); static Bool s_inQM = FALSE; #define PERF_LOG(x) s_perfLog.log x #else // DEBUG_LOGGING -#define PERF_LOG(x) {} +#define PERF_LOG(x) #endif // DEBUG_LOGGING // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index b9678a641ef..cca76b9d991 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -43,7 +43,6 @@ #include "Common/ThingFactory.h" #include "Common/ThingTemplate.h" #include "Common/Xfer.h" -#include "Common/GameLOD.h" #include "GameClient/Anim2D.h" #include "GameClient/CampaignManager.h" #include "GameClient/CommandXlat.h" @@ -63,6 +62,7 @@ #include "GameClient/HotKey.h" #include "GameClient/IMEManager.h" #include "GameClient/InGameUI.h" +#include "GameClient/Intro.h" #include "GameClient/Keyboard.h" #include "GameClient/LanguageFilter.h" #include "GameClient/LookAtXlat.h" @@ -77,7 +77,6 @@ #include "GameClient/View.h" #include "GameClient/VideoPlayer.h" #include "GameClient/WindowXlat.h" -#include "GameLogic/FPUControl.h" #include "GameLogic/GameLogic.h" #include "GameLogic/GhostObject.h" #include "GameLogic/Object.h" @@ -107,6 +106,8 @@ GameClient::GameClient() m_nextDrawableID = (DrawableID)1; TheDrawGroupInfo = new DrawGroupInfo; + + m_intro = nullptr; } //std::vector preloadTextureNamesGlobalHack; @@ -150,6 +151,10 @@ GameClient::~GameClient() } m_drawableList = nullptr; + // Should be destroyed before the Display String Manager + delete m_intro; + m_intro = nullptr; + // delete the ray effects delete TheRayEffects; TheRayEffects = nullptr; @@ -414,6 +419,8 @@ void GameClient::init() TheDisplayStringManager->postProcessLoad(); + m_intro = NEW Intro; + #ifdef PERF_TIMERS TheGraphDraw = new GraphDraw; #endif @@ -495,73 +502,19 @@ void GameClient::update() // create the FRAME_TICK message GameMessage *frameMsg = TheMessageStream->appendMessage( GameMessage::MSG_FRAME_TICK ); frameMsg->appendTimestampArgument( getFrame() ); - static Bool playSizzle = FALSE; - // We need to show the movie first. - if(TheGlobalData->m_playIntro && !TheDisplay->isMoviePlaying()) - { - if(TheGameLODManager && TheGameLODManager->didMemPass()) - TheDisplay->playLogoMovie("EALogoMovie", 5000, 3000); - else - TheDisplay->playLogoMovie("EALogoMovie640", 5000, 3000); - TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; - playSizzle = TRUE; - } - //Initial Game Condition. We must show the movie first and then we can display the shell - if(TheGlobalData->m_afterIntro && !TheDisplay->isMoviePlaying()) + // Update intro + if (m_intro != nullptr) { - if( playSizzle && TheGlobalData->m_playSizzle ) - { - TheWritableGlobalData->m_allowExitOutOfMovies = TRUE; - if(TheGameLODManager && TheGameLODManager->didMemPass()) - TheDisplay->playMovie("Sizzle"); - else - TheDisplay->playMovie("Sizzle640"); - playSizzle = FALSE; - } - else - { - TheWritableGlobalData->m_breakTheMovie = TRUE; - TheWritableGlobalData->m_allowExitOutOfMovies = TRUE; + m_intro->update(); - if(TheGameLODManager && !TheGameLODManager->didMemPass()) - { - TheWritableGlobalData->m_breakTheMovie = FALSE; - - WindowLayout *legal = TheWindowManager->winCreateLayout("Menus/LegalPage.wnd"); - if(legal) - { - legal->hide(FALSE); - legal->bringForward(); - Int beginTime = timeGetTime(); - while(beginTime + 4000 > timeGetTime() ) - { - if (GameClient::isMovieAbortRequested()) - { - break; - } - - TheWindowManager->update(); - // redraw all views, update the GUI - TheDisplay->draw(); - Sleep(100); - } - setFPMode(); - - - legal->destroyWindows(); - deleteInstance(legal); - - } - TheWritableGlobalData->m_breakTheMovie = TRUE; - - - } + if (m_intro->isDone()) + { + delete m_intro; + m_intro = nullptr; TheShell->showShellMap(TRUE); TheShell->showShell(); - TheWritableGlobalData->m_afterIntro = FALSE; } } @@ -587,7 +540,7 @@ void GameClient::update() } - if(TheGlobalData->m_playIntro || TheGlobalData->m_afterIntro) + if (m_intro != nullptr) { // redraw all views, update the GUI TheDisplay->UPDATE(); diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 571d073f944..e969bc91be2 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -3481,9 +3481,10 @@ void InGameUI::deselectDrawable( Drawable *draw ) //------------------------------------------------------------------------------------------------- /** Clear all drawables' "select" status */ //------------------------------------------------------------------------------------------------- -void InGameUI::deselectAllDrawables( Bool postMsg ) +void InGameUI::deselectAllDrawables() { const DrawableList *selected = getAllSelectedDrawables(); + const Bool hadSelectedDrawables = !selected->empty(); // loop through all the selected drawables for ( DrawableListCIt it = selected->begin(); it != selected->end(); ) @@ -3504,16 +3505,11 @@ void InGameUI::deselectAllDrawables( Bool postMsg ) // our selection can no longer consist of exactly one angry mob m_soloNexusSelectedDrawableID = INVALID_DRAWABLE_ID; - - ///@todo don't we want to not emit this message if there wasn't a group at all? (CBD) - /** @todo also, we probably are sending this message too much, we should come up with - some kind of "selections are dirty" status that we can check once per frame and send - the correct group info over the network ... could be tricky tho (or impossible) given - the order of operations of things happening in the code (CBD) */ - if( postMsg ) + // TheSuperHackers @tweak Only send this message when objects were previously selected. + if (hadSelectedDrawables) { // TheSuperHackers @tweak Originally this message had one boolean argument, but it wasn't used for anything. - TheMessageStream->appendMessage( GameMessage::MSG_DESTROY_SELECTED_GROUP ); + TheMessageStream->appendMessage(GameMessage::MSG_DESTROY_SELECTED_GROUP); } } diff --git a/Generals/Code/GameEngineDevice/CMakeLists.txt b/Generals/Code/GameEngineDevice/CMakeLists.txt index e4b6cb9cfab..a0d6f8e25c3 100644 --- a/Generals/Code/GameEngineDevice/CMakeLists.txt +++ b/Generals/Code/GameEngineDevice/CMakeLists.txt @@ -222,6 +222,7 @@ target_link_libraries(g_gameenginedevice PRIVATE corei_gameenginedevice_private gi_always gi_main + stb ) target_link_libraries(g_gameenginedevice PUBLIC diff --git a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h index beec99a261c..31569a641f0 100644 --- a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h +++ b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h @@ -123,7 +123,7 @@ class W3DDisplay : public Display virtual VideoBuffer* createVideoBuffer() override; ///< Create a video buffer that can be used for this display - virtual void takeScreenShot() override; //save screenshot to file + virtual void takeScreenShot(ScreenshotFormat format, Int jpegQuality) override; //save screenshot in specified format virtual void toggleMovieCapture() override; //enable AVI or frame capture mode. virtual void toggleLetterBox() override; ///m_headless) return; + // TheSuperHackers @feature bobtista 10/07/2026 Show messages for screenshots finished by the screenshot thread. + W3D_UpdateScreenshotMessages(); + updateAverageFPS(); if (TheGlobalData->m_enableDynamicLOD && TheGameLogic->getShowDynamicLOD()) { @@ -2049,14 +2052,7 @@ void W3DDisplay::draw() // TheSuperHackers @bugfix Mauller 20/07/2025 scale videos based on screen size so they are shown in their original aspect drawScaledVideoBuffer( m_videoBuffer, m_videoStream ); } - if( m_copyrightDisplayString ) - { - Int x, y, dX, dY; - m_copyrightDisplayString->getSize(&dX, &dY); - x = (getWidth() / 2) - (dX /2); - y = getHeight() - dY - 20 ; - m_copyrightDisplayString->draw(x, y, GameMakeColor(0,0,0,255), GameMakeColor(0,0,0,0),0,0); - } + // render letter box before debug display so debug info isn't hidden renderLetterBox(now); @@ -3073,228 +3069,6 @@ void W3DDisplay::setShroudLevel( Int x, Int y, CellShroudStatus setting ) } } -//============================================================================= -///Utility function to dump data into a .BMP file -// GeneralsX @build BenderAI 10/03/2026 Screenshot is Windows-specific functionality -#ifdef _WIN32 -static void CreateBMPFile(LPTSTR pszFile, char *image, Int width, Int height) -{ - HANDLE hf; // file handle - BITMAPFILEHEADER hdr; // bitmap file-header - PBITMAPINFOHEADER pbih; // bitmap info-header - LPBYTE lpBits; // memory pointer - DWORD dwTotal; // total count of bytes - DWORD cb; // incremental count of bytes - BYTE *hp; // byte pointer - DWORD dwTmp; - - PBITMAPINFO pbmi; - - pbmi = (PBITMAPINFO) LocalAlloc(LPTR,sizeof(BITMAPINFOHEADER)); - if (pbmi == nullptr) - return; - - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = width; - pbmi->bmiHeader.biHeight = height; - pbmi->bmiHeader.biPlanes = 1; - pbmi->bmiHeader.biBitCount = 24; - pbmi->bmiHeader.biCompression = BI_RGB; - pbmi->bmiHeader.biSizeImage = (pbmi->bmiHeader.biWidth + 7) /8 * pbmi->bmiHeader.biHeight * 24; - pbmi->bmiHeader.biClrImportant = 0; - - pbih = (PBITMAPINFOHEADER) pbmi; - lpBits = (LPBYTE) image; - - // Create the .BMP file. - hf = CreateFile(pszFile, - GENERIC_READ | GENERIC_WRITE, - (DWORD) 0, - nullptr, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - (HANDLE) nullptr); - - if (hf != INVALID_HANDLE_VALUE) - { - hdr.bfType = 0x4d42; // 0x42 = "B" 0x4d = "M" - // Compute the size of the entire file. - hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + - pbih->biSize + pbih->biClrUsed - * sizeof(RGBQUAD) + pbih->biSizeImage); - hdr.bfReserved1 = 0; - hdr.bfReserved2 = 0; - - // Compute the offset to the array of color indices. - hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + - pbih->biSize + pbih->biClrUsed - * sizeof (RGBQUAD); - - // Copy the BITMAPFILEHEADER into the .BMP file. - if (WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), - (LPDWORD) &dwTmp, nullptr)) - { - // Copy the BITMAPINFOHEADER and RGBQUAD array into the file. - if (WriteFile(hf, (LPVOID) pbih, sizeof(BITMAPINFOHEADER) + pbih->biClrUsed * sizeof (RGBQUAD),(LPDWORD) &dwTmp, nullptr)) - { - // Copy the array of color indices into the .BMP file. - dwTotal = cb = pbih->biSizeImage; - hp = lpBits; - WriteFile(hf, (LPSTR) hp, (int) cb, (LPDWORD) &dwTmp, nullptr); - } - } - - // Close the .BMP file. - CloseHandle(hf); - } - - // Free memory. - LocalFree( (HLOCAL) pbmi); -} - -///Save Screen Capture to a file -void W3DDisplay::takeScreenShot() -{ - char leafname[256]; - char pathname[1024]; - - static int frame_number = 1; - - Bool done = false; - while (!done) { -#ifdef CAPTURE_TO_TARGA - sprintf( leafname, "%s%.3d.tga", "sshot", frame_number++); -#else - sprintf( leafname, "%s%.3d.bmp", "sshot", frame_number++); -#endif - strlcpy(pathname, TheGlobalData->getPath_UserData().str(), ARRAY_SIZE(pathname)); - strlcat(pathname, leafname, ARRAY_SIZE(pathname)); - if (_access( pathname, 0 ) == -1) - done = true; - } - - // TheSuperHackers @bugfix xezon 21/05/2025 Get the back buffer and create a copy of the surface. - // Originally this code took the front buffer and tried to lock it. This does not work when the - // render view clips outside the desktop boundaries. It crashed the game. - SurfaceClass* surface = DX8Wrapper::_Get_DX8_Back_Buffer(); - - SurfaceClass::SurfaceDescription surfaceDesc; - surface->Get_Description(surfaceDesc); - - SurfaceClass* surfaceCopy = NEW_REF(SurfaceClass, (DX8Wrapper::_Create_DX8_Surface(surfaceDesc.Width, surfaceDesc.Height, surfaceDesc.Format))); - DX8Wrapper::_Copy_DX8_Rects(surface->Peek_D3D_Surface(), nullptr, 0, surfaceCopy->Peek_D3D_Surface(), nullptr); - - surface->Release_Ref(); - surface = nullptr; - - struct Rect - { - int Pitch; - void* pBits; - } lrect; - - lrect.pBits = surfaceCopy->Lock(&lrect.Pitch); - if (lrect.pBits == nullptr) - { - surfaceCopy->Release_Ref(); - return; - } - - unsigned int x,y,index,index2,width,height; - - width = surfaceDesc.Width; - height = surfaceDesc.Height; - - char *image=NEW char[3*width*height]; -#ifdef CAPTURE_TO_TARGA - //bytes are mixed in targa files, not rgb order. - for (y=0; yUnlock(); - surfaceCopy->Release_Ref(); - surfaceCopy = nullptr; - - Targa targ; - memset(&targ.Header,0,sizeof(targ.Header)); - targ.Header.Width=width; - targ.Header.Height=height; - targ.Header.PixelDepth=24; - targ.Header.ImageType=TGA_TRUECOLOR; - targ.SetImage(image); - targ.YFlip(); - - targ.Save(pathname,TGAF_IMAGE,false); -#else //capturing to bmp file - //bmp is same byte order - for (y=0; yUnlock(); - surfaceCopy->Release_Ref(); - surfaceCopy = nullptr; - - //Flip the image - char *ptr,*ptr1; - char v,v1; - - for (y = 0; y < (height >> 1); y++) - { - /* Compute address of lines to exchange. */ - ptr = (image + ((width * y) * 3)); - ptr1 = (image + ((width * (height - 1)) * 3)); - ptr1 -= ((width * y) * 3); - - /* Exchange all the pixels on this scan line. */ - for (x = 0; x < (width * 3); x++) - { - v = *ptr; - v1 = *ptr1; - *ptr = v1; - *ptr1 = v; - ptr++; - ptr1++; - } - } - CreateBMPFile(pathname, image, width, height); -#endif - - delete [] image; - - UnicodeString ufileName; - ufileName.translate(leafname); - TheInGameUI->message(TheGameText->fetch("GUI:ScreenCapture"), ufileName.str()); -} -#else -void W3DDisplay::takeScreenShot(void) -{ - // TODO (Phase 3): Implement SDL3-based screenshot capture -} -#endif /** Start/Stop capturing an AVI movie*/ void W3DDisplay::toggleMovieCapture() @@ -3302,6 +3076,11 @@ void W3DDisplay::toggleMovieCapture() WW3D::Toggle_Movie_Capture("Movie",30); } +void W3DDisplay::takeScreenShot(ScreenshotFormat format, Int jpegQuality) +{ + W3D_TakeCompressedScreenshot(format, jpegQuality); +} + #if defined(RTS_DEBUG) diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp index 4a9bf52823c..6a77974f3c6 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp @@ -511,9 +511,6 @@ void BoxRenderObjClass::render_box(RenderInfoClass & rinfo,const Vector3 & cente DX8Wrapper::Set_Index_Buffer(ibaccess,0); DX8Wrapper::Set_Vertex_Buffer(vbaccess); - SphereClass sphere; - Get_Obj_Space_Bounding_Sphere(sphere); - DX8Wrapper::Draw_Triangles(buffer_type,0,NUM_BOX_FACES,0,NUM_BOX_VERTS); } } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp index ccfebcdccf9..5b1d4618445 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp @@ -1180,8 +1180,6 @@ void DazzleRenderObjClass::Render_Dazzle(CameraClass* camera) DX8Wrapper::Set_Index_Buffer(ib_access,dazzle_vertex_count); DX8Wrapper::Set_Shader(default_halo_shader); DX8Wrapper::Set_Texture(0,types[type]->Get_Halo_Texture()); - SphereClass sphere(Get_Position(),0.1f); - DX8Wrapper::Draw_Triangles(0,halo_poly_count,0,vertex_count); } @@ -1189,7 +1187,6 @@ void DazzleRenderObjClass::Render_Dazzle(CameraClass* camera) DX8Wrapper::Set_Index_Buffer(ib_access,0); DX8Wrapper::Set_Shader(default_dazzle_shader); DX8Wrapper::Set_Texture(0,types[type]->Get_Dazzle_Texture()); - SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f); DX8Wrapper::Draw_Triangles(0,dazzle_poly_count,0,vertex_count); } @@ -1197,7 +1194,6 @@ void DazzleRenderObjClass::Render_Dazzle(CameraClass* camera) DX8Wrapper::Set_Index_Buffer(ib_access,dazzle_vertex_count+halo_vertex_count); DX8Wrapper::Set_Shader(default_dazzle_shader); DX8Wrapper::Set_Texture(0,lensflare->Get_Texture()); - SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f); DX8Wrapper::Draw_Triangles(0,lensflare_poly_count,0,vertex_count); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h index cbc007a719c..4794b5ca3d6 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h @@ -129,7 +129,7 @@ class GapFillerClass ShaderClass* ShaderArray[MeshMatDescClass::MAX_PASSES]; MeshModelClass* mmc; - GapFillerClass& operator = (const GapFillerClass&) CPP_11(= delete); + GapFillerClass& operator = (const GapFillerClass&) FUNCTION_DELETE; public: GapFillerClass(MeshModelClass* mmc); GapFillerClass(const GapFillerClass& that); diff --git a/Generals/Code/Tools/GUIEdit/Include/GUIEditDisplay.h b/Generals/Code/Tools/GUIEdit/Include/GUIEditDisplay.h index ee27b4cc7a0..c2219ec7d2e 100644 --- a/Generals/Code/Tools/GUIEdit/Include/GUIEditDisplay.h +++ b/Generals/Code/Tools/GUIEdit/Include/GUIEditDisplay.h @@ -101,7 +101,7 @@ class GUIEditDisplay : public Display virtual void drawScaledVideoBuffer( VideoBuffer *buffer, VideoStreamInterface *stream ) override { } virtual void drawVideoBuffer( VideoBuffer *buffer, Int startX, Int startY, Int endX, Int endY ) override { } - virtual void takeScreenShot() override { } + virtual void takeScreenShot(ScreenshotFormat format, Int jpegQuality) override { } virtual void toggleMovieCapture() override {} // methods that we need to stub diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt index c0efea45391..60c2e8af3cb 100644 --- a/GeneralsMD/Code/GameEngine/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt @@ -570,33 +570,33 @@ set(GAMEENGINE_SRC Source/Common/GameMain.cpp Source/Common/GlobalData.cpp # Source/Common/INI/INI.cpp - Source/Common/INI/INIAiData.cpp - Source/Common/INI/INIAnimation.cpp +# Source/Common/INI/INIAiData.cpp +# Source/Common/INI/INIAnimation.cpp # Source/Common/INI/INIAudioEventInfo.cpp - Source/Common/INI/INICommandButton.cpp - Source/Common/INI/INICommandSet.cpp - Source/Common/INI/INIControlBarScheme.cpp - Source/Common/INI/INICrate.cpp - Source/Common/INI/INIDamageFX.cpp - Source/Common/INI/INIDrawGroupInfo.cpp - Source/Common/INI/INIGameData.cpp - Source/Common/INI/INIMapCache.cpp - Source/Common/INI/INIMapData.cpp - Source/Common/INI/INIMappedImage.cpp +# Source/Common/INI/INICommandButton.cpp +# Source/Common/INI/INICommandSet.cpp +# Source/Common/INI/INIControlBarScheme.cpp +# Source/Common/INI/INICrate.cpp +# Source/Common/INI/INIDamageFX.cpp +# Source/Common/INI/INIDrawGroupInfo.cpp +# Source/Common/INI/INIGameData.cpp +# Source/Common/INI/INIMapCache.cpp +# Source/Common/INI/INIMapData.cpp +# Source/Common/INI/INIMappedImage.cpp # Source/Common/INI/INIMiscAudio.cpp - Source/Common/INI/INIModel.cpp - Source/Common/INI/INIMultiplayer.cpp - Source/Common/INI/INIObject.cpp - Source/Common/INI/INIParticleSys.cpp - Source/Common/INI/INISpecialPower.cpp - Source/Common/INI/INITerrain.cpp - Source/Common/INI/INITerrainBridge.cpp - Source/Common/INI/INITerrainRoad.cpp - Source/Common/INI/INIUpgrade.cpp +# Source/Common/INI/INIModel.cpp +# Source/Common/INI/INIMultiplayer.cpp +# Source/Common/INI/INIObject.cpp +# Source/Common/INI/INIParticleSys.cpp +# Source/Common/INI/INISpecialPower.cpp +# Source/Common/INI/INITerrain.cpp +# Source/Common/INI/INITerrainBridge.cpp +# Source/Common/INI/INITerrainRoad.cpp +# Source/Common/INI/INIUpgrade.cpp # Source/Common/INI/INIVideo.cpp - Source/Common/INI/INIWater.cpp - Source/Common/INI/INIWeapon.cpp - Source/Common/INI/INIWebpageURL.cpp +# Source/Common/INI/INIWater.cpp +# Source/Common/INI/INIWeapon.cpp +# Source/Common/INI/INIWebpageURL.cpp Source/Common/Language.cpp Source/Common/MessageStream.cpp Source/Common/MiniLog.cpp diff --git a/GeneralsMD/Code/GameEngine/Include/Common/BitFlags.h b/GeneralsMD/Code/GameEngine/Include/Common/BitFlags.h index 3d368e8f383..f0b8a3fb5df 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/BitFlags.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/BitFlags.h @@ -45,7 +45,7 @@ class AsciiString; So we wrap to correct this, but leave the bitset "exposed" so that we can use all the non-ctor functions on it directly (since it doesn't overload operator= to do the "wrong" thing, strangely enough) */ -template +template class BitFlags { private: diff --git a/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h b/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h index 61afcb5d14f..51847b0e7b4 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h @@ -36,8 +36,8 @@ //------------------------------------------------------------------------------------------------- /* -template -void BitFlags::buildDescription( AsciiString* str ) const +template +void BitFlags::buildDescription( AsciiString* str ) const { if ( str == nullptr ) return;//sanity @@ -56,8 +56,8 @@ void BitFlags::buildDescription( AsciiString* str ) const */ //------------------------------------------------------------------------------------------------- -template -void BitFlags::parse(INI* ini, AsciiString* str) +template +void BitFlags::parse(INI* ini, AsciiString* str) { // m_bits.reset(); if (str) @@ -129,16 +129,16 @@ void BitFlags::parse(INI* ini, AsciiString* str) //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- -template -/*static*/ void BitFlags::parseFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) +template +/*static*/ void BitFlags::parseFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) { ((BitFlags*)store)->parse(ini, nullptr); } //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- -template -/*static*/ void BitFlags::parseSingleBitFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) +template +/*static*/ void BitFlags::parseSingleBitFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/) { const char *token = ini->getNextToken(); Int bitIndex = INI::scanIndexList(token, s_bitNameList); // this throws if the token is not found @@ -152,8 +152,8 @@ template * Version Info: * 1: Initial version */ //------------------------------------------------------------------------------------------------- -template -void BitFlags::xfer(Xfer* xfer) +template +void BitFlags::xfer(Xfer* xfer) { // this deserves a version number XferVersion currentVersion = 1; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DisabledTypes.h b/GeneralsMD/Code/GameEngine/Include/Common/DisabledTypes.h index de61b555344..b0569fe653d 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/DisabledTypes.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/DisabledTypes.h @@ -61,7 +61,7 @@ enum DisabledType CPP_11(: Int) DISABLED_ANY = 65535 ///< Do not use this value for setting disabled types (read-only) }; -typedef BitFlags DisabledMaskType; +typedef BitFlags DisabledMaskType; #define MAKE_DISABLED_MASK(k) DisabledMaskType(DisabledMaskType::kInit, (k)) #define MAKE_DISABLED_MASK2(k,a) DisabledMaskType(DisabledMaskType::kInit, (k), (a)) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 7b9f4da7479..a5dde6ff1b3 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -135,8 +135,8 @@ class GlobalData : public SubsystemInterface Bool m_trilinearTerrainTex; Bool m_multiPassTerrain; Bool m_adjustCliffTextures; - Bool m_stretchTerrain; - Bool m_useHalfHeightMap; + Bool m_stretchTerrain; // TheSuperHackers @info Legacy, unused + Bool m_useHalfHeightMap; // TheSuperHackers @info Legacy, unused Bool m_drawEntireTerrain; _TerrainLOD m_terrainLOD; Bool m_enableDynamicLOD; @@ -147,6 +147,7 @@ class GlobalData : public SubsystemInterface Bool m_clientRetaliationModeEnabled; Bool m_doubleClickAttackMove; Bool m_rightMouseAlwaysScrolls; + Int m_jpegQuality; // TheSuperHackers @feature Quality for JPEG screenshots. Bool m_useWaterPlane; Bool m_useCloudPlane; Bool m_useShadowVolumes; @@ -371,7 +372,6 @@ class GlobalData : public SubsystemInterface Bool m_shellMapOn; ///< User can set the shell map not to load Bool m_playIntro; ///< Flag to say if we're to play the intro or not Bool m_playSizzle; ///< Flag to say whether we play the sizzle movie after the logo movie. - Bool m_afterIntro; ///< we need to tell the game our intro is done Bool m_allowExitOutOfMovies; ///< flag to allow exit out of movies only after the Intro has played Bool m_loadScreenRender; ///< flag to disallow rendering of almost everything during a loadscreen diff --git a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h index a81d4e62870..8c0956d038a 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h @@ -176,7 +176,7 @@ enum KindOfType CPP_11(: Int) KINDOF_FIRST = 0, }; -typedef BitFlags KindOfMaskType; +typedef BitFlags KindOfMaskType; #define MAKE_KINDOF_MASK(k) KindOfMaskType(KindOfMaskType::kInit, (k)) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 7a473ca626a..34e4593e956 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -256,7 +256,8 @@ class GameMessage : public MemoryPoolObject MSG_META_BEGIN_PREFER_SELECTION, ///< The Shift key has been depressed alone MSG_META_END_PREFER_SELECTION, ///< The Shift key has been released. - MSG_META_TAKE_SCREENSHOT, ///< take screenshot + MSG_META_TAKE_SCREENSHOT, ///< take JPEG screenshot + MSG_META_TAKE_SCREENSHOT_PNG, ///< TheSuperHackers @feature Take lossless PNG screenshot MSG_META_ALL_CHEER, ///< Yay! :) MSG_META_TOGGLE_ATTACKMOVE, ///< enter attack-move mode @@ -634,8 +635,10 @@ class GameMessage : public MemoryPoolObject GameMessage( Type type ); - GameMessage *next() { return m_next; } ///< Return next message in the stream - GameMessage *prev() { return m_prev; } ///< Return prev message in the stream + GameMessage *next() { return m_next; } ///< Return next message in the stream + const GameMessage *next() const { return m_next; } ///< Return next message in the stream + GameMessage *prev() { return m_prev; } ///< Return prev message in the stream + const GameMessage *prev() const { return m_prev; } ///< Return prev message in the stream Type getType() const { return m_type; } ///< Return the message type @@ -770,6 +773,8 @@ class MessageStream : public GameMessageList protected: + Bool isRedundantMessage(const GameMessage *msg) const; + struct TranslatorData { TranslatorData *m_next, *m_prev; ///< List links for list of translators diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ModelState.h b/GeneralsMD/Code/GameEngine/Include/Common/ModelState.h index 8d2b8bbd3c7..fd463cf26d2 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/ModelState.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/ModelState.h @@ -243,7 +243,7 @@ enum ModelConditionFlagType CPP_11(: Int) //------------------------------------------------------------------------------------------------- -typedef BitFlags ModelConditionFlags; +typedef BitFlags ModelConditionFlags; #define MAKE_MODELCONDITION_MASK(k) ModelConditionFlags(ModelConditionFlags::kInit, (k)) #define MAKE_MODELCONDITION_MASK2(k,a) ModelConditionFlags(ModelConditionFlags::kInit, (k), (a)) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/PlayerList.h b/GeneralsMD/Code/GameEngine/Include/Common/PlayerList.h index ae03bd636cf..a0cc0f3b033 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/PlayerList.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/PlayerList.h @@ -52,6 +52,7 @@ class DataChunkInput; struct DataChunkInfo; class DataChunkOutput; +class GameInfo; class Player; class Team; class TeamFactory; @@ -156,7 +157,7 @@ class PlayerList : public SubsystemInterface, */ PlayerMaskType getPlayersWithRelationship( Int srcPlayerIndex, UnsignedInt allowedRelationships ); - Byte getSlotIndex(Int playerIndex) const; + Int getSlotIndex(Int playerIndex) const; protected: @@ -166,13 +167,13 @@ class PlayerList : public SubsystemInterface, virtual void loadPostProcess() override; private: - void resolveSlotIndices(); - void setSlotIndex(Int playerIndex, Byte slotIndex); + void assignSlotIndices(const GameInfo& gameInfo); + void setSlotIndex(Int playerIndex, Int slotIndex); Player *m_local; Int m_playerCount; Player *m_players[MAX_PLAYER_COUNT]; - Byte m_slotIndices[MAX_PLAYER_COUNT]; + Int m_slotIndices[MAX_PLAYER_COUNT]; }; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/SpecialPowerMaskType.h b/GeneralsMD/Code/GameEngine/Include/Common/SpecialPowerMaskType.h index fafff1ad213..b350f927db6 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/SpecialPowerMaskType.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/SpecialPowerMaskType.h @@ -32,4 +32,4 @@ #include "Common/BitFlagsIO.h" #include "Common/SpecialPowerType.h" -typedef BitFlags SpecialPowerMaskType; +typedef BitFlags SpecialPowerMaskType; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h b/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h index f6fe7759fe3..27b971d63eb 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h @@ -56,7 +56,7 @@ enum UpgradeStatusType CPP_11(: Int) // A value of 512 was chosen to allow room for plenty of upgrades while also conserving memory. #define UPGRADE_MAX_COUNT 512 -typedef BitFlags UpgradeMaskType; +typedef BitFlags UpgradeMaskType; #define MAKE_UPGRADE_MASK(k) UpgradeMaskType(UpgradeMaskType::kInit, (k)) #define MAKE_UPGRADE_MASK2(k,a) UpgradeMaskType(UpgradeMaskType::kInit, (k), (a)) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameClient.h b/GeneralsMD/Code/GameEngine/Include/GameClient/GameClient.h index ea8e3a59c5d..68b55457811 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/GameClient.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/GameClient.h @@ -44,6 +44,7 @@ class Drawable; class FontLibrary; class GameWindowManager; class InGameUI; +class Intro; class Keyboard; class Mouse; class ParticleSystemManager; @@ -181,6 +182,7 @@ class GameClient : public SubsystemInterface, private: + Intro* m_intro; UnsignedInt m_renderedObjectCount; ///< Keeps track of the number of rendered objects -- resets each frame. //--------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h index 21a5b2d292d..bca18dc48e7 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h @@ -448,7 +448,7 @@ friend class Drawable; // for selection/deselection transactions // Drawable selection mechanisms virtual void selectDrawable( Drawable *draw ); ///< Mark given Drawable as "selected" virtual void deselectDrawable( Drawable *draw ); ///< Clear "selected" status from Drawable - virtual void deselectAllDrawables( Bool postMsg = true ); ///< Clear the "select" flag from all drawables + virtual void deselectAllDrawables(); ///< Clear the "select" flag from all drawables virtual Int getSelectCount() { return m_selectCount; } ///< Get count of currently selected drawables virtual Int getMaxSelectCount() { return m_maxSelectCount; } ///< Get the max number of selected drawables virtual UnsignedInt getFrameSelectionChanged() { return m_frameSelectionChanged; } ///< Get the max number of selected drawables diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/ArmorSet.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/ArmorSet.h index 247011075a6..e4b99834452 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/ArmorSet.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/ArmorSet.h @@ -55,7 +55,7 @@ enum ArmorSetType CPP_11(: Int) }; //------------------------------------------------------------------------------------------------- -typedef BitFlags ArmorSetFlags; +typedef BitFlags ArmorSetFlags; //------------------------------------------------------------------------------------------------- class ArmorTemplateSet diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h index 29d391b81a3..a510d3994f2 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h @@ -821,7 +821,7 @@ class Object : public Thing, public Snapshot }; // deleteInstance is not meant to be used with Object in order to require the use of TheGameLogic->destroyObject() -void deleteInstance(Object* object) CPP_11(= delete); +void deleteInstance(Object* object) FUNCTION_DELETE; // describe an object as an AsciiString: e.g. "Object 102 (KillerBuggy) [GLARocketBuggy, owned by player 2 (GLAIntroPlayer)]" AsciiString DebugDescribeObject(const Object *obj); diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h index aede4770421..a7e6c665f25 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSetFlags.h @@ -30,4 +30,4 @@ #include "GameLogic/WeaponSetType.h" -typedef BitFlags WeaponSetFlags; +typedef BitFlags WeaponSetFlags; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp index cd8e7e10eb9..a00822afca1 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp @@ -419,7 +419,6 @@ Int parseHeadless(char *args[], int num) { TheWritableGlobalData->m_headless = TRUE; TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; TheWritableGlobalData->m_playSizzle = FALSE; // TheSuperHackers @fix bobtista 03/02/2026 Set DX8Wrapper_IsWindowed to false in headless @@ -444,7 +443,6 @@ Int parseReplay(char *args[], int num) TheWritableGlobalData->m_simulateReplays.push_back(filename); TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; TheWritableGlobalData->m_playSizzle = FALSE; TheWritableGlobalData->m_shellMapOn = FALSE; @@ -797,7 +795,6 @@ Int parseNoShaders(char *args[], int) Int parseNoLogo(char *args[], int) { TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; TheWritableGlobalData->m_playSizzle = FALSE; return 1; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp index 656e97428f7..bc4a3550bf9 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp @@ -840,9 +840,6 @@ void GameEngine::init() } } - if(!TheGlobalData->m_playIntro) - TheWritableGlobalData->m_afterIntro = TRUE; - } catch (ErrorCode ec) { @@ -864,9 +861,6 @@ void GameEngine::init() RELEASE_CRASH(("Uncaught Exception during initialization.")); } - if(!TheGlobalData->m_playIntro) - TheWritableGlobalData->m_afterIntro = TRUE; - resetSubsystems(); HideControlBar(); @@ -959,7 +953,7 @@ Bool GameEngine::canUpdateRegularGameLogic(UnsignedInt logicTimeQueryFlags) } const Bool enabled = TheFramePacer->isLogicTimeScaleEnabled(); - const Int maxRenderFps = TheFramePacer->getFramesPerSecondLimit(); + const Int maxRenderFps = TheFramePacer->getActualFramesPerSecondLimit(); #if defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE) const Bool useFastMode = TheGlobalData->m_TiVOFastMode; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 47c311736b2..343bc09d387 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -58,6 +58,7 @@ #include "GameLogic/Module/BodyModule.h" #include "GameClient/Color.h" +#include "GameClient/Display.h" #include "GameClient/TerrainVisual.h" #include "GameNetwork/FirewallHelper.h" @@ -672,6 +673,7 @@ GlobalData::GlobalData() m_enableDynamicLOD = TRUE; m_enableStaticLOD = TRUE; m_rightMouseAlwaysScrolls = FALSE; + m_jpegQuality = DEFAULT_JPEG_QUALITY; m_useWaterPlane = FALSE; m_useCloudPlane = FALSE; m_downwindAngle = ( -0.785f );//Northeast! @@ -1033,7 +1035,6 @@ GlobalData::GlobalData() m_shellMapOn =TRUE; m_playIntro = TRUE; m_playSizzle = TRUE; - m_afterIntro = FALSE; m_allowExitOutOfMovies = FALSE; m_loadScreenRender = FALSE; @@ -1224,6 +1225,7 @@ void GlobalData::parseGameDataDefinition( INI* ini ) TheWritableGlobalData->m_useRightMouseScrollWithAlternateMouse = optionPref.getRightMouseScrollWithAlternateMouseEnabled(); TheWritableGlobalData->m_clientRetaliationModeEnabled = optionPref.getRetaliationModeEnabled(); TheWritableGlobalData->m_doubleClickAttackMove = optionPref.getDoubleClickAttackMoveEnabled(); + TheWritableGlobalData->m_jpegQuality = optionPref.getJpegQuality(); TheWritableGlobalData->m_keyboardScrollFactor = optionPref.getScrollFactor(); TheWritableGlobalData->m_drawScrollAnchor = optionPref.getDrawScrollAnchor(); TheWritableGlobalData->m_moveScrollAnchor = optionPref.getMoveScrollAnchor(); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp index f7c58e978d2..9980021c6ee 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp @@ -337,6 +337,7 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_META_BEGIN_PREFER_SELECTION) CASE_LABEL(MSG_META_END_PREFER_SELECTION) CASE_LABEL(MSG_META_TAKE_SCREENSHOT) + CASE_LABEL(MSG_META_TAKE_SCREENSHOT_PNG) CASE_LABEL(MSG_META_ALL_CHEER) CASE_LABEL(MSG_META_TOGGLE_ATTACKMOVE) CASE_LABEL(MSG_META_BEGIN_CAMERA_ROTATE_LEFT) @@ -994,7 +995,7 @@ void MessageStream::removeTranslator( TranslatorID id ) // ------------------------------------------------------------------------------------------------ #if defined(RTS_DEBUG) -Bool isInvalidDebugCommand( GameMessage::Type t ) +static Bool isInvalidDebugCommand( GameMessage::Type t ) { // see if this is something that should be prevented in multiplayer games // Don't reject this stuff in skirmish games. @@ -1081,6 +1082,16 @@ void MessageStream::propagateMessages() { for( msg=m_firstMessage; msg; msg=next ) { + // TheSuperHackers @tweak Delete messages that we know are redundant. This can reduce network traffic. + // @info If there is a need to look back on previous messages, then first invalidate the messages in this loop + // before deleting them later. + if (isRedundantMessage(msg)) + { + next = msg->next(); + deleteInstance(msg); + continue; + } + if (ss->m_translator #if defined(RTS_DEBUG) && !isInvalidDebugCommand(msg->getType()) @@ -1088,16 +1099,15 @@ void MessageStream::propagateMessages() ) { GameMessageDisposition disp = ss->m_translator->translateGameMessage(msg); - next = msg->next(); if (disp == DESTROY_MESSAGE) { + next = msg->next(); deleteInstance(msg); + continue; } } - else - { - next = msg->next(); - } + + next = msg->next(); } } @@ -1111,6 +1121,47 @@ void MessageStream::propagateMessages() } +Bool MessageStream::isRedundantMessage(const GameMessage *msg) const +{ + switch (msg->getType()) + { + case GameMessage::MSG_DESTROY_SELECTED_GROUP: + { + const GameMessage* msgNext = msg->next(); + if (!msgNext) + break; + + switch (msgNext->getType()) + { + case GameMessage::MSG_CREATE_SELECTED_GROUP: + case GameMessage::MSG_CREATE_SELECTED_GROUP_NO_SOUND: + if (msgNext->getArgumentCount() >= 1) + { + const Bool newGroup = msgNext->getArgument(0)->boolean; + if (newGroup) + return true; + } + break; + case GameMessage::MSG_DESTROY_SELECTED_GROUP: + return true; + case GameMessage::MSG_SELECT_TEAM0: + case GameMessage::MSG_SELECT_TEAM1: + case GameMessage::MSG_SELECT_TEAM2: + case GameMessage::MSG_SELECT_TEAM3: + case GameMessage::MSG_SELECT_TEAM4: + case GameMessage::MSG_SELECT_TEAM5: + case GameMessage::MSG_SELECT_TEAM6: + case GameMessage::MSG_SELECT_TEAM7: + case GameMessage::MSG_SELECT_TEAM8: + case GameMessage::MSG_SELECT_TEAM9: + return true; + } + break; + } + } + + return false; +} //------------------------------------------------------------------------------------------------ // CommandList diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index 59aecf569f3..ad9e5c369d5 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -196,8 +196,8 @@ void dumpBattlePlanBonuses(const BattlePlanBonusesData *b, AsciiString name, con kindofMaskAsAsciiString(b->m_invalidKindOf).str())); } #else -#define DUMPBATTLEPLANBONUSES(x,y,z) {} -#define CRCDUMPBATTLEPLANBONUSES(x,y,z) {} +#define DUMPBATTLEPLANBONUSES(x,y,z) +#define CRCDUMPBATTLEPLANBONUSES(x,y,z) #endif // DEBUG_CRC // ------------------------------------------------------------------------------------------------ diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index 2299d004563..0acf5df7c36 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -58,8 +58,8 @@ #include "GameLogic/Object.h" #endif #include "GameLogic/SidesList.h" -#include "GameNetwork/NetworkDefs.h" #include "GameNetwork/GameInfo.h" +#include "GameNetwork/NetworkDefs.h" #include //----------------------------------------------------------------------------- @@ -244,7 +244,10 @@ void PlayerList::newGame() } // GeneralsX @bugfix felipebraz 05/07/2026 Pre-compute the network slot to player mapping - resolveSlotIndices(); + if (TheGameInfo) + { + assignSlotIndices(*TheGameInfo); + } } //----------------------------------------------------------------------------- @@ -256,7 +259,7 @@ void PlayerList::init() for (int i = 1; i < MAX_PLAYER_COUNT; i++) m_players[i]->init(nullptr); - std::fill(m_slotIndices, m_slotIndices + MAX_PLAYER_COUNT, -1); + std::fill(m_slotIndices, m_slotIndices + ARRAY_SIZE(m_slotIndices), -1); // call setLocalPlayer so that becomingLocalPlayer() gets called appropriately setLocalPlayer(m_players[0]); @@ -404,7 +407,6 @@ Player *PlayerList::getEachPlayerFromMask( PlayerMaskType& maskToAdjust ) return nullptr; // mask not found } - //------------------------------------------------------------------------------------------------- PlayerMaskType PlayerList::getPlayersWithRelationship( Int srcPlayerIndex, UnsignedInt allowedRelationships ) { @@ -504,7 +506,7 @@ void PlayerList::loadPostProcess() } //----------------------------------------------------------------------------- -void PlayerList::setSlotIndex(Int playerIndex, Byte slotIndex) +void PlayerList::setSlotIndex(Int playerIndex, Int slotIndex) { if (playerIndex >= 0 && playerIndex < ARRAY_SIZE(m_slotIndices)) { @@ -513,7 +515,7 @@ void PlayerList::setSlotIndex(Int playerIndex, Byte slotIndex) } //----------------------------------------------------------------------------- -Byte PlayerList::getSlotIndex(Int playerIndex) const +Int PlayerList::getSlotIndex(Int playerIndex) const { if (playerIndex >= 0 && playerIndex < ARRAY_SIZE(m_slotIndices)) { @@ -524,26 +526,21 @@ Byte PlayerList::getSlotIndex(Int playerIndex) const } //----------------------------------------------------------------------------- -void PlayerList::resolveSlotIndices() +void PlayerList::assignSlotIndices(const GameInfo& gameInfo) { - if (!TheGameInfo) - return; - AsciiString playerName; for (Int i = 0; i < MAX_SLOTS; ++i) { - const GameSlot* slot = TheGameInfo->getSlot(i); + const GameSlot* slot = gameInfo.getConstSlot(i); if (!slot || !slot->isOccupied()) continue; playerName.format("player%d", i); - Player* player = findPlayerWithNameKey(TheNameKeyGenerator->nameToKey(playerName)); - if (player) + if (Player* player = findPlayerWithNameKey(TheNameKeyGenerator->nameToKey(playerName))) { setSlotIndex(player->getPlayerIndex(), i); } } } - diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 221e1013f40..ac9b043c2ac 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -856,6 +856,16 @@ static void saveOptions() TheWritableGlobalData->m_gameWindowTransitionSpeedMultiplier = speed; } + //------------------------------------------------------------------------------------------------- + // Set JPEG screenshot quality + { + Int quality = pref->getJpegQuality(); + AsciiString prefString; + prefString.format("%d", quality); + (*pref)["JpegQuality"] = prefString; + TheWritableGlobalData->m_jpegQuality = quality; + } + //------------------------------------------------------------------------------------------------- // Resolution // diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index bf3355d2af2..0c321eef441 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -78,7 +78,7 @@ void refreshPlayerList( Bool forceRefresh = FALSE ); static LogClass s_perfLog("Perf.txt"); #define PERF_LOG(x) s_perfLog.log x #else // DEBUG_LOGGING -#define PERF_LOG(x) {} +#define PERF_LOG(x) #endif // DEBUG_LOGGING // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index e8c4b89555f..3b1e67de325 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -75,7 +75,7 @@ static LogClass s_perfLog("QMPerf.txt"); static Bool s_inQM = FALSE; #define PERF_LOG(x) s_perfLog.log x #else // DEBUG_LOGGING -#define PERF_LOG(x) {} +#define PERF_LOG(x) #endif // DEBUG_LOGGING // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index fdd5e443d33..1331ae431b3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -45,7 +45,6 @@ #include "Common/ThingFactory.h" #include "Common/ThingTemplate.h" #include "Common/Xfer.h" -#include "Common/GameLOD.h" #include "GameClient/Anim2D.h" #include "GameClient/CampaignManager.h" #include "GameClient/ChallengeGenerals.h" @@ -66,6 +65,7 @@ #include "GameClient/HotKey.h" #include "GameClient/IMEManager.h" #include "GameClient/InGameUI.h" +#include "GameClient/Intro.h" #include "GameClient/Keyboard.h" #include "GameClient/LanguageFilter.h" #include "GameClient/LookAtXlat.h" @@ -81,7 +81,6 @@ #include "GameClient/View.h" #include "GameClient/VideoPlayer.h" #include "GameClient/WindowXlat.h" -#include "GameLogic/FPUControl.h" #include "GameLogic/GameLogic.h" #include "GameLogic/GhostObject.h" #include "GameLogic/Object.h" @@ -111,6 +110,8 @@ GameClient::GameClient() m_nextDrawableID = (DrawableID)1; TheDrawGroupInfo = new DrawGroupInfo; + + m_intro = nullptr; } //std::vector preloadTextureNamesGlobalHack; @@ -154,6 +155,10 @@ GameClient::~GameClient() } m_drawableList = nullptr; + // Should be destroyed before the Display String Manager + delete m_intro; + m_intro = nullptr; + // delete the ray effects delete TheRayEffects; TheRayEffects = nullptr; @@ -444,6 +449,8 @@ void GameClient::init() TheSnowManager->setName("TheSnowManager"); } + m_intro = NEW Intro; + #ifdef PERF_TIMERS TheGraphDraw = new GraphDraw; #endif @@ -526,73 +533,19 @@ void GameClient::update() // create the FRAME_TICK message GameMessage *frameMsg = TheMessageStream->appendMessage( GameMessage::MSG_FRAME_TICK ); frameMsg->appendTimestampArgument( getFrame() ); - static Bool playSizzle = FALSE; - // We need to show the movie first. - if(TheGlobalData->m_playIntro && !TheDisplay->isMoviePlaying()) - { - if(TheGameLODManager && TheGameLODManager->didMemPass()) - TheDisplay->playLogoMovie("EALogoMovie", 5000, 3000); - else - TheDisplay->playLogoMovie("EALogoMovie640", 5000, 3000); - TheWritableGlobalData->m_playIntro = FALSE; - TheWritableGlobalData->m_afterIntro = TRUE; - playSizzle = TRUE; - } - //Initial Game Condition. We must show the movie first and then we can display the shell - if(TheGlobalData->m_afterIntro && !TheDisplay->isMoviePlaying()) + // Update intro + if (m_intro != nullptr) { - if( playSizzle && TheGlobalData->m_playSizzle ) - { - TheWritableGlobalData->m_allowExitOutOfMovies = TRUE; - if(TheGameLODManager && TheGameLODManager->didMemPass()) - TheDisplay->playMovie("Sizzle"); - else - TheDisplay->playMovie("Sizzle640"); - playSizzle = FALSE; - } - else - { - TheWritableGlobalData->m_breakTheMovie = TRUE; - TheWritableGlobalData->m_allowExitOutOfMovies = TRUE; + m_intro->update(); - if(TheGameLODManager && !TheGameLODManager->didMemPass()) - { - TheWritableGlobalData->m_breakTheMovie = FALSE; - - WindowLayout *legal = TheWindowManager->winCreateLayout("Menus/LegalPage.wnd"); - if(legal) - { - legal->hide(FALSE); - legal->bringForward(); - Int beginTime = timeGetTime(); - while(beginTime + 4000 > timeGetTime() ) - { - if (GameClient::isMovieAbortRequested()) - { - break; - } - - TheWindowManager->update(); - // redraw all views, update the GUI - TheDisplay->draw(); - Sleep(100); - } - setFPMode(); - - - legal->destroyWindows(); - deleteInstance(legal); - - } - TheWritableGlobalData->m_breakTheMovie = TRUE; - - - } + if (m_intro->isDone()) + { + delete m_intro; + m_intro = nullptr; - TheShell->showShellMap(TRUE); - TheShell->showShell(); - TheWritableGlobalData->m_afterIntro = FALSE; + TheShell->showShellMap(TRUE); + TheShell->showShell(); } } @@ -634,7 +587,7 @@ void GameClient::update() TheInGameUI->setCameraTrackingDrawable( FALSE ); } - if(TheGlobalData->m_playIntro || TheGlobalData->m_afterIntro) + if (m_intro != nullptr) { // redraw all views, update the GUI TheDisplay->UPDATE(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index aa47c35d562..d8cc749800c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -3541,9 +3541,10 @@ void InGameUI::deselectDrawable( Drawable *draw ) //------------------------------------------------------------------------------------------------- /** Clear all drawables' "select" status */ //------------------------------------------------------------------------------------------------- -void InGameUI::deselectAllDrawables( Bool postMsg ) +void InGameUI::deselectAllDrawables() { const DrawableList *selected = getAllSelectedDrawables(); + const Bool hadSelectedDrawables = !selected->empty(); // loop through all the selected drawables for ( DrawableListCIt it = selected->begin(); it != selected->end(); ) @@ -3564,16 +3565,11 @@ void InGameUI::deselectAllDrawables( Bool postMsg ) // our selection can no longer consist of exactly one angry mob m_soloNexusSelectedDrawableID = INVALID_DRAWABLE_ID; - - ///@todo don't we want to not emit this message if there wasn't a group at all? (CBD) - /** @todo also, we probably are sending this message too much, we should come up with - some kind of "selections are dirty" status that we can check once per frame and send - the correct group info over the network ... could be tricky tho (or impossible) given - the order of operations of things happening in the code (CBD) */ - if( postMsg ) + // TheSuperHackers @tweak Only send this message when objects were previously selected. + if (hadSelectedDrawables) { // TheSuperHackers @tweak Originally this message had one boolean argument, but it wasn't used for anything. - TheMessageStream->appendMessage( GameMessage::MSG_DESTROY_SELECTED_GROUP ); + TheMessageStream->appendMessage(GameMessage::MSG_DESTROY_SELECTED_GROUP); } } diff --git a/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt b/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt index 58b984894e9..a21f7273246 100644 --- a/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt @@ -241,6 +241,7 @@ target_link_libraries(z_gameenginedevice PRIVATE corei_gameenginedevice_private zi_always zi_main + stb ) target_link_libraries(z_gameenginedevice PUBLIC @@ -273,27 +274,5 @@ if(SAGE_USE_MINIAUDIO) target_link_libraries(z_gameenginedevice PUBLIC miniaudio_lib) endif() -# Phase 3: Video playback with FFmpeg (configured by Core/GameEngineDevice when RTS_BUILD_OPTION_FFMPEG=ON) -# GeneralsX @feature BenderAI 21/02/2026 Video playback framework -if(RTS_BUILD_OPTION_FFMPEG) - # Add VideoDevice FFmpeg implementation (video playback) - target_sources(z_gameenginedevice PUBLIC - Include/VideoDevice/Bink/BinkVideoPlayer.h - Include/VideoDevice/FFmpeg/FFmpegFile.h - Include/VideoDevice/FFmpeg/FFmpegVideoPlayer.h - Source/VideoDevice/FFmpeg/FFmpegFile.cpp - Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp - ) - target_compile_definitions(z_gameenginedevice PUBLIC SAGE_USE_FFMPEG) - # GeneralsX @build felipebraz 20/06/2025 PkgConfig::FFMPEG is PRIVATE in corei_gameenginedevice_private so it - # does not propagate transitively to consumers of z_gameenginedevice (z_generals). Explicitly - # expose it as PUBLIC so the final linker of z_generals can resolve av_* symbols. - # Use IMPORTED_TARGET guard to avoid re-calling pkg_check_modules if Core already called it. - if(NOT TARGET PkgConfig::FFMPEG) - find_package(PkgConfig REQUIRED) - pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET libavcodec libavformat libavutil libswscale) - endif() - target_link_libraries(z_gameenginedevice PUBLIC PkgConfig::FFMPEG) -endif() # CURL::libcurl is now propagated transitively via corei_gameengine_public (Core/GameEngine/CMakeLists.txt). \ No newline at end of file diff --git a/GeneralsMD/Code/GameEngineDevice/Include/VideoDevice/FFmpeg/FFmpegFile.h b/GeneralsMD/Code/GameEngineDevice/Include/VideoDevice/FFmpeg/FFmpegFile.h deleted file mode 100644 index d1ef5f6eec0..00000000000 --- a/GeneralsMD/Code/GameEngineDevice/Include/VideoDevice/FFmpeg/FFmpegFile.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file - * - * @author feliwir - * - * @brief Class for opening FFmpeg contexts from a file. - * - * @copyright Thyme 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 - * 2 of the License, or (at your option) any later version. - * A full copy of the GNU General Public License can be found in - * LICENSE - */ -#pragma once - -#include "always.h" - -#include -#include - -struct AVFormatContext; -struct AVIOContext; -struct AVCodec; -struct AVCodecContext; -struct AVFrame; -struct AVPacket; -struct File; - -using FFmpegFrameCallback = std::function; - -class FFmpegFile -{ -public: - FFmpegFile(); - FFmpegFile(File *file); - ~FFmpegFile(); - - bool open(File *file); - void close(); - void setFrameCallback(FFmpegFrameCallback callback) { m_frameCallback = callback; } - void setUserData(void *user_data) { m_userData = user_data; } - // Read & decode a packet from the container. Note that we could/should split this step - bool decodePacket(); - void seekFrame(int frame_idx); - bool hasAudio() const; - - // Audio specific - int getSizeForSamples(int numSamples) const; - int getNumChannels() const; - int getSampleRate() const; - int getBytesPerSample() const; - - // Video specific - int getWidth() const; - int getHeight() const; - int getNumFrames() const; - int getCurrentFrame() const; - int getPixelFormat() const; - unsigned int getFrameTime() const; - -private: - struct FFmpegStream - { - AVCodecContext *codec_ctx = nullptr; - const AVCodec *codec = nullptr; - int stream_idx = -1; - int stream_type = -1; - AVFrame *frame = nullptr; - }; - - static int readPacket(void *opaque, uint8_t *buf, int buf_size); - const FFmpegStream *findMatch(int type) const; - - FFmpegFrameCallback m_frameCallback = nullptr; - AVFormatContext *m_fmtCtx = nullptr; - AVIOContext *m_avioCtx = nullptr; - AVPacket *m_packet = nullptr; - std::vector m_streams; - File *m_file = nullptr; - void *m_userData = nullptr; -}; \ No newline at end of file diff --git a/GeneralsMD/Code/GameEngineDevice/Include/VideoDevice/FFmpeg/FFmpegVideoPlayer.h b/GeneralsMD/Code/GameEngineDevice/Include/VideoDevice/FFmpeg/FFmpegVideoPlayer.h deleted file mode 100644 index 1065a2fda16..00000000000 --- a/GeneralsMD/Code/GameEngineDevice/Include/VideoDevice/FFmpeg/FFmpegVideoPlayer.h +++ /dev/null @@ -1,148 +0,0 @@ -/* -** Command & Conquer Generals Zero Hour(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2025 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: Generals -// -// File name: GameEngineDevice/FFmpegVideoPlayer.h -// -// Created: 03/13/25 -// -//---------------------------------------------------------------------------- - -#pragma once - -#ifndef __VIDEODEVICE_FFMPEGDEVICE_H_ -#define __VIDEODEVICE_FFMPEGDEVICE_H_ - - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "GameClient/VideoPlayer.h" - -//---------------------------------------------------------------------------- -// Forward References -//---------------------------------------------------------------------------- - -class FFmpegFile; -struct AVFrame; -struct SwsContext; - -//---------------------------------------------------------------------------- -// Type Defines -//---------------------------------------------------------------------------- - -//=============================== -// FFmpegVideoStream -//=============================== - -class FFmpegVideoStream : public VideoStream -{ - friend class FFmpegVideoPlayer; - - protected: - bool m_good = true; - bool m_gotFrame = false; - AVFrame *m_frame = nullptr; - SwsContext *m_swsContext = nullptr; - FFmpegFile* m_ffmpegFile; ///< Bink streaming handle; - Char *m_memFile; ///< Pointer to memory resident file - uint64_t m_startTime = 0; ///< Time the stream started - uint8_t *m_audioBuffer = nullptr; - - FFmpegVideoStream(FFmpegFile* file); ///< only BinkVideoPlayer can create these - virtual ~FFmpegVideoStream(); - - static void onFrame(AVFrame *frame, int stream_idx, int stream_type, void *user_data); - public: - - virtual void update( void ); ///< Update bink stream - - virtual Bool isFrameReady( void ); ///< Is the frame ready to be displayed - virtual void frameDecompress( void ); ///< Render current frame in to buffer - virtual void frameRender( VideoBuffer *buffer ); ///< Render current frame in to buffer - virtual void frameNext( void ); ///< Advance to next frame - virtual Int frameIndex( void ); ///< Returns zero based index of current frame - virtual Int frameCount( void ); ///< Returns the total number of frames in the stream - virtual void frameGoto( Int index ); ///< Go to the spcified frame index - virtual Int height( void ); ///< Return the height of the video - virtual Int width( void ); ///< Return the width of the video -}; - -//=============================== -// FFmpegVideoPlayer -//=============================== -/** - * FFmpeg video playback code. - */ -//=============================== - -class FFmpegVideoPlayer : public VideoPlayer -{ - - protected: - - VideoStreamInterface* createStream( File* file ); - - public: - - // subsytem requirements - virtual void init( void ); ///< Initialize video playback code - virtual void reset( void ); ///< Reset video playback - virtual void update( void ); ///< Services all audio tasks. Should be called frequently - - virtual void deinit( void ); ///< Close down player - - - FFmpegVideoPlayer(); - ~FFmpegVideoPlayer(); - - // service - virtual void loseFocus( void ); ///< Should be called when application loses focus - virtual void regainFocus( void ); ///< Should be called when application regains focus - - virtual VideoStreamInterface* open( AsciiString movieTitle ); ///< Open video file for playback - virtual VideoStreamInterface* load( AsciiString movieTitle ); ///< Load video file in to memory for playback - - virtual void notifyVideoPlayerOfNewProvider( Bool nowHasValid ); - virtual void initializeBinkWithMiles( void ); -}; - - -//---------------------------------------------------------------------------- -// Inlining -//---------------------------------------------------------------------------- - - -#endif // __VIDEODEVICE_FFMPEGDEVICE_H_ diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h index 98384303e58..cb9232dc1f7 100644 --- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h +++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h @@ -123,7 +123,7 @@ class W3DDisplay : public Display virtual VideoBuffer* createVideoBuffer() override; ///< Create a video buffer that can be used for this display - virtual void takeScreenShot() override; //save screenshot to file + virtual void takeScreenShot(ScreenshotFormat format, Int jpegQuality) override; //save screenshot in specified format virtual void toggleMovieCapture() override; //enable AVI or frame capture mode. virtual void toggleLetterBox() override; /// -#include -} - - -FFmpegFile::FFmpegFile() {} - -FFmpegFile::FFmpegFile(File *file) -{ - open(file); -} - -FFmpegFile::~FFmpegFile() -{ - close(); -} - -bool FFmpegFile::open(File *file) -{ -#if LOGGING_LEVEL != LOGLEVEL_NONE - av_log_set_level(AV_LOG_INFO); -#endif - -// This is required for FFmpeg older than 4.0 -> deprecated afterwards though -#if LIBAVFORMAT_VERSION_MAJOR < 58 - av_register_all(); -#endif - - m_file = file; - - // FFmpeg setup - m_fmtCtx = avformat_alloc_context(); - if (!m_fmtCtx) { - DEBUG_LOG(("Failed to alloc AVFormatContext")); - return false; - } - - constexpr size_t avio_ctx_buffer_size = 0x10000; - uint8_t *buffer = static_cast(av_malloc(avio_ctx_buffer_size)); - if (buffer == nullptr) { - DEBUG_LOG(("Failed to alloc AVIOContextBuffer")); - close(); - return false; - } - - m_avioCtx = avio_alloc_context(buffer, avio_ctx_buffer_size, 0, file, &readPacket, nullptr, nullptr); - if (m_avioCtx == nullptr) { - DEBUG_LOG(("Failed to alloc AVIOContext")); - close(); - return false; - } - - m_fmtCtx->pb = m_avioCtx; - m_fmtCtx->flags |= AVFMT_FLAG_CUSTOM_IO; - - int result = 0; - result = avformat_open_input(&m_fmtCtx, nullptr, nullptr, nullptr); - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'avformat_open_input': %s", error_buffer)); - close(); - return false; - } - - result = avformat_find_stream_info(m_fmtCtx, NULL); - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'avformat_find_stream_info': %s", error_buffer)); - close(); - return false; - } - - m_streams.resize(m_fmtCtx->nb_streams); - for (unsigned int stream_idx = 0; stream_idx < m_fmtCtx->nb_streams; stream_idx++) { - AVStream *av_stream = m_fmtCtx->streams[stream_idx]; - const AVCodec *input_codec = avcodec_find_decoder(av_stream->codecpar->codec_id); - if (input_codec == nullptr) { - DEBUG_LOG(("Codec not supported: '%s'", avcodec_get_name(av_stream->codecpar->codec_id))); - close(); - return false; - } - - AVCodecContext *codec_ctx = avcodec_alloc_context3(input_codec); - if (codec_ctx == nullptr) { - DEBUG_LOG(("Could not allocate codec context")); - close(); - return false; - } - - result = avcodec_parameters_to_context(codec_ctx, av_stream->codecpar); - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'avcodec_parameters_to_context': %s", error_buffer)); - close(); - return false; - } - - result = avcodec_open2(codec_ctx, input_codec, NULL); - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'avcodec_open2': %s", error_buffer)); - close(); - return false; - } - - FFmpegStream &output_stream = m_streams[stream_idx]; - output_stream.codec_ctx = codec_ctx; - output_stream.codec = input_codec; - output_stream.stream_type = input_codec->type; - output_stream.stream_idx = stream_idx; - output_stream.frame = av_frame_alloc(); - } - - m_packet = av_packet_alloc(); - - return true; -} - -/** - * Read an FFmpeg packet from file - */ -int FFmpegFile::readPacket(void *opaque, uint8_t *buf, int buf_size) -{ - File *file = static_cast(opaque); - int read = file->read(buf, buf_size); - - // Streaming protocol requires us to return real errors - when we read less equal 0 we're at EOF - if (read <= 0) - return AVERROR_EOF; - - return read; -} - -/** - * close all the open FFmpeg handles for an open file. - */ -void FFmpegFile::close() -{ - if (m_fmtCtx != nullptr) { - avformat_close_input(&m_fmtCtx); - } - - for (auto &stream : m_streams) { - if (stream.codec_ctx != nullptr) { - avcodec_free_context(&stream.codec_ctx); - av_frame_free(&stream.frame); - } - } - m_streams.clear(); - - if (m_avioCtx != nullptr && m_avioCtx->buffer != nullptr) { - av_freep(&m_avioCtx->buffer); - } - - if (m_avioCtx != nullptr) { - avio_context_free(&m_avioCtx); - } - - if (m_packet != nullptr) { - av_packet_free(&m_packet); - } - - if (m_file != nullptr) { - m_file->close(); - m_file = nullptr; - } -} - -bool FFmpegFile::decodePacket() -{ - DEBUG_ASSERTCRASH(m_fmtCtx != nullptr, ("null format context")); - DEBUG_ASSERTCRASH(m_packet != nullptr, ("null packet pointer")); - - int result = av_read_frame(m_fmtCtx, m_packet); - if (result == AVERROR_EOF) // EOF - return false; - - const int stream_idx = m_packet->stream_index; - DEBUG_ASSERTCRASH(m_streams.size() > stream_idx, ("stream index out of bounds")); - - auto &stream = m_streams[stream_idx]; - AVCodecContext *codec_ctx = stream.codec_ctx; - result = avcodec_send_packet(codec_ctx, m_packet); - // Check if we need more data - if (result == AVERROR(EAGAIN)) - return true; - - // Handle any other errors - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'avcodec_send_packet': %s", error_buffer)); - return false; - } - av_packet_unref(m_packet); - - // Get all frames in this packet - while (result >= 0) { - result = avcodec_receive_frame(codec_ctx, stream.frame); - - // Check if we need more data - if (result == AVERROR(EAGAIN)) - return true; - - // Handle any other errors - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'avcodec_receive_frame': %s", error_buffer)); - return false; - } - - if (m_frameCallback != nullptr) { - m_frameCallback(stream.frame, stream_idx, stream.stream_type, m_userData); - } - } - - return true; -} - -void FFmpegFile::seekFrame(int frame_idx) -{ - // Note: not tested, since not used ingame - for (auto &stream : m_streams) { - int64_t timestamp = av_q2d(m_fmtCtx->streams[stream.stream_idx]->time_base) * frame_idx - * av_q2d(m_fmtCtx->streams[stream.stream_idx]->avg_frame_rate); - int result = av_seek_frame(m_fmtCtx, stream.stream_idx, timestamp, AVSEEK_FLAG_ANY); - if (result < 0) { - char error_buffer[1024]; - av_strerror(result, error_buffer, sizeof(error_buffer)); - DEBUG_LOG(("Failed 'av_seek_frame': %s", error_buffer)); - } - } -} - -bool FFmpegFile::hasAudio() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_AUDIO); - return stream != nullptr; -} - -const FFmpegFile::FFmpegStream *FFmpegFile::findMatch(int type) const -{ - for (auto &candidate : m_streams) { - if (candidate.stream_type == type) - return &candidate; - } - - return nullptr; -} - -int FFmpegFile::getNumChannels() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_AUDIO); - if (stream == nullptr) - return 0; - - return stream->codec_ctx->ch_layout.nb_channels; -} - -int FFmpegFile::getSampleRate() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_AUDIO); - if (stream == nullptr) - return 0; - - return stream->codec_ctx->sample_rate; -} - -int FFmpegFile::getBytesPerSample() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_AUDIO); - if (stream == nullptr) - return 0; - - return av_get_bytes_per_sample(stream->codec_ctx->sample_fmt); -} - -int FFmpegFile::getSizeForSamples(int numSamples) const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_AUDIO); - if (stream == nullptr) - return 0; - - return av_samples_get_buffer_size(NULL, stream->codec_ctx->ch_layout.nb_channels, numSamples, stream->codec_ctx->sample_fmt, 1); -} - -int FFmpegFile::getHeight() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_VIDEO); - if (stream == nullptr) - return 0; - - return stream->codec_ctx->height; -} - -int FFmpegFile::getWidth() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_VIDEO); - if (stream == nullptr) - return 0; - - return stream->codec_ctx->width; -} - -int FFmpegFile::getNumFrames() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_VIDEO); - if (m_fmtCtx == nullptr || stream == nullptr || m_fmtCtx->streams[stream->stream_idx] == nullptr) - return 0; - - return (m_fmtCtx->duration / (double)AV_TIME_BASE) * av_q2d(m_fmtCtx->streams[stream->stream_idx]->avg_frame_rate); -} - -int FFmpegFile::getCurrentFrame() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_VIDEO); - if (m_fmtCtx == nullptr || stream == nullptr) - return 0; - return stream->codec_ctx->frame_num; -} - -int FFmpegFile::getPixelFormat() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_VIDEO); - if (stream == nullptr) - return AV_PIX_FMT_NONE; - - return stream->codec_ctx->pix_fmt; -} - -unsigned int FFmpegFile::getFrameTime() const -{ - const FFmpegStream *stream = findMatch(AVMEDIA_TYPE_VIDEO); - if (stream == nullptr) - return 0; - return 1000u / av_q2d(m_fmtCtx->streams[stream->stream_idx]->avg_frame_rate); -} diff --git a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp deleted file mode 100644 index 97e5971a3d1..00000000000 --- a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp +++ /dev/null @@ -1,737 +0,0 @@ -/* -** Command & Conquer Generals Zero Hour(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: Generals -// -// Module: VideoDevice -// -// File name: FFmpegVideoPlayer.cpp -// -// Created: 03/13/24 SV -// -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "Lib/BaseType.h" -#include "VideoDevice/FFmpeg/FFmpegVideoPlayer.h" -#include "Common/AudioAffect.h" -#include "Common/GameAudio.h" -#include "Common/GameMemory.h" -#include "Common/GlobalData.h" -#include "Common/Registry.h" -#include "Common/FileSystem.h" - -#include "VideoDevice/FFmpeg/FFmpegFile.h" - -extern "C" { - #include - #include -} - -// GeneralsX @build Mr. Meeseeks 17/06/2026 Prioritize MiniAudio backend over OpenAL to prevent redefinition conflicts -#ifdef SAGE_USE_MINIAUDIO -#include "MiniAudioDevice/MiniAudioStream.h" -#elif defined(SAGE_USE_OPENAL) -#include "OpenALAudioDevice/OpenALAudioManager.h" -#include "OpenALAudioDevice/OpenALAudioStream.h" -#endif - -#include - -//---------------------------------------------------------------------------- -// Externals -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Defines -//---------------------------------------------------------------------------- -#define VIDEO_LANG_PATH_FORMAT "Data/%s/Movies/%s.%s" -#define VIDEO_PATH "Data\\Movies" -#define VIDEO_EXT "bik" - - -//---------------------------------------------------------------------------- -// Private Types -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Prototypes -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Functions -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Functions -//---------------------------------------------------------------------------- - - -//============================================================================ -// FFmpegVideoPlayer::FFmpegVideoPlayer -//============================================================================ - -FFmpegVideoPlayer::FFmpegVideoPlayer() -{ - -} - -//============================================================================ -// FFmpegVideoPlayer::~FFmpegVideoPlayer -//============================================================================ - -FFmpegVideoPlayer::~FFmpegVideoPlayer() -{ - deinit(); -} - -//============================================================================ -// FFmpegVideoPlayer::init -//============================================================================ - -void FFmpegVideoPlayer::init( void ) -{ - // Need to load the stuff from the ini file. - VideoPlayer::init(); - - initializeBinkWithMiles(); -} - -//============================================================================ -// FFmpegVideoPlayer::deinit -//============================================================================ - -void FFmpegVideoPlayer::deinit( void ) -{ - TheAudio->releaseHandleForBink(); - VideoPlayer::deinit(); -} - -//============================================================================ -// FFmpegVideoPlayer::reset -//============================================================================ - -void FFmpegVideoPlayer::reset( void ) -{ - VideoPlayer::reset(); -} - -//============================================================================ -// FFmpegVideoPlayer::update -//============================================================================ - -void FFmpegVideoPlayer::update( void ) -{ - VideoPlayer::update(); - -} - -//============================================================================ -// FFmpegVideoPlayer::loseFocus -//============================================================================ - -void FFmpegVideoPlayer::loseFocus( void ) -{ - VideoPlayer::loseFocus(); -} - -//============================================================================ -// FFmpegVideoPlayer::regainFocus -//============================================================================ - -void FFmpegVideoPlayer::regainFocus( void ) -{ - VideoPlayer::regainFocus(); -} - -//============================================================================ -// FFmpegVideoPlayer::createStream -//============================================================================ - -VideoStreamInterface* FFmpegVideoPlayer::createStream( File* file ) -{ - - if ( file == NULL ) - { - return NULL; - } - - FFmpegFile* ffmpegHandle = NEW FFmpegFile(); - if(!ffmpegHandle->open(file)) - { - delete ffmpegHandle; - return NULL; - } - - FFmpegVideoStream *stream = NEW FFmpegVideoStream(ffmpegHandle); - - if ( stream ) - { - stream->m_next = m_firstStream; - stream->m_player = this; - m_firstStream = stream; - - // never let volume go to 0, as Bink will interpret that as "play at full volume". - Int mod = (Int) ((TheAudio->getVolume(AudioAffect_Speech) * 0.8f) * 100) + 1; - [[maybe_unused]] Int volume = (32768 * mod) / 100; - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to set volume (%g -> %d -> %d\n", - TheAudio->getVolume(AudioAffect_Speech), mod, volume)); - //BinkSetVolume( stream->m_handle,0, volume); - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - set volume\n")); - } - - return stream; -} - -//============================================================================ -// FFmpegVideoPlayer::open -//============================================================================ - -VideoStreamInterface* FFmpegVideoPlayer::open( AsciiString movieTitle ) -{ - VideoStreamInterface* stream = NULL; - - const Video* pVideo = getVideo(movieTitle); - if (pVideo) { - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to open bink file\n")); - - if (TheGlobalData->m_modDir.isNotEmpty()) - { - char filePath[ _MAX_PATH ]; - sprintf( filePath, "%s%s\\%s.%s", TheGlobalData->m_modDir.str(), VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); - File* file = TheFileSystem->openFile(filePath); - DEBUG_ASSERTLOG(!file, ("opened bink file %s\n", filePath)); - if (file) - { - return createStream( file ); - } - } - - char localizedFilePath[ _MAX_PATH ]; - sprintf( localizedFilePath, VIDEO_LANG_PATH_FORMAT, GetRegistryLanguage().str(), pVideo->m_filename.str(), VIDEO_EXT ); - File* file = TheFileSystem->openFile(localizedFilePath); - DEBUG_ASSERTLOG(!file, ("opened localized bink file %s\n", localizedFilePath)); - if (!file) - { - char filePath[ _MAX_PATH ]; - sprintf( filePath, "%s\\%s.%s", VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); - file = TheFileSystem->openFile(filePath); - DEBUG_ASSERTLOG(!file, ("opened bink file %s\n", filePath)); - } - - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to create stream\n")); - stream = createStream( file ); - } - - return stream; -} - -//============================================================================ -// FFmpegVideoPlayer::load -//============================================================================ - -VideoStreamInterface* FFmpegVideoPlayer::load( AsciiString movieTitle ) -{ - return open(movieTitle); // load() used to have the same body as open(), so I'm combining them. Munkee. -} - -//============================================================================ -//============================================================================ -void FFmpegVideoPlayer::notifyVideoPlayerOfNewProvider( Bool nowHasValid ) -{ - if (!nowHasValid) { - TheAudio->releaseHandleForBink(); - //BinkSetSoundTrack(0, 0); - } else { - initializeBinkWithMiles(); - } -} - -//============================================================================ -//============================================================================ -void FFmpegVideoPlayer::initializeBinkWithMiles() -{ - Int retVal = 0; - void *driver = TheAudio->getHandleForBink(); - - if ( driver ) - { - //retVal = BinkSoundUseDirectSound(driver); - } - if( !driver || retVal == 0) - { - //BinkSetSoundTrack ( 0,0 ); - } -} - -//============================================================================ -// FFmpegVideoStream::FFmpegVideoStream -//============================================================================ - -FFmpegVideoStream::FFmpegVideoStream(FFmpegFile* file) -: m_ffmpegFile(file) -{ - m_ffmpegFile->setFrameCallback(onFrame); - m_ffmpegFile->setUserData(this); - - // GeneralsX @build Mr. Meeseeks 17/06/2026 Prioritize MiniAudio backend over OpenAL to prevent redefinition conflicts -#ifdef SAGE_USE_MINIAUDIO - // Release the audio handle if it's already in use - MiniAudioStream* audioStream = (MiniAudioStream*)TheAudio->getHandleForBink(); - audioStream->reset(); -#elif defined(SAGE_USE_OPENAL) - // Release the audio handle if it's already in use - OpenALAudioStream* audioStream = (OpenALAudioStream*)TheAudio->getHandleForBink(); - audioStream->reset(); -#endif - - // Decode until we have our first video frame - while (m_good && m_gotFrame == false) - m_good = m_ffmpegFile->decodePacket(); - -#ifdef SAGE_USE_MINIAUDIO - // Start audio playback - audioStream->setVolume(1.0f); - audioStream->play(); -#elif defined(SAGE_USE_OPENAL) - // Start audio playback - // GeneralsX @bugfix fbraz3 23/04/2026 Ensure video stream starts with audible gain even after prior source reuse. - // Issue: https://github.com/fbraz3/GeneralsX/issues/38 - audioStream->setVolume(1.0f); - audioStream->play(); -#endif - - m_startTime = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); -} - -//============================================================================ -// FFmpegVideoStream::~FFmpegVideoStream -//============================================================================ - -FFmpegVideoStream::~FFmpegVideoStream() -{ - // GeneralsX @bugfix fbraz3 20/04/2026 Stop and clear queued OpenAL buffers so video audio - // does not bleed into gameplay after the loading screen closes the stream. - // Issue: https://github.com/fbraz3/GeneralsX/issues/38 -#ifdef SAGE_USE_MINIAUDIO - if (TheAudio) - { - MiniAudioStream* audioStream = (MiniAudioStream*)TheAudio->getHandleForBink(); - if (audioStream) - audioStream->reset(); - } -#elif defined(SAGE_USE_OPENAL) - if (TheAudio) - { - OpenALAudioStream* audioStream = (OpenALAudioStream*)TheAudio->getHandleForBink(); - if (audioStream) - audioStream->reset(); - } -#endif - av_freep(&m_audioBuffer); - av_frame_free(&m_frame); - sws_freeContext(m_swsContext); - delete m_ffmpegFile; -} - -void FFmpegVideoStream::onFrame(AVFrame *frame, int stream_idx, int stream_type, void *user_data) -{ - FFmpegVideoStream *videoStream = static_cast(user_data); - if (stream_type == AVMEDIA_TYPE_VIDEO) { - av_frame_free(&videoStream->m_frame); - videoStream->m_frame = av_frame_clone(frame); - videoStream->m_gotFrame = true; - } -#ifdef SAGE_USE_MINIAUDIO - else if (stream_type == AVMEDIA_TYPE_AUDIO) { - MiniAudioStream* audioStream = (MiniAudioStream*)TheAudio->getHandleForBink(); - - AVSampleFormat sampleFmt = static_cast(frame->format); - const int bytesPerSample = av_get_bytes_per_sample(sampleFmt); - int outputBitsPerSample = bytesPerSample * 8; // May change after float→s16 conversion - const int frameSize = - av_samples_get_buffer_size(NULL, frame->ch_layout.nb_channels, frame->nb_samples, sampleFmt, 1); - if (frameSize <= 0 || bytesPerSample <= 0 || frame->ch_layout.nb_channels <= 0 || frame->nb_samples <= 0) { - return; - } - - int outputFrameSize = frameSize; - uint8_t* frameData = frame->data[0]; - - // Convert float32 to PCM16 for miniaudio compatibility - if (sampleFmt == AV_SAMPLE_FMT_FLT || sampleFmt == AV_SAMPLE_FMT_FLTP) - { - outputBitsPerSample = 16; // Converted to 16-bit PCM - outputFrameSize = frame->nb_samples * frame->ch_layout.nb_channels * (int)sizeof(int16_t); - videoStream->m_audioBuffer = static_cast(av_realloc(videoStream->m_audioBuffer, outputFrameSize)); - if (videoStream->m_audioBuffer == nullptr) - { - DEBUG_LOG(("Failed to allocate converted audio buffer")); - return; - } - - int16_t *dst = reinterpret_cast(videoStream->m_audioBuffer); - if (sampleFmt == AV_SAMPLE_FMT_FLTP) - { - for (int sample_idx = 0; sample_idx < frame->nb_samples; ++sample_idx) - { - for (int channel_idx = 0; channel_idx < frame->ch_layout.nb_channels; ++channel_idx) - { - const float sample = reinterpret_cast(frame->data[channel_idx])[sample_idx]; - const float clamped = (sample < -1.0f) ? -1.0f : ((sample > 1.0f) ? 1.0f : sample); - *dst++ = static_cast(clamped * 32767.0f); - } - } - } - else - { - const float *src = reinterpret_cast(frame->data[0]); - const int totalSamples = frame->nb_samples * frame->ch_layout.nb_channels; - for (int i = 0; i < totalSamples; ++i) - { - const float clamped = (src[i] < -1.0f) ? -1.0f : ((src[i] > 1.0f) ? 1.0f : src[i]); - *dst++ = static_cast(clamped * 32767.0f); - } - } - - frameData = videoStream->m_audioBuffer; - } - // The format is planar - convert it to interleaved - else if (av_sample_fmt_is_planar(sampleFmt)) - { - videoStream->m_audioBuffer = static_cast(av_realloc(videoStream->m_audioBuffer, outputFrameSize)); - if (videoStream->m_audioBuffer == nullptr) - { - DEBUG_LOG(("Failed to allocate audio buffer")); - return; - } - - // Write the samples into our audio buffer - for (int sample_idx = 0; sample_idx < frame->nb_samples; sample_idx++) - { - int byte_offset = sample_idx * bytesPerSample; - for (int channel_idx = 0; channel_idx < frame->ch_layout.nb_channels; channel_idx++) - { - uint8_t* dst = - &videoStream - ->m_audioBuffer[byte_offset * frame->ch_layout.nb_channels + channel_idx * bytesPerSample]; - uint8_t* src = &frame->data[channel_idx][byte_offset]; - memcpy(dst, src, bytesPerSample); - } - } - frameData = videoStream->m_audioBuffer; - } - - // Determine miniaudio format based on actual output bits per sample - ma_format maFormat = ma_format_s16; - if (outputBitsPerSample == 8) maFormat = ma_format_u8; - else if (outputBitsPerSample == 16) maFormat = ma_format_s16; - else if (outputBitsPerSample == 32) maFormat = ma_format_f32; - - audioStream->bufferData(frameData, outputFrameSize, maFormat, frame->sample_rate, frame->ch_layout.nb_channels); - audioStream->update(); - } -#elif defined(SAGE_USE_OPENAL) - else if (stream_type == AVMEDIA_TYPE_AUDIO) { - OpenALAudioStream* audioStream = (OpenALAudioStream*)TheAudio->getHandleForBink(); - - AVSampleFormat sampleFmt = static_cast(frame->format); - const int bytesPerSample = av_get_bytes_per_sample(sampleFmt); - const int frameSize = - av_samples_get_buffer_size(NULL, frame->ch_layout.nb_channels, frame->nb_samples, sampleFmt, 1); - if (frameSize <= 0 || bytesPerSample <= 0 || frame->ch_layout.nb_channels <= 0 || frame->nb_samples <= 0) { - return; - } - - int outputBitsPerSample = bytesPerSample * 8; - int outputFrameSize = frameSize; - uint8_t* frameData = frame->data[0]; - - // GeneralsX @bugfix BenderAI 22/04/2026 Convert float32 FFmpeg output to PCM16 for robust OpenAL compatibility. - if (sampleFmt == AV_SAMPLE_FMT_FLT || sampleFmt == AV_SAMPLE_FMT_FLTP) - { - outputBitsPerSample = 16; - outputFrameSize = frame->nb_samples * frame->ch_layout.nb_channels * (int)sizeof(int16_t); - videoStream->m_audioBuffer = static_cast(av_realloc(videoStream->m_audioBuffer, outputFrameSize)); - if (videoStream->m_audioBuffer == nullptr) - { - DEBUG_LOG(("Failed to allocate converted audio buffer")); - return; - } - - int16_t *dst = reinterpret_cast(videoStream->m_audioBuffer); - if (sampleFmt == AV_SAMPLE_FMT_FLTP) - { - for (int sample_idx = 0; sample_idx < frame->nb_samples; ++sample_idx) - { - for (int channel_idx = 0; channel_idx < frame->ch_layout.nb_channels; ++channel_idx) - { - const float sample = reinterpret_cast(frame->data[channel_idx])[sample_idx]; - const float clamped = (sample < -1.0f) ? -1.0f : ((sample > 1.0f) ? 1.0f : sample); - *dst++ = static_cast(clamped * 32767.0f); - } - } - } - else - { - const float *src = reinterpret_cast(frame->data[0]); - const int totalSamples = frame->nb_samples * frame->ch_layout.nb_channels; - for (int i = 0; i < totalSamples; ++i) - { - const float clamped = (src[i] < -1.0f) ? -1.0f : ((src[i] > 1.0f) ? 1.0f : src[i]); - *dst++ = static_cast(clamped * 32767.0f); - } - } - - frameData = videoStream->m_audioBuffer; - } - // The format is planar - convert it to interleaved - else if (av_sample_fmt_is_planar(sampleFmt)) - { - videoStream->m_audioBuffer = static_cast(av_realloc(videoStream->m_audioBuffer, outputFrameSize)); - if (videoStream->m_audioBuffer == nullptr) - { - DEBUG_LOG(("Failed to allocate audio buffer")); - return; - } - - // Write the samples into our audio buffer - for (int sample_idx = 0; sample_idx < frame->nb_samples; sample_idx++) - { - int byte_offset = sample_idx * bytesPerSample; - for (int channel_idx = 0; channel_idx < frame->ch_layout.nb_channels; channel_idx++) - { - uint8_t* dst = - &videoStream - ->m_audioBuffer[byte_offset * frame->ch_layout.nb_channels + channel_idx * bytesPerSample]; - uint8_t* src = &frame->data[channel_idx][byte_offset]; - memcpy(dst, src, bytesPerSample); - } - } - frameData = videoStream->m_audioBuffer; - } - - ALenum format = OpenALAudioManager::getALFormat(frame->ch_layout.nb_channels, outputBitsPerSample); - audioStream->bufferData(frameData, outputFrameSize, format, frame->sample_rate); - audioStream->update(); - } -#endif -} - - -//============================================================================ -// FFmpegVideoStream::update -//============================================================================ - -void FFmpegVideoStream::update( void ) -{ -#ifdef SAGE_USE_MINIAUDIO - MiniAudioStream* audioStream = (MiniAudioStream*)TheAudio->getHandleForBink(); - audioStream->update(); -#elif defined(SAGE_USE_OPENAL) - // GeneralsX @bugfix BenderAI 22/04/2026 Keep source maintenance without force-restarting playback each frame. - // Calling play() from the video update loop can continuously reset source progress - // during loadscreen transitions, leading to effective silence. - OpenALAudioStream* audioStream = (OpenALAudioStream*)TheAudio->getHandleForBink(); - audioStream->update(); -#endif - //BinkWait( m_handle ); -} - -//============================================================================ -// FFmpegVideoStream::isFrameReady -//============================================================================ - -Bool FFmpegVideoStream::isFrameReady( void ) -{ - uint64_t time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); - bool ready = (time - m_startTime) >= m_ffmpegFile->getFrameTime() * frameIndex(); - return ready; - - //return !BinkWait( m_handle ); -} - -//============================================================================ -// FFmpegVideoStream::frameDecompress -//============================================================================ - -void FFmpegVideoStream::frameDecompress( void ) -{ - //BinkDoFrame( m_handle ); -} - -//============================================================================ -// FFmpegVideoStream::frameRender -//============================================================================ - -void FFmpegVideoStream::frameRender( VideoBuffer *buffer ) -{ - if (buffer == nullptr) { - return; - } - - if (m_frame == nullptr) { - return; - } - - if (m_frame->data == nullptr) { - return; - } - - AVPixelFormat dst_pix_fmt; - - switch (buffer->format()) { - case VideoBuffer::TYPE_R8G8B8: - dst_pix_fmt = AV_PIX_FMT_RGB24; - break; - case VideoBuffer::TYPE_X8R8G8B8: - dst_pix_fmt = AV_PIX_FMT_BGR0; - break; - case VideoBuffer::TYPE_R5G6B5: - dst_pix_fmt = AV_PIX_FMT_RGB565; - break; - case VideoBuffer::TYPE_X1R5G5B5: - dst_pix_fmt = AV_PIX_FMT_RGB555; - break; - default: - return; - } - - m_swsContext = sws_getCachedContext(m_swsContext, - width(), - height(), - static_cast(m_frame->format), - buffer->width(), - buffer->height(), - dst_pix_fmt, - SWS_BICUBIC, - NULL, - NULL, - NULL); - - uint8_t *buffer_data = static_cast(buffer->lock()); - if (buffer_data == nullptr) { - DEBUG_LOG(("Failed to lock videobuffer")); - return; - } - - int dst_strides[] = { (int)buffer->pitch() }; - uint8_t *dst_data[] = { buffer_data }; - [[maybe_unused]] int result = - sws_scale(m_swsContext, m_frame->data, m_frame->linesize, 0, height(), dst_data, dst_strides); - DEBUG_ASSERTLOG(result >= 0, ("Failed to scale frame")); - buffer->unlock(); -} - -//============================================================================ -// FFmpegVideoStream::frameNext -//============================================================================ - -void FFmpegVideoStream::frameNext( void ) -{ - m_gotFrame = false; - // Decode until we have our next video frame - while (m_good && m_gotFrame == false) - m_good = m_ffmpegFile->decodePacket(); -} - -//============================================================================ -// FFmpegVideoStream::frameIndex -//============================================================================ - -Int FFmpegVideoStream::frameIndex( void ) -{ - return m_ffmpegFile->getCurrentFrame(); -} - -//============================================================================ -// FFmpegVideoStream::totalFrames -//============================================================================ - -Int FFmpegVideoStream::frameCount( void ) -{ - return m_ffmpegFile->getNumFrames(); -} - -//============================================================================ -// FFmpegVideoStream::frameGoto -//============================================================================ - -void FFmpegVideoStream::frameGoto( Int index ) -{ - m_ffmpegFile->seekFrame(index); -} - -//============================================================================ -// VideoStream::height -//============================================================================ - -Int FFmpegVideoStream::height( void ) -{ - return m_ffmpegFile->getHeight(); -} - -//============================================================================ -// VideoStream::width -//============================================================================ - -Int FFmpegVideoStream::width( void ) -{ - return m_ffmpegFile->getWidth(); -} - - - diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp index 54c9a36880f..7ebfe325229 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp @@ -3424,7 +3424,6 @@ void W3DVolumetricShadowManager::renderShadows( Bool forceStencilFill ) Int numRenderedShadows = 0; AABoxClass bbox; - SphereClass bsphere; //Get a bounding box around our visible universe. Bounded by terrain and the sky //so much tighter fitting volume than what's actually visible. This will cull diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index 61d7d1a31c2..2974a4c2611 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -88,6 +88,7 @@ static void drawFramerateBar(); #include "W3DDevice/GameClient/W3DShaderManager.h" #include "W3DDevice/GameClient/W3DDebugDisplay.h" #include "W3DDevice/GameClient/W3DProjectedShadow.h" +#include "W3DDevice/GameClient/W3DScreenshot.h" #include "W3DDevice/GameClient/W3DShroud.h" #include "WWMath/wwmath.h" #include "WWLib/registry.h" @@ -1858,8 +1859,7 @@ void W3DDisplay::calculateTerrainLOD() default: curLOD = TERRAIN_LOD_DISABLE; break; case TERRAIN_LOD_AUTOMATIC: curLOD = TERRAIN_LOD_MAX; break; case TERRAIN_LOD_MAX: curLOD = TERRAIN_LOD_NO_WATER; break; - case TERRAIN_LOD_HALF_CLOUDS: curLOD = TERRAIN_LOD_DISABLE; break; - case TERRAIN_LOD_NO_WATER: curLOD = TERRAIN_LOD_HALF_CLOUDS; break; + case TERRAIN_LOD_NO_WATER: curLOD = TERRAIN_LOD_DISABLE; break; } if (curLOD == TERRAIN_LOD_DISABLE) { break; @@ -1952,6 +1952,9 @@ void W3DDisplay::draw() if (TheGlobalData->m_headless) return; + // TheSuperHackers @feature bobtista 10/07/2026 Show messages for screenshots finished by the screenshot thread. + W3D_UpdateScreenshotMessages(); + updateAverageFPS(); if (TheGlobalData->m_enableDynamicLOD && TheGameLogic->getShowDynamicLOD()) { @@ -2159,14 +2162,7 @@ void W3DDisplay::draw() // TheSuperHackers @bugfix Mauller 20/07/2025 scale videos based on screen size so they are shown in their original aspect drawScaledVideoBuffer( m_videoBuffer, m_videoStream ); } - if( m_copyrightDisplayString ) - { - Int x, y, dX, dY; - m_copyrightDisplayString->getSize(&dX, &dY); - x = (getWidth() / 2) - (dX /2); - y = getHeight() - dY - 20 ; - m_copyrightDisplayString->draw(x, y, GameMakeColor(0,0,0,255), GameMakeColor(0,0,0,0),0,0); - } + // render letter box before debug display so debug info isn't hidden renderLetterBox(now); @@ -3206,236 +3202,6 @@ void W3DDisplay::setShroudLevel( Int x, Int y, CellShroudStatus setting ) } } -//============================================================================= -///Utility function to dump data into a .BMP file -// GeneralsX @build BenderAI 13/02/2026 Screenshot is Windows-specific functionality -#ifdef _WIN32 -static void CreateBMPFile(LPTSTR pszFile, char *image, Int width, Int height) -{ - HANDLE hf; // file handle - BITMAPFILEHEADER hdr; // bitmap file-header - BITMAPINFOHEADER* pbih; // bitmap info-header - unsigned char* lpBits; // memory pointer - DWORD dwTotal; // total count of bytes - DWORD cb; // incremental count of bytes - BYTE *hp; // byte pointer - DWORD dwTmp; - - BITMAPINFO* pbmi; - - pbmi = (BITMAPINFO*) LocalAlloc(LPTR,sizeof(BITMAPINFOHEADER)); - if (pbmi == nullptr) - return; - - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = width; - pbmi->bmiHeader.biHeight = height; - pbmi->bmiHeader.biPlanes = 1; - pbmi->bmiHeader.biBitCount = 24; - pbmi->bmiHeader.biCompression = BI_RGB; - pbmi->bmiHeader.biSizeImage = (pbmi->bmiHeader.biWidth + 7) /8 * pbmi->bmiHeader.biHeight * 24; - pbmi->bmiHeader.biClrImportant = 0; - - pbih = (BITMAPINFOHEADER*) pbmi; - lpBits = (unsigned char*) image; - - // Create the .BMP file. - hf = CreateFile(pszFile, - GENERIC_READ | GENERIC_WRITE, - (DWORD) 0, - nullptr, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - (HANDLE) nullptr); - - if (hf != INVALID_HANDLE_VALUE) - { - hdr.bfType = 0x4d42; // 0x42 = "B" 0x4d = "M" - // Compute the size of the entire file. - hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + - pbih->biSize + pbih->biClrUsed - * sizeof(RGBQUAD) + pbih->biSizeImage); - hdr.bfReserved1 = 0; - hdr.bfReserved2 = 0; - - // Compute the offset to the array of color indices. - hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + - pbih->biSize + pbih->biClrUsed - * sizeof (RGBQUAD); - - // Copy the BITMAPFILEHEADER into the .BMP file. - if (WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), - (LPDWORD) &dwTmp, nullptr)) - { - // Copy the BITMAPINFOHEADER and RGBQUAD array into the file. - if (WriteFile(hf, (LPVOID) pbih, sizeof(BITMAPINFOHEADER) + pbih->biClrUsed * sizeof (RGBQUAD),(LPDWORD) &dwTmp, nullptr)) - { - // Copy the array of color indices into the .BMP file. - dwTotal = cb = pbih->biSizeImage; - hp = lpBits; - WriteFile(hf, (LPSTR) hp, (int) cb, (LPDWORD) &dwTmp, nullptr); - } - } - - // Close the .BMP file. - CloseHandle(hf); - } - - // Free memory. - LocalFree( (HLOCAL) pbmi); -} -#else -// Linux stub: Screenshot not implemented (would require SDL3 surface capture) -static void CreateBMPFile(const char* pszFile, char *image, Int width, Int height) -{ - // TODO (Phase 3): Implement SDL3-based screenshot capture -} -#endif -// GeneralsX @build BenderAI 13/02/2026 Screenshot is Windows-specific functionality -#ifdef _WIN32 -void W3DDisplay::takeScreenShot() -{ - char leafname[256]; - char pathname[1024]; - - static int frame_number = 1; - - Bool done = false; - while (!done) { -#ifdef CAPTURE_TO_TARGA - sprintf( leafname, "%s%.3d.tga", "sshot", frame_number++); -#else - sprintf( leafname, "%s%.3d.bmp", "sshot", frame_number++); -#endif - strlcpy(pathname, TheGlobalData->getPath_UserData().str(), ARRAY_SIZE(pathname)); - strlcat(pathname, leafname, ARRAY_SIZE(pathname)); - if (_access( pathname, 0 ) == -1) - done = true; - } - - // TheSuperHackers @bugfix xezon 21/05/2025 Get the back buffer and create a copy of the surface. - // Originally this code took the front buffer and tried to lock it. This does not work when the - // render view clips outside the desktop boundaries. It crashed the game. - SurfaceClass* surface = DX8Wrapper::_Get_DX8_Back_Buffer(); - - SurfaceClass::SurfaceDescription surfaceDesc; - surface->Get_Description(surfaceDesc); - - SurfaceClass* surfaceCopy = NEW_REF(SurfaceClass, (DX8Wrapper::_Create_DX8_Surface(surfaceDesc.Width, surfaceDesc.Height, surfaceDesc.Format))); - DX8Wrapper::_Copy_DX8_Rects(surface->Peek_D3D_Surface(), nullptr, 0, surfaceCopy->Peek_D3D_Surface(), nullptr); - - surface->Release_Ref(); - surface = nullptr; - - struct Rect - { - int Pitch; - void* pBits; - } lrect; - - lrect.pBits = surfaceCopy->Lock(&lrect.Pitch); - if (lrect.pBits == nullptr) - { - surfaceCopy->Release_Ref(); - return; - } - - unsigned int x,y,index,index2,width,height; - - width = surfaceDesc.Width; - height = surfaceDesc.Height; - - char *image=NEW char[3*width*height]; -#ifdef CAPTURE_TO_TARGA - //bytes are mixed in targa files, not rgb order. - for (y=0; yUnlock(); - surfaceCopy->Release_Ref(); - surfaceCopy = nullptr; - - Targa targ; - memset(&targ.Header,0,sizeof(targ.Header)); - targ.Header.Width=width; - targ.Header.Height=height; - targ.Header.PixelDepth=24; - targ.Header.ImageType=TGA_TRUECOLOR; - targ.SetImage(image); - targ.YFlip(); - - targ.Save(pathname,TGAF_IMAGE,false); -#else //capturing to bmp file - //bmp is same byte order - for (y=0; yUnlock(); - surfaceCopy->Release_Ref(); - surfaceCopy = nullptr; - - //Flip the image - char *ptr,*ptr1; - char v,v1; - - for (y = 0; y < (height >> 1); y++) - { - /* Compute address of lines to exchange. */ - ptr = (image + ((width * y) * 3)); - ptr1 = (image + ((width * (height - 1)) * 3)); - ptr1 -= ((width * y) * 3); - - /* Exchange all the pixels on this scan line. */ - for (x = 0; x < (width * 3); x++) - { - v = *ptr; - v1 = *ptr1; - *ptr = v1; - *ptr1 = v; - ptr++; - ptr1++; - } - } - CreateBMPFile(pathname, image, width, height); -#endif - - delete [] image; - - UnicodeString ufileName; - ufileName.translate(leafname); - TheInGameUI->message(TheGameText->fetch("GUI:ScreenCapture"), ufileName.str()); -} -#else -// Linux stub: Screenshot capture not implemented -void W3DDisplay::takeScreenShot(void) -{ - // TODO (Phase 3): Implement SDL3-based screenshot capture -} -#endif /** Start/Stop capturing an AVI movie*/ void W3DDisplay::toggleMovieCapture() @@ -3443,6 +3209,11 @@ void W3DDisplay::toggleMovieCapture() WW3D::Toggle_Movie_Capture("Movie",30); } +void W3DDisplay::takeScreenShot(ScreenshotFormat format, Int jpegQuality) +{ + W3D_TakeCompressedScreenshot(format, jpegQuality); +} + #if defined(RTS_DEBUG) diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp index 3620d63ca84..7b048d57a72 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp @@ -511,9 +511,6 @@ void BoxRenderObjClass::render_box(RenderInfoClass & rinfo,const Vector3 & cente DX8Wrapper::Set_Index_Buffer(ibaccess,0); DX8Wrapper::Set_Vertex_Buffer(vbaccess); - SphereClass sphere; - Get_Obj_Space_Bounding_Sphere(sphere); - DX8Wrapper::Draw_Triangles(buffer_type,0,NUM_BOX_FACES,0,NUM_BOX_VERTS); } } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp index ee5b18e079a..76c8916f477 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp @@ -1227,8 +1227,6 @@ void DazzleRenderObjClass::Render_Dazzle(CameraClass* camera) DX8Wrapper::Set_Index_Buffer(ib_access,dazzle_vertex_count); DX8Wrapper::Set_Shader(default_halo_shader); DX8Wrapper::Set_Texture(0,types[type]->Get_Halo_Texture()); - SphereClass sphere(Get_Position(),0.1f); - DX8Wrapper::Draw_Triangles(0,halo_poly_count,0,vertex_count); } @@ -1236,7 +1234,6 @@ void DazzleRenderObjClass::Render_Dazzle(CameraClass* camera) DX8Wrapper::Set_Index_Buffer(ib_access,0); DX8Wrapper::Set_Shader(default_dazzle_shader); DX8Wrapper::Set_Texture(0,types[type]->Get_Dazzle_Texture()); - SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f); DX8Wrapper::Draw_Triangles(0,dazzle_poly_count,0,vertex_count); } @@ -1244,7 +1241,6 @@ void DazzleRenderObjClass::Render_Dazzle(CameraClass* camera) DX8Wrapper::Set_Index_Buffer(ib_access,dazzle_vertex_count+halo_vertex_count); DX8Wrapper::Set_Shader(default_dazzle_shader); DX8Wrapper::Set_Texture(0,lensflare->Get_Texture()); - SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f); DX8Wrapper::Draw_Triangles(0,lensflare_poly_count,0,vertex_count); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h index 86fc55e767c..3b425c21be7 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdl.h @@ -129,7 +129,7 @@ class GapFillerClass ShaderClass* ShaderArray[MeshMatDescClass::MAX_PASSES]; MeshModelClass* mmc; - GapFillerClass& operator = (const GapFillerClass&) CPP_11(= delete); + GapFillerClass& operator = (const GapFillerClass&) FUNCTION_DELETE; public: GapFillerClass(MeshModelClass* mmc); GapFillerClass(const GapFillerClass& that); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Include/GUIEditDisplay.h b/GeneralsMD/Code/Tools/GUIEdit/Include/GUIEditDisplay.h index 9e432ecb827..ddd7b84bafb 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Include/GUIEditDisplay.h +++ b/GeneralsMD/Code/Tools/GUIEdit/Include/GUIEditDisplay.h @@ -101,7 +101,7 @@ class GUIEditDisplay : public Display virtual void drawScaledVideoBuffer( VideoBuffer *buffer, VideoStreamInterface *stream ) override { } virtual void drawVideoBuffer( VideoBuffer *buffer, Int startX, Int startY, Int endX, Int endY ) override { } - virtual void takeScreenShot() override { } + virtual void takeScreenShot(ScreenshotFormat format, Int jpegQuality) override { } virtual void toggleMovieCapture() override {} // methods that we need to stub diff --git a/cmake/gamespy.cmake b/cmake/gamespy.cmake index 7c11ccd12ac..4c498628781 100644 --- a/cmake/gamespy.cmake +++ b/cmake/gamespy.cmake @@ -3,7 +3,7 @@ set(GAMESPY_SERVER_NAME "server.cnc-online.net") FetchContent_Declare( gamespy - GIT_REPOSITORY https://github.com/TheAssemblyArmada/GamespySDK.git + GIT_REPOSITORY https://github.com/TheSuperHackers/GamespySDK.git GIT_TAG 07e3d15c500415abc281efb74322ab6d9c857eb8 ) diff --git a/cmake/stb.cmake b/cmake/stb.cmake new file mode 100644 index 00000000000..8db04af3e70 --- /dev/null +++ b/cmake/stb.cmake @@ -0,0 +1,21 @@ +# Fetch the stb library for writing JPEG and PNG screenshots. + +# vcpkg provides stb through a find module (FindStb.cmake), not a config package, +# so the search must not be restricted to CONFIG mode. +find_package(Stb QUIET) + +if(NOT Stb_FOUND) + include(FetchContent) + FetchContent_Declare( + stb + GIT_REPOSITORY https://github.com/TheSuperHackers/stb.git + GIT_TAG 5c205738c191bcb0abc65c4febfa9bd25ff35234 + ) + + FetchContent_MakeAvailable(stb) + + set(Stb_INCLUDE_DIR ${stb_SOURCE_DIR}) +endif() + +add_library(stb INTERFACE) +target_include_directories(stb INTERFACE ${Stb_INCLUDE_DIR}) diff --git a/flatpak/com.fbraz3.GeneralsX.yml b/flatpak/com.fbraz3.GeneralsX.yml index 5a9b027eed1..97083d2da79 100644 --- a/flatpak/com.fbraz3.GeneralsX.yml +++ b/flatpak/com.fbraz3.GeneralsX.yml @@ -66,7 +66,8 @@ modules: -DFETCHCONTENT_SOURCE_DIR_OPENAL_SOFT=/run/build/generalsx/openal-soft-src \ -DFETCHCONTENT_SOURCE_DIR_GAMESPY=/run/build/generalsx/gamespy-src \ -DFETCHCONTENT_SOURCE_DIR_LZHL=/run/build/generalsx/lzhl-src/CompLibHeader \ - -DFETCHCONTENT_SOURCE_DIR_GAMEMATH=/run/build/generalsx/gamemath-src + -DFETCHCONTENT_SOURCE_DIR_GAMEMATH=/run/build/generalsx/gamemath-src \ + -DFETCHCONTENT_SOURCE_DIR_STB=/run/build/generalsx/stb-src - cmake --build build-flatpak --target g_generals -j "${FLATPAK_BUILDER_N_JOBS:-4}" - cmake --build build-flatpak --target sage_patch -j "${FLATPAK_BUILDER_N_JOBS:-4}" || true - install -Dm755 build-flatpak/Generals/GeneralsX /app/bin/GeneralsX @@ -189,3 +190,7 @@ modules: url: https://github.com/TheSuperHackers/GameMath.git commit: 59f7ccd494f7e7c916a784ac26ef266f9f09d78d dest: gamemath-src + - type: git + url: https://github.com/TheSuperHackers/stb.git + commit: 5c205738c191bcb0abc65c4febfa9bd25ff35234 + dest: stb-src diff --git a/flatpak/com.fbraz3.GeneralsXZH.yml b/flatpak/com.fbraz3.GeneralsXZH.yml index 69755117fb8..a4eb66c5ee0 100644 --- a/flatpak/com.fbraz3.GeneralsXZH.yml +++ b/flatpak/com.fbraz3.GeneralsXZH.yml @@ -66,7 +66,8 @@ modules: -DFETCHCONTENT_SOURCE_DIR_OPENAL_SOFT=/run/build/generalsxzh/openal-soft-src \ -DFETCHCONTENT_SOURCE_DIR_GAMESPY=/run/build/generalsxzh/gamespy-src \ -DFETCHCONTENT_SOURCE_DIR_LZHL=/run/build/generalsxzh/lzhl-src/CompLibHeader \ - -DFETCHCONTENT_SOURCE_DIR_GAMEMATH=/run/build/generalsxzh/gamemath-src + -DFETCHCONTENT_SOURCE_DIR_GAMEMATH=/run/build/generalsxzh/gamemath-src \ + -DFETCHCONTENT_SOURCE_DIR_STB=/run/build/generalsxzh/stb-src - cmake --build build-flatpak --target z_generals -j "${FLATPAK_BUILDER_N_JOBS:-4}" - cmake --build build-flatpak --target sage_patch -j "${FLATPAK_BUILDER_N_JOBS:-4}" || true - install -Dm755 build-flatpak/GeneralsMD/GeneralsXZH /app/bin/GeneralsXZH @@ -197,3 +198,7 @@ modules: url: https://github.com/TheSuperHackers/GameMath.git commit: 59f7ccd494f7e7c916a784ac26ef266f9f09d78d dest: gamemath-src + - type: git + url: https://github.com/TheSuperHackers/stb.git + commit: 5c205738c191bcb0abc65c4febfa9bd25ff35234 + dest: stb-src diff --git a/resources/dockerbuild/Dockerfile.linux b/resources/dockerbuild/Dockerfile.linux index 960a5c4388b..5496a44a446 100644 --- a/resources/dockerbuild/Dockerfile.linux +++ b/resources/dockerbuild/Dockerfile.linux @@ -18,6 +18,7 @@ RUN apt-get update -qq && \ build-essential \ cmake \ ninja-build \ + nasm \ git \ curl \ ca-certificates \ diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py index f691b45c96c..71f688aeb0d 100644 --- a/scripts/cpp/unify_move_files.py +++ b/scripts/cpp/unify_move_files.py @@ -591,6 +591,31 @@ def main(): #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp") #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIAiData.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIAiData.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIAnimation.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIAnimation.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INICommandButton.cpp", Game.CORE, "GameEngine/Source/Common/INI/INICommandButton.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INICommandSet.cpp", Game.CORE, "GameEngine/Source/Common/INI/INICommandSet.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIControlBarScheme.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIControlBarScheme.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INICrate.cpp", Game.CORE, "GameEngine/Source/Common/INI/INICrate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIDamageFX.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIDamageFX.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIDrawGroupInfo.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIGameData.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIGameData.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIMapCache.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIMapCache.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIMapData.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIMapData.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIMappedImage.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIMappedImage.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIModel.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIModel.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIMultiplayer.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIMultiplayer.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIObject.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIObject.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIParticleSys.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIParticleSys.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INISpecialPower.cpp", Game.CORE, "GameEngine/Source/Common/INI/INISpecialPower.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INITerrain.cpp", Game.CORE, "GameEngine/Source/Common/INI/INITerrain.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INITerrainBridge.cpp", Game.CORE, "GameEngine/Source/Common/INI/INITerrainBridge.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INITerrainRoad.cpp", Game.CORE, "GameEngine/Source/Common/INI/INITerrainRoad.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIUpgrade.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIWater.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIWater.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIWeapon.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIWeapon.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/INI/INIWebpageURL.cpp", Game.CORE, "GameEngine/Source/Common/INI/INIWebpageURL.cpp") + return diff --git a/vcpkg.json b/vcpkg.json index 2e3f38c5f9b..f92bee83276 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -22,6 +22,8 @@ "name": "curl", "platform": "!windows", "features": ["ssl"] - } + }, + "ffmpeg", + "stb" ] } \ No newline at end of file