diff --git a/code/cgame/cg_drawtools.cpp b/code/cgame/cg_drawtools.cpp index 1fbb029a..f1a1d061 100644 --- a/code/cgame/cg_drawtools.cpp +++ b/code/cgame/cg_drawtools.cpp @@ -1210,7 +1210,7 @@ void CG_DrawSpectatorView_ver_6() } void CG_DrawSpectatorView() { - if (cgi.protocol >= PROTOCOL_MOHTA_MIN) { + if (cg_protocol >= PROTOCOL_MOHTA_MIN) { CG_DrawSpectatorView_ver_15(); } else { CG_DrawSpectatorView_ver_6(); diff --git a/code/cgame/cg_local.h b/code/cgame/cg_local.h index 0c0f56cb..684e55cb 100644 --- a/code/cgame/cg_local.h +++ b/code/cgame/cg_local.h @@ -359,9 +359,9 @@ typedef struct { typedef struct { gameState_t gameState; // gamestate from server glconfig_t glconfig; // rendering configuration - float screenXScale; // derived from glconfig - float screenYScale; - float screenXBias; + float screenXScale; // derived from glconfig + float screenYScale; + float screenXBias; int serverCommandSequence; // reliable command stream counter int processedSnapshotNum;// the number of snapshots cgame has requested @@ -402,6 +402,7 @@ extern cvar_t* developer; extern cgs_t cgs; extern cg_t cg; extern clientGameImport_t cgi; +extern int cg_protocol; extern centity_t cg_entities[MAX_GENTITIES]; extern markPoly_t cg_markPolys[MAX_MARK_POLYS]; diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 0714c699..7a5a2d21 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -31,11 +31,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif clientGameImport_t cgi; +static clientGameExport_t cge; cvar_t* paused; cvar_t* developer; cg_t cg; cgs_t cgs; +int cg_protocol; centity_t cg_entities[MAX_GENTITIES]; cvar_t* cg_animSpeed; @@ -587,6 +589,10 @@ void CG_Init(clientGameImport_t* imported, int serverMessageNum, cgi.Free = &CG_Free; #endif + cg_protocol = cgi.Cvar_Get("com_protocol", "", 0)->integer; + CG_InitCGMessageAPI(&cge); + CG_InitScoresAPI(&cge); + memset(&cg, 0, sizeof(cg)); memset(&cgs, 0, sizeof(cgs)); @@ -675,8 +681,6 @@ The only exported function from this module */ clientGameExport_t *GetCGameAPI(void) { - static clientGameExport_t cge; - cge.CG_Init = CG_Init; cge.CG_DrawActiveFrame = CG_DrawActiveFrame; cge.CG_Shutdown = CG_Shutdown; @@ -701,9 +705,6 @@ clientGameExport_t *GetCGameAPI(void) cge.CG_WeaponCommandButtonBits = CG_WeaponCommandButtonBits; cge.CG_CheckCaptureKey = CG_CheckCaptureKey; - CG_InitCGMessageAPI(&cge); - CG_InitScoresAPI(&cge); - // FIXME //cge.profStruct = NULL; @@ -821,7 +822,7 @@ void CG_ParseFogInfo_ver_6(const char* str) { } void CG_ParseFogInfo(const char* str) { - if (cgi.protocol >= PROTOCOL_MOHTA_MIN) { + if (cg_protocol >= PROTOCOL_MOHTA_MIN) { CG_ParseFogInfo_ver_15(str); } else { CG_ParseFogInfo_ver_6(str); diff --git a/code/cgame/cg_modelanim.c b/code/cgame/cg_modelanim.c index ec939781..6d92cd4d 100644 --- a/code/cgame/cg_modelanim.c +++ b/code/cgame/cg_modelanim.c @@ -30,7 +30,7 @@ void CG_PlayerTeamIcon(refEntity_t* pModel, entityState_t* pPlayerState) { qboolean bInArtillery, bInTeam, bSpecialIcon; - if (cgi.protocol < PROTOCOL_MOHTA_MIN) + if (cg_protocol < PROTOCOL_MOHTA_MIN) { if (pPlayerState->eFlags & EF_ALLIES) { diff --git a/code/cgame/cg_parsemsg.cpp b/code/cgame/cg_parsemsg.cpp index bbc914d1..2ef979ec 100644 --- a/code/cgame/cg_parsemsg.cpp +++ b/code/cgame/cg_parsemsg.cpp @@ -1147,7 +1147,7 @@ void CG_ParseCGMessage_ver_6() } void CG_InitCGMessageAPI(clientGameExport_t* cge) -{ if (cgi.protocol >= PROTOCOL_MOHTA_MIN) { +{ if (cg_protocol >= PROTOCOL_MOHTA_MIN) { cge->CG_ParseCGMessage = &CG_ParseCGMessage_ver_15; } else { cge->CG_ParseCGMessage = &CG_ParseCGMessage_ver_6; diff --git a/code/cgame/cg_public.h b/code/cgame/cg_public.h index 135b63d4..55290315 100644 --- a/code/cgame/cg_public.h +++ b/code/cgame/cg_public.h @@ -360,9 +360,6 @@ typedef struct clientAnim_t* anim; stopWatch_t* stopWatch; - target_game_e targetGame; - protocol_e protocol; - } clientGameImport_t; diff --git a/code/cgame/cg_scoreboard.cpp b/code/cgame/cg_scoreboard.cpp index df938199..227e5fb5 100644 --- a/code/cgame/cg_scoreboard.cpp +++ b/code/cgame/cg_scoreboard.cpp @@ -719,7 +719,7 @@ void CG_ParseScores_ver_6() void CG_ParseScores() { - if (cgi.protocol >= PROTOCOL_MOHTA_MIN) { + if (cg_protocol >= PROTOCOL_MOHTA_MIN) { CG_ParseScores_ver_15(); } else { CG_ParseScores_ver_6(); @@ -733,7 +733,7 @@ void CG_InitScoresAPI(clientGameExport_t* cge) cge->CG_GetScoreBoardPosition = CG_GetScoreBoardPosition; cge->CG_GetScoreBoardDrawHeader = CG_GetScoreBoardDrawHeader; - if (cgi.protocol >= PROTOCOL_MOHTA_MIN) { + if (cg_protocol >= PROTOCOL_MOHTA_MIN) { cge->CG_GetColumnName = &CG_GetColumnName_ver_15; } else { cge->CG_GetColumnName = &CG_GetColumnName_ver_6; diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index 66c0c9e0..4bf9caf4 100644 --- a/code/cgame/cg_servercmds.c +++ b/code/cgame/cg_servercmds.c @@ -225,7 +225,7 @@ static void CG_Stopwatch_f() Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters"); } - if (cgi.protocol >= PROTOCOL_MOHTA_MIN) { + if (cg_protocol >= PROTOCOL_MOHTA_MIN) { cgi.stopWatch->iStartTime = atoi(cgi.Argv(1)); } else { // The base game has it wrong diff --git a/code/client/cl_cgame.cpp b/code/client/cl_cgame.cpp index f9daf003..ec85ca83 100644 --- a/code/client/cl_cgame.cpp +++ b/code/client/cl_cgame.cpp @@ -758,9 +758,6 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) { // FIXME //cgi->pUnknownVar = NULL; - cgi->targetGame = (target_game_e)com_target_game->integer; - cgi->protocol = (protocol_e)com_protocol->integer; - cls.cgameStarted = qtrue; }