Move Hostage* and Bomb* messages to Radar, due it used mainly for Radar. Remove 320 sprites support. Move ReceiveW message to rain.cpp
This commit is contained in:
parent
706c80803a
commit
8b4f372b66
|
@ -127,12 +127,7 @@ int WeaponsResource :: HasAmmo( WEAPON *p )
|
|||
|
||||
void WeaponsResource :: LoadWeaponSprites( WEAPON *pWeapon )
|
||||
{
|
||||
int i, iRes;
|
||||
|
||||
if (ScreenWidth < 640)
|
||||
iRes = 320;
|
||||
else
|
||||
iRes = 640;
|
||||
int i, iRes = 640;
|
||||
|
||||
char sz[128];
|
||||
|
||||
|
|
|
@ -64,11 +64,6 @@ GHUD_DECLARE_MESSAGE(Concuss)
|
|||
GHUD_DECLARE_MESSAGE(ResetHUD)
|
||||
GHUD_DECLARE_MESSAGE(ViewMode)
|
||||
GHUD_DECLARE_MESSAGE(GameMode)
|
||||
GHUD_DECLARE_MESSAGE(ReceiveW)
|
||||
GHUD_DECLARE_MESSAGE(BombDrop)
|
||||
GHUD_DECLARE_MESSAGE(HostageK)
|
||||
GHUD_DECLARE_MESSAGE(BombPickup)
|
||||
GHUD_DECLARE_MESSAGE(HostagePos)
|
||||
GHUD_DECLARE_MESSAGE(ShadowIdx)
|
||||
|
||||
void __CmdFunc_InputCommandSpecial()
|
||||
|
@ -90,18 +85,12 @@ void CHud :: Init( void )
|
|||
HOOK_MESSAGE( ViewMode );
|
||||
HOOK_MESSAGE( SetFOV );
|
||||
HOOK_MESSAGE( Concuss );
|
||||
HOOK_MESSAGE( ReceiveW );
|
||||
|
||||
HOOK_MESSAGE( BombDrop );
|
||||
HOOK_MESSAGE( BombPickup );
|
||||
HOOK_MESSAGE( HostagePos );
|
||||
HOOK_MESSAGE( HostageK );
|
||||
HOOK_MESSAGE( ShadowIdx );
|
||||
|
||||
CVAR_CREATE( "_vgui_menus", "1", FCVAR_ARCHIVE | FCVAR_USERINFO );
|
||||
CVAR_CREATE( "_cl_autowepswitch", "1", FCVAR_ARCHIVE | FCVAR_USERINFO );
|
||||
CVAR_CREATE( "_ah", "0", FCVAR_ARCHIVE | FCVAR_USERINFO );
|
||||
CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round
|
||||
|
||||
hud_textmode = CVAR_CREATE( "hud_textmode", "0", FCVAR_ARCHIVE );
|
||||
cl_righthand = CVAR_CREATE( "hand", "1", FCVAR_ARCHIVE );
|
||||
|
@ -190,8 +179,7 @@ void CHud :: Init( void )
|
|||
static byte color[] = {255, 255, 255, 255};
|
||||
gMobileAPI.pfnTouchResetDefaultButtons();
|
||||
gMobileAPI.pfnTouchAddDefaultButton("_settings", "touch_defaults/settings.tga", "menu_touchoptions",
|
||||
0.4, 0.4, 0.6, 0.6, color, 0, 1.0f, TOUCH_FL_NOEDIT | TOUCH_FL_DEF_SHOW );
|
||||
gEngfuncs.pfnClientCmd("alias touch_loaddefaults menu_touchoptions");
|
||||
0.0, 0.0, 1.0, 1.0, color, 0, 1.0f, TOUCH_FL_NOEDIT | TOUCH_FL_DEF_SHOW );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -117,80 +117,6 @@ int CHud :: MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf )
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_BombDrop(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
g_PlayerExtraInfo[33].origin.x = reader.ReadCoord();
|
||||
g_PlayerExtraInfo[33].origin.y = reader.ReadCoord();
|
||||
g_PlayerExtraInfo[33].origin.z = reader.ReadCoord();
|
||||
|
||||
g_PlayerExtraInfo[33].radarflashon = 1;
|
||||
g_PlayerExtraInfo[33].radarflashes = 99999;
|
||||
g_PlayerExtraInfo[33].radarflash = gHUD.m_flTime;
|
||||
strncpy(g_PlayerExtraInfo[33].teamname, "TERRORIST", MAX_TEAM_NAME);
|
||||
g_PlayerExtraInfo[33].dead = 0;
|
||||
g_PlayerExtraInfo[33].nextflash = true;
|
||||
|
||||
int Flag = reader.ReadByte();
|
||||
g_PlayerExtraInfo[33].playerclass = Flag;
|
||||
|
||||
if( Flag ) // bomb planted
|
||||
{
|
||||
m_SpectatorGui.m_bBombPlanted = 0;
|
||||
m_Timer.m_iFlags = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_BombPickup(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
g_PlayerExtraInfo[33].radarflashon = 0;
|
||||
g_PlayerExtraInfo[33].radarflash = 0.0f;
|
||||
g_PlayerExtraInfo[33].radarflashes = 0;
|
||||
g_PlayerExtraInfo[33].dead = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_HostagePos(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
int Flag = reader.ReadByte();
|
||||
int idx = reader.ReadByte();
|
||||
if ( idx <= MAX_HOSTAGES )
|
||||
{
|
||||
g_HostageInfo[idx].origin.x = reader.ReadCoord();
|
||||
g_HostageInfo[idx].origin.y = reader.ReadCoord();
|
||||
g_HostageInfo[idx].origin.z = reader.ReadCoord();
|
||||
if ( Flag == 1 )
|
||||
{
|
||||
g_HostageInfo[idx].radarflash = gHUD.m_flTime;
|
||||
g_HostageInfo[idx].radarflashon = 1;
|
||||
g_HostageInfo[idx].radarflashes = 99999;
|
||||
}
|
||||
strncpy(g_HostageInfo[idx].teamname, "CT", MAX_TEAM_NAME);
|
||||
g_HostageInfo[idx].dead = 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_HostageK(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
int idx = reader.ReadByte();
|
||||
if ( idx <= MAX_HOSTAGES )
|
||||
{
|
||||
g_HostageInfo[idx].dead = 1;
|
||||
g_HostageInfo[idx].radarflash = gHUD.m_flTime;
|
||||
g_HostageInfo[idx].radarflashes = 15;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_ShadowIdx(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
|
|
@ -40,6 +40,11 @@ DECLARE_COMMAND( m_Radar, ShowRadar )
|
|||
DECLARE_COMMAND( m_Radar, HideRadar )
|
||||
|
||||
DECLARE_MESSAGE( m_Radar, Radar )
|
||||
DECLARE_MESSAGE( m_Radar, HostageK )
|
||||
DECLARE_MESSAGE( m_Radar, HostagePos )
|
||||
DECLARE_MESSAGE( m_Radar, BombDrop )
|
||||
DECLARE_MESSAGE( m_Radar, BombPickup )
|
||||
|
||||
|
||||
static byte r_RadarCross[8][8] =
|
||||
{
|
||||
|
@ -86,6 +91,10 @@ int CHudRadar::Init()
|
|||
HOOK_MESSAGE( Radar );
|
||||
HOOK_COMMAND( "drawradar", ShowRadar );
|
||||
HOOK_COMMAND( "hideradar", HideRadar );
|
||||
HOOK_MESSAGE( HostageK );
|
||||
HOOK_MESSAGE( HostagePos );
|
||||
HOOK_MESSAGE( BombDrop );
|
||||
HOOK_MESSAGE( BombPickup );
|
||||
|
||||
m_iFlags = HUD_DRAW;
|
||||
|
||||
|
@ -479,3 +488,77 @@ Vector CHudRadar::WorldToRadar(const Vector vPlayerOrigin, const Vector vObjectO
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int CHudRadar::MsgFunc_BombDrop(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
g_PlayerExtraInfo[33].origin.x = reader.ReadCoord();
|
||||
g_PlayerExtraInfo[33].origin.y = reader.ReadCoord();
|
||||
g_PlayerExtraInfo[33].origin.z = reader.ReadCoord();
|
||||
|
||||
g_PlayerExtraInfo[33].radarflashon = 1;
|
||||
g_PlayerExtraInfo[33].radarflashes = 99999;
|
||||
g_PlayerExtraInfo[33].radarflash = gHUD.m_flTime;
|
||||
strncpy(g_PlayerExtraInfo[33].teamname, "TERRORIST", MAX_TEAM_NAME);
|
||||
g_PlayerExtraInfo[33].dead = 0;
|
||||
g_PlayerExtraInfo[33].nextflash = true;
|
||||
|
||||
int Flag = reader.ReadByte();
|
||||
g_PlayerExtraInfo[33].playerclass = Flag;
|
||||
|
||||
if( Flag ) // bomb planted
|
||||
{
|
||||
gHUD.m_SpectatorGui.m_bBombPlanted = 0;
|
||||
gHUD.m_Timer.m_iFlags = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHudRadar::MsgFunc_BombPickup(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
g_PlayerExtraInfo[33].radarflashon = 0;
|
||||
g_PlayerExtraInfo[33].radarflash = 0.0f;
|
||||
g_PlayerExtraInfo[33].radarflashes = 0;
|
||||
g_PlayerExtraInfo[33].dead = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHudRadar::MsgFunc_HostagePos(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
int Flag = reader.ReadByte();
|
||||
int idx = reader.ReadByte();
|
||||
if ( idx <= MAX_HOSTAGES )
|
||||
{
|
||||
g_HostageInfo[idx].origin.x = reader.ReadCoord();
|
||||
g_HostageInfo[idx].origin.y = reader.ReadCoord();
|
||||
g_HostageInfo[idx].origin.z = reader.ReadCoord();
|
||||
if ( Flag == 1 )
|
||||
{
|
||||
g_HostageInfo[idx].radarflash = gHUD.m_flTime;
|
||||
g_HostageInfo[idx].radarflashon = 1;
|
||||
g_HostageInfo[idx].radarflashes = 99999;
|
||||
}
|
||||
strncpy(g_HostageInfo[idx].teamname, "CT", MAX_TEAM_NAME);
|
||||
g_HostageInfo[idx].dead = 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHudRadar::MsgFunc_HostageK(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
int idx = reader.ReadByte();
|
||||
if ( idx <= MAX_HOSTAGES )
|
||||
{
|
||||
g_HostageInfo[idx].dead = 1;
|
||||
g_HostageInfo[idx].radarflash = gHUD.m_flTime;
|
||||
g_HostageInfo[idx].radarflashes = 15;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -155,15 +155,8 @@ extern vec3_t vec3_origin;
|
|||
float *GetClientColor( int clientIndex );
|
||||
inline HSPRITE LoadSprite(const char *pszName)
|
||||
{
|
||||
int i;
|
||||
char sz[256];
|
||||
|
||||
if (ScreenWidth < 640)
|
||||
i = 320;
|
||||
else
|
||||
i = 640;
|
||||
|
||||
sprintf(sz, pszName, i);
|
||||
snprintf(sz, 256, pszName, 640);
|
||||
|
||||
return SPR_Load(sz);
|
||||
}
|
||||
|
|
|
@ -970,11 +970,6 @@ public:
|
|||
CHudMsgFunc(ViewMode);
|
||||
CHudMsgFunc(SetFOV);
|
||||
CHudMsgFunc(Concuss);
|
||||
CHudMsgFunc(ReceiveW);
|
||||
CHudMsgFunc(BombDrop);
|
||||
CHudMsgFunc(BombPickup);
|
||||
CHudMsgFunc(HostagePos);
|
||||
CHudMsgFunc(HostageK);
|
||||
CHudMsgFunc(ShadowIdx);
|
||||
|
||||
// Screen information
|
||||
|
|
|
@ -24,6 +24,10 @@ public:
|
|||
CClientSprite m_hRadar;
|
||||
CClientSprite m_hRadarOpaque;
|
||||
|
||||
int MsgFunc_BombDrop(const char *pszName, int iSize, void *pbuf);
|
||||
int MsgFunc_BombPickup(const char *pszName, int iSize, void *pbuf);
|
||||
int MsgFunc_HostagePos(const char *pszName, int iSize, void *pbuf);
|
||||
int MsgFunc_HostageK(const char *pszName, int iSize, void *pbuf);
|
||||
private:
|
||||
|
||||
cvar_t *cl_radartype;
|
||||
|
|
|
@ -418,39 +418,8 @@ void ResetRain( void )
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
=================================
|
||||
InitRain
|
||||
initialze system
|
||||
=================================
|
||||
*/
|
||||
void InitRain( void )
|
||||
{
|
||||
memset( &Rain, 0, sizeof(Rain) );
|
||||
memset( &FirstChainDrip, 0, sizeof( cl_drip_t ));
|
||||
memset( &FirstChainFX, 0, sizeof( cl_rainfx_t ));
|
||||
|
||||
#ifdef _DEBUG
|
||||
if( !debug_rain )
|
||||
debug_rain = CVAR_CREATE( "Rain.debug", "0", 0 );
|
||||
#endif
|
||||
|
||||
Rain.hsprRain = SPR_Load("sprites/effects/rain.spr");
|
||||
Rain.hsprSnow = SPR_Load("sprites/effects/snowflake.spr");
|
||||
Rain.hsprRipple = SPR_Load("sprites/effects/ripple.spr");
|
||||
}
|
||||
|
||||
|
||||
void SetPoint( float x, float y, float z, float (*matrix)[4])
|
||||
{
|
||||
Vector point( x, y, z ), result;
|
||||
|
||||
VectorTransform( point, matrix, result );
|
||||
|
||||
gEngfuncs.pTriAPI->Vertex3fv( result );
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_ReceiveW(const char *pszName, int iSize, void *pbuf)
|
||||
int __MsgFunc_ReceiveW(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize);
|
||||
|
||||
|
@ -472,6 +441,41 @@ int CHud::MsgFunc_ReceiveW(const char *pszName, int iSize, void *pbuf)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
=================================
|
||||
InitRain
|
||||
initialze system
|
||||
=================================
|
||||
*/
|
||||
void InitRain( void )
|
||||
{
|
||||
memset( &Rain, 0, sizeof(Rain) );
|
||||
memset( &FirstChainDrip, 0, sizeof( cl_drip_t ));
|
||||
memset( &FirstChainFX, 0, sizeof( cl_rainfx_t ));
|
||||
|
||||
#ifdef _DEBUG
|
||||
if( !debug_rain )
|
||||
debug_rain = CVAR_CREATE( "Rain.debug", "0", 0 );
|
||||
#endif
|
||||
|
||||
Rain.hsprRain = SPR_Load("sprites/effects/rain.spr");
|
||||
Rain.hsprSnow = SPR_Load("sprites/effects/snowflake.spr");
|
||||
Rain.hsprRipple = SPR_Load("sprites/effects/ripple.spr");
|
||||
|
||||
HOOK_MESSAGE( ReceiveW );
|
||||
}
|
||||
|
||||
|
||||
void SetPoint( float x, float y, float z, float (*matrix)[4])
|
||||
{
|
||||
Vector point( x, y, z ), result;
|
||||
|
||||
VectorTransform( point, matrix, result );
|
||||
|
||||
gEngfuncs.pTriAPI->Vertex3fv( result );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=================================
|
||||
|
|
Loading…
Reference in New Issue