From 3836a55efb99002a7ebeb50b1e344eeb03c78ea2 Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Tue, 13 Jan 2026 17:20:50 +0100
Subject: [PATCH 01/11] feat: Add simulation math CRC utility
---
Core/GameEngine/CMakeLists.txt | 2 +
.../Include/Common/SimulationMathCrc.h | 28 +++++++
.../Source/Common/SimulationMathCrc.cpp | 79 +++++++++++++++++++
.../GameEngine/Source/Common/CommandLine.cpp | 10 +++
4 files changed, 119 insertions(+)
create mode 100644 Core/GameEngine/Include/Common/SimulationMathCrc.h
create mode 100644 Core/GameEngine/Source/Common/SimulationMathCrc.cpp
diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index eb7b7541e14..533dfa487ee 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -118,6 +118,7 @@ set(GAMEENGINE_SRC
# Include/Common/StatsCollector.h
# Include/Common/STLTypedefs.h
Include/Common/StreamingArchiveFile.h
+ Include/Common/SimulationMathCrc.h
# Include/Common/SubsystemInterface.h
# Include/Common/SystemInfo.h
# Include/Common/Team.h
@@ -582,6 +583,7 @@ set(GAMEENGINE_SRC
# Source/Common/GameMain.cpp
Source/Common/GameUtility.cpp
# Source/Common/GlobalData.cpp
+ Source/Common/SimulationMathCrc.cpp
# Source/Common/INI/INI.cpp
# Source/Common/INI/INIAiData.cpp
# Source/Common/INI/INIAnimation.cpp
diff --git a/Core/GameEngine/Include/Common/SimulationMathCrc.h b/Core/GameEngine/Include/Common/SimulationMathCrc.h
new file mode 100644
index 00000000000..c813556085f
--- /dev/null
+++ b/Core/GameEngine/Include/Common/SimulationMathCrc.h
@@ -0,0 +1,28 @@
+/*
+** 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
+
+#include "Lib/BaseType.h"
+
+class SimulationMathCrc
+{
+public:
+ static UnsignedInt calculate();
+ static void print();
+};
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
new file mode 100644
index 00000000000..80bcfa400e8
--- /dev/null
+++ b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
@@ -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 .
+*/
+
+#include "PreRTS.h"
+
+#include "Common/SimulationMathCrc.h"
+#include "Common/XferCRC.h"
+#include "WWMath/matrix3d.h"
+#include "WWMath/wwmath.h"
+
+#include
+#include
+
+static void append_matrix_crc(XferCRC &xfer)
+{
+ Matrix3D matrix;
+ Matrix3D factors_matrix;
+
+ matrix.Set(
+ 4.1f, 1.2f, 0.3f, 0.4f,
+ 0.5f, 3.6f, 0.7f, 0.8f,
+ 0.9f, 1.0f, 2.1f, 1.2f);
+
+ factors_matrix.Set(
+ WWMath::Sin(0.7f) * log10f(2.3f),
+ WWMath::Cos(1.1f) * powf(1.1f, 2.0f),
+ tanf(0.3f),
+ asinf(0.9673022627830505),
+ acosf(0.9673022627830505),
+ atanf(0.9673022627830505) * powf(1.1f, 2.0f),
+ atan2f(0.4f, 1.3f),
+ sinhf(0.2f),
+ coshf(0.4f) * tanhf(0.5f),
+ sqrtf(55788.84375),
+ expf(0.1f) * log10f(2.3f),
+ logf(1.4f));
+
+ Matrix3D::Multiply(matrix, factors_matrix, &matrix);
+ matrix.Get_Inverse(matrix);
+
+ xfer.xferMatrix3D(&matrix);
+}
+
+UnsignedInt SimulationMathCrc::calculate()
+{
+ XferCRC xfer;
+ xfer.open("SimulationMathCrc");
+
+ _fpreset();
+ // TheSuperHackers @info stm Use the same rounding mode as used in the game, this affects vc6 only.
+ _controlfp(0x000A001F, _MCW_RC | _MCW_PC | _MCW_EM);
+
+ append_matrix_crc(xfer);
+
+ _fpreset();
+
+ xfer.close();
+
+ return xfer.getCRC();
+}
+
+void SimulationMathCrc::print() {
+ printf("Simulation CRC: %08X\n", calculate());
+}
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
index 0ec260b3861..71e7b5720d4 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
@@ -30,6 +30,7 @@
#include "Common/CRCDebug.h"
#include "Common/LocalFileSystem.h"
#include "Common/Recorder.h"
+#include "Common/SimulationMathCrc.h"
#include "Common/version.h"
#include "GameClient/ClientInstance.h"
#include "GameClient/TerrainVisual.h" // for TERRAIN_LOD_MIN definition
@@ -458,6 +459,13 @@ Int parseJobs(char *args[], int num)
return 1;
}
+Int parsePrintSimMathCrc(char *args[], int num)
+{
+ SimulationMathCrc::print();
+ exit(0);
+ return 1;
+}
+
Int parseXRes(char *args[], int num)
{
if (num > 1)
@@ -1163,6 +1171,8 @@ static CommandLineParam paramsForStartup[] =
// (If you have 4 cores, call it with -jobs 4)
// If you do not call this, all replays will be simulated in sequence in the same process.
{ "-jobs", parseJobs },
+
+ { "-printSimMathCrc", parsePrintSimMathCrc },
};
// These Params are parsed during Engine Init before INI data is loaded
From 60fe1d62b047db02b6ff62a746c1788eaa93a078 Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Wed, 14 Jan 2026 00:51:18 +0100
Subject: [PATCH 02/11] Style touchup
---
Core/GameEngine/Source/Common/SimulationMathCrc.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
index 80bcfa400e8..398e78e51bb 100644
--- a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
@@ -26,7 +26,7 @@
#include
#include
-static void append_matrix_crc(XferCRC &xfer)
+static void appendMatrixCrc(XferCRC &xfer)
{
Matrix3D matrix;
Matrix3D factors_matrix;
@@ -62,10 +62,10 @@ UnsignedInt SimulationMathCrc::calculate()
xfer.open("SimulationMathCrc");
_fpreset();
- // TheSuperHackers @info stm Use the same rounding mode as used in the game, this affects vc6 only.
+ // TheSuperHackers @info stm Use the same rounding mode as used in the game. This affects vc6 only.
_controlfp(0x000A001F, _MCW_RC | _MCW_PC | _MCW_EM);
- append_matrix_crc(xfer);
+ appendMatrixCrc(xfer);
_fpreset();
@@ -75,5 +75,5 @@ UnsignedInt SimulationMathCrc::calculate()
}
void SimulationMathCrc::print() {
- printf("Simulation CRC: %08X\n", calculate());
+ printf("Simulation Math CRC: %08X\n", calculate());
}
From dc7d4e1eac651e2fd9c88df11f3b689c54331525 Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Mon, 19 Jan 2026 13:11:41 +0100
Subject: [PATCH 03/11] Remove command line option. Minor style touchup
---
Core/GameEngine/CMakeLists.txt | 4 ++--
Core/GameEngine/Source/Common/SimulationMathCrc.cpp | 5 -----
.../Code/GameEngine/Source/Common/CommandLine.cpp | 10 ----------
3 files changed, 2 insertions(+), 17 deletions(-)
diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index 533dfa487ee..fd155b1ab32 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -118,7 +118,7 @@ set(GAMEENGINE_SRC
# Include/Common/StatsCollector.h
# Include/Common/STLTypedefs.h
Include/Common/StreamingArchiveFile.h
- Include/Common/SimulationMathCrc.h
+ Include/Common/SimulationMathCrc.h
# Include/Common/SubsystemInterface.h
# Include/Common/SystemInfo.h
# Include/Common/Team.h
@@ -583,7 +583,7 @@ set(GAMEENGINE_SRC
# Source/Common/GameMain.cpp
Source/Common/GameUtility.cpp
# Source/Common/GlobalData.cpp
- Source/Common/SimulationMathCrc.cpp
+ Source/Common/SimulationMathCrc.cpp
# Source/Common/INI/INI.cpp
# Source/Common/INI/INIAiData.cpp
# Source/Common/INI/INIAnimation.cpp
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
index 398e78e51bb..fc219ca3714 100644
--- a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
@@ -24,7 +24,6 @@
#include "WWMath/wwmath.h"
#include
-#include
static void appendMatrixCrc(XferCRC &xfer)
{
@@ -73,7 +72,3 @@ UnsignedInt SimulationMathCrc::calculate()
return xfer.getCRC();
}
-
-void SimulationMathCrc::print() {
- printf("Simulation Math CRC: %08X\n", calculate());
-}
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
index 71e7b5720d4..0ec260b3861 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
@@ -30,7 +30,6 @@
#include "Common/CRCDebug.h"
#include "Common/LocalFileSystem.h"
#include "Common/Recorder.h"
-#include "Common/SimulationMathCrc.h"
#include "Common/version.h"
#include "GameClient/ClientInstance.h"
#include "GameClient/TerrainVisual.h" // for TERRAIN_LOD_MIN definition
@@ -459,13 +458,6 @@ Int parseJobs(char *args[], int num)
return 1;
}
-Int parsePrintSimMathCrc(char *args[], int num)
-{
- SimulationMathCrc::print();
- exit(0);
- return 1;
-}
-
Int parseXRes(char *args[], int num)
{
if (num > 1)
@@ -1171,8 +1163,6 @@ static CommandLineParam paramsForStartup[] =
// (If you have 4 cores, call it with -jobs 4)
// If you do not call this, all replays will be simulated in sequence in the same process.
{ "-jobs", parseJobs },
-
- { "-printSimMathCrc", parsePrintSimMathCrc },
};
// These Params are parsed during Engine Init before INI data is loaded
From e6b2bd5dcd3c01f2601b27f725fe1578d15f1909 Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Mon, 19 Jan 2026 13:21:00 +0100
Subject: [PATCH 04/11] Fix header file
---
Core/GameEngine/Include/Common/SimulationMathCrc.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/Core/GameEngine/Include/Common/SimulationMathCrc.h b/Core/GameEngine/Include/Common/SimulationMathCrc.h
index c813556085f..0a3a0255e5f 100644
--- a/Core/GameEngine/Include/Common/SimulationMathCrc.h
+++ b/Core/GameEngine/Include/Common/SimulationMathCrc.h
@@ -24,5 +24,4 @@ class SimulationMathCrc
{
public:
static UnsignedInt calculate();
- static void print();
};
From 97dc9b74f30cd81fae8a637cad14e6917ff867ea Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Thu, 29 Jan 2026 10:17:15 +0100
Subject: [PATCH 05/11] Update info comment
---
Core/GameEngine/Source/Common/SimulationMathCrc.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
index fc219ca3714..fbc2d89c839 100644
--- a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
@@ -61,7 +61,7 @@ UnsignedInt SimulationMathCrc::calculate()
xfer.open("SimulationMathCrc");
_fpreset();
- // TheSuperHackers @info stm Use the same rounding mode as used in the game. This affects vc6 only.
+ // TheSuperHackers @info stephanmeesters 29/01/2026 Use the same rounding mode as used in the game. This affects vc6 only.
_controlfp(0x000A001F, _MCW_RC | _MCW_PC | _MCW_EM);
appendMatrixCrc(xfer);
From 04096e4ae9d837afd81484540d273833b4b57ba3 Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Wed, 4 Feb 2026 13:34:59 +0100
Subject: [PATCH 06/11] Use setFPMode()
---
Core/GameEngine/Source/Common/SimulationMathCrc.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
index fbc2d89c839..56b0f2f8ff8 100644
--- a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
@@ -22,6 +22,7 @@
#include "Common/XferCRC.h"
#include "WWMath/matrix3d.h"
#include "WWMath/wwmath.h"
+#include "GameLogic/FPUControl.h"
#include
@@ -60,9 +61,7 @@ UnsignedInt SimulationMathCrc::calculate()
XferCRC xfer;
xfer.open("SimulationMathCrc");
- _fpreset();
- // TheSuperHackers @info stephanmeesters 29/01/2026 Use the same rounding mode as used in the game. This affects vc6 only.
- _controlfp(0x000A001F, _MCW_RC | _MCW_PC | _MCW_EM);
+ setFPMode();
appendMatrixCrc(xfer);
From d4c935429578dc9c5b39e5d82bce0e8f9e3e443a Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Wed, 4 Feb 2026 13:37:46 +0100
Subject: [PATCH 07/11] Rename factors matrix
---
Core/GameEngine/Source/Common/SimulationMathCrc.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
index 56b0f2f8ff8..7c75ac53e2b 100644
--- a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
@@ -29,14 +29,14 @@
static void appendMatrixCrc(XferCRC &xfer)
{
Matrix3D matrix;
- Matrix3D factors_matrix;
+ Matrix3D factorsMatrix;
matrix.Set(
4.1f, 1.2f, 0.3f, 0.4f,
0.5f, 3.6f, 0.7f, 0.8f,
0.9f, 1.0f, 2.1f, 1.2f);
- factors_matrix.Set(
+ factorsMatrix.Set(
WWMath::Sin(0.7f) * log10f(2.3f),
WWMath::Cos(1.1f) * powf(1.1f, 2.0f),
tanf(0.3f),
@@ -50,7 +50,7 @@ static void appendMatrixCrc(XferCRC &xfer)
expf(0.1f) * log10f(2.3f),
logf(1.4f));
- Matrix3D::Multiply(matrix, factors_matrix, &matrix);
+ Matrix3D::Multiply(matrix, factorsMatrix, &matrix);
matrix.Get_Inverse(matrix);
xfer.xferMatrix3D(&matrix);
From 94240c0872468149c4a200c99a4f568bc058dbda Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Mon, 2 Mar 2026 21:18:59 +0100
Subject: [PATCH 08/11] Process review comments
---
Core/GameEngine/CMakeLists.txt | 2 +-
Core/GameEngine/Include/Common/SimulationMathCrc.h | 2 --
.../Source/Common/{ => System}/SimulationMathCrc.cpp | 4 ++--
3 files changed, 3 insertions(+), 5 deletions(-)
rename Core/GameEngine/Source/Common/{ => System}/SimulationMathCrc.cpp (95%)
diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index f41cb23aeb6..b5f99b83ddd 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -583,7 +583,6 @@ set(GAMEENGINE_SRC
# Source/Common/GameMain.cpp
Source/Common/GameUtility.cpp
# Source/Common/GlobalData.cpp
- Source/Common/SimulationMathCrc.cpp
Source/Common/INI/INI.cpp
# Source/Common/INI/INIAiData.cpp
# Source/Common/INI/INIAnimation.cpp
@@ -683,6 +682,7 @@ set(GAMEENGINE_SRC
Source/Common/System/XferCRC.cpp
Source/Common/System/XferLoad.cpp
Source/Common/System/XferSave.cpp
+ Source/Common/System/SimulationMathCrc.cpp
# Source/Common/TerrainTypes.cpp
# Source/Common/Thing/DrawModule.cpp
# Source/Common/Thing/Module.cpp
diff --git a/Core/GameEngine/Include/Common/SimulationMathCrc.h b/Core/GameEngine/Include/Common/SimulationMathCrc.h
index 0a3a0255e5f..031bc2e3f88 100644
--- a/Core/GameEngine/Include/Common/SimulationMathCrc.h
+++ b/Core/GameEngine/Include/Common/SimulationMathCrc.h
@@ -18,8 +18,6 @@
#pragma once
-#include "Lib/BaseType.h"
-
class SimulationMathCrc
{
public:
diff --git a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
similarity index 95%
rename from Core/GameEngine/Source/Common/SimulationMathCrc.cpp
rename to Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
index 7c75ac53e2b..7cdf89e7947 100644
--- a/Core/GameEngine/Source/Common/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
@@ -26,7 +26,7 @@
#include
-static void appendMatrixCrc(XferCRC &xfer)
+static void appendSimulationMathCrc(XferCRC &xfer)
{
Matrix3D matrix;
Matrix3D factorsMatrix;
@@ -63,7 +63,7 @@ UnsignedInt SimulationMathCrc::calculate()
setFPMode();
- appendMatrixCrc(xfer);
+ appendSimulationMathCrc(xfer);
_fpreset();
From 02b3760c73de701b6fe71f5a50cfc78860ff0c43 Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Mon, 2 Mar 2026 21:37:25 +0100
Subject: [PATCH 09/11] Update
Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---
Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
index 7cdf89e7947..e3f3aab2fcb 100644
--- a/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
@@ -61,7 +61,7 @@ UnsignedInt SimulationMathCrc::calculate()
XferCRC xfer;
xfer.open("SimulationMathCrc");
- setFPMode();
+ setFPMode();
appendSimulationMathCrc(xfer);
From aa7cd2a8e9fe4518932c0bcefecf1aa7c16c60bf Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Mon, 2 Mar 2026 23:23:08 +0100
Subject: [PATCH 10/11] Move to Common/Diagnostic
---
Core/GameEngine/CMakeLists.txt | 4 ++--
.../Include/Common/{ => Diagnostic}/SimulationMathCrc.h | 0
.../Common/{System => Diagnostic}/SimulationMathCrc.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
rename Core/GameEngine/Include/Common/{ => Diagnostic}/SimulationMathCrc.h (100%)
rename Core/GameEngine/Source/Common/{System => Diagnostic}/SimulationMathCrc.cpp (97%)
diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index b5f99b83ddd..c8090f38354 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -118,7 +118,6 @@ set(GAMEENGINE_SRC
# Include/Common/StatsCollector.h
Include/Common/STLTypedefs.h
Include/Common/StreamingArchiveFile.h
- Include/Common/SimulationMathCrc.h
Include/Common/SubsystemInterface.h
# Include/Common/SystemInfo.h
# Include/Common/Team.h
@@ -142,6 +141,7 @@ set(GAMEENGINE_SRC
Include/Common/XferDeepCRC.h
Include/Common/XferLoad.h
Include/Common/XferSave.h
+ Include/Common/Diagnostic/SimulationMathCrc.h
# Include/GameClient/Anim2D.h
# Include/GameClient/AnimateWindowManager.h
# Include/GameClient/CampaignManager.h
@@ -682,7 +682,7 @@ set(GAMEENGINE_SRC
Source/Common/System/XferCRC.cpp
Source/Common/System/XferLoad.cpp
Source/Common/System/XferSave.cpp
- Source/Common/System/SimulationMathCrc.cpp
+ Source/Common/Diagnostic/SimulationMathCrc.cpp
# Source/Common/TerrainTypes.cpp
# Source/Common/Thing/DrawModule.cpp
# Source/Common/Thing/Module.cpp
diff --git a/Core/GameEngine/Include/Common/SimulationMathCrc.h b/Core/GameEngine/Include/Common/Diagnostic/SimulationMathCrc.h
similarity index 100%
rename from Core/GameEngine/Include/Common/SimulationMathCrc.h
rename to Core/GameEngine/Include/Common/Diagnostic/SimulationMathCrc.h
diff --git a/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp
similarity index 97%
rename from Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
rename to Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp
index e3f3aab2fcb..8b0b35dd0b8 100644
--- a/Core/GameEngine/Source/Common/System/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp
@@ -18,7 +18,7 @@
#include "PreRTS.h"
-#include "Common/SimulationMathCrc.h"
+#include "Common/Diagnostic/SimulationMathCrc.h"
#include "Common/XferCRC.h"
#include "WWMath/matrix3d.h"
#include "WWMath/wwmath.h"
From 572caec38b171e7471d44b0a06fdc95c068d45aa Mon Sep 17 00:00:00 2001
From: stm <14291421+stephanmeesters@users.noreply.github.com>
Date: Tue, 3 Mar 2026 23:40:51 +0100
Subject: [PATCH 11/11] Trim float values. Insert files in alphabetical order
---
Core/GameEngine/CMakeLists.txt | 4 ++--
.../Source/Common/Diagnostic/SimulationMathCrc.cpp | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index c8090f38354..41a65f232d4 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -29,6 +29,7 @@ set(GAMEENGINE_SRC
# Include/Common/DamageFX.h
# Include/Common/DataChunk.h
Include/Common/Debug.h
+ Include/Common/Diagnostic/SimulationMathCrc.h
# Include/Common/Dict.h
# Include/Common/Directory.h
# Include/Common/DisabledTypes.h
@@ -141,7 +142,6 @@ set(GAMEENGINE_SRC
Include/Common/XferDeepCRC.h
Include/Common/XferLoad.h
Include/Common/XferSave.h
- Include/Common/Diagnostic/SimulationMathCrc.h
# Include/GameClient/Anim2D.h
# Include/GameClient/AnimateWindowManager.h
# Include/GameClient/CampaignManager.h
@@ -574,6 +574,7 @@ set(GAMEENGINE_SRC
Source/Common/crc.cpp
Source/Common/CRCDebug.cpp
# Source/Common/DamageFX.cpp
+ Source/Common/Diagnostic/SimulationMathCrc.cpp
# Source/Common/Dict.cpp
# Source/Common/DiscreteCircle.cpp
Source/Common/FramePacer.cpp
@@ -682,7 +683,6 @@ set(GAMEENGINE_SRC
Source/Common/System/XferCRC.cpp
Source/Common/System/XferLoad.cpp
Source/Common/System/XferSave.cpp
- Source/Common/Diagnostic/SimulationMathCrc.cpp
# Source/Common/TerrainTypes.cpp
# Source/Common/Thing/DrawModule.cpp
# Source/Common/Thing/Module.cpp
diff --git a/Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp b/Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp
index 8b0b35dd0b8..1b062f44e34 100644
--- a/Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp
+++ b/Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp
@@ -40,13 +40,13 @@ static void appendSimulationMathCrc(XferCRC &xfer)
WWMath::Sin(0.7f) * log10f(2.3f),
WWMath::Cos(1.1f) * powf(1.1f, 2.0f),
tanf(0.3f),
- asinf(0.9673022627830505),
- acosf(0.9673022627830505),
- atanf(0.9673022627830505) * powf(1.1f, 2.0f),
+ asinf(0.967302263f),
+ acosf(0.967302263f),
+ atanf(0.967302263f) * powf(1.1f, 2.0f),
atan2f(0.4f, 1.3f),
sinhf(0.2f),
coshf(0.4f) * tanhf(0.5f),
- sqrtf(55788.84375),
+ sqrtf(55788.84375f),
expf(0.1f) * log10f(2.3f),
logf(1.4f));