Skip to content

Commit 2fb478a

Browse files
committed
unify(common): Merge GameCommon and related code (TheSuperHackers#2180)
1 parent d5e1088 commit 2fb478a

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

Generals/Code/GameEngine/Include/Common/GameCommon.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@
4747

4848
#pragma once
4949

50+
#define DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE ///< Take of the DONT to get cheats back in to release
51+
52+
//#define _CAMPEA_DEMO
53+
5054
// ----------------------------------------------------------------------------------------------
5155
#include "Lib/BaseType.h"
5256
#include "WWCommon.h"
5357
#include "Common/GameDefines.h"
5458

5559
// ----------------------------------------------------------------------------------------------
5660
#if defined(RTS_DEBUG)
57-
#define NO_DUMP_PERF_STATS
61+
#define DUMP_PERF_STATS
5862
#else
5963
#define NO_DUMP_PERF_STATS
6064
#endif
@@ -119,6 +123,18 @@ enum
119123
#error "this is the wrong size"
120124
#endif
121125

126+
// ----------------------------------------------------------------------------------------------
127+
enum
128+
{
129+
MAX_GLOBAL_GENERAL_TYPES = 9, ///< number of playable General Types, not including the boss)
130+
131+
/// The start of the playable global generals playertemplates
132+
GLOBAL_GENERAL_BEGIN = 5,
133+
134+
/// The end of the playable global generals
135+
GLOBAL_GENERAL_END = (GLOBAL_GENERAL_BEGIN + MAX_GLOBAL_GENERAL_TYPES - 1)
136+
};
137+
122138
//-------------------------------------------------------------------------------------------------
123139
enum GameDifficulty CPP_11(: Int)
124140
{
@@ -207,6 +223,7 @@ enum CommandSourceType CPP_11(: Int)
207223
CMD_FROM_SCRIPT,
208224
CMD_FROM_AI,
209225
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.
226+
CMD_DEFAULT_SWITCH_WEAPON, // Special case: A weapon that can be chosen -- this is the default case (machine gun vs flashbang).
210227

211228
COMMAND_SOURCE_TYPE_COUNT
212229
};

Generals/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ class GlobalData : public SubsystemInterface
280280

281281
#ifdef DUMP_PERF_STATS
282282
Bool m_dumpPerformanceStatistics;
283+
Bool m_dumpStatsAtInterval;///< should I automatically dum stats every in N frames
284+
Int m_statsInterval; ///< if so, how many is N?
283285
#endif
284286

285287
Bool m_forceBenchmark; ///<forces running of CPU detection benchmark, even on known cpu's.

Generals/Code/GameEngine/Include/GameLogic/AI.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,11 @@ class Waypoint;
308308
class Team;
309309
class Weapon;
310310

311-
// TheSuperHackers @build xezon 22/03/2025 Renames AI_PASSIVE to not conflict with macro in ws2def.h
311+
// TheSuperHackers @build xezon 17/03/2025 Renames AI_PASSIVE to not conflict with macro in ws2def.h
312312

313313
// Note - written out in save/load xfer and .map files, don't change these numbers.
314-
enum AttitudeType CPP_11(: Int) {
314+
enum AttitudeType CPP_11(: Int)
315+
{
315316
ATTITUDE_SLEEP = -2,
316317
ATTITUDE_PASSIVE=-1,
317318
ATTITUDE_NORMAL=0,
@@ -331,6 +332,7 @@ static const char *const TheCommandSourceMaskNames[] =
331332
"FROM_SCRIPT",
332333
"FROM_AI",
333334
"FROM_DOZER", //don't use this
335+
"DEFAULT_SWITCH_WEAPON", //unit will pick this weapon when normal logic fails.
334336

335337
nullptr
336338
};

Generals/Code/GameEngine/Source/Common/GlobalData.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,8 @@ GlobalData::GlobalData()
10191019

10201020
#ifdef DUMP_PERF_STATS
10211021
m_dumpPerformanceStatistics = FALSE;
1022+
m_dumpStatsAtInterval = FALSE;
1023+
m_statsInterval = 30;
10221024
#endif
10231025

10241026
m_forceBenchmark = FALSE; ///<forces running of CPU detection benchmark, even on known cpu's.

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void StatDumpClass::dumpStats()
263263
fprintf( m_fp, " Video RAM: %d\n", Debug_Statistics::Get_Record_Texture_Size() - 1376256 );
264264

265265
// terrain stats
266-
fprintf( m_fp, " 3-Way Blends: %d, Shoreline Blends: %d\n", TheTerrainRenderObject->getNumExtraBlendTiles(), TheTerrainRenderObject->getNumShoreLineTiles() );
266+
fprintf( m_fp, " 3-Way Blends: %d/%d, \n Shoreline Blends: %d/%d\n", TheTerrainRenderObject->getNumExtraBlendTiles(TRUE),TheTerrainRenderObject->getNumExtraBlendTiles(FALSE), TheTerrainRenderObject->getNumShoreLineTiles(TRUE),TheTerrainRenderObject->getNumShoreLineTiles(FALSE));
267267

268268
fprintf( m_fp, "\n" );
269269

0 commit comments

Comments
 (0)