diff --git a/Makefile b/Makefile index f981b8c65..a09aa66c9 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ endif export CROSS_COMPILING ifndef VERSION -VERSION=1.0.2 +VERSION=1.0.3 endif ifndef VM_PREFIX @@ -856,6 +856,7 @@ makedirs: @$(MKDIR) $(B)/$(MISSIONPACK)/game @$(MKDIR) $(B)/$(MISSIONPACK)/ui @$(MKDIR) $(B)/$(MISSIONPACK)/qcommon + @$(MKDIR) $(B)/$(MISSIONPACK)/q3ui @$(MKDIR) $(B)/$(MISSIONPACK)/vm @$(MKDIR) $(B)/tools/asm @$(MKDIR) $(B)/tools/etc diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 4c2b9b104..b8983a0eb 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -2393,7 +2393,7 @@ static void CG_FeederSelection(float feederID, int index) { static float CG_Cvar_Get(const char *cvar) { char buff[128]; memset(buff, 0, sizeof(buff)); - trap_Cvar_VariableStringBuffer(cvar, buff, sizeof(buff)); + trap_Cvar_LatchedVariableStringBuffer(cvar, buff, sizeof(buff)); return atof(buff); } @@ -2471,7 +2471,7 @@ void CG_LoadHudMenu( void ) { cgDC.runScript = &CG_RunMenuScript; cgDC.getTeamColor = &CG_GetTeamColor; cgDC.setCVar = trap_Cvar_Set; - cgDC.getCVarString = trap_Cvar_VariableStringBuffer; + cgDC.getCVarString = trap_Cvar_LatchedVariableStringBuffer; cgDC.getCVarValue = CG_Cvar_Get; cgDC.drawTextWithCursor = &CG_Text_PaintWithCursor; cgDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode; diff --git a/code/game/bg_public.h b/code/game/bg_public.h index 0f6cee49d..ad3416cb9 100644 --- a/code/game/bg_public.h +++ b/code/game/bg_public.h @@ -44,7 +44,7 @@ Suite 120, Rockville, Maryland 20850 USA. // Keep this in-sync with VERSION in Makefile. #ifndef PRODUCT_VERSION - #define PRODUCT_VERSION "1.0.2" + #define PRODUCT_VERSION "1.0.3" #endif // because games can change separately from the main system protocol, we need a diff --git a/code/q3_ui/ui_controls2.c b/code/q3_ui/ui_controls2.c index 3ef767cf1..6ef3ca511 100644 --- a/code/q3_ui/ui_controls2.c +++ b/code/q3_ui/ui_controls2.c @@ -729,7 +729,7 @@ static void Controls_UpdateModel( int anim ) { break; } - UI_PlayerInfo_SetInfo( &s_controls.playerinfo, s_controls.playerLegs, s_controls.playerTorso, s_controls.playerViewangles, s_controls.playerMoveangles, s_controls.playerWeapon, s_controls.playerChat ); + UI_PlayerInfo_SetInfo( &s_controls.playerinfo, s_controls.localPlayerNum, s_controls.playerLegs, s_controls.playerTorso, s_controls.playerViewangles, s_controls.playerMoveangles, s_controls.playerWeapon, s_controls.playerChat ); } diff --git a/code/q3_ui/ui_local.h b/code/q3_ui/ui_local.h index 8ce9992e3..8eaaca1b9 100644 --- a/code/q3_ui/ui_local.h +++ b/code/q3_ui/ui_local.h @@ -521,11 +521,13 @@ typedef struct { int barrelTime; int realWeapon; + + int localPlayerNum; } uiPlayerInfo_t; void UI_DrawPlayer( float x, float y, float w, float h, uiPlayerInfo_t *pi, int time ); void UI_PlayerInfo_SetModel( uiPlayerInfo_t *pi, const char *model, const char *headmodel, char *teamName ); -void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat ); +void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int localPlayerNum, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat ); void UI_PlayerInfo_UpdateColor( uiPlayerInfo_t *pi ); qboolean UI_RegisterPlayerModelname( uiPlayerInfo_t *pi, const char *modelSkinName, const char *headModelSkinName, const char *teamName ); diff --git a/code/q3_ui/ui_playermodel.c b/code/q3_ui/ui_playermodel.c index e5a09a024..30a549cf8 100644 --- a/code/q3_ui/ui_playermodel.c +++ b/code/q3_ui/ui_playermodel.c @@ -193,7 +193,7 @@ static void PlayerModel_UpdateModel( void ) VectorClear( moveangles ); UI_PlayerInfo_SetModel( &s_playermodel.playerinfo, s_playermodel.modelskin, s_playermodel.headmodelskin, NULL ); - UI_PlayerInfo_SetInfo( &s_playermodel.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, moveangles, WP_MACHINEGUN, qfalse ); + UI_PlayerInfo_SetInfo( &s_playermodel.playerinfo, s_playermodel.localPlayerNum, LEGS_IDLE, TORSO_STAND, viewangles, moveangles, WP_MACHINEGUN, qfalse ); } /* diff --git a/code/q3_ui/ui_players.c b/code/q3_ui/ui_players.c index 0b09dd98a..73bdd0f82 100644 --- a/code/q3_ui/ui_players.c +++ b/code/q3_ui/ui_players.c @@ -1327,7 +1327,7 @@ UI_PlayerInfo_UpdateColor =============== */ void UI_PlayerInfo_UpdateColor( uiPlayerInfo_t *pi ) { - CG_PlayerColorFromIndex( trap_Cvar_VariableIntegerValue( "color1" ), pi->color1 ); + CG_PlayerColorFromIndex( trap_Cvar_VariableIntegerValue( Com_LocalPlayerCvarName( pi->localPlayerNum, "color1" ) ), pi->color1 ); pi->c1RGBA[0] = 255 * pi->color1[0]; pi->c1RGBA[1] = 255 * pi->color1[1]; @@ -1341,11 +1341,12 @@ void UI_PlayerInfo_UpdateColor( uiPlayerInfo_t *pi ) { UI_PlayerInfo_SetInfo =============== */ -void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, qboolean chat ) { +void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int localPlayerNum, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, qboolean chat ) { int currentAnim; weapon_t weaponNum; pi->chat = chat; + pi->localPlayerNum = localPlayerNum; UI_PlayerInfo_UpdateColor( pi ); diff --git a/code/q3_ui/ui_playersettings.c b/code/q3_ui/ui_playersettings.c index 7f9190781..3b52a7b18 100644 --- a/code/q3_ui/ui_playersettings.c +++ b/code/q3_ui/ui_playersettings.c @@ -275,7 +275,7 @@ static void PlayerSettings_DrawPlayer( void *self ) { viewangles[YAW] = 180 - 30; viewangles[PITCH] = 0; viewangles[ROLL] = 0; - UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); + UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, s_playersettings.localPlayerNum, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); } b = (menubitmap_s*) self; @@ -357,7 +357,7 @@ static void PlayerSettings_SetMenuItems( void ) { trap_Cvar_VariableStringBuffer( Com_LocalPlayerCvarName(s_playersettings.localPlayerNum, "headmodel"), headmodel, sizeof ( headmodel ) ); UI_PlayerInfo_SetModel( &s_playersettings.playerinfo, model, headmodel, NULL ); - UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); + UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, s_playersettings.localPlayerNum, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); // handicap h = Com_Clamp( 5, 100, trap_Cvar_VariableValue(Com_LocalPlayerCvarName(s_playersettings.localPlayerNum, "handicap")) ); diff --git a/code/ui/ui_local.h b/code/ui/ui_local.h index 3c85ea35d..fe0754854 100644 --- a/code/ui/ui_local.h +++ b/code/ui/ui_local.h @@ -197,11 +197,13 @@ typedef struct { int barrelTime; int realWeapon; + + int localPlayerNum; } uiPlayerInfo_t; void UI_DrawPlayer( float x, float y, float w, float h, uiPlayerInfo_t *pi, int time ); void UI_PlayerInfo_SetModel( uiPlayerInfo_t *pi, const char *model, const char *headmodel, char *teamName ); -void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat ); +void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int localPlayerNum, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat ); void UI_PlayerInfo_UpdateColor( uiPlayerInfo_t *pi ); qboolean UI_RegisterPlayerModelname( uiPlayerInfo_t *pi, const char *modelSkinName , const char *headName, const char *teamName); diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c index 032a788e4..13fddd6bc 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -1041,7 +1041,7 @@ static void UI_DrawPlayerModel(rectDef_t *rect) { viewangles[ROLL] = 0; VectorClear( moveangles ); UI_PlayerInfo_SetModel( &info, model, head, team); - UI_PlayerInfo_SetInfo( &info, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); + UI_PlayerInfo_SetInfo( &info, 0, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); // UI_RegisterPlayerModelname( &info, model, head, team); updateModel = qfalse; updateModelColor = qfalse; // playerinfo setinfo calls updatecolor @@ -1188,7 +1188,7 @@ static void UI_DrawOpponent(rectDef_t *rect) { viewangles[ROLL] = 0; VectorClear( moveangles ); UI_PlayerInfo_SetModel( &info2, model, headmodel, ""); - UI_PlayerInfo_SetInfo( &info2, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); + UI_PlayerInfo_SetInfo( &info2, 0, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); UI_RegisterPlayerModelname( &info2, model, headmodel, team); updateOpponentModel = qfalse; } @@ -4696,6 +4696,13 @@ static void UI_BuildQ3Model_List( void ) } +static float UI_Cvar_Get(const char *cvar) { + char buff[128]; + memset(buff, 0, sizeof(buff)); + trap_Cvar_LatchedVariableStringBuffer(cvar, buff, sizeof(buff)); + return atof(buff); +} + /* ================= @@ -4735,8 +4742,8 @@ void UI_Init( qboolean inGameLoad, int maxSplitView ) { uiInfo.uiDC.runScript = &UI_RunMenuScript; uiInfo.uiDC.getTeamColor = &UI_GetTeamColor; uiInfo.uiDC.setCVar = trap_Cvar_Set; - uiInfo.uiDC.getCVarString = trap_Cvar_VariableStringBuffer; - uiInfo.uiDC.getCVarValue = trap_Cvar_VariableValue; + uiInfo.uiDC.getCVarString = trap_Cvar_LatchedVariableStringBuffer; + uiInfo.uiDC.getCVarValue = UI_Cvar_Get; uiInfo.uiDC.drawTextWithCursor = &UI_Text_PaintWithCursor; uiInfo.uiDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode; uiInfo.uiDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode; diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c index b18783cf6..556c37627 100644 --- a/code/ui/ui_players.c +++ b/code/ui/ui_players.c @@ -1333,7 +1333,7 @@ UI_PlayerInfo_UpdateColor =============== */ void UI_PlayerInfo_UpdateColor( uiPlayerInfo_t *pi ) { - CG_PlayerColorFromIndex( trap_Cvar_VariableIntegerValue( "color1" ), pi->color1 ); + CG_PlayerColorFromIndex( trap_Cvar_VariableIntegerValue( Com_LocalPlayerCvarName( pi->localPlayerNum, "color1" ) ), pi->color1 ); pi->c1RGBA[0] = 255 * pi->color1[0]; pi->c1RGBA[1] = 255 * pi->color1[1]; @@ -1347,11 +1347,12 @@ void UI_PlayerInfo_UpdateColor( uiPlayerInfo_t *pi ) { UI_PlayerInfo_SetInfo =============== */ -void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, qboolean chat ) { +void UI_PlayerInfo_SetInfo( uiPlayerInfo_t *pi, int localPlayerNum, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, qboolean chat ) { int currentAnim; weapon_t weaponNum; pi->chat = chat; + pi->localPlayerNum = localPlayerNum; UI_PlayerInfo_UpdateColor( pi );