Trying to Use convar_t on cvars created by CVAR_CREATE. Update submodules
This commit is contained in:
parent
956d584c9f
commit
0171e60c20
2
3rdparty/regamelite
vendored
2
3rdparty/regamelite
vendored
@ -1 +1 @@
|
||||
Subproject commit 040e76a2181cc12130801397e423cd1d4a3e4276
|
||||
Subproject commit 9cda6e89a535533bc1110fe58cbcd636844b90fa
|
2
3rdparty/yapb
vendored
2
3rdparty/yapb
vendored
@ -1 +1 @@
|
||||
Subproject commit 4157fa3caff7a98bf797b729a8c8e203063c77e5
|
||||
Subproject commit f8650aebd58be6c004d34cde4bb142aca8cfbefb
|
@ -19,6 +19,7 @@
|
||||
//
|
||||
|
||||
#include "hud.h"
|
||||
#include "cvardef.h"
|
||||
#include "cl_util.h"
|
||||
#include "parsemsg.h"
|
||||
#include "pm_shared.h"
|
||||
@ -354,9 +355,9 @@ int CHudAmmo::Init(void)
|
||||
m_pHud_DrawHistory_Time = CVAR_CREATE( "hud_drawhistory_time", HISTORY_DRAW_TIME, 0 );
|
||||
m_pHud_FastSwitch = CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress
|
||||
CVAR_CREATE( "cl_observercrosshair", "1", 0 );
|
||||
m_pClCrosshairColor = CVAR_CREATE( "cl_crosshair_color", "50 250 50", FCVAR_ARCHIVE );
|
||||
m_pClCrosshairTranslucent = CVAR_CREATE( "cl_crosshair_translucent", "1", FCVAR_ARCHIVE );
|
||||
m_pClCrosshairSize = CVAR_CREATE( "cl_crosshair_size", "auto", FCVAR_ARCHIVE );
|
||||
m_pClCrosshairColor = (convar_t*)CVAR_CREATE( "cl_crosshair_color", "50 250 50", FCVAR_ARCHIVE );
|
||||
m_pClCrosshairTranslucent = (convar_t*)CVAR_CREATE( "cl_crosshair_translucent", "1", FCVAR_ARCHIVE );
|
||||
m_pClCrosshairSize = (convar_t*)CVAR_CREATE( "cl_crosshair_size", "auto", FCVAR_ARCHIVE );
|
||||
m_pClDynamicCrosshair = CVAR_CREATE("cl_dynamiccrosshair", "1", FCVAR_ARCHIVE);
|
||||
|
||||
m_iFlags = HUD_DRAW | HUD_THINK; //!!!
|
||||
@ -367,8 +368,8 @@ int CHudAmmo::Init(void)
|
||||
|
||||
m_cvarB = m_cvarR = m_cvarG = -1;
|
||||
m_iCurrentCrosshair = 0;
|
||||
m_bAdditive = 1;
|
||||
m_iCrosshairScaleBase = 1024;
|
||||
m_bAdditive = true;
|
||||
m_iCrosshairScaleBase = -1;
|
||||
m_bDrawCrosshair = true;
|
||||
|
||||
gWR.Init();
|
||||
@ -1386,6 +1387,9 @@ void CHudAmmo::DrawCrosshair( float flTime )
|
||||
|
||||
void CHudAmmo::CalcCrosshairSize()
|
||||
{
|
||||
if( !m_pClCrosshairSize->modified )
|
||||
return;
|
||||
|
||||
const char *size = m_pClCrosshairSize->string;
|
||||
|
||||
if( !stricmp(size, "auto") )
|
||||
@ -1415,6 +1419,8 @@ void CHudAmmo::CalcCrosshairSize()
|
||||
{
|
||||
m_iCrosshairScaleBase = 640;
|
||||
}
|
||||
|
||||
m_pClCrosshairSize->modified = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1437,17 +1443,18 @@ void CHudAmmo::CalcCrosshairDrawMode()
|
||||
|
||||
void CHudAmmo::CalcCrosshairColor()
|
||||
{
|
||||
if( !m_pClCrosshairColor->modified )
|
||||
return;
|
||||
|
||||
const char *colors = m_pClCrosshairColor->string;
|
||||
|
||||
int tempR;
|
||||
int tempG;
|
||||
int tempB;
|
||||
sscanf( colors, "%d %d %d", &m_cvarR, &m_cvarG, &m_cvarB);
|
||||
|
||||
sscanf( colors, "%d %d %d", &tempR, &tempG, &tempB);
|
||||
m_R = m_cvarR = bound( 0, m_cvarR, 255 );
|
||||
m_G = m_cvarG = bound( 0, m_cvarG, 255 );
|
||||
m_B = m_cvarB = bound( 0, m_cvarB, 255 );
|
||||
|
||||
m_R = m_cvarR = bound( 0, tempR, 255 );
|
||||
m_G = m_cvarG = bound( 0, tempG, 255 );
|
||||
m_B = m_cvarB = bound( 0, tempB, 255 );
|
||||
m_pClCrosshairSize->modified = false;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -182,32 +182,25 @@ int CHudMenu :: MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf )
|
||||
// so execute it and exit
|
||||
if( _extended_menus->value != 0.0f )
|
||||
{
|
||||
if( !strcmp(menustring, "#RadioA") )
|
||||
if( !strncmp(menustring, "#Radio", 6 ) )
|
||||
{
|
||||
ShowVGUIMenu(MENU_RADIOA);
|
||||
return 1;
|
||||
}
|
||||
else if( !strcmp(menustring, "#RadioB"))
|
||||
{
|
||||
ShowVGUIMenu(MENU_RADIOB);
|
||||
return 1;
|
||||
}
|
||||
else if( !strcmp(menustring, "#RadioC"))
|
||||
{
|
||||
ShowVGUIMenu(MENU_RADIOC);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we just show touch screen numbers
|
||||
ShowVGUIMenu(MENU_NUMERICAL_MENU);
|
||||
if( menustring[6] == 'A' )
|
||||
{
|
||||
ShowVGUIMenu(MENU_RADIOA); return 1;
|
||||
}
|
||||
else if( menustring[6] == 'B' )
|
||||
{
|
||||
ShowVGUIMenu(MENU_RADIOB); return 1;
|
||||
}
|
||||
else if( menustring[6] == 'B' )
|
||||
{
|
||||
ShowVGUIMenu(MENU_RADIOC); return 1;
|
||||
}
|
||||
else ShowVGUIMenu( MENU_NUMERICAL_MENU ); // we just show touch screen numbers
|
||||
}
|
||||
else ShowVGUIMenu(MENU_NUMERICAL_MENU);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we just show touch screen numbers
|
||||
ShowVGUIMenu(MENU_NUMERICAL_MENU);
|
||||
}
|
||||
else ShowVGUIMenu(MENU_NUMERICAL_MENU);
|
||||
|
||||
if ( !m_fWaitingForMore ) // this is the start of a new menu
|
||||
{
|
||||
@ -261,7 +254,7 @@ int CHudMenu::MsgFunc_AllowSpec(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
m_bAllowSpec = !!reader.ReadByte();
|
||||
m_bAllowSpec = (bool)reader.ReadByte();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -190,9 +190,9 @@ CSimpleMap sayTextFmt[] =
|
||||
int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf )
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
char szBuf[3][64] = { 0 };
|
||||
|
||||
int client_index = reader.ReadByte(); // the client who spoke the message
|
||||
char szBuf[3][64];
|
||||
strncpy( szBuf[0], reader.ReadString(), sizeof(szBuf[0]));
|
||||
strncpy( szBuf[1], reader.ReadString(), sizeof(szBuf[1]));
|
||||
strncpy( szBuf[2], reader.ReadString(), sizeof(szBuf[2]));
|
||||
|
@ -185,9 +185,9 @@ private:
|
||||
bool m_bDrawCrosshair;
|
||||
int m_iAmmoLastCheck;
|
||||
|
||||
cvar_t *m_pClCrosshairColor;
|
||||
cvar_t *m_pClCrosshairTranslucent;
|
||||
cvar_t *m_pClCrosshairSize;
|
||||
convar_t *m_pClCrosshairColor;
|
||||
convar_t *m_pClCrosshairTranslucent;
|
||||
convar_t *m_pClCrosshairSize;
|
||||
cvar_t *m_pClDynamicCrosshair;
|
||||
cvar_t *m_pHud_FastSwitch;
|
||||
cvar_t *m_pHud_DrawHistory_Time;
|
||||
|
@ -33,4 +33,23 @@ typedef struct cvar_s
|
||||
float value;
|
||||
struct cvar_s *next;
|
||||
} cvar_t;
|
||||
|
||||
|
||||
// WARNING: Private structure from Xash3D Engine. Use with caution
|
||||
typedef struct convar_s
|
||||
{
|
||||
// this part shared with cvar_t
|
||||
char *name;
|
||||
char *string;
|
||||
int flags;
|
||||
float value;
|
||||
struct convar_s *next;
|
||||
|
||||
// this part unique for convar_t
|
||||
int integer; // atoi( string )
|
||||
qboolean modified; // set each time the cvar is changed
|
||||
char *reset_string; // cvar_restart will reset to this value
|
||||
char *latched_string; // for CVAR_LATCH vars
|
||||
char *description; // variable descrition info
|
||||
} convar_t;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user