[openjk] 48/130: Rename saved game affected classes
Simon McVittie
smcv at debian.org
Fri Oct 28 11:09:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository openjk.
commit 62edd3c44494c13a12818c342401d196830f7e7d
Author: bibendovsky <bibendovsky at hotmail.com>
Date: Fri Jul 22 22:10:29 2016 +0300
Rename saved game affected classes
---
code/cgame/cg_main.cpp | 2 +-
code/cgame/cg_players.cpp | 2 +-
code/game/AI_HazardTrooper.cpp | 2 +-
code/game/NPC.cpp | 8 ++++----
code/game/NPC_spawn.cpp | 2 +-
code/game/NPC_stats.cpp | 8 ++++----
code/game/Q3_Interface.cpp | 6 +++---
code/game/b_local.h | 2 +-
code/game/b_public.h | 13 +++++++-----
code/game/fields.h | 4 ++--
code/game/g_local.h | 8 +++++---
code/game/g_main.cpp | 2 +-
code/game/g_public.h | 3 ++-
code/game/g_savegame.cpp | 14 ++++++-------
code/game/g_shared.h | 43 ++++++++++++++++++++++++---------------
code/qcommon/msg.cpp | 2 +-
code/qcommon/q_shared.h | 7 +++++--
code/qcommon/qcommon.h | 6 +++---
code/ui/ui_main.cpp | 7 ++++---
codeJK2/cgame/cg_main.cpp | 2 +-
codeJK2/cgame/cg_players.cpp | 2 +-
codeJK2/game/NPC.cpp | 4 ++--
codeJK2/game/NPC_spawn.cpp | 4 ++--
codeJK2/game/NPC_stats.cpp | 8 ++++----
codeJK2/game/Q3_Interface.cpp | 6 +++---
codeJK2/game/b_local.h | 2 +-
codeJK2/game/b_public.h | 13 +++++++-----
codeJK2/game/fields.h | 4 ++--
codeJK2/game/g_local.h | 8 +++++---
codeJK2/game/g_main.cpp | 2 +-
codeJK2/game/g_savegame.cpp | 14 ++++++-------
codeJK2/game/g_shared.h | 46 ++++++++++++++++++++++++++----------------
32 files changed, 147 insertions(+), 109 deletions(-)
diff --git a/code/cgame/cg_main.cpp b/code/cgame/cg_main.cpp
index d704b8a..f6d955a 100644
--- a/code/cgame/cg_main.cpp
+++ b/code/cgame/cg_main.cpp
@@ -990,7 +990,7 @@ Ghoul2 Insert End
}
-void CG_RegisterClientRenderInfo(ja_clientInfo_t *ci, renderInfo_t *ri)
+void CG_RegisterClientRenderInfo(ja_clientInfo_t *ci, ja_renderInfo_t *ri)
{
char *slash;
char headModelName[MAX_QPATH];
diff --git a/code/cgame/cg_players.cpp b/code/cgame/cg_players.cpp
index bbbe476..25d3abb 100644
--- a/code/cgame/cg_players.cpp
+++ b/code/cgame/cg_players.cpp
@@ -1811,7 +1811,7 @@ CG_AddHeadBob
*/
static qboolean CG_AddHeadBob( centity_t *cent, vec3_t addTo )
{
- renderInfo_t *renderInfo = ¢->gent->client->renderInfo;
+ ja_renderInfo_t *renderInfo = ¢->gent->client->renderInfo;
const int volume = gi.VoiceVolume[cent->gent->s.clientNum];
const int volChange = volume - renderInfo->lastVoiceVolume;//was *3 because voice fromLA was too low
int i;
diff --git a/code/game/AI_HazardTrooper.cpp b/code/game/AI_HazardTrooper.cpp
index fd4e6be..d5f6f82 100644
--- a/code/game/AI_HazardTrooper.cpp
+++ b/code/game/AI_HazardTrooper.cpp
@@ -452,7 +452,7 @@ private:
float targetNoiseLevel;
gentity_t* scanner = mActors[scannerIndex];
- gNPCstats_t* scannerStats = &(scanner->NPC->stats);
+ ja_gNPCstats_t* scannerStats = &(scanner->NPC->stats);
float scannerMaxViewDist = scannerStats->visrange;
float scannerMinVisability = 0.1f;//1.0f - scannerStats->vigilance;
float scannerMaxHearDist = scannerStats->earshot;
diff --git a/code/game/NPC.cpp b/code/game/NPC.cpp
index 885eeb4..f46e8d8 100644
--- a/code/game/NPC.cpp
+++ b/code/game/NPC.cpp
@@ -76,13 +76,13 @@ cvar_t *d_slowmodeath;
extern qboolean stop_icarus;
gentity_t *NPC;
-gNPC_t *NPCInfo;
+ja_gNPC_t *NPCInfo;
ja_gclient_t *client;
usercmd_t ucmd;
visibility_t enemyVisibility;
void NPC_SetAnim(gentity_t *ent,int setAnimParts,int anim,int setAnimFlags, int iBlend);
-static bState_t G_CurrentBState( gNPC_t *gNPC );
+static bState_t G_CurrentBState( ja_gNPC_t *gNPC );
extern int eventClearTime;
@@ -914,7 +914,7 @@ void SetNPCGlobals( gentity_t *ent )
}
gentity_t *_saved_NPC;
-gNPC_t *_saved_NPCInfo;
+ja_gNPC_t *_saved_NPCInfo;
ja_gclient_t *_saved_client;
usercmd_t _saved_ucmd;
@@ -2137,7 +2137,7 @@ void NPC_RunBehavior( int team, int bState )
}
}
-static bState_t G_CurrentBState( gNPC_t *gNPC )
+static bState_t G_CurrentBState( ja_gNPC_t *gNPC )
{
if ( gNPC->tempBehavior != BS_DEFAULT )
{//Overrides normal behavior until cleared
diff --git a/code/game/NPC_spawn.cpp b/code/game/NPC_spawn.cpp
index 02719e1..a593d4f 100644
--- a/code/game/NPC_spawn.cpp
+++ b/code/game/NPC_spawn.cpp
@@ -1517,7 +1517,7 @@ gentity_t *NPC_Spawn_Do( gentity_t *ent, qboolean fullSpawnNow )
newent->NPC_type = Q_strlwr( G_NewString( ent->NPC_type ) ); //get my own copy so i can free it when i die
}
- newent->NPC = (gNPC_t*) gi.Malloc(sizeof(gNPC_t), TAG_G_ALLOC, qtrue);
+ newent->NPC = (ja_gNPC_t*) gi.Malloc(sizeof(ja_gNPC_t), TAG_G_ALLOC, qtrue);
newent->NPC->tempGoal = G_Spawn();
diff --git a/code/game/NPC_stats.cpp b/code/game/NPC_stats.cpp
index caf851f..01e29cd 100644
--- a/code/game/NPC_stats.cpp
+++ b/code/game/NPC_stats.cpp
@@ -356,7 +356,7 @@ static int MoveTypeNameToEnum( const char *name )
return MT_STATIC;
}
-extern void CG_RegisterClientRenderInfo(ja_clientInfo_t *ci, renderInfo_t *ri);
+extern void CG_RegisterClientRenderInfo(ja_clientInfo_t *ci, ja_renderInfo_t *ri);
extern void CG_RegisterClientModels (int entityNum);
extern void CG_RegisterNPCCustomSounds( ja_clientInfo_t *ci );
@@ -1578,7 +1578,7 @@ Precaches NPC skins, tgas and md3s.
void CG_NPC_Precache ( gentity_t *spawner )
{
ja_clientInfo_t ci={};
- renderInfo_t ri={};
+ ja_renderInfo_t ri={};
team_t playerTeam = TEAM_FREE;
const char *token;
const char *value;
@@ -1942,8 +1942,8 @@ qboolean NPC_ParseParms( const char *NPCName, gentity_t *NPC )
char playerModel[MAX_QPATH];
char customSkin[MAX_QPATH];
ja_clientInfo_t *ci = &NPC->client->clientInfo;
- renderInfo_t *ri = &NPC->client->renderInfo;
- gNPCstats_t *stats = NULL;
+ ja_renderInfo_t *ri = &NPC->client->renderInfo;
+ ja_gNPCstats_t *stats = NULL;
qboolean md3Model = qtrue;
char surfOff[1024]={0};
char surfOn[1024]={0};
diff --git a/code/game/Q3_Interface.cpp b/code/game/Q3_Interface.cpp
index 7f3c1a6..a527a58 100644
--- a/code/game/Q3_Interface.cpp
+++ b/code/game/Q3_Interface.cpp
@@ -752,7 +752,7 @@ static void Q3_SetObjective(const char *ObjEnum, int status)
{
int objectiveID;
ja_gclient_t *client;
- objectives_t *objective;
+ ja_objectives_t *objective;
int *objectivesShown;
client = &level.clients[0];
@@ -4077,8 +4077,8 @@ void Q3_SetParm (int entID, int parmNum, const char *parmValue)
if( !ent->parms )
{
- ent->parms = (parms_t *)G_Alloc( sizeof(parms_t) );
- memset( ent->parms, 0, sizeof(parms_t) );
+ ent->parms = (ja_parms_t *)G_Alloc( sizeof(ja_parms_t) );
+ memset( ent->parms, 0, sizeof(ja_parms_t) );
}
if ( (val = Q3_CheckStringCounterIncrement( parmValue )) )
diff --git a/code/game/b_local.h b/code/game/b_local.h
index 0814fc8..a49df8d 100644
--- a/code/game/b_local.h
+++ b/code/game/b_local.h
@@ -80,7 +80,7 @@ extern void Debug_NPCPrintf( gentity_t *printNPC, cvar_t *cv, int debugLevel, ch
//MCG - Begin============================================================
//NPC_ai variables - shared by NPC.cpp andf the following modules
extern gentity_t *NPC;
-extern gNPC_t *NPCInfo;
+extern ja_gNPC_t *NPCInfo;
extern ja_gclient_t *client;
extern usercmd_t ucmd;
extern visibility_t enemyVisibility;
diff --git a/code/game/b_public.h b/code/game/b_public.h
index a547fab..f2054f0 100644
--- a/code/game/b_public.h
+++ b/code/game/b_public.h
@@ -132,8 +132,9 @@ typedef enum
} sexType_t;
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct gNPCstats_e
+class ja_gNPCstats_t
{//Stats, loaded in, and can be set by scripts
+public:
//AI
int aggression; // "
int aim; // "
@@ -202,7 +203,7 @@ typedef struct gNPCstats_e
saved_game->read<int32_t>(acceleration);
saved_game->read<int32_t>(sex);
}
-} gNPCstats_t;
+}; // ja_gNPCstats_t
#define MAX_ENEMY_POS_LAG 2400
@@ -210,8 +211,10 @@ typedef struct gNPCstats_e
#define ENEMY_POS_LAG_STEPS (MAX_ENEMY_POS_LAG/ENEMY_POS_LAG_INTERVAL)
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_gNPC_t
{
+public:
//FIXME: Put in playerInfo or something
int timeOfDeath; //FIXME do we really need both of these
gentity_t *touchedByPlayer;
@@ -298,7 +301,7 @@ typedef struct
vec3_t lastPathAngles; //So we know which way to face generally when we stop
//stats
- gNPCstats_t stats;
+ ja_gNPCstats_t stats;
int aimErrorDebounceTime;
float lastAimErrorYaw;
float lastAimErrorPitch;
@@ -622,7 +625,7 @@ typedef struct
saved_game->read<int32_t>(ffireDebounce);
saved_game->read<int32_t>(ffireFadeDebounce);
}
-} gNPC_t;
+}; // ja_gNPC_t
void G_SquadPathsInit(void);
diff --git a/code/game/fields.h b/code/game/fields.h
index 877ecec..ba7bb10 100644
--- a/code/game/fields.h
+++ b/code/game/fields.h
@@ -37,9 +37,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define FOFS(x) offsetof(gentity_t, x) // usually already defined in qshared.h
#endif
#define STOFS(x) offsetof(spawn_temp_t, x)
-#define LLOFS(x) offsetof(level_locals_t, x)
+#define LLOFS(x) offsetof(ja_level_locals_t, x)
#define CLOFS(x) offsetof(ja_gclient_t, x)
-#define NPCOFS(x) offsetof(gNPC_t, x)
+#define NPCOFS(x) offsetof(ja_gNPC_t, x)
#define VHOFS(x) offsetof(Vehicle_t, x)
//
diff --git a/code/game/g_local.h b/code/game/g_local.h
index 9da71d5..3502333 100644
--- a/code/game/g_local.h
+++ b/code/game/g_local.h
@@ -239,8 +239,10 @@ typedef struct
#define WF_PUFFING 0x00000004 // puffing something
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_level_locals_t
{
+public:
ja_gclient_t *clients; // [maxclients]
// store latched cvars here that we want to get at often
@@ -343,9 +345,9 @@ typedef struct
saved_game->read<int32_t>(worldFlags);
saved_game->read<int32_t>(dmState);
}
-} level_locals_t;
+}; // ja_level_locals_t
-extern level_locals_t level;
+extern ja_level_locals_t level;
extern game_export_t globals;
extern cvar_t *g_gravity;
diff --git a/code/game/g_main.cpp b/code/game/g_main.cpp
index 4475289..0d75924 100644
--- a/code/game/g_main.cpp
+++ b/code/game/g_main.cpp
@@ -62,7 +62,7 @@ extern qboolean g_bCollidableRoffs;
#define STEPSIZE 18
-level_locals_t level;
+ja_level_locals_t level;
game_import_t gi;
game_export_t globals;
gentity_t g_entities[MAX_GENTITIES];
diff --git a/code/game/g_public.h b/code/game/g_public.h
index 08cf22c..0465c27 100644
--- a/code/game/g_public.h
+++ b/code/game/g_public.h
@@ -90,10 +90,11 @@ typedef enum
#ifndef GAME_INCLUDE
// the server needs to know enough information to handle collision and snapshot generation
+class playerState_t;
struct gentity_s {
entityState_t s; // communicated by server to clients
- struct playerState_s *client;
+ playerState_t *client;
qboolean inuse;
qboolean linked; // qfalse if not in any good cluster
diff --git a/code/game/g_savegame.cpp b/code/game/g_savegame.cpp
index 31dcbae..25a362c 100644
--- a/code/game/g_savegame.cpp
+++ b/code/game/g_savegame.cpp
@@ -835,7 +835,7 @@ All pointer variables (except function pointers) must be handled specially.
*/
static void WriteLevelLocals ()
{
- level_locals_t *temp = (level_locals_t *)gi.Malloc(sizeof(level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
+ ja_level_locals_t *temp = (ja_level_locals_t *)gi.Malloc(sizeof(ja_level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
*temp = level; // copy out all data into a temp space
EnumerateFields(savefields_LevelLocals, temp, INT_ID('L','V','L','C'), LLOFS(LEVEL_LOCALS_T_SAVESTOP)); // sizeof(temp));
@@ -855,7 +855,7 @@ static void ReadLevelLocals ()
//
ja_gclient_t *pClients = level.clients; // save clients
- level_locals_t *temp = (level_locals_t *)gi.Malloc(sizeof(level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
+ ja_level_locals_t *temp = (ja_level_locals_t *)gi.Malloc(sizeof(ja_level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
*temp = level; // struct copy
EvaluateFields(savefields_LevelLocals, temp, (byte *)&level, INT_ID('L','V','L','C'), LLOFS(LEVEL_LOCALS_T_SAVESTOP),qfalse); // sizeof(level_locals_t));
level = *temp; // struct copy
@@ -909,7 +909,7 @@ static void WriteGEntities(qboolean qbAutosave)
//
if (tempEnt.NPC)
{
- gNPC_t npc = *ent->NPC; // NOT *tempEnt.NPC; !! :-)
+ ja_gNPC_t npc = *ent->NPC; // NOT *tempEnt.NPC; !! :-)
EnumerateFields(savefields_gNPC, &npc, INT_ID('G','N','P','C'), sizeof(npc));
}
@@ -1022,7 +1022,7 @@ static void ReadGEntities(qboolean qbAutosave)
//
if (pEnt->NPC) // will be qtrue/qfalse
{
- gNPC_t tempNPC;
+ ja_gNPC_t tempNPC;
EvaluateFields(savefields_gNPC, &tempNPC,(byte *)pEntOriginal->NPC, INT_ID('G','N','P','C'), sizeof (*pEnt->NPC),qfalse);
@@ -1039,7 +1039,7 @@ static void ReadGEntities(qboolean qbAutosave)
// original didn't have one (hmmm...), so make a new one...
//
//assert(0); // I want to know about this, though not in release
- pEnt->NPC = (gNPC_t *) G_Alloc(sizeof(*pEnt->NPC));
+ pEnt->NPC = (ja_gNPC_t *) G_Alloc(sizeof(*pEnt->NPC));
}
// copy over the one we've just loaded...
@@ -1091,7 +1091,7 @@ static void ReadGEntities(qboolean qbAutosave)
//
if (pEnt->parms) // will be qtrue/qfalse
{
- parms_t tempParms;
+ ja_parms_t tempParms;
::gi.saved_game->read_chunk(
INT_ID('P','A','R','M'),
@@ -1109,7 +1109,7 @@ static void ReadGEntities(qboolean qbAutosave)
{
// original didn't have one, so make a new one...
//
- pEnt->parms = (parms_t *) G_Alloc(sizeof(*pEnt->parms));
+ pEnt->parms = (ja_parms_t *) G_Alloc(sizeof(*pEnt->parms));
}
// copy over the one we've just loaded...
diff --git a/code/game/g_shared.h b/code/game/g_shared.h
index ddf8aa5..8fe7f2a 100644
--- a/code/game/g_shared.h
+++ b/code/game/g_shared.h
@@ -198,8 +198,10 @@ typedef enum
#define RF_LOCKEDANGLE 1
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct renderInfo_s
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_renderInfo_t
{
+public:
// Legs model, or full model on one piece entities
union
@@ -402,7 +404,7 @@ typedef struct renderInfo_s
saved_game->read<int32_t>(lookingDebounceTime);
saved_game->read<float>(legsYaw);
}
-} renderInfo_t;
+}; // ja_renderInfo_t
// Movement information structure
@@ -430,7 +432,10 @@ typedef enum {
} playerTeamStateState_t;
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct {
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_playerTeamState_t
+{
+public:
playerTeamStateState_t state;
int captures;
@@ -477,11 +482,13 @@ typedef struct {
saved_game->read<float>(flagsince);
saved_game->read<float>(lastfraggedcarrier);
}
-} playerTeamState_t;
+}; // ja_playerTeamState_t
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct objectives_s
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_objectives_t
{
+public:
qboolean display; // A displayable objective?
int status; // Succeed or fail or pending
@@ -499,14 +506,16 @@ typedef struct objectives_s
saved_game->read<int32_t>(display);
saved_game->read<int32_t>(status);
}
-} objectives_t;
+}; // ja_objectives_t
// NOTE: This is an arbitrary number greater than our current number of objectives with
// some fluff just in case we add more in the future.
#define MAX_MISSION_OBJ 100
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct missionStats_s
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_missionStats_t
{
+public:
int secretsFound; // # of secret areas found
int totalSecrets; // # of secret areas that could have been found
int shotsFired; // total number of shots fired
@@ -560,7 +569,7 @@ typedef struct missionStats_s
saved_game->read<int32_t>(forceUsed);
saved_game->read<int32_t>(weaponUsed);
}
-} missionStats_t;
+}; // ja_missionStats_t
// the auto following clients don't follow a specific client
// number, but instead follow the first two active players
@@ -579,8 +588,8 @@ class ja_clientSession_t
public:
int missionObjectivesShown; // Number of times mission objectives have been updated
team_t sessionTeam;
- objectives_t mission_objectives[MAX_MISSION_OBJ];
- missionStats_t missionStats; // Various totals while on a mission
+ ja_objectives_t mission_objectives[MAX_MISSION_OBJ];
+ ja_missionStats_t missionStats; // Various totals while on a mission
void sg_export(
@@ -616,7 +625,7 @@ public:
int enterTime; // level.time the client entered the game
short cmd_angles[3]; // angles sent over in the last command
- playerTeamState_t teamState; // status in teamplay games
+ ja_playerTeamState_t teamState; // status in teamplay games
void sg_export(
@@ -744,7 +753,7 @@ public:
float hiddenDist;//How close ents have to be to pick you up as an enemy
vec3_t hiddenDir;//Normalized direction in which NPCs can't see you (you are hidden)
- renderInfo_t renderInfo;
+ ja_renderInfo_t renderInfo;
//dismember tracker
bool dismembered;
@@ -919,8 +928,10 @@ public:
#define MAX_PARMS 16
#define MAX_PARM_STRING_LENGTH MAX_QPATH//was 16, had to lengthen it so they could take a valid file path
-typedef struct
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class ja_parms_t
{
+public:
char parm[MAX_PARMS][MAX_PARM_STRING_LENGTH];
@@ -935,7 +946,7 @@ typedef struct
{
saved_game->read<int8_t>(parm);
}
-} parms_t;
+}; // ja_parms_t
#ifdef GAME_INCLUDE
//these hold the place for the enums in functions.h so i don't have to recompile everytime it changes
@@ -1135,7 +1146,7 @@ Ghoul2 Insert End
//Script/ICARUS-related fields
int m_iIcarusID;
int taskID[NUM_TIDS];
- parms_t *parms;
+ ja_parms_t *parms;
char *behaviorSet[NUM_BSETS];
char *script_targetname;
int delayScriptTime;
@@ -1202,7 +1213,7 @@ Ghoul2 Insert End
//NPC/Player entity fields
//FIXME: Make these client only?
- gNPC_t *NPC;//Only allocated if the entity becomes an NPC
+ ja_gNPC_t *NPC;//Only allocated if the entity becomes an NPC
//Other NPC/Player-related entity fields
char *ownername;//Used by squadpaths to locate owning NPC
diff --git a/code/qcommon/msg.cpp b/code/qcommon/msg.cpp
index 1a35150..dc23211 100644
--- a/code/qcommon/msg.cpp
+++ b/code/qcommon/msg.cpp
@@ -1026,7 +1026,7 @@ MSG_WriteDeltaPlayerstate
=============
*/
-void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct playerState_s *to ) {
+void MSG_WriteDeltaPlayerstate( msg_t *msg, playerState_t *from, playerState_t *to ) {
int i;
playerState_t dummy;
int statsbits;
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 0186889..54ef294 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -2278,7 +2278,10 @@ typedef struct
// so if a playerState_t is transmitted, the entityState_t can be fully derived
// from it.
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct playerState_s {
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class playerState_t
+{
+public:
int commandTime; // cmd->serverTime of last executed command
int pm_type;
int bobCycle; // for view bobbing and footstep generation
@@ -2864,7 +2867,7 @@ typedef struct playerState_s {
saved_game->read<int32_t>(brokenLimbs);
saved_game->read<int32_t>(electrifyTime);
}
-} playerState_t;
+}; // playerState_t
//====================================================================
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index bd79f4b..483b85b 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -68,7 +68,7 @@ void MSG_WriteData (msg_t *buf, const void *data, int length);
struct usercmd_s;
struct entityState_s;
-struct playerState_s;
+class playerState_t;
void MSG_WriteBits( msg_t *msg, int value, int bits );
@@ -99,8 +99,8 @@ void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
void MSG_ReadEntity( msg_t *msg, entityState_t *to);
void MSG_WriteEntity( msg_t *msg, entityState_t *to, int removeNum);
-void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct playerState_s *to );
-void MSG_ReadDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct playerState_s *to );
+void MSG_WriteDeltaPlayerstate( msg_t *msg, playerState_t *from, playerState_t *to );
+void MSG_ReadDeltaPlayerstate( msg_t *msg, playerState_t *from, playerState_t *to );
/*
==============================================================
diff --git a/code/ui/ui_main.cpp b/code/ui/ui_main.cpp
index 3f48716..2b790af 100644
--- a/code/ui/ui_main.cpp
+++ b/code/ui/ui_main.cpp
@@ -2017,12 +2017,13 @@ static qboolean UI_OwnerDrawHandleKey(int ownerDraw, int flags, float *special,
//because the ui can be loaded while the game/cgame are not loaded. So we're going to recreate what we need here.
#undef MAX_ANIM_FILES
#define MAX_ANIM_FILES 4
-typedef struct
+class ui_animFileSet_t
{
+public:
char filename[MAX_QPATH];
ja_animation_t animations[MAX_ANIMATIONS];
-} animFileSet_t;
-static animFileSet_t ui_knownAnimFileSets[MAX_ANIM_FILES];
+}; // ui_animFileSet_t
+static ui_animFileSet_t ui_knownAnimFileSets[MAX_ANIM_FILES];
int ui_numKnownAnimFileSets;
diff --git a/codeJK2/cgame/cg_main.cpp b/codeJK2/cgame/cg_main.cpp
index 7b2e5c2..709f443 100644
--- a/codeJK2/cgame/cg_main.cpp
+++ b/codeJK2/cgame/cg_main.cpp
@@ -939,7 +939,7 @@ Ghoul2 Insert End
}
-void CG_RegisterClientRenderInfo(jo_clientInfo_t *ci, renderInfo_t *ri)
+void CG_RegisterClientRenderInfo(jo_clientInfo_t *ci, jo_renderInfo_t *ri)
{
char *slash;
char headModelName[MAX_QPATH];
diff --git a/codeJK2/cgame/cg_players.cpp b/codeJK2/cgame/cg_players.cpp
index 5f544bd..7aea958 100644
--- a/codeJK2/cgame/cg_players.cpp
+++ b/codeJK2/cgame/cg_players.cpp
@@ -1666,7 +1666,7 @@ CG_AddHeadBob
*/
static qboolean CG_AddHeadBob( centity_t *cent, vec3_t addTo )
{
- renderInfo_t *renderInfo = ¢->gent->client->renderInfo;
+ jo_renderInfo_t *renderInfo = ¢->gent->client->renderInfo;
const int volume = gi.VoiceVolume[cent->gent->s.clientNum];
const int volChange = volume - renderInfo->lastVoiceVolume;//was *3 because voice fromLA was too low
int i;
diff --git a/codeJK2/game/NPC.cpp b/codeJK2/game/NPC.cpp
index c301664..b6a69e2 100644
--- a/codeJK2/game/NPC.cpp
+++ b/codeJK2/game/NPC.cpp
@@ -75,7 +75,7 @@ cvar_t *d_slowmodeath;
extern qboolean stop_icarus;
gentity_t *NPC;
-gNPC_t *NPCInfo;
+jo_gNPC_t *NPCInfo;
jo_gclient_t *client;
usercmd_t ucmd;
visibility_t enemyVisibility;
@@ -817,7 +817,7 @@ void SetNPCGlobals( gentity_t *ent )
}
gentity_t *_saved_NPC;
-gNPC_t *_saved_NPCInfo;
+jo_gNPC_t *_saved_NPCInfo;
jo_gclient_t *_saved_client;
usercmd_t _saved_ucmd;
diff --git a/codeJK2/game/NPC_spawn.cpp b/codeJK2/game/NPC_spawn.cpp
index 3627d20..c3faba7 100644
--- a/codeJK2/game/NPC_spawn.cpp
+++ b/codeJK2/game/NPC_spawn.cpp
@@ -1070,9 +1070,9 @@ void NPC_Begin (gentity_t *ent)
}
}
-gNPC_t *New_NPC_t()
+jo_gNPC_t *New_NPC_t()
{
- gNPC_t *ptr = (gNPC_t *)G_Alloc (sizeof(gNPC_t));
+ jo_gNPC_t *ptr = (jo_gNPC_t *)G_Alloc (sizeof(jo_gNPC_t));
if (ptr)
{
diff --git a/codeJK2/game/NPC_stats.cpp b/codeJK2/game/NPC_stats.cpp
index 85e7cfd..1eec8d1 100644
--- a/codeJK2/game/NPC_stats.cpp
+++ b/codeJK2/game/NPC_stats.cpp
@@ -301,7 +301,7 @@ static int MoveTypeNameToEnum( const char *name )
return MT_STATIC;
}
-extern void CG_RegisterClientRenderInfo(jo_clientInfo_t *ci, renderInfo_t *ri);
+extern void CG_RegisterClientRenderInfo(jo_clientInfo_t *ci, jo_renderInfo_t *ri);
extern void CG_RegisterClientModels (int entityNum);
extern void CG_RegisterNPCCustomSounds( jo_clientInfo_t *ci );
extern void CG_RegisterNPCEffects( team_t team );
@@ -706,7 +706,7 @@ Precaches NPC skins, tgas and md3s.
void NPC_Precache ( gentity_t *spawner )
{
jo_clientInfo_t ci={};
- renderInfo_t ri={};
+ jo_renderInfo_t ri={};
team_t playerTeam = TEAM_FREE;
const char *token;
const char *value;
@@ -1070,8 +1070,8 @@ qboolean NPC_ParseParms( const char *NPCName, gentity_t *NPC )
char playerModel[MAX_QPATH];
char customSkin[MAX_QPATH];
jo_clientInfo_t *ci = &NPC->client->clientInfo;
- renderInfo_t *ri = &NPC->client->renderInfo;
- gNPCstats_t *stats = NULL;
+ jo_renderInfo_t *ri = &NPC->client->renderInfo;
+ jo_gNPCstats_t *stats = NULL;
qboolean md3Model = qtrue;
char surfOff[1024];
char surfOn[1024];
diff --git a/codeJK2/game/Q3_Interface.cpp b/codeJK2/game/Q3_Interface.cpp
index 71699d5..86dc9ef 100644
--- a/codeJK2/game/Q3_Interface.cpp
+++ b/codeJK2/game/Q3_Interface.cpp
@@ -723,7 +723,7 @@ static void Q3_SetObjective(const char *ObjEnum, int status)
{
int objectiveID;
jo_gclient_t *client;
- objectives_t *objective;
+ jo_objectives_t *objective;
int *objectivesShown;
client = &level.clients[0];
@@ -4124,8 +4124,8 @@ void Q3_SetParm (int entID, int parmNum, const char *parmValue)
if( !ent->parms )
{
- ent->parms = (parms_t *)G_Alloc( sizeof(parms_t) );
- memset( ent->parms, 0, sizeof(parms_t) );
+ ent->parms = (jo_parms_t *)G_Alloc( sizeof(jo_parms_t) );
+ memset( ent->parms, 0, sizeof(jo_parms_t) );
}
if ( (val = Q3_CheckStringCounterIncrement( parmValue )) )
diff --git a/codeJK2/game/b_local.h b/codeJK2/game/b_local.h
index d450b92..dd3ebd0 100644
--- a/codeJK2/game/b_local.h
+++ b/codeJK2/game/b_local.h
@@ -81,7 +81,7 @@ extern void Debug_NPCPrintf( gentity_t *printNPC, cvar_t *cv, int debugLevel, ch
//MCG - Begin============================================================
//NPC_ai variables - shared by NPC.cpp andf the following modules
extern gentity_t *NPC;
-extern gNPC_t *NPCInfo;
+extern jo_gNPC_t *NPCInfo;
extern jo_gclient_t *client;
extern usercmd_t ucmd;
extern visibility_t enemyVisibility;
diff --git a/codeJK2/game/b_public.h b/codeJK2/game/b_public.h
index 85f6671..66263b0 100644
--- a/codeJK2/game/b_public.h
+++ b/codeJK2/game/b_public.h
@@ -114,8 +114,9 @@ typedef enum //# movetype_e
NUM_MOVETYPES
} movetype_t;
-typedef struct gNPCstats_e
+class jo_gNPCstats_t
{//Stats, loaded in, and can be set by scripts
+public:
//AI
int aggression; // "
int aim; // "
@@ -183,7 +184,7 @@ typedef struct gNPCstats_e
saved_game->read<int32_t>(health);
saved_game->read<int32_t>(acceleration);
}
-} gNPCstats_t;
+}; // jo_gNPCstats_t
// NOTE!!! If you add any ptr fields into this structure could you please tell me so I can update the load/save code?
// so far the only things I've got to cope with are a bunch of gentity_t*'s, but tell me if any more get added -slc
@@ -193,8 +194,10 @@ typedef struct gNPCstats_e
#define ENEMY_POS_LAG_INTERVAL 100
#define ENEMY_POS_LAG_STEPS (MAX_ENEMY_POS_LAG/ENEMY_POS_LAG_INTERVAL)
-typedef struct
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_gNPC_t
{
+public:
//FIXME: Put in playerInfo or something
int timeOfDeath; //FIXME do we really need both of these
gentity_t *touchedByPlayer;
@@ -275,7 +278,7 @@ typedef struct
vec3_t lastPathAngles; //So we know which way to face generally when we stop
//stats
- gNPCstats_t stats;
+ jo_gNPCstats_t stats;
int aimErrorDebounceTime;
float lastAimErrorYaw;
float lastAimErrorPitch;
@@ -550,7 +553,7 @@ typedef struct
saved_game->read<int32_t>(ffireDebounce);
saved_game->read<int32_t>(ffireFadeDebounce);
}
-} gNPC_t;
+}; // jo_gNPC_t
void G_SquadPathsInit(void);
void NPC_InitGame( void );
diff --git a/codeJK2/game/fields.h b/codeJK2/game/fields.h
index b08b128..42e3da3 100644
--- a/codeJK2/game/fields.h
+++ b/codeJK2/game/fields.h
@@ -37,9 +37,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define FOFS(x) offsetof(gentity_t, x) // usually already defined in qshared.h
#endif
#define STOFS(x) offsetof(spawn_temp_t, x)
-#define LLOFS(x) offsetof(level_locals_t, x)
+#define LLOFS(x) offsetof(jo_level_locals_t, x)
#define CLOFS(x) offsetof(jo_gclient_t, x)
-#define NPCOFS(x) offsetof(gNPC_t, x)
+#define NPCOFS(x) offsetof(jo_gNPC_t, x)
//
#define strFOFS(x) #x,FOFS(x)
#define strSTOFS(x) #x,STOFS(x)
diff --git a/codeJK2/game/g_local.h b/codeJK2/game/g_local.h
index 4488fd4..58f8d08 100644
--- a/codeJK2/game/g_local.h
+++ b/codeJK2/game/g_local.h
@@ -194,8 +194,10 @@ typedef struct
#define WF_SNOWING 0x00000002 //snowing
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_level_locals_t
{
+public:
jo_gclient_t *clients; // [maxclients]
// store latched cvars here that we want to get at often
@@ -291,9 +293,9 @@ typedef struct
saved_game->read<int32_t>(worldFlags);
saved_game->read<int32_t>(dmState);
}
-} level_locals_t;
+}; // jo_level_locals_t
-extern level_locals_t level;
+extern jo_level_locals_t level;
extern game_export_t globals;
extern cvar_t *g_gravity;
diff --git a/codeJK2/game/g_main.cpp b/codeJK2/game/g_main.cpp
index 1de4cd1..4306808 100644
--- a/codeJK2/game/g_main.cpp
+++ b/codeJK2/game/g_main.cpp
@@ -44,7 +44,7 @@ int eventClearTime = 0;
#define STEPSIZE 18
-level_locals_t level;
+jo_level_locals_t level;
game_import_t gi;
game_export_t globals;
gentity_t g_entities[MAX_GENTITIES];
diff --git a/codeJK2/game/g_savegame.cpp b/codeJK2/game/g_savegame.cpp
index c7df21c..5e75a1e9 100644
--- a/codeJK2/game/g_savegame.cpp
+++ b/codeJK2/game/g_savegame.cpp
@@ -667,7 +667,7 @@ All pointer variables (except function pointers) must be handled specially.
*/
static void WriteLevelLocals ()
{
- level_locals_t *temp = (level_locals_t *)gi.Malloc(sizeof(level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
+ jo_level_locals_t *temp = (jo_level_locals_t *)gi.Malloc(sizeof(jo_level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
*temp = level; // copy out all data into a temp space
EnumerateFields(savefields_LevelLocals, temp, INT_ID('L','V','L','C'), LLOFS(LEVEL_LOCALS_T_SAVESTOP));
@@ -687,7 +687,7 @@ static void ReadLevelLocals ()
//
jo_gclient_t *pClients = level.clients; // save clients
- level_locals_t *temp = (level_locals_t *)gi.Malloc(sizeof(level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
+ jo_level_locals_t *temp = (jo_level_locals_t *)gi.Malloc(sizeof(jo_level_locals_t), TAG_TEMP_WORKSPACE, qfalse);
*temp = level;
EvaluateFields(savefields_LevelLocals, temp, &level, INT_ID('L','V','L','C'), LLOFS(LEVEL_LOCALS_T_SAVESTOP),qfalse); // sizeof(level_locals_t));
level = *temp; // struct copy
@@ -741,7 +741,7 @@ static void WriteGEntities(qboolean qbAutosave)
//
if (tempEnt.NPC)
{
- gNPC_t npc = *ent->NPC; // NOT *tempEnt.NPC; !! :-)
+ jo_gNPC_t npc = *ent->NPC; // NOT *tempEnt.NPC; !! :-)
EnumerateFields(savefields_gNPC, &npc, INT_ID('G','N','P','C'), sizeof(npc));
}
@@ -847,7 +847,7 @@ static void ReadGEntities(qboolean qbAutosave)
//
if (pEnt->NPC) // will be qtrue/qfalse
{
- gNPC_t tempNPC;
+ jo_gNPC_t tempNPC;
EvaluateFields(savefields_gNPC, &tempNPC,pEntOriginal->NPC, INT_ID('G','N','P','C'), sizeof (*pEnt->NPC),qfalse);
@@ -864,7 +864,7 @@ static void ReadGEntities(qboolean qbAutosave)
// original didn't have one (hmmm...), so make a new one...
//
//assert(0); // I want to know about this, though not in release
- pEnt->NPC = (gNPC_t *) G_Alloc(sizeof(*pEnt->NPC));
+ pEnt->NPC = (jo_gNPC_t *) G_Alloc(sizeof(*pEnt->NPC));
}
// copy over the one we've just loaded...
@@ -903,7 +903,7 @@ static void ReadGEntities(qboolean qbAutosave)
//
if (pEnt->parms) // will be qtrue/qfalse
{
- parms_t tempParms;
+ jo_parms_t tempParms;
::gi.saved_game->read_chunk(
INT_ID('P','A','R','M'),
@@ -921,7 +921,7 @@ static void ReadGEntities(qboolean qbAutosave)
{
// original didn't have one, so make a new one...
//
- pEnt->parms = (parms_t *) G_Alloc(sizeof(*pEnt->parms));
+ pEnt->parms = (jo_parms_t *) G_Alloc(sizeof(*pEnt->parms));
}
// copy over the one we've just loaded...
diff --git a/codeJK2/game/g_shared.h b/codeJK2/game/g_shared.h
index f9e108e..c25e7b1 100644
--- a/codeJK2/game/g_shared.h
+++ b/codeJK2/game/g_shared.h
@@ -255,8 +255,10 @@ typedef enum
#define RF_LOCKEDANGLE 1
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct renderInfo_s
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_renderInfo_t
{
+public:
// Legs model, or full model on one piece entities
union
{
@@ -438,7 +440,7 @@ typedef struct renderInfo_s
saved_game->read<int32_t>(lookingDebounceTime);
saved_game->read<float>(legsYaw);
}
-} renderInfo_t;
+}; // jo_renderInfo_t
// Movement information structure
@@ -466,7 +468,10 @@ typedef enum {
} playerTeamStateState_t;
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct {
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_playerTeamState_t
+{
+public:
playerTeamStateState_t state;
int captures;
@@ -513,11 +518,13 @@ typedef struct {
saved_game->read<float>(flagsince);
saved_game->read<float>(lastfraggedcarrier);
}
-} playerTeamState_t;
+}; // jo_playerTeamState_t
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct objectives_s
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_objectives_t
{
+public:
qboolean display; // A displayable objective?
int status; // Succeed or fail or pending
@@ -535,12 +542,14 @@ typedef struct objectives_s
saved_game->read<int32_t>(display);
saved_game->read<int32_t>(status);
}
-} objectives_t;
+}; // jo_objectives_t
#define MAX_MISSION_OBJ 80
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-typedef struct missionStats_s
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_missionStats_t
{
+public:
int secretsFound; // # of secret areas found
int totalSecrets; // # of secret areas that could have been found
int shotsFired; // total number of shots fired
@@ -594,7 +603,7 @@ typedef struct missionStats_s
saved_game->read<int32_t>(forceUsed);
saved_game->read<int32_t>(weaponUsed);
}
-} missionStats_t;
+}; // jo_missionStats_t
// the auto following clients don't follow a specific client
// number, but instead follow the first two active players
@@ -613,8 +622,8 @@ class jo_clientSession_t
public:
int missionObjectivesShown; // Number of times mission objectives have been updated
team_t sessionTeam;
- objectives_t mission_objectives[MAX_MISSION_OBJ];
- missionStats_t missionStats; // Various totals while on a mission
+ jo_objectives_t mission_objectives[MAX_MISSION_OBJ];
+ jo_missionStats_t missionStats; // Various totals while on a mission
void sg_export(
@@ -651,7 +660,7 @@ public:
int enterTime; // level.time the client entered the game
short cmd_angles[3]; // angles sent over in the last command
- playerTeamState_t teamState; // status in teamplay games
+ jo_playerTeamState_t teamState; // status in teamplay games
void sg_export(
@@ -781,7 +790,7 @@ public:
float hiddenDist;//How close ents have to be to pick you up as an enemy
vec3_t hiddenDir;//Normalized direction in which NPCs can't see you (you are hidden)
- renderInfo_t renderInfo;
+ jo_renderInfo_t renderInfo;
saberTrail_t saberTrail;
//dismember tracker
@@ -929,8 +938,11 @@ public:
#define MAX_PARMS 16
#define MAX_PARM_STRING_LENGTH MAX_QPATH//was 16, had to lengthen it so they could take a valid file path
-typedef struct
-{
+
+// FIXME Added prefix to avoid debugging problems in Visual Studio.
+class jo_parms_t
+{
+public:
char parm[MAX_PARMS][MAX_PARM_STRING_LENGTH];
@@ -945,7 +957,7 @@ typedef struct
{
saved_game->read<int8_t>(parm);
}
-} parms_t;
+}; // jo_parms_t
#define GAME_INCLUDE
#ifdef GAME_INCLUDE
@@ -1135,7 +1147,7 @@ Ghoul2 Insert End
CSequencer *sequencer;
CTaskManager *taskManager;
int taskID[NUM_TIDS];
- parms_t *parms;
+ jo_parms_t *parms;
char *behaviorSet[NUM_BSETS];
char *script_targetname;
int delayScriptTime;
@@ -1198,7 +1210,7 @@ Ghoul2 Insert End
//FIELDS USED EXCLUSIVELY BY SPECIFIC CLASSES OF ENTITIES
//NPC/Player entity fields
//FIXME: Make these client only?
- gNPC_t *NPC;//Only allocated if the entity becomes an NPC
+ jo_gNPC_t *NPC;//Only allocated if the entity becomes an NPC
//Other NPC/Player-related entity fields
char *ownername;//Used by squadpaths to locate owning NPC
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git
More information about the Pkg-games-commits
mailing list