From acf29bf263c1349d0c2c4e165986bf9e823669bf Mon Sep 17 00:00:00 2001
From: xezon <4720891+xezon@users.noreply.github.com>
Date: Sun, 25 Jan 2026 11:23:59 +0100
Subject: [PATCH 1/2] unify(lib): Move BaseType.h, trig.h to Core (#2185)
---
Core/CMakeLists.txt | 2 +
.../Libraries/Include/Lib/BaseType.h | 0
.../Libraries/Include/Lib/trig.h | 0
Generals/Code/CMakeLists.txt | 8 -
.../Code/Libraries/Include/Lib/BaseType.h | 453 ------------------
Generals/Code/Libraries/Include/Lib/trig.h | 30 --
GeneralsMD/Code/CMakeLists.txt | 8 -
scripts/cpp/unify_move_files.py | 3 +
8 files changed, 5 insertions(+), 499 deletions(-)
rename {GeneralsMD/Code => Core}/Libraries/Include/Lib/BaseType.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Include/Lib/trig.h (100%)
delete mode 100644 Generals/Code/Libraries/Include/Lib/BaseType.h
delete mode 100644 Generals/Code/Libraries/Include/Lib/trig.h
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index ccf2513e5e6..7c1269d1db9 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -14,7 +14,9 @@ target_include_directories(corei_libraries_source_wwvegas_wwlib INTERFACE "Libra
target_include_directories(corei_main INTERFACE "Main")
target_sources(corei_libraries_include PRIVATE
+ Libraries/Include/Lib/BaseType.h
Libraries/Include/Lib/BaseTypeCore.h
+ Libraries/Include/Lib/trig.h
Libraries/Include/rts/debug.h
Libraries/Include/rts/profile.h
)
diff --git a/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h b/Core/Libraries/Include/Lib/BaseType.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Include/Lib/BaseType.h
rename to Core/Libraries/Include/Lib/BaseType.h
diff --git a/GeneralsMD/Code/Libraries/Include/Lib/trig.h b/Core/Libraries/Include/Lib/trig.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Include/Lib/trig.h
rename to Core/Libraries/Include/Lib/trig.h
diff --git a/Generals/Code/CMakeLists.txt b/Generals/Code/CMakeLists.txt
index e52d043e441..85838bb94d6 100644
--- a/Generals/Code/CMakeLists.txt
+++ b/Generals/Code/CMakeLists.txt
@@ -1,20 +1,14 @@
# g stands for Generals, i stands for Interface
add_library(gi_gameengine_include INTERFACE)
-add_library(gi_libraries_include INTERFACE)
add_library(gi_libraries_source_wwvegas INTERFACE)
add_library(gi_main INTERFACE)
add_library(gi_always INTERFACE)
add_library(gi_always_no_pch INTERFACE) # Use this for Shared Libs with MFC AFX
target_include_directories(gi_gameengine_include INTERFACE "GameEngine/Include")
-target_include_directories(gi_libraries_include INTERFACE "Libraries/Include")
target_include_directories(gi_libraries_source_wwvegas INTERFACE "Libraries/Source/WWVegas")
target_include_directories(gi_main INTERFACE "Main")
-target_sources(gi_libraries_include PRIVATE
- Libraries/Include/Lib/BaseType.h
- Libraries/Include/Lib/trig.h
-)
target_compile_definitions(gi_always INTERFACE
RTS_GENERALS=1
)
@@ -25,11 +19,9 @@ target_link_libraries(gi_gameengine_include INTERFACE
corei_gameengine_include
)
target_link_libraries(gi_always INTERFACE
- gi_libraries_include
corei_always # Must stay below so headers from game are included first
)
target_link_libraries(gi_always_no_pch INTERFACE
- gi_libraries_include
corei_always_no_pch # Must stay below so headers from game are included first
)
diff --git a/Generals/Code/Libraries/Include/Lib/BaseType.h b/Generals/Code/Libraries/Include/Lib/BaseType.h
deleted file mode 100644
index 274f700f76e..00000000000
--- a/Generals/Code/Libraries/Include/Lib/BaseType.h
+++ /dev/null
@@ -1,453 +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 .
-*/
-
-// FILE: BaseType.h ///////////////////////////////////////////////////////////
-//
-// Project: RTS3
-//
-// Basic types and constants
-// Author: Michael S. Booth, January 1995, September 2000
-//
-///////////////////////////////////////////////////////////////////////////////
-
-// tell the compiler to only load this file once
-
-#pragma once
-
-#include "Lib/BaseTypeCore.h"
-#include "Lib/trig.h"
-
-//-----------------------------------------------------------------------------
-typedef wchar_t WideChar; ///< multi-byte character representations
-
-//-----------------------------------------------------------------------------
-template
-inline NUM sqr(NUM x)
-{
- return x*x;
-}
-
-template
-inline NUM clamp(NUM lo, NUM val, NUM hi)
-{
- if (val < lo) return lo;
- else if (val > hi) return hi;
- else return val;
-}
-
-template
-inline int sign(NUM x)
-{
- if (x > 0) return 1;
- else if (x < 0) return -1;
- else return 0;
-}
-
-//-----------------------------------------------------------------------------
-inline Real rad2deg(Real rad) { return rad * (180/PI); }
-inline Real deg2rad(Real rad) { return rad * (PI/180); }
-
-//-----------------------------------------------------------------------------
-// For twiddling bits
-//-----------------------------------------------------------------------------
-// TheSuperHackers @build xezon 17/03/2025 Renames BitTest to BitIsSet to prevent conflict with BitTest macro from winnt.h
-#define BitIsSet( x, i ) ( ( (x) & (i) ) != 0 )
-#define BitSet( x, i ) ( (x) |= (i) )
-#define BitClear( x, i ) ( (x ) &= ~(i) )
-#define BitToggle( x, i ) ( (x) ^= (i) )
-
-//-------------------------------------------------------------------------------------------------
-
-// note, this function depends on the cpu rounding mode, which we set to CHOP every frame,
-// but apparently tends to be left in unpredictable modes by various system bits of
-// code, so use this function with caution -- it might not round in the way you want.
-__forceinline long fast_float2long_round(float f)
-{
- long i;
-
-#if defined(_MSC_VER) && _MSC_VER < 1300
- __asm {
- fld [f]
- fistp [i]
- }
-#else
- i = lroundf(f);
-#endif
-
- return i;
-}
-
-// super fast float trunc routine, works always (independent of any FPU modes)
-// code courtesy of Martin Hoffesommer (grin)
-__forceinline float fast_float_trunc(float f)
-{
-#if defined(_MSC_VER) && _MSC_VER < 1300
- _asm
- {
- mov ecx,[f]
- shr ecx,23
- mov eax,0xff800000
- xor ebx,ebx
- sub cl,127
- cmovc eax,ebx
- sar eax,cl
- and [f],eax
- }
- return f;
-#else
- unsigned x = *(unsigned *)&f;
- unsigned char exp = x >> 23;
- int mask = exp < 127 ? 0 : 0xff800000;
- exp -= 127;
- mask >>= exp & 31;
- x &= mask;
- return *(float *)&x;
-#endif
-}
-
-// same here, fast floor function
-__forceinline float fast_float_floor(float f)
-{
- static unsigned almost1=(126<<23)|0x7fffff;
- if (*(unsigned *)&f &0x80000000)
- f-=*(float *)&almost1;
- return fast_float_trunc(f);
-}
-
-// same here, fast ceil function
-__forceinline float fast_float_ceil(float f)
-{
- static unsigned almost1=(126<<23)|0x7fffff;
- if ( (*(unsigned *)&f &0x80000000)==0)
- f+=*(float *)&almost1;
- return fast_float_trunc(f);
-}
-
-//-------------------------------------------------------------------------------------------------
-#define REAL_TO_INT(x) ((Int)(x))
-#define REAL_TO_UNSIGNEDINT(x) ((UnsignedInt)(x))
-#define REAL_TO_SHORT(x) ((Short)(x))
-#define REAL_TO_UNSIGNEDSHORT(x) ((UnsignedShort)(x))
-#define REAL_TO_BYTE(x) ((Byte)(x))
-#define REAL_TO_UNSIGNEDBYTE(x) ((UnsignedByte)(x))
-#define REAL_TO_CHAR(x) ((Char)(x))
-#define DOUBLE_TO_REAL(x) ((Real)(x))
-#define DOUBLE_TO_INT(x) ((Int)(x))
-#define INT_TO_REAL(x) ((Real)(x))
-
-// once we've ceiled/floored, trunc and round are identical, and currently, round is faster... (srj)
-#if RTS_GENERALS /*&& RETAIL_COMPATIBLE_CRC*/
-#define REAL_TO_INT_CEIL(x) (fast_float2long_round(ceilf(x)))
-#define REAL_TO_INT_FLOOR(x) (fast_float2long_round(floorf(x)))
-#else
-#define REAL_TO_INT_CEIL(x) (fast_float2long_round(fast_float_ceil(x)))
-#define REAL_TO_INT_FLOOR(x) (fast_float2long_round(fast_float_floor(x)))
-#endif
-
-#define FAST_REAL_TRUNC(x) fast_float_trunc(x)
-#define FAST_REAL_CEIL(x) fast_float_ceil(x)
-#define FAST_REAL_FLOOR(x) fast_float_floor(x)
-
-//--------------------------------------------------------------------
-// Derived type definitions
-//--------------------------------------------------------------------
-
-// NOTE: Keep these derived types simple, and avoid constructors and destructors
-// so they can be used within unions.
-
-// real-valued range defined by low and high values
-struct RealRange
-{
- Real lo, hi; // low and high values of the range
-
- // combine the given range with us such that we now encompass
- // both ranges
- void combine( RealRange &other )
- {
- lo = MIN( lo, other.lo );
- hi = MAX( hi, other.hi );
- }
-};
-
-struct Coord2D
-{
- Real x, y;
-
- Real length( void ) const { return (Real)sqrt( x*x + y*y ); }
-
- void normalize( void )
- {
- Real len = length();
- if( len != 0 )
- {
- x /= len;
- y /= len;
- }
- }
-
- Real toAngle( void ) const; ///< turn 2D vector into angle (where angle 0 is down the +x axis)
-
-};
-
-inline Real Coord2D::toAngle( void ) const
-{
-#if RTS_GENERALS /*&& RETAIL_COMPATIBLE_CRC*/
- Coord2D vector;
-
- vector.x = x;
- vector.y = y;
-
- Real dist = (Real)sqrt(vector.x * vector.x + vector.y * vector.y);
-
- // normalize
- if (dist == 0.0f)
- return 0.0f;
-
- Coord2D dir;
- dir.x = 1.0f;
- dir.y = 0.0f;
-
- Real distInv = 1.0f / dist;
- vector.x *= distInv;
- vector.y *= distInv;
-
- // dot of two unit vectors is cos of angle
- Real c = dir.x*vector.x + dir.y*vector.y;
-
- // bound it in case of numerical error
- if (c < -1.0)
- c = -1.0;
- else if (c > 1.0)
- c = 1.0;
-
- Real value = (Real)ACos( (Real)c );
-
- // Determine sign by checking Z component of dir cross vector
- // Note this is assumes 2D, and is identical to dotting the perpendicular of v with dir
- Real perpZ = dir.x * vector.y - dir.y * vector.x;
- if (perpZ < 0.0f)
- value = -value;
-
- // note: to make this 3D, 'dir' and 'vector' can be normalized and dotted just as they are
- // to test sign, compute N = dir X vector, then P = N x dir, then S = P . vector, where sign of
- // S is sign of angle - MSB
-
- return value;
-#else
- const Real len = length();
- if (len == 0.0f)
- return 0.0f;
-
- Real c = x/len;
- // bound it in case of numerical error
- if (c < -1.0f)
- c = -1.0f;
- else if (c > 1.0f)
- c = 1.0f;
-
- return y < 0.0f ? -ACos(c) : ACos(c);
-#endif
-}
-
-struct ICoord2D
-{
- Int x, y;
-
- Int length( void ) const { return (Int)sqrt( (double)(x*x + y*y) ); }
-};
-
-struct Region2D
-{
- Coord2D lo, hi; // bounds of 2D rectangular region
-
- Real width( void ) const { return hi.x - lo.x; }
- Real height( void ) const { return hi.y - lo.y; }
-};
-
-struct IRegion2D
-{
- ICoord2D lo, hi; // bounds of 2D rectangular region
-
- Int width( void ) const { return hi.x - lo.x; }
- Int height( void ) const { return hi.y - lo.y; }
-};
-
-
-struct Coord3D
-{
- Real x, y, z;
-
- Real length( void ) const { return (Real)sqrt( x*x + y*y + z*z ); }
- Real lengthSqr( void ) const { return ( x*x + y*y + z*z ); }
-
- void normalize( void )
- {
- Real len = length();
-
- if( len != 0 )
- {
- x /= len;
- y /= len;
- z /= len;
- }
- }
-
- static void crossProduct( const Coord3D *a, const Coord3D *b, Coord3D *r )
- {
- r->x = (a->y * b->z - a->z * b->y);
- r->y = (a->z * b->x - a->x * b->z);
- r->z = (a->x * b->y - a->y * b->x);
- }
-
- void zero( void )
- {
- x = 0.0f;
- y = 0.0f;
- z = 0.0f;
- }
-
- void add( const Coord3D *a )
- {
- x += a->x;
- y += a->y;
- z += a->z;
- }
-
- void sub( const Coord3D *a )
- {
- x -= a->x;
- y -= a->y;
- z -= a->z;
- }
-
- void set( const Coord3D *a )
- {
- x = a->x;
- y = a->y;
- z = a->z;
- }
-
- void set( Real ax, Real ay, Real az )
- {
- x = ax;
- y = ay;
- z = az;
- }
-
- void scale( Real scale )
- {
- x *= scale;
- y *= scale;
- z *= scale;
- }
-
- Bool equals( const Coord3D &r )
- {
- return (x == r.x &&
- y == r.y &&
- z == r.z);
- }
-
- Bool operator==( const Coord3D &r ) const
- {
- return (x == r.x &&
- y == r.y &&
- z == r.z);
- }
-};
-
-struct ICoord3D
-{
- Int x, y, z;
-
- Int length( void ) const { return (Int)sqrt( (double)(x*x + y*y + z*z) ); }
- void zero( void )
- {
-
- x = 0;
- y = 0;
- z = 0;
- }
-};
-
-struct Region3D
-{
- Coord3D lo, hi; // axis-aligned bounding box
-
- Real width( void ) const { return hi.x - lo.x; }
- Real height( void ) const { return hi.y - lo.y; }
- Real depth( void ) const { return hi.z - lo.z; }
-
- void zero() { lo.zero(); hi.zero(); }
- Bool isInRegionNoZ( const Coord3D *query ) const
- {
- return (lo.x < query->x) && (query->x < hi.x)
- && (lo.y < query->y) && (query->y < hi.y);
- }
- Bool isInRegionWithZ( const Coord3D *query ) const
- {
- return (lo.x < query->x) && (query->x < hi.x)
- && (lo.y < query->y) && (query->y < hi.y)
- && (lo.z < query->z) && (query->z < hi.z);
- }
-};
-
-struct IRegion3D
-{
- ICoord3D lo, hi; // axis-aligned bounding box
-
- Int width( void ) const { return hi.x - lo.x; }
- Int height( void ) const { return hi.y - lo.y; }
- Int depth( void ) const { return hi.z - lo.z; }
-};
-
-
-struct RGBColor
-{
- Real red, green, blue; // range between 0 and 1
-
- Int getAsInt() const
- {
- return
- ((Int)(red * 255.0) << 16) |
- ((Int)(green * 255.0) << 8) |
- ((Int)(blue * 255.0) << 0);
- }
-
- void setFromInt(Int c)
- {
- red = ((c >> 16) & 0xff) / 255.0f;
- green = ((c >> 8) & 0xff) / 255.0f;
- blue = ((c >> 0) & 0xff) / 255.0f;
- }
-
-};
-
-struct RGBAColorReal
-{
-
- Real red, green, blue, alpha; // range between 0.0 and 1.0
-
-};
-
-struct RGBAColorInt
-{
-
- UnsignedInt red, green, blue, alpha; // range between 0 and 255
-
-};
diff --git a/Generals/Code/Libraries/Include/Lib/trig.h b/Generals/Code/Libraries/Include/Lib/trig.h
deleted file mode 100644
index 569f1ff3496..00000000000
--- a/Generals/Code/Libraries/Include/Lib/trig.h
+++ /dev/null
@@ -1,30 +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 .
-*/
-
-// Trig.h
-// fast trig functions
-// Author: Sondra Iverson, March 1998
-// Converted to Generals by Matthew D. Campbell, February 2002
-
-#pragma once
-
-Real Sin(Real);
-Real Cos(Real);
-Real Tan(Real);
-Real ACos(Real);
-Real ASin(Real x);
diff --git a/GeneralsMD/Code/CMakeLists.txt b/GeneralsMD/Code/CMakeLists.txt
index d173801dc98..a713dcc7c2b 100644
--- a/GeneralsMD/Code/CMakeLists.txt
+++ b/GeneralsMD/Code/CMakeLists.txt
@@ -1,20 +1,14 @@
# z stands for Zero Hour, i stands for Interface
add_library(zi_gameengine_include INTERFACE)
-add_library(zi_libraries_include INTERFACE)
add_library(zi_libraries_source_wwvegas INTERFACE)
add_library(zi_main INTERFACE)
add_library(zi_always INTERFACE)
add_library(zi_always_no_pch INTERFACE) # Use this for Shared Libs with MFC AFX
target_include_directories(zi_gameengine_include INTERFACE "GameEngine/Include")
-target_include_directories(zi_libraries_include INTERFACE "Libraries/Include")
target_include_directories(zi_libraries_source_wwvegas INTERFACE "Libraries/Source/WWVegas")
target_include_directories(zi_main INTERFACE "Main")
-target_sources(zi_libraries_include PRIVATE
- Libraries/Include/Lib/BaseType.h
- Libraries/Include/Lib/trig.h
-)
target_compile_definitions(zi_always INTERFACE
RTS_ZEROHOUR=1
)
@@ -25,11 +19,9 @@ target_link_libraries(zi_gameengine_include INTERFACE
corei_gameengine_include
)
target_link_libraries(zi_always INTERFACE
- zi_libraries_include
corei_always # Must stay below so headers from game are included first
)
target_link_libraries(zi_always_no_pch INTERFACE
- zi_libraries_include
corei_always_no_pch # Must stay below so headers from game are included first
)
diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py
index 3430d4b450f..f0845dd95f3 100644
--- a/scripts/cpp/unify_move_files.py
+++ b/scripts/cpp/unify_move_files.py
@@ -260,6 +260,9 @@ def main():
#unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/UserPreferences.h", Game.CORE, "GameEngine/Include/Common/UserPreferences.h")
#unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/UserPreferences.cpp", Game.CORE, "GameEngine/Source/Common/UserPreferences.cpp")
+ #unify_file(Game.ZEROHOUR, "Libraries/Include/Lib/BaseType.h", Game.CORE, "Libraries/Include/Lib/BaseType.h")
+ #unify_file(Game.ZEROHOUR, "Libraries/Include/Lib/trig.h", Game.CORE, "Libraries/Include/Lib/trig.h")
+
return
From 8fd7226419e37b6a7efeac05510430d4da2ccd39 Mon Sep 17 00:00:00 2001
From: xezon <4720891+xezon@users.noreply.github.com>
Date: Sun, 25 Jan 2026 11:27:47 +0100
Subject: [PATCH 2/2] unify(common): Move common system files to Core needed
for ParticleEditor (#2185)
---
Core/GameEngine/CMakeLists.txt | 28 +-
.../GameEngine/Include/Common/Errors.h | 0
.../GameEngine/Include/Common/GameCommon.h | 0
.../GameEngine/Include/Common/GameType.h | 0
.../GameEngine/Include/Common/INI.h | 0
.../GameEngine/Include/Common/STLTypedefs.h | 0
.../GameEngine/Include/Common/Snapshot.h | 0
.../Include/Common/SubsystemInterface.h | 0
.../Include/GameClient/ChallengeGenerals.h | 0
.../GameEngine/Source/Common/INI/INI.cpp | 0
.../Source/Common/System/GameCommon.cpp | 0
.../Source/Common/System/GameType.cpp | 0
.../Source/Common/System/Snapshot.cpp | 0
.../Common/System/SubsystemInterface.cpp | 0
.../GameClient/GUI/ChallengeGenerals.cpp | 0
Generals/Code/GameEngine/CMakeLists.txt | 28 +-
.../Code/GameEngine/Include/Common/Errors.h | 67 -
.../GameEngine/Include/Common/GameCommon.h | 505 -----
.../Code/GameEngine/Include/Common/GameType.h | 191 --
Generals/Code/GameEngine/Include/Common/INI.h | 415 ----
.../GameEngine/Include/Common/STLTypedefs.h | 297 ---
.../Code/GameEngine/Include/Common/Snapshot.h | 67 -
.../Include/Common/SubsystemInterface.h | 168 --
.../GameEngine/Include/Common/ThingSort.h | 2 +-
.../Include/GameClient/ChallengeGenerals.h | 155 --
.../Code/GameEngine/Source/Common/INI/INI.cpp | 2000 -----------------
.../Source/Common/System/GameCommon.cpp | 69 -
.../Source/Common/System/GameType.cpp | 48 -
.../Source/Common/System/Snapshot.cpp | 56 -
.../Common/System/SubsystemInterface.cpp | 236 --
GeneralsMD/Code/GameEngine/CMakeLists.txt | 28 +-
.../GameEngine/Include/Common/ThingSort.h | 2 +-
.../GameClient/GUI/ChallengeGenerals.cpp | 160 --
scripts/cpp/unify_move_files.py | 14 +
34 files changed, 58 insertions(+), 4478 deletions(-)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Errors.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/GameCommon.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/GameType.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/INI.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/STLTypedefs.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Snapshot.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/SubsystemInterface.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/ChallengeGenerals.h (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/INI/INI.cpp (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/GameCommon.cpp (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/GameType.cpp (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/Snapshot.cpp (100%)
rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/SubsystemInterface.cpp (100%)
rename {Generals/Code => Core}/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp (100%)
delete mode 100644 Generals/Code/GameEngine/Include/Common/Errors.h
delete mode 100644 Generals/Code/GameEngine/Include/Common/GameCommon.h
delete mode 100644 Generals/Code/GameEngine/Include/Common/GameType.h
delete mode 100644 Generals/Code/GameEngine/Include/Common/INI.h
delete mode 100644 Generals/Code/GameEngine/Include/Common/STLTypedefs.h
delete mode 100644 Generals/Code/GameEngine/Include/Common/Snapshot.h
delete mode 100644 Generals/Code/GameEngine/Include/Common/SubsystemInterface.h
delete mode 100644 Generals/Code/GameEngine/Include/GameClient/ChallengeGenerals.h
delete mode 100644 Generals/Code/GameEngine/Source/Common/INI/INI.cpp
delete mode 100644 Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp
delete mode 100644 Generals/Code/GameEngine/Source/Common/System/GameType.cpp
delete mode 100644 Generals/Code/GameEngine/Source/Common/System/Snapshot.cpp
delete mode 100644 Generals/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp
delete mode 100644 GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp
diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index 13fa1158a01..50636fc397f 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -37,14 +37,14 @@ set(GAMEENGINE_SRC
Include/Common/DynamicAudioEventInfo.h
# Include/Common/encrypt.h
# Include/Common/Energy.h
-# Include/Common/Errors.h
+ Include/Common/Errors.h
Include/Common/file.h
Include/Common/FileSystem.h
Include/Common/FramePacer.h
Include/Common/FrameRateLimit.h
# Include/Common/FunctionLexicon.h
Include/Common/GameAudio.h
-# Include/Common/GameCommon.h
+ Include/Common/GameCommon.h
Include/Common/GameDefines.h
# Include/Common/GameEngine.h
# Include/Common/GameLOD.h
@@ -54,13 +54,13 @@ set(GAMEENGINE_SRC
# Include/Common/GameSpyMiscPreferences.h
# Include/Common/GameState.h
# Include/Common/GameStateMap.h
-# Include/Common/GameType.h
+ Include/Common/GameType.h
Include/Common/GameUtility.h
# Include/Common/Geometry.h
# Include/Common/GlobalData.h
# Include/Common/Handicap.h
# Include/Common/IgnorePreferences.h
-# Include/Common/INI.h
+ Include/Common/INI.h
# Include/Common/INIException.h
# Include/Common/KindOf.h
# Include/Common/LadderPreferences.h
@@ -108,7 +108,7 @@ set(GAMEENGINE_SRC
#Include/Common/simpleplayer.h # unused
# Include/Common/SkirmishBattleHonors.h
# Include/Common/SkirmishPreferences.h
-# Include/Common/Snapshot.h
+ Include/Common/Snapshot.h
# Include/Common/SparseMatchFinder.h
# Include/Common/SpecialPower.h
# Include/Common/SpecialPowerMaskType.h
@@ -116,9 +116,9 @@ set(GAMEENGINE_SRC
# Include/Common/StackDump.h
# Include/Common/StateMachine.h
# Include/Common/StatsCollector.h
-# Include/Common/STLTypedefs.h
+ Include/Common/STLTypedefs.h
Include/Common/StreamingArchiveFile.h
-# Include/Common/SubsystemInterface.h
+ Include/Common/SubsystemInterface.h
# Include/Common/SystemInfo.h
# Include/Common/Team.h
# Include/Common/Terrain.h
@@ -145,7 +145,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/AnimateWindowManager.h
# Include/GameClient/CampaignManager.h
# Include/GameClient/CDCheck.h
-# Include/GameClient/ChallengeGenerals.h
+ Include/GameClient/ChallengeGenerals.h
# Include/GameClient/ClientInstance.h
Include/GameClient/ClientRandomValue.h
# Include/GameClient/Color.h
@@ -582,7 +582,7 @@ set(GAMEENGINE_SRC
# Source/Common/GameMain.cpp
Source/Common/GameUtility.cpp
# Source/Common/GlobalData.cpp
-# Source/Common/INI/INI.cpp
+ Source/Common/INI/INI.cpp
# Source/Common/INI/INIAiData.cpp
# Source/Common/INI/INIAnimation.cpp
Source/Common/INI/INIAudioEventInfo.cpp
@@ -653,10 +653,10 @@ set(GAMEENGINE_SRC
Source/Common/System/File.cpp
Source/Common/System/FileSystem.cpp
# Source/Common/System/FunctionLexicon.cpp
-# Source/Common/System/GameCommon.cpp
+ Source/Common/System/GameCommon.cpp
#Source/Common/System/GameMemory.cpp # is conditionally appended
#Source/Common/System/GameMemoryInit.cpp # is conditionally appended
-# Source/Common/System/GameType.cpp
+ Source/Common/System/GameType.cpp
# Source/Common/System/Geometry.cpp
# Source/Common/System/KindOf.cpp
# Source/Common/System/List.cpp
@@ -670,10 +670,10 @@ set(GAMEENGINE_SRC
# Source/Common/System/registry.cpp
# Source/Common/System/SaveGame/GameState.cpp
# Source/Common/System/SaveGame/GameStateMap.cpp
-# Source/Common/System/Snapshot.cpp
+ Source/Common/System/Snapshot.cpp
# Source/Common/System/StackDump.cpp
Source/Common/System/StreamingArchiveFile.cpp
-# Source/Common/System/SubsystemInterface.cpp
+ Source/Common/System/SubsystemInterface.cpp
# Source/Common/System/Trig.cpp
Source/Common/System/UnicodeString.cpp
# Source/Common/System/Upgrade.cpp
@@ -710,7 +710,7 @@ set(GAMEENGINE_SRC
# Source/GameClient/GlobalLanguage.cpp
# Source/GameClient/GraphDraw.cpp
# Source/GameClient/GUI/AnimateWindowManager.cpp
-# Source/GameClient/GUI/ChallengeGenerals.cpp
+ Source/GameClient/GUI/ChallengeGenerals.cpp
# Source/GameClient/GUI/ControlBar/ControlBar.cpp
# Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp
# Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Errors.h b/Core/GameEngine/Include/Common/Errors.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/Errors.h
rename to Core/GameEngine/Include/Common/Errors.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h b/Core/GameEngine/Include/Common/GameCommon.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h
rename to Core/GameEngine/Include/Common/GameCommon.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameType.h b/Core/GameEngine/Include/Common/GameType.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/GameType.h
rename to Core/GameEngine/Include/Common/GameType.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/INI.h b/Core/GameEngine/Include/Common/INI.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/INI.h
rename to Core/GameEngine/Include/Common/INI.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/STLTypedefs.h b/Core/GameEngine/Include/Common/STLTypedefs.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/STLTypedefs.h
rename to Core/GameEngine/Include/Common/STLTypedefs.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Snapshot.h b/Core/GameEngine/Include/Common/Snapshot.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/Snapshot.h
rename to Core/GameEngine/Include/Common/Snapshot.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/SubsystemInterface.h b/Core/GameEngine/Include/Common/SubsystemInterface.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/Common/SubsystemInterface.h
rename to Core/GameEngine/Include/Common/SubsystemInterface.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ChallengeGenerals.h b/Core/GameEngine/Include/GameClient/ChallengeGenerals.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/ChallengeGenerals.h
rename to Core/GameEngine/Include/GameClient/ChallengeGenerals.h
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp b/Core/GameEngine/Source/Common/INI/INI.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp
rename to Core/GameEngine/Source/Common/INI/INI.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameCommon.cpp b/Core/GameEngine/Source/Common/System/GameCommon.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/Common/System/GameCommon.cpp
rename to Core/GameEngine/Source/Common/System/GameCommon.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameType.cpp b/Core/GameEngine/Source/Common/System/GameType.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/Common/System/GameType.cpp
rename to Core/GameEngine/Source/Common/System/GameType.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Snapshot.cpp b/Core/GameEngine/Source/Common/System/Snapshot.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/Common/System/Snapshot.cpp
rename to Core/GameEngine/Source/Common/System/Snapshot.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp b/Core/GameEngine/Source/Common/System/SubsystemInterface.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp
rename to Core/GameEngine/Source/Common/System/SubsystemInterface.cpp
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp b/Core/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp
similarity index 100%
rename from Generals/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp
diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt
index f4ef0c45917..217d7dcecba 100644
--- a/Generals/Code/GameEngine/CMakeLists.txt
+++ b/Generals/Code/GameEngine/CMakeLists.txt
@@ -33,12 +33,12 @@ set(GAMEENGINE_SRC
Include/Common/DrawModule.h
Include/Common/encrypt.h
Include/Common/Energy.h
- Include/Common/Errors.h
+# Include/Common/Errors.h
# Include/Common/file.h
# Include/Common/FileSystem.h
Include/Common/FunctionLexicon.h
# Include/Common/GameAudio.h
- Include/Common/GameCommon.h
+# Include/Common/GameCommon.h
# Include/Common/GameDefines.h
Include/Common/GameEngine.h
Include/Common/GameLOD.h
@@ -48,12 +48,12 @@ set(GAMEENGINE_SRC
Include/Common/GameSpyMiscPreferences.h
Include/Common/GameState.h
Include/Common/GameStateMap.h
- Include/Common/GameType.h
+# Include/Common/GameType.h
Include/Common/Geometry.h
Include/Common/GlobalData.h
Include/Common/Handicap.h
Include/Common/IgnorePreferences.h
- Include/Common/INI.h
+# Include/Common/INI.h
Include/Common/INIException.h
Include/Common/KindOf.h
Include/Common/LadderPreferences.h
@@ -98,7 +98,7 @@ set(GAMEENGINE_SRC
Include/Common/ScoreKeeper.h
Include/Common/SkirmishBattleHonors.h
Include/Common/SkirmishPreferences.h
- Include/Common/Snapshot.h
+# Include/Common/Snapshot.h
Include/Common/SparseMatchFinder.h
Include/Common/SpecialPower.h
Include/Common/SpecialPowerMaskType.h
@@ -106,9 +106,9 @@ set(GAMEENGINE_SRC
Include/Common/StackDump.h
Include/Common/StateMachine.h
Include/Common/StatsCollector.h
- Include/Common/STLTypedefs.h
+# Include/Common/STLTypedefs.h
# Include/Common/StreamingArchiveFile.h
- Include/Common/SubsystemInterface.h
+# Include/Common/SubsystemInterface.h
Include/Common/SystemInfo.h
Include/Common/Team.h
Include/Common/Terrain.h
@@ -132,7 +132,7 @@ set(GAMEENGINE_SRC
# Include/Common/XferSave.h
Include/GameClient/Anim2D.h
Include/GameClient/AnimateWindowManager.h
- Include/GameClient/ChallengeGenerals.h
+# Include/GameClient/ChallengeGenerals.h
Include/GameClient/CampaignManager.h
Include/GameClient/CDCheck.h
Include/GameClient/ClientInstance.h
@@ -533,7 +533,7 @@ set(GAMEENGINE_SRC
Source/Common/GameLOD.cpp
Source/Common/GameMain.cpp
Source/Common/GlobalData.cpp
- Source/Common/INI/INI.cpp
+# Source/Common/INI/INI.cpp
Source/Common/INI/INIAiData.cpp
Source/Common/INI/INIAnimation.cpp
# Source/Common/INI/INIAudioEventInfo.cpp
@@ -602,9 +602,9 @@ set(GAMEENGINE_SRC
# Source/Common/System/File.cpp
# Source/Common/System/FileSystem.cpp
Source/Common/System/FunctionLexicon.cpp
- Source/Common/System/GameCommon.cpp
+# Source/Common/System/GameCommon.cpp
#Source/Common/System/GameMemory.cpp
- Source/Common/System/GameType.cpp
+# Source/Common/System/GameType.cpp
Source/Common/System/Geometry.cpp
Source/Common/System/KindOf.cpp
Source/Common/System/List.cpp
@@ -618,10 +618,10 @@ set(GAMEENGINE_SRC
Source/Common/System/registry.cpp
Source/Common/System/SaveGame/GameState.cpp
Source/Common/System/SaveGame/GameStateMap.cpp
- Source/Common/System/Snapshot.cpp
+# Source/Common/System/Snapshot.cpp
Source/Common/System/StackDump.cpp
# Source/Common/System/StreamingArchiveFile.cpp
- Source/Common/System/SubsystemInterface.cpp
+# Source/Common/System/SubsystemInterface.cpp
Source/Common/System/Trig.cpp
# Source/Common/System/UnicodeString.cpp
Source/Common/System/Upgrade.cpp
@@ -658,7 +658,7 @@ set(GAMEENGINE_SRC
Source/GameClient/GlobalLanguage.cpp
Source/GameClient/GraphDraw.cpp
Source/GameClient/GUI/AnimateWindowManager.cpp
- Source/GameClient/GUI/ChallengeGenerals.cpp
+# Source/GameClient/GUI/ChallengeGenerals.cpp
Source/GameClient/GUI/ControlBar/ControlBar.cpp
Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp
Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
diff --git a/Generals/Code/GameEngine/Include/Common/Errors.h b/Generals/Code/GameEngine/Include/Common/Errors.h
deleted file mode 100644
index 2c2cec27c6c..00000000000
--- a/Generals/Code/GameEngine/Include/Common/Errors.h
+++ /dev/null
@@ -1,67 +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: Errors.h
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: Errors.h
-//
-// Created: Steven Johnson, August 2001
-//
-// Desc: Error codes
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-/**
- An ErrorCode is the repository for failure modes. In almost all situations,
- these values will be THROWN, not returned as error codes. Feel free
- to add to this list as necessary; however, there should generally be very
- few codes needed.
-*/
-enum ErrorCode CPP_11(: UnsignedInt)
-{
- ERROR_BASE = 0xdead0001, // a nice, distinctive value
-
- ERROR_BUG = (ERROR_BASE + 0x0000), ///< should not be possible under normal operation
- ERROR_OUT_OF_MEMORY = (ERROR_BASE + 0x0001), ///< unable to allocate memory.
- ERROR_BAD_ARG = (ERROR_BASE + 0x0002), ///< generic "bad argument".
- ERROR_INVALID_FILE_VERSION = (ERROR_BASE + 0x0003), ///< Unrecognized file version.
- ERROR_CORRUPT_FILE_FORMAT = (ERROR_BASE + 0x0004), ///< Invalid file format.
- ERROR_BAD_INI = (ERROR_BASE + 0x0005), ///< Bad INI data.
- ERROR_INVALID_D3D = (ERROR_BASE + 0x0006), ///< Error initing D3D
-
- ERROR_LAST
-};
diff --git a/Generals/Code/GameEngine/Include/Common/GameCommon.h b/Generals/Code/GameEngine/Include/Common/GameCommon.h
deleted file mode 100644
index 34e26d9b065..00000000000
--- a/Generals/Code/GameEngine/Include/Common/GameCommon.h
+++ /dev/null
@@ -1,505 +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: GameCommon.h ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GameCommon.h
-//
-// Created: Steven Johnson, October 2001
-//
-// Desc: This is a catchall header for some basic types and definitions
-// needed by various bits of the GameLogic/GameClient, but that
-// we haven't found a good place for yet. Hopefully this file
-// should go away someday, but for now is a convenient spot.
-//
-//-----------------------------------------------------------------------------
-
-#pragma once
-
-#define DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE ///< Take of the DONT to get cheats back in to release
-
-//#define _CAMPEA_DEMO
-
-// ----------------------------------------------------------------------------------------------
-#include "Lib/BaseType.h"
-#include "WWCommon.h"
-#include "Common/GameDefines.h"
-
-// ----------------------------------------------------------------------------------------------
-#if defined(RTS_DEBUG)
- #define DUMP_PERF_STATS
-#else
- #define NO_DUMP_PERF_STATS
-#endif
-
-// ----------------------------------------------------------------------------------------------
-enum
-{
- BaseFps = 30, // The historic base frame rate for this game. This value must never change.
- LOGICFRAMES_PER_SECOND = WWSyncPerSecond,
- MSEC_PER_SECOND = 1000
-};
-const Real LOGICFRAMES_PER_MSEC_REAL = (((Real)LOGICFRAMES_PER_SECOND) / ((Real)MSEC_PER_SECOND));
-const Real MSEC_PER_LOGICFRAME_REAL = (((Real)MSEC_PER_SECOND) / ((Real)LOGICFRAMES_PER_SECOND));
-const Real LOGICFRAMES_PER_SECONDS_REAL = (Real)LOGICFRAMES_PER_SECOND;
-const Real SECONDS_PER_LOGICFRAME_REAL = 1.0f / LOGICFRAMES_PER_SECONDS_REAL;
-
-// ----------------------------------------------------------------------------------------------
-// note that this returns a REAL value, not an int... most callers will want to
-// call ceil() on the result, so that partial frames get converted to full frames!
-inline Real ConvertDurationFromMsecsToFrames(Real msec)
-{
- return (msec * LOGICFRAMES_PER_MSEC_REAL);
-}
-
-// ----------------------------------------------------------------------------------------------
-inline Real ConvertVelocityInSecsToFrames(Real distPerMsec)
-{
- // this looks wrong, but is the correct conversion factor.
- return (distPerMsec * SECONDS_PER_LOGICFRAME_REAL);
-}
-
-// ----------------------------------------------------------------------------------------------
-inline Real ConvertAccelerationInSecsToFrames(Real distPerSec2)
-{
- // this looks wrong, but is the correct conversion factor.
- const Real SEC_PER_LOGICFRAME_SQR = (SECONDS_PER_LOGICFRAME_REAL * SECONDS_PER_LOGICFRAME_REAL);
- return (distPerSec2 * SEC_PER_LOGICFRAME_SQR);
-}
-
-// ----------------------------------------------------------------------------------------------
-inline Real ConvertAngularVelocityInDegreesPerSecToRadsPerFrame(Real degPerSec)
-{
- const Real RADS_PER_DEGREE = PI / 180.0f;
- return (degPerSec * (SECONDS_PER_LOGICFRAME_REAL * RADS_PER_DEGREE));
-}
-
-// ----------------------------------------------------------------------------------------------
-enum
-{
- MAX_PLAYER_COUNT = 16 ///< max number of Players.
-};
-
-// ----------------------------------------------------------------------------------------------
-/**
- a bitmask that can uniquely represent each player.
-*/
-#if MAX_PLAYER_COUNT <= 16
- typedef UnsignedShort PlayerMaskType;
- const PlayerMaskType PLAYERMASK_ALL = 0xffff;
- const PlayerMaskType PLAYERMASK_NONE = 0x0;
-#else
- #error "this is the wrong size"
-#endif
-
-// ----------------------------------------------------------------------------------------------
-enum
-{
- MAX_GLOBAL_GENERAL_TYPES = 9, ///< number of playable General Types, not including the boss)
-
- /// The start of the playable global generals playertemplates
- GLOBAL_GENERAL_BEGIN = 5,
-
- /// The end of the playable global generals
- GLOBAL_GENERAL_END = (GLOBAL_GENERAL_BEGIN + MAX_GLOBAL_GENERAL_TYPES - 1)
-};
-
-//-------------------------------------------------------------------------------------------------
-enum GameDifficulty CPP_11(: Int)
-{
- DIFFICULTY_EASY,
- DIFFICULTY_NORMAL,
- DIFFICULTY_HARD,
-
- DIFFICULTY_COUNT
-};
-
-//-------------------------------------------------------------------------------------------------
-enum PlayerType CPP_11(: Int)
-{
- PLAYER_HUMAN, ///< player is human-controlled
- PLAYER_COMPUTER, ///< player is computer-controlled
-
- PLAYERTYPE_COUNT
-};
-
-//-------------------------------------------------------------------------------------------------
-/// A PartitionCell can be one of three states for Shroud
-enum CellShroudStatus CPP_11(: Int)
-{
- CELLSHROUD_CLEAR,
- CELLSHROUD_FOGGED,
- CELLSHROUD_SHROUDED,
-};
-
-//-------------------------------------------------------------------------------------------------
-/// Since an object can take up more than a single PartitionCell, this is a status that applies to the whole Object
-enum ObjectShroudStatus CPP_11(: Int)
-{
- OBJECTSHROUD_INVALID, ///< indeterminate state, will recompute
- OBJECTSHROUD_CLEAR, ///< object is not shrouded at all (ie, completely visible)
- OBJECTSHROUD_PARTIAL_CLEAR, ///< object is partly clear (rest is shroud or fog)
- OBJECTSHROUD_FOGGED, ///< object is completely fogged
- OBJECTSHROUD_SHROUDED, ///< object is completely shrouded
- OBJECTSHROUD_INVALID_BUT_PREVIOUS_VALID, ///< indeterminate state, will recompute, BUT previous status is valid, don't reset (used for save/load)
-};
-
-//-------------------------------------------------------------------------------------------------
-enum GuardMode CPP_11(: Int)
-{
- GUARDMODE_NORMAL,
- GUARDMODE_GUARD_WITHOUT_PURSUIT, // no pursuit out of guard area
- GUARDMODE_GUARD_FLYING_UNITS_ONLY // ignore nonflyers
-};
-
-// ---------------------------------------------------
-enum
-{
- NEVER = 0,
- FOREVER = 0x3fffffff // (we use 0x3fffffff so that we can add offsets and not overflow...
- // at 30fps we're still pretty safe!)
-};
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-
-/// Veterancy level define needed by several files that don't need the full Experience code.
-// NOTE NOTE NOTE: Keep TheVeterencyNames in sync with these.
-enum VeterancyLevel CPP_11(: Int)
-{
- LEVEL_REGULAR,
- LEVEL_VETERAN,
- LEVEL_ELITE,
- LEVEL_HEROIC,
-
- LEVEL_COUNT,
- LEVEL_INVALID,
-
- LEVEL_FIRST = 0,
- LEVEL_LAST = LEVEL_HEROIC
-};
-
-// TheVeterancyNames is defined in GameCommon.cpp
-extern const char *const TheVeterancyNames[];
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-enum CommandSourceType CPP_11(: Int)
-{
-
- CMD_FROM_PLAYER = 0,
- CMD_FROM_SCRIPT,
- CMD_FROM_AI,
- CMD_FROM_DOZER, // Special rare command when the dozer originates a command to attack a mine. Mines are not ai-attackable, and it seems deceitful for the dozer to generate a player or script command. jba.
- CMD_DEFAULT_SWITCH_WEAPON, // Special case: A weapon that can be chosen -- this is the default case (machine gun vs flashbang).
-
- COMMAND_SOURCE_TYPE_COUNT
-};
-
-//-------------------------------------------------------------------------------------------------
-enum AbleToAttackType CPP_11(: Int)
-{
- _ATTACK_FORCED = 0x01,
- _ATTACK_CONTINUED = 0x02,
- _ATTACK_TUNNELNETWORK_GUARD = 0x04,
-
- /**
- can we attack if this is a new target?
- */
- ATTACK_NEW_TARGET = (0),
-
- /**
- can we attack if this is a new target, via force-fire?
- (The only current difference between this and ATTACK_NEW_TARGET is that disguised units
- are force-attackable even when stealthed.)
- */
- ATTACK_NEW_TARGET_FORCED= (_ATTACK_FORCED),
-
- /**
- can we attack if this is continuation of an existing attack?
- (The only current difference between this and ATTACK_NEW_TARGET is you are allowed to follow
- immobile shrouded units into the fog)
- */
- ATTACK_CONTINUED_TARGET = (_ATTACK_CONTINUED),
-
- /**
- can we attack if this is continuation of an existing attack?
- (The only current difference between this and ATTACK_NEW_TARGET is you are allowed to follow
- immobile shrouded units into the fog)
- */
- ATTACK_CONTINUED_TARGET_FORCED = (_ATTACK_FORCED | _ATTACK_CONTINUED),
-
- /**
- Special case that bypasses some of the checks for units guarding from within tunnel networks!
- For example, a unit inside couldn't normally see outside and would fail.
- */
- ATTACK_TUNNEL_NETWORK_GUARD = (_ATTACK_TUNNELNETWORK_GUARD)
-
-};
-
-//-------------------------------------------------------------------------------------------------
-inline Bool isForcedAttack(AbleToAttackType t)
-{
- return (((Int)t) & _ATTACK_FORCED) != 0;
-}
-
-//-------------------------------------------------------------------------------------------------
-inline Bool isContinuedAttack(AbleToAttackType t)
-{
- return (((Int)t) & _ATTACK_CONTINUED) != 0;
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-
-typedef UnsignedInt VeterancyLevelFlags;
-
-const VeterancyLevelFlags VETERANCY_LEVEL_FLAGS_ALL = 0xffffffff;
-const VeterancyLevelFlags VETERANCY_LEVEL_FLAGS_NONE = 0x00000000;
-
-inline Bool getVeterancyLevelFlag(VeterancyLevelFlags flags, VeterancyLevel dt)
-{
- return (flags & (1UL << (dt - 1))) != 0;
-}
-
-inline VeterancyLevelFlags setVeterancyLevelFlag(VeterancyLevelFlags flags, VeterancyLevel dt)
-{
- return (flags | (1UL << (dt - 1)));
-}
-
-inline VeterancyLevelFlags clearVeterancyLevelFlag(VeterancyLevelFlags flags, VeterancyLevel dt)
-{
- return (flags & ~(1UL << (dt - 1)));
-}
-
-// ----------------------------------------------------------------------------------------------
-#define BOGUSPTR(p) ((((unsigned int)(p)) & 1) != 0)
-
-// ----------------------------------------------------------------------------------------------
-#define MAKE_DLINK_HEAD(OBJCLASS, LISTNAME) \
-public: \
- inline DLINK_ITERATOR iterate_##LISTNAME() const \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr")); \
- return DLINK_ITERATOR(m_dlinkhead_##LISTNAME.m_head, &OBJCLASS::dlink_next_##LISTNAME); \
- } \
- inline OBJCLASS *getFirstItemIn_##LISTNAME() const \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr")); \
- return m_dlinkhead_##LISTNAME.m_head; \
- } \
- inline Bool isInList_##LISTNAME(OBJCLASS* o) const \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr")); \
- return o->dlink_isInList_##LISTNAME(&m_dlinkhead_##LISTNAME.m_head); \
- } \
- inline void prependTo_##LISTNAME(OBJCLASS* o) \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr")); \
- if (!isInList_##LISTNAME(o)) \
- o->dlink_prependTo_##LISTNAME(&m_dlinkhead_##LISTNAME.m_head); \
- } \
- inline void removeFrom_##LISTNAME(OBJCLASS* o) \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr")); \
- if (isInList_##LISTNAME(o)) \
- o->dlink_removeFrom_##LISTNAME(&m_dlinkhead_##LISTNAME.m_head); \
- } \
- typedef void (*RemoveAllProc_##LISTNAME)(OBJCLASS* o); \
- inline void removeAll_##LISTNAME(RemoveAllProc_##LISTNAME p = nullptr) \
- { \
- while (m_dlinkhead_##LISTNAME.m_head) \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr"));\
- OBJCLASS *tmp = m_dlinkhead_##LISTNAME.m_head; \
- removeFrom_##LISTNAME(tmp); \
- if (p) (*p)(tmp); \
- } \
- } \
- inline void reverse_##LISTNAME() \
- { \
- OBJCLASS* cur = m_dlinkhead_##LISTNAME.m_head; \
- OBJCLASS* prev = nullptr; \
- while (cur) \
- { \
- OBJCLASS* originalNext = cur->dlink_next_##LISTNAME(); \
- cur->dlink_swapLinks_##LISTNAME(); \
- prev = cur; \
- cur = originalNext; \
- } \
- m_dlinkhead_##LISTNAME.m_head = prev; \
- } \
-private: \
- /* a trick: init head to zero */ \
- struct DLINKHEAD_##LISTNAME \
- { \
- public: \
- OBJCLASS* m_head; \
- inline DLINKHEAD_##LISTNAME() : \
- m_head(0) { } \
- inline ~DLINKHEAD_##LISTNAME() \
- { DEBUG_ASSERTCRASH(!m_head,("destroying dlinkhead still in a list " #LISTNAME)); } \
- }; \
- DLINKHEAD_##LISTNAME m_dlinkhead_##LISTNAME;
-
-// ----------------------------------------------------------------------------------------------
-#define MAKE_DLINK(OBJCLASS, LISTNAME) \
-public: \
- OBJCLASS* dlink_prev_##LISTNAME() const { return m_dlink_##LISTNAME.m_prev; } \
- OBJCLASS* dlink_next_##LISTNAME() const { return m_dlink_##LISTNAME.m_next; } \
- void dlink_swapLinks_##LISTNAME() \
- { \
- OBJCLASS* originalNext = m_dlink_##LISTNAME.m_next; \
- m_dlink_##LISTNAME.m_next = m_dlink_##LISTNAME.m_prev; \
- m_dlink_##LISTNAME.m_prev = originalNext; \
- } \
- Bool dlink_isInList_##LISTNAME(OBJCLASS* const* pListHead) const \
- { \
- DEBUG_ASSERTCRASH(!BOGUSPTR(*pListHead) && !BOGUSPTR(m_dlink_##LISTNAME.m_next) && !BOGUSPTR(m_dlink_##LISTNAME.m_prev), ("bogus ptrs")); \
- return *pListHead == this || m_dlink_##LISTNAME.m_prev || m_dlink_##LISTNAME.m_next; \
- } \
- void dlink_prependTo_##LISTNAME(OBJCLASS** pListHead) \
- { \
- DEBUG_ASSERTCRASH(!dlink_isInList_##LISTNAME(pListHead), ("already in list " #LISTNAME)); \
- DEBUG_ASSERTCRASH(!BOGUSPTR(*pListHead) && !BOGUSPTR(m_dlink_##LISTNAME.m_next) && !BOGUSPTR(m_dlink_##LISTNAME.m_prev), ("bogus ptrs")); \
- m_dlink_##LISTNAME.m_next = *pListHead; \
- if (*pListHead) \
- (*pListHead)->m_dlink_##LISTNAME.m_prev = this; \
- *pListHead = this; \
- DEBUG_ASSERTCRASH(!BOGUSPTR(*pListHead) && !BOGUSPTR(m_dlink_##LISTNAME.m_next) && !BOGUSPTR(m_dlink_##LISTNAME.m_prev), ("bogus ptrs")); \
- } \
- void dlink_removeFrom_##LISTNAME(OBJCLASS** pListHead) \
- { \
- DEBUG_ASSERTCRASH(dlink_isInList_##LISTNAME(pListHead), ("not in list" #LISTNAME)); \
- DEBUG_ASSERTCRASH(!BOGUSPTR(*pListHead) && !BOGUSPTR(m_dlink_##LISTNAME.m_next) && !BOGUSPTR(m_dlink_##LISTNAME.m_prev), ("bogus ptrs")); \
- if (m_dlink_##LISTNAME.m_next) \
- m_dlink_##LISTNAME.m_next->m_dlink_##LISTNAME.m_prev = m_dlink_##LISTNAME.m_prev; \
- if (m_dlink_##LISTNAME.m_prev) \
- m_dlink_##LISTNAME.m_prev->m_dlink_##LISTNAME.m_next = m_dlink_##LISTNAME.m_next; \
- else \
- *pListHead = m_dlink_##LISTNAME.m_next; \
- m_dlink_##LISTNAME.m_prev = 0; \
- m_dlink_##LISTNAME.m_next = 0; \
- DEBUG_ASSERTCRASH(!BOGUSPTR(*pListHead) && !BOGUSPTR(m_dlink_##LISTNAME.m_next) && !BOGUSPTR(m_dlink_##LISTNAME.m_prev), ("bogus ptrs")); \
- } \
-private: \
- /* a trick: init links to zero */ \
- struct DLINK_##LISTNAME \
- { \
- public: \
- OBJCLASS* m_prev; \
- OBJCLASS* m_next; \
- inline DLINK_##LISTNAME() : \
- m_prev(0), m_next(0) { } \
- inline ~DLINK_##LISTNAME() \
- { DEBUG_ASSERTCRASH(!m_prev && !m_next,("destroying dlink still in a list " #LISTNAME)); } \
- }; \
- DLINK_##LISTNAME m_dlink_##LISTNAME;
-
-// ------------------------------------------------------------------------
-// this is the weird C++ syntax for "call pointer-to-member-function"... see C++ FAQ LITE for details.
-#define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember))
-
-// ------------------------------------------------------------------------
-template
-class DLINK_ITERATOR
-{
-public:
- // this is the weird C++ syntax for "pointer-to-member-function"
- typedef OBJCLASS* (OBJCLASS::*GetNextFunc)() const;
-private:
- OBJCLASS* m_cur;
- GetNextFunc m_getNextFunc; // this is the weird C++ syntax for "pointer-to-member-function"
-public:
- DLINK_ITERATOR(OBJCLASS* cur, GetNextFunc getNextFunc) : m_cur(cur), m_getNextFunc(getNextFunc)
- {
- }
-
- void advance()
- {
- if (m_cur)
- m_cur = callMemberFunction(*m_cur, m_getNextFunc)();
- }
-
- Bool done() const
- {
- return m_cur == nullptr;
- }
-
- OBJCLASS* cur() const
- {
- return m_cur;
- }
-
-};
-
-// ------------------------------------------------------------------------
-
-enum WhichTurretType CPP_11(: Int)
-{
- TURRET_INVALID = -1,
-
- TURRET_MAIN = 0,
- TURRET_ALT,
-
- MAX_TURRETS
-};
-
-// ------------------------------------------------------------------------
-// this normalizes an angle to the range -PI...PI.
-// TheSuperHackers @todo DO NOT USE THIS FUNCTION! Use WWMath::Normalize_Angle instead. Delete this.
-extern Real normalizeAngle(Real angle);
-
-// ------------------------------------------------------------------------
-// this returns the difference between a1 and a2, normalized.
-inline Real stdAngleDiff(Real a1, Real a2)
-{
- return normalizeAngle(a1 - a2);
-}
-
-// ------------------------------------------------------------------------
-// NOTE NOTE NOTE: Keep TheRelationShipNames in sync with this enum
-enum Relationship CPP_11(: Int)
-{
- ENEMIES,
- NEUTRAL,
- ALLIES,
-
- RELATIONSHIP_COUNT
-};
-
-
-// TheRelationShipNames is defined in Common/GameCommon.cpp
-extern const char *const TheRelationshipNames[];
diff --git a/Generals/Code/GameEngine/Include/Common/GameType.h b/Generals/Code/GameEngine/Include/Common/GameType.h
deleted file mode 100644
index c28b9e04fbd..00000000000
--- a/Generals/Code/GameEngine/Include/Common/GameType.h
+++ /dev/null
@@ -1,191 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// GameType.h
-// Basic data types needed for the game engine. This is an extension of BaseType.h.
-// Author: Michael S. Booth, April 2001
-
-#pragma once
-
-#include "Lib/BaseType.h"
-
-// the default size of the world map
-#define DEFAULT_WORLD_WIDTH 64
-#define DEFAULT_WORLD_HEIGHT 64
-
-/// A unique, generic "identifier" used to access Objects.
-enum ObjectID CPP_11(: Int)
-{
- INVALID_ID = 0,
- FORCE_OBJECTID_TO_LONG_SIZE = 0x7ffffff
-};
-
-/// A unique, generic "identifier" used to access Drawables.
-enum DrawableID CPP_11(: Int)
-{
- INVALID_DRAWABLE_ID = 0,
- FORCE_DRAWABLEID_TO_LONG_SIZE = 0x7ffffff
-};
-
-/// A unique, generic "identifier" used to identify player specified formations.
-enum FormationID CPP_11(: Int)
-{
- NO_FORMATION_ID = 0, // Unit is not a member of any formation
- FORCE_FORMATIONID_TO_LONG_SIZE = 0x7ffffff
-};
-
-#define INVALID_ANGLE -100.0f
-
-class INI;
-
-//-------------------------------------------------------------------------------------------------
-/** The time of day enumeration, keep in sync with TimeOfDayNames[] */
-//-------------------------------------------------------------------------------------------------
-enum TimeOfDay CPP_11(: Int)
-{
- TIME_OF_DAY_INVALID,
-
- TIME_OF_DAY_MORNING,
- TIME_OF_DAY_AFTERNOON,
- TIME_OF_DAY_EVENING,
- TIME_OF_DAY_NIGHT,
-
- TIME_OF_DAY_COUNT,
- TIME_OF_DAY_FIRST = TIME_OF_DAY_MORNING,
-};
-
-extern const char *const TimeOfDayNames[];
-// defined in Common/GameType.cpp
-
-//-------------------------------------------------------------------------------------------------
-enum Weather CPP_11(: Int)
-{
- WEATHER_NORMAL = 0,
- WEATHER_SNOWY = 1,
-
- WEATHER_COUNT
-};
-
-extern const char *const WeatherNames[];
-
-enum Scorches CPP_11(: Int)
-{
- SCORCH_1 = 0,
- SCORCH_2 = 1,
- SCORCH_3 = 2,
- SCORCH_4 = 3,
- SHADOW_SCORCH = 4,
-/* SCORCH_6 = 5,
- SCORCH_7 = 6,
- SCORCH_8 = 7,
-
- CRATER_1 = 8,
- CRATER_2 = 9,
- CRATER_3 = 10,
- CRATER_4 = 11,
- CRATER_5 = 12,
- CRATER_6 = 13,
- CRATER_7 = 14,
- CRATER_8 = 15,
-
-
- MISC_DECAL_1 = 16,
- MISC_DECAL_2 = 17,
- MISC_DECAL_3 = 18,
- MISC_DECAL_4 = 19,
- MISC_DECAL_5 = 20,
- MISC_DECAL_6 = 21,
- MISC_DECAL_7 = 22,
- MISC_DECAL_8 = 23,
-
- MISC_DECAL_9 = 24,
- MISC_DECAL_10 = 25,
- MISC_DECAL_11 = 26,
- MISC_DECAL_12 = 27,
- MISC_DECAL_13 = 28,
- MISC_DECAL_14 = 29,
- MISC_DECAL_15 = 30,
- MISC_DECAL_16 = 31,
-
- MISC_DECAL_17 = 32,
- MISC_DECAL_18 = 33,
- MISC_DECAL_19 = 34,
- MISC_DECAL_20 = 35,
- MISC_DECAL_21 = 36,
- MISC_DECAL_22 = 37,
- MISC_DECAL_23 = 38,
- MISC_DECAL_24 = 39,
-
- MISC_DECAL_25 = 40,
- MISC_DECAL_26 = 41,
- MISC_DECAL_27 = 42,
- MISC_DECAL_28 = 43,
- MISC_DECAL_29 = 44,
- MISC_DECAL_30 = 45,
- MISC_DECAL_31 = 46,
- MISC_DECAL_32 = 47,
-
- MISC_DECAL_33 = 48,
- MISC_DECAL_34 = 49,
- MISC_DECAL_35 = 50,
- MISC_DECAL_36 = 51,
- MISC_DECAL_37 = 52,
- MISC_DECAL_38 = 53,
- MISC_DECAL_39 = 54,
- MISC_DECAL_40 = 55,
-
- MISC_DECAL_41 = 56,
- MISC_DECAL_42 = 57,
- MISC_DECAL_43 = 58,
- MISC_DECAL_44 = 59,
- MISC_DECAL_45 = 60,
- MISC_DECAL_46 = 61,
- MISC_DECAL_47 = 62,
- MISC_DECAL_48 = 63,
-*/
- SCORCH_COUNT
-};
-
-//-------------------------------------------------------------------------------------------------
-enum WeaponSlotType CPP_11(: Int)
-{
- PRIMARY_WEAPON = 0,
- SECONDARY_WEAPON,
- TERTIARY_WEAPON,
-
- WEAPONSLOT_COUNT
-};
-
-//-------------------------------------------------------------------------------------------------
-// Pathfind layers - ground is the first layer, each bridge is another. jba.
-// Layer 1 is the ground.
-// Layer 2 is the top layer - bridge if one is present, ground otherwise.
-// Layer 2 - LAYER_LAST -1 are bridges.
-// Layer_WALL is a special "wall" layer for letting units run around on top of a wall
-// made of structures.
-// Note that the bridges just index in the pathfinder, so you don't actually
-// have a LAYER_BRIDGE_1 enum value.
-enum PathfindLayerEnum CPP_11(: Int) {LAYER_INVALID = 0, LAYER_GROUND = 1, LAYER_WALL = 15, LAYER_LAST=15};
-
-//-------------------------------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Include/Common/INI.h b/Generals/Code/GameEngine/Include/Common/INI.h
deleted file mode 100644
index f08d157f7dc..00000000000
--- a/Generals/Code/GameEngine/Include/Common/INI.h
+++ /dev/null
@@ -1,415 +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: INI.h ////////////////////////////////////////////////////////////////////////////////////
-// Author: Colin Day, November 2001
-// Desc: INI Reader
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include // for offsetof, which we don't use but everyone who includes us does
-#include "Common/STLTypedefs.h"
-#include "Common/AsciiString.h"
-#include "Common/GameCommon.h"
-
-//-------------------------------------------------------------------------------------------------
-class INI;
-class Xfer;
-class File;
-enum ScienceType CPP_11(: Int);
-
-//-------------------------------------------------------------------------------------------------
-/** These control the behavior of loading the INI data into items */
-//-------------------------------------------------------------------------------------------------
-enum INILoadType CPP_11(: Int)
-{
- INI_LOAD_INVALID, ///< invalid load type
- INI_LOAD_OVERWRITE, ///< create new or load *over* existing data instance
- INI_LOAD_CREATE_OVERRIDES, ///< create new or load into *new* override data instance
- INI_LOAD_MULTIFILE ///< create new or continue loading into existing data instance.
-};
-
-//-------------------------------------------------------------------------------------------------
-/** INI constant defines */
-//-------------------------------------------------------------------------------------------------
-enum
-{
- INI_MAX_CHARS_PER_LINE = 1028, ///< max characters per line entry in any ini file
-};
-
-//-------------------------------------------------------------------------------------------------
-/** Status return codes for the INI reader */
-//-------------------------------------------------------------------------------------------------
-enum
-{
- // we map all of these to the same "real" error code, because
- // we generally don't care why it failed; but since the code distinguishes,
- // I didn't want to wipe out that intelligence. if we ever need to distinguish
- // failure modes at runtime, just put in real values for these.
- INI_CANT_SEARCH_DIR = ERROR_BAD_INI,
- INI_INVALID_DIRECTORY = ERROR_BAD_INI,
- INI_INVALID_PARAMS = ERROR_BAD_INI,
- INI_INVALID_NAME_LIST = ERROR_BAD_INI,
- INI_INVALID_DATA = ERROR_BAD_INI,
- INI_MISSING_END_TOKEN = ERROR_BAD_INI,
- INI_UNKNOWN_TOKEN = ERROR_BAD_INI,
- INI_BUFFER_TOO_SMALL = ERROR_BAD_INI,
- INI_FILE_NOT_OPEN = ERROR_BAD_INI,
- INI_FILE_ALREADY_OPEN = ERROR_BAD_INI,
- INI_CANT_OPEN_FILE = ERROR_BAD_INI,
- INI_UNKNOWN_ERROR = ERROR_BAD_INI,
- INI_END_OF_FILE = ERROR_BAD_INI
-};
-
-//-------------------------------------------------------------------------------------------------
-/** Function typedef for parsing data block fields.
- *
- * buffer - the character buffer of the line from INI that we are reading and parsing
- * instance - instance of what we're loading (for example a ThingTemplate instance)
- * store - where to store the data parsed, this is a field in the *instance* 'instance'
- */
-//-------------------------------------------------------------------------------------------------
-typedef void (*INIFieldParseProc)( INI *ini, void *instance, void *store, const void* userData );
-
-//-------------------------------------------------------------------------------------------------
-typedef const char* const ConstCharPtr;
-typedef ConstCharPtr* ConstCharPtrArray;
-
-//-------------------------------------------------------------------------------------------------
-struct LookupListRec
-{
- const char* name;
- Int value;
-};
-typedef const LookupListRec *ConstLookupListRecArray;
-
-//-------------------------------------------------------------------------------------------------
-/** Parse tables for all fields of each data block are created using these */
-//-------------------------------------------------------------------------------------------------
-struct FieldParse
-{
- const char* token; ///< token of the field
- INIFieldParseProc parse; ///< the parse function
- const void* userData; ///< field-specific data
- Int offset; ///< offset to data field
-
- void set(const char* t, INIFieldParseProc p, const void* u, Int o)
- {
- token = t;
- parse = p;
- userData = u;
- offset = o;
- }
-};
-
-//-------------------------------------------------------------------------------------------------
-class MultiIniFieldParse
-{
-private:
- enum { MAX_MULTI_FIELDS = 16 };
-
- const FieldParse* m_fieldParse[MAX_MULTI_FIELDS];
- UnsignedInt m_extraOffset[MAX_MULTI_FIELDS];
- Int m_count;
-
-public:
- MultiIniFieldParse() : m_count(0)
- {
- for(Int i = 0; i < MAX_MULTI_FIELDS; i++)
- m_extraOffset[i] = 0;
- }
-
- void add(const FieldParse* f, UnsignedInt e = 0);
-
- Int getCount() const { return m_count; }
- const FieldParse* getNthFieldParse(Int i) const { return m_fieldParse[i]; }
- UnsignedInt getNthExtraOffset(Int i) const { return m_extraOffset[i]; }
-};
-
-//-------------------------------------------------------------------------------------------------
-/** Function typedef for parsing INI types blocks */
-//-------------------------------------------------------------------------------------------------
-typedef void (*INIBlockParse)( INI *ini );
-typedef void (*BuildMultiIniFieldProc)(MultiIniFieldParse& p);
-
-//-------------------------------------------------------------------------------------------------
-/** INI Reader interface */
-//-------------------------------------------------------------------------------------------------
-class INI
-{
- INI(const INI&);
- INI& operator=(const INI&);
-
-public:
-
- INI();
- ~INI();
-
- // TheSuperHackers @feature xezon 19/08/2025
- // Load a specific INI file by name and/or INI files from a directory (and its subdirectories).
- // For example "Data\INI\Armor" loads "Data\INI\Armor.ini" and all *.ini files in "Data\INI\Armor".
- // Throws if not a single INI file is found or one is not read correctly.
- UnsignedInt loadFileDirectory( AsciiString fileDirName, INILoadType loadType, Xfer *pXfer, Bool subdirs = TRUE );
-
- // Load INI files from a directory (and its subdirectories).
- // Throws if one INI file is not read correctly.
- UnsignedInt loadDirectory( AsciiString dirName, INILoadType loadType, Xfer *pXfer, Bool subdirs = TRUE );
-
- // Load one specific INI file by name.
- // Throws if the INI file is not found or is not read correctly.
- UnsignedInt load( AsciiString filename, INILoadType loadType, Xfer *pXfer );
-
- static Bool isDeclarationOfType( AsciiString blockType, AsciiString blockName, char *bufferToCheck );
- static Bool isEndOfBlock( char *bufferToCheck );
-
- // data type parsing (the highest level of what type of thing we're parsing)
- static void parseObjectDefinition( INI *ini );
- static void parseObjectReskinDefinition( INI *ini );
- static void parseWeaponTemplateDefinition( INI *ini );
- static void parseScienceDefinition( INI *ini );
- static void parseRankDefinition( INI *ini );
- static void parseCrateTemplateDefinition( INI *ini );
- static void parseLocomotorTemplateDefinition( INI *ini );
- static void parseLanguageDefinition( INI *ini );
- static void parsePlayerTemplateDefinition( INI *ini );
- static void parseGameDataDefinition( INI *ini );
- static void parseMapDataDefinition( INI *ini );
- static void parseAnim2DDefinition( INI *ini );
- static void parseAudioEventDefinition( INI *ini );
- static void parseDialogDefinition( INI *ini );
- static void parseMusicTrackDefinition( INI *ini );
- static void parseWebpageURLDefinition( INI *ini );
- static void parseHeaderTemplateDefinition( INI *ini );
- static void parseParticleSystemDefinition( INI *ini );
- static void parseWaterSettingDefinition( INI *ini );
- static void parseWaterTransparencyDefinition( INI *ini );
- static void parseWeatherDefinition( INI *ini );
- static void parseMappedImageDefinition( INI *ini );
- static void parseArmorDefinition( INI *ini );
- static void parseDamageFXDefinition( INI *ini );
- static void parseDrawGroupNumberDefinition( INI *ini );
- static void parseTerrainDefinition( INI *ini );
- static void parseTerrainRoadDefinition( INI *ini );
- static void parseTerrainBridgeDefinition( INI *ini );
- static void parseMetaMapDefinition( INI *ini );
- static void parseFXListDefinition( INI *ini );
- static void parseObjectCreationListDefinition( INI* ini );
- static void parseMultiplayerSettingsDefinition( INI* ini );
- static void parseMultiplayerColorDefinition( INI* ini );
- static void parseMultiplayerStartingMoneyChoiceDefinition( INI* ini );
- static void parseOnlineChatColorDefinition( INI* ini );
- static void parseMapCacheDefinition( INI* ini );
- static void parseVideoDefinition( INI* ini );
- static void parseCommandButtonDefinition( INI *ini );
- static void parseCommandSetDefinition( INI *ini );
- static void parseUpgradeDefinition( INI *ini );
- static void parseMouseDefinition( INI* ini );
- static void parseMouseCursorDefinition( INI* ini );
- static void parseAIDataDefinition( INI *ini );
- static void parseSpecialPowerDefinition( INI *ini );
- static void parseInGameUIDefinition( INI *ini );
- static void parseControlBarSchemeDefinition( INI *ini );
- static void parseControlBarResizerDefinition( INI *ini );
- static void parseShellMenuSchemeDefinition( INI *ini );
- static void parseCampaignDefinition( INI *ini );
- static void parseAudioSettingsDefinition( INI *ini );
- static void parseMiscAudio( INI *ini );
- static void parseStaticGameLODDefinition( INI *ini);
- static void parseDynamicGameLODDefinition( INI *ini);
- static void parseStaticGameLODLevel( INI* ini, void * , void *store, const void*);
- static void parseDynamicGameLODLevel( INI* ini, void * , void *store, const void*);
- static void parseLODPreset( INI* ini);
- static void parseBenchProfile( INI* ini);
- static void parseEvaEvent( INI* ini );
- static void parseCredits( INI* ini );
- static void parseWindowTransitions( INI* ini );
- static void parseChallengeModeDefinition( INI* ini );
-
- AsciiString getFilename( void ) const { return m_filename; }
- INILoadType getLoadType( void ) const { return m_loadType; }
- UnsignedInt getLineNum( void ) const { return m_lineNum; }
- const char *getSeps( void ) const { return m_seps; }
- const char *getSepsPercent( void ) const { return m_sepsPercent; }
- const char *getSepsColon( void ) const { return m_sepsColon; }
- const char *getSepsQuote( void ) { return m_sepsQuote; }
- Bool isEOF( void ) const { return m_endOfFile; }
-
- void initFromINI( void *what, const FieldParse* parseTable );
- void initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList );
- void initFromINIMultiProc( void *what, BuildMultiIniFieldProc proc );
-
- static void parseUnsignedByte( INI *ini, void *instance, void *store, const void* userData );
- static void parseShort( INI *ini, void *instance, void *store, const void* userData );
- static void parseUnsignedShort( INI *ini, void *instance, void *store, const void* userData );
- static void parseInt( INI *ini, void *instance, void *store, const void* userData );
- static void parseUnsignedInt( INI *ini, void *instance, void *store, const void* userData );
- static void parseReal( INI *ini, void *instance, void *store, const void* userData );
- static void parsePositiveNonZeroReal( INI *ini, void *instance, void *store, const void* userData );
- static void parseBool( INI *ini, void *instance, void *store, const void* userData );
- static void parseBitInInt32( INI *ini, void *instance, void *store, const void* userData );
- static void parseAsciiString( INI *ini, void *instance, void *store, const void* userData );
- static void parseQuotedAsciiString( INI *ini, void *instance, void *store, const void* userData );
- static void parseAsciiStringVector( INI *ini, void *instance, void *store, const void* userData );
- static void parseAsciiStringVectorAppend( INI *ini, void *instance, void *store, const void* userData );
- static void parseAndTranslateLabel( INI *ini, void *instance, void *store, const void* userData );
- static void parseMappedImage( INI *ini, void *instance, void *store, const void *userData );
- static void parseAnim2DTemplate( INI *ini, void *instance, void *store, const void *userData );
- static void parsePercentToReal( INI *ini, void *instance, void *store, const void* userData );
- static void parseRGBColor( INI *ini, void *instance, void *store, const void* userData );
- static void parseRGBAColorInt( INI *ini, void *instance, void *store, const void* userData );
- static void parseColorInt( INI *ini, void *instance, void *store, const void* userData );
- static void parseCoord3D( INI *ini, void *instance, void *store, const void* userData );
- static void parseCoord2D( INI *ini, void *instance, void *store, const void *userData );
- static void parseICoord2D( INI *ini, void *instance, void *store, const void *userData );
- static void parseDynamicAudioEventRTS( INI *ini, void *instance, void *store, const void* userData );
- static void parseAudioEventRTS( INI *ini, void *instance, void *store, const void* userData );
- static void parseFXList( INI *ini, void *instance, void *store, const void* userData );
- static void parseParticleSystemTemplate( INI *ini, void *instance, void *store, const void *userData );
- static void parseObjectCreationList( INI *ini, void *instance, void *store, const void* userData );
- static void parseSpecialPowerTemplate( INI *ini, void *instance, void *store, const void *userData );
- static void parseUpgradeTemplate( INI *ini, void *instance, void *store, const void *userData );
- static void parseScience( INI *ini, void *instance, void *store, const void *userData );
- static void parseScienceVector( INI *ini, void *instance, void *store, const void *userData );
- static void parseGameClientRandomVariable( INI* ini, void *instance, void *store, const void* userData );
- static void parseBitString8( INI *ini, void *instance, void *store, const void* userData );
- static void parseBitString32( INI *ini, void *instance, void *store, const void* userData );
- static void parseByteSizedIndexList( INI *ini, void *instance, void *store, const void* userData );
- static void parseIndexList( INI *ini, void *instance, void *store, const void* userData );
- static void parseLookupList( INI *ini, void *instance, void *store, const void* userData );
- static void parseThingTemplate( INI *ini, void *instance, void *store, const void* userData );
- static void parseArmorTemplate( INI *ini, void *instance, void *store, const void* userData );
- static void parseDamageFX( INI *ini, void *instance, void *store, const void* userData );
- static void parseWeaponTemplate( INI *ini, void *instance, void *store, const void* userData );
- // parse a duration in msec and convert to duration in frames
- static void parseDurationReal( INI *ini, void *instance, void *store, const void* userData );
- // parse a duration in msec and convert to duration in integral number of frames, (unsignedint) rounding UP
- static void parseDurationUnsignedInt( INI *ini, void *instance, void *store, const void* userData );
- static void parseDurationUnsignedShort( INI *ini, void *instance, void *store, const void *userData );
- // parse acceleration in (dist/sec) and convert to (dist/frame)
- static void parseVelocityReal( INI *ini, void *instance, void *store, const void* userData );
- // parse acceleration in (dist/sec^2) and convert to (dist/frame^2)
- static void parseAccelerationReal( INI *ini, void *instance, void *store, const void* userData );
- // parse angle in degrees and convert to radians
- static void parseAngleReal( INI *ini, void *instance, void *store, const void *userData );
- // note that this parses in degrees/sec, and converts to rads/frame!
- static void parseAngularVelocityReal( INI *ini, void *instance, void *store, const void *userData );
- static void parseDamageTypeFlags(INI* ini, void* instance, void* store, const void* userData);
- static void parseDeathTypeFlags(INI* ini, void* instance, void* store, const void* userData);
- static void parseVeterancyLevelFlags(INI* ini, void* instance, void* store, const void* userData);
- static void parseSoundsList( INI* ini, void *instance, void *store, const void* /*userData*/ );
-
-
- /**
- return the next token. if seps is null (or omitted), the standard seps are used.
-
- this will *never* return null; if there are no more tokens, an exception will be thrown.
- */
- const char* getNextToken(const char* seps = nullptr);
-
- /**
- just like getNextToken(), except that null is returned if no more tokens are present
- (rather than throwing an exception). usually you should call getNextToken(),
- but for some cases this is handier (ie, parsing a variable-length number of tokens).
- */
- const char* getNextTokenOrNull(const char* seps = nullptr);
-
- /**
- This is called when the next thing you expect is something like:
-
- Tag:value
-
- pass "Tag" (without the colon) for 'expected', and you will have the 'value'
- token returned.
-
- If "Tag" is not the next token, an error is thrown.
- */
- const char* getNextSubToken(const char* expected);
-
- /**
- return the next ascii string. this is usually the same the result of getNextToken(),
- except that it allows for quote-delimited strings (eg, "foo bar"), so you can
- get strings with spaces, and/or empty strings.
- */
- AsciiString getNextAsciiString();
- AsciiString getNextQuotedAsciiString(); //fixed version of above. We can't fix the regular one for fear of breaking existing code. :-(
-
- /**
- utility routine that does a sscanf() on the string to get the Science, and throws
- an exception if not of the right form.
- */
- static ScienceType scanScience(const char* token);
-
- /**
- utility routine that does a sscanf() on the string to get the int, and throws
- an exception if not of the right form.
- */
- static Int scanInt(const char* token);
-
- /**
- utility routine that does a sscanf() on the string to get the unsigned int, and throws
- an exception if not of the right form.
- */
- static UnsignedInt scanUnsignedInt(const char* token);
-
- /**
- utility routine that does a sscanf() on the string to get the real, and throws
- an exception if not of the right form.
- */
- static Real scanReal(const char* token);
- static Real scanPercentToReal(const char* token);
-
- static Int scanIndexList(const char* token, ConstCharPtrArray nameList);
- static Int scanLookupList(const char* token, ConstLookupListRecArray lookupList);
-
- static Bool scanBool(const char* token);
-
-protected:
-
- static Bool isValidINIFilename( const char *filename ); ///< is this a valid .ini filename
-
- void prepFile( AsciiString filename, INILoadType loadType );
- void unPrepFile();
-
- void readLine( void );
-
- char* m_readBuffer; ///< internal read buffer
- unsigned m_readBufferNext; ///< next char in read buffer
- unsigned m_readBufferUsed; ///< number of bytes in read buffer
-
- AsciiString m_filename; ///< filename of file currently loading
- INILoadType m_loadType; ///< load time for current file
- UnsignedInt m_lineNum; ///< current line number that's been read
- char m_buffer[ INI_MAX_CHARS_PER_LINE+1 ];///< buffer to read file contents into
- const char *m_seps; ///< for strtok parsing
- const char *m_sepsPercent; ///< m_seps with percent delimiter as well
- const char *m_sepsColon; ///< m_seps with colon delimiter as well
- const char *m_sepsQuote; ///< token to represent a quoted ascii string
- const char *m_blockEndToken; ///< token to represent end of data block
- Bool m_endOfFile; ///< TRUE when we've hit EOF
-#ifdef DEBUG_CRASHING
- char m_curBlockStart[ INI_MAX_CHARS_PER_LINE+1 ]; ///< first line of cur block
-#endif
-};
diff --git a/Generals/Code/GameEngine/Include/Common/STLTypedefs.h b/Generals/Code/GameEngine/Include/Common/STLTypedefs.h
deleted file mode 100644
index 484b3f33e80..00000000000
--- a/Generals/Code/GameEngine/Include/Common/STLTypedefs.h
+++ /dev/null
@@ -1,297 +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: STLTypedefs.h ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: STLTypedefs.h
-//
-// Created: John McDonald
-//
-// Desc: @todo
-//
-//-----------------------------------------------------------------------------
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// srj sez: this must come first, first, first.
-#define _STLP_USE_NEWALLOC 1
-//#define _STLP_USE_CUSTOM_NEWALLOC STLSpecialAlloc
-class STLSpecialAlloc;
-
-//-----------------------------------------------------------------------------
-#include "Common/AsciiString.h"
-#include "Common/UnicodeString.h"
-#include "Common/GameCommon.h"
-#include "Common/GameMemory.h"
-
-//-----------------------------------------------------------------------------
-
-
-// FORWARD DECLARATIONS
-class Object;
-enum NameKeyType CPP_11(: Int);
-enum ObjectID CPP_11(: Int);
-enum DrawableID CPP_11(: Int);
-
-#include
-#include
-#include
-#include
-#include