From 0632e3060a84a3d5e8637d425d3d77fa30ce18d6 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 26 Nov 2019 22:53:53 -0600 Subject: [PATCH 1/4] mint-arena: Fix compiling Team Arena with q3_ui "make USE_MISSIONPACK_Q3_UI=1" failed because build directory didn't exist. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index f981b8c65..c9b13ac27 100644 --- a/Makefile +++ b/Makefile @@ -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 From 9e1b8f4e5b772b1f8d1ba218f094e17f8779edf3 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 15 Dec 2019 12:34:08 -0600 Subject: [PATCH 2/4] mint-arena: Fix changing engine latch cvars in Team Arena menu Spearmint doesn't allow VMs to immediately change engine latch cvars since it bypasses engine validation and reports incorrect state in console. The menus however edit / display cvars for applying later so they need to work with the latched values. Engine latch cvars referenced by Team Arena menu scripts (start server and setup -> system menus): sv_maxclients r_allowExtensions r_colorbits r_ext_compressed_textures r_mode r_picmip r_texturebits r_vertexlight Issue introduced in Spearmint July 12, 2014 commit: "spearmint: Limit what Cvar_VM_Set can force change" --- code/cgame/cg_main.c | 4 ++-- code/ui/ui_main.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) 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/ui/ui_main.c b/code/ui/ui_main.c index 032a788e4..c06207150 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -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; From 85016c46588be86616b612303b1044d3e052bcce Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 1 May 2020 16:40:43 -0400 Subject: [PATCH 3/4] mint-arena: Fix color1 on player model for player 2-4 in q3_ui Changing color1 and color2 cvars worked correctly but displaying color1 on weapon / player models (rgbGen entity) always used player 1's color. --- code/q3_ui/ui_controls2.c | 2 +- code/q3_ui/ui_local.h | 4 +++- code/q3_ui/ui_playermodel.c | 2 +- code/q3_ui/ui_players.c | 5 +++-- code/q3_ui/ui_playersettings.c | 4 ++-- code/ui/ui_local.h | 4 +++- code/ui/ui_main.c | 4 ++-- code/ui/ui_players.c | 5 +++-- 8 files changed, 18 insertions(+), 12 deletions(-) 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 b1b0b5d0e..02ac18f1b 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 c06207150..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; } diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c index aa85e3347..39d22f9c3 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 ); From 9ffc594a3d15e942ed19f0203d8724b10dff14f9 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 10 Jul 2020 16:05:17 -0400 Subject: [PATCH 4/4] mint-arena: Change version to 1.0.3 --- Makefile | 2 +- code/game/bg_public.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c9b13ac27..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 diff --git a/code/game/bg_public.h b/code/game/bg_public.h index 4e769a286..9078ac48d 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