Skip to content

Commit

Permalink
Merge branch 'master' into example/camo-pants_get-surface-shader
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Jan 16, 2021
2 parents a2ee75a + 9ffc594 commit 8b51c12
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 18 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ endif
export CROSS_COMPILING

ifndef VERSION
VERSION=1.0.2
VERSION=1.0.3
endif

ifndef VM_PREFIX
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion code/game/bg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/q3_ui/ui_controls2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}


Expand Down
4 changes: 3 additions & 1 deletion code/q3_ui/ui_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion code/q3_ui/ui_playermodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/*
Expand Down
5 changes: 3 additions & 2 deletions code/q3_ui/ui_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 );

Expand Down
4 changes: 2 additions & 2 deletions code/q3_ui/ui_playersettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")) );
Expand Down
4 changes: 3 additions & 1 deletion code/ui/ui_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
15 changes: 11 additions & 4 deletions code/ui/ui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}


/*
=================
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions code/ui/ui_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 );

Expand Down

0 comments on commit 8b51c12

Please sign in to comment.