Fix glock18 burst mode(again), ugly fix of death cam. Autoindent on some files
This commit is contained in:
parent
0b2fe9c159
commit
1a1d5d68a6
@ -27,10 +27,10 @@ project (CLDLL)
|
|||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINUX -D_LINUX -DCLIENT_WEAPONS -DCLIENT_DLL")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINUX -D_LINUX -DCLIENT_WEAPONS -DCLIENT_DLL")
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp")
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -Wl,--no-undefined")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -Wl,--no-undefined")
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
|
||||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
||||||
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")
|
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")
|
||||||
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3")
|
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ggdb -O3")
|
||||||
|
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||||
|
@ -28,15 +28,15 @@ extern cvar_t *hud_textmode;
|
|||||||
#define HOOK_MESSAGE(x) gEngfuncs.pfnHookUserMsg(#x, __MsgFunc_##x );
|
#define HOOK_MESSAGE(x) gEngfuncs.pfnHookUserMsg(#x, __MsgFunc_##x );
|
||||||
|
|
||||||
#define DECLARE_MESSAGE(y, x) int __MsgFunc_##x(const char *pszName, int iSize, void *pbuf) \
|
#define DECLARE_MESSAGE(y, x) int __MsgFunc_##x(const char *pszName, int iSize, void *pbuf) \
|
||||||
{ \
|
{ \
|
||||||
return gHUD.y.MsgFunc_##x(pszName, iSize, pbuf ); \
|
return gHUD.y.MsgFunc_##x(pszName, iSize, pbuf ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HOOK_COMMAND(x, y) gEngfuncs.pfnAddCommand( x, __CmdFunc_##y );
|
#define HOOK_COMMAND(x, y) gEngfuncs.pfnAddCommand( x, __CmdFunc_##y );
|
||||||
#define DECLARE_COMMAND(y, x) void __CmdFunc_##x( void ) \
|
#define DECLARE_COMMAND(y, x) void __CmdFunc_##x( void ) \
|
||||||
{ \
|
{ \
|
||||||
gHUD.y.UserCmd_##x( ); \
|
gHUD.y.UserCmd_##x( ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float CVAR_GET_FLOAT( const char *x ) { return gEngfuncs.pfnGetCvarFloat( (char*)x ); }
|
inline float CVAR_GET_FLOAT( const char *x ) { return gEngfuncs.pfnGetCvarFloat( (char*)x ); }
|
||||||
inline char* CVAR_GET_STRING( const char *x ) { return gEngfuncs.pfnGetCvarString( (char*)x ); }
|
inline char* CVAR_GET_STRING( const char *x ) { return gEngfuncs.pfnGetCvarString( (char*)x ); }
|
||||||
|
@ -169,9 +169,9 @@ void DLLEXPORT HUD_ProcessPlayerState( struct entity_state_s *dst, const struct
|
|||||||
g_iPlayerClass = dst->playerclass;
|
g_iPlayerClass = dst->playerclass;
|
||||||
g_iTeamNumber = g_PlayerExtraInfo[dst->number].teamnumber;
|
g_iTeamNumber = g_PlayerExtraInfo[dst->number].teamnumber;
|
||||||
|
|
||||||
g_iUser1 = src->iuser1;
|
dst->iuser1 = g_iUser1 = src->iuser1;
|
||||||
g_iUser2 = src->iuser2;
|
dst->iuser2 = g_iUser2 = src->iuser2;
|
||||||
g_iUser3 = src->iuser3;
|
dst->iuser3 = g_iUser3 = src->iuser3;
|
||||||
}
|
}
|
||||||
dst->fuser2 = src->fuser2;
|
dst->fuser2 = src->fuser2;
|
||||||
iOnTrain[src->number] = src->iuser4;
|
iOnTrain[src->number] = src->iuser4;
|
||||||
|
@ -297,10 +297,10 @@ void EV_HLDM_GunshotDecalTrace( pmtrace_t *pTrace, char *decalName )
|
|||||||
int wallPuffSprite;
|
int wallPuffSprite;
|
||||||
switch( iRand % 4 ) // but every bullet makes a wall puff
|
switch( iRand % 4 ) // but every bullet makes a wall puff
|
||||||
{
|
{
|
||||||
case 0: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff1.spr"); break;
|
case 0: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff1.spr"); break;
|
||||||
case 1: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff2.spr"); break;
|
case 1: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff2.spr"); break;
|
||||||
case 2: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff3.spr"); break;
|
case 2: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff3.spr"); break;
|
||||||
case 3: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff4.spr"); break;
|
case 3: wallPuffSprite = gEngfuncs.pEventAPI->EV_FindModelIndex("sprites/wall_puff4.spr"); break;
|
||||||
}
|
}
|
||||||
TEMPENTITY *te = gEngfuncs.pEfxAPI->R_DefaultSprite( pTrace->endpos, wallPuffSprite, 20.0f );
|
TEMPENTITY *te = gEngfuncs.pEfxAPI->R_DefaultSprite( pTrace->endpos, wallPuffSprite, 20.0f );
|
||||||
if( te )
|
if( te )
|
||||||
@ -482,15 +482,15 @@ void EV_Dummy( struct event_args_s *args )
|
|||||||
|
|
||||||
void RemoveBody(TEMPENTITY *te, float frametime, float current_time)
|
void RemoveBody(TEMPENTITY *te, float frametime, float current_time)
|
||||||
{
|
{
|
||||||
// go underground...
|
// go underground...
|
||||||
if ( current_time >= 2 * te->entity.curstate.fuser2 + 5.0 )
|
/*if ( current_time >= 2 * te->entity.curstate.fuser2 + 5.0 )
|
||||||
te->entity.origin.z -= 5.0 * frametime;
|
te->entity.origin.z -= 5.0 * frametime;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void HitBody(TEMPENTITY *ent, pmtrace_s *ptr)
|
void HitBody(TEMPENTITY *ent, pmtrace_s *ptr)
|
||||||
{
|
{
|
||||||
if ( ptr->plane.normal.z > 0.0 )
|
/*if ( ptr->plane.normal.z > 0.0 )
|
||||||
ent->flags |= FTENT_NONE;
|
ent->flags |= FTENT_NONE;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -499,11 +499,11 @@ void CreateCorpse(Vector *p_vOrigin, Vector *p_vAngles, const char *pModel, floa
|
|||||||
int modelIdx = gEngfuncs.pEventAPI->EV_FindModelIndex(pModel);
|
int modelIdx = gEngfuncs.pEventAPI->EV_FindModelIndex(pModel);
|
||||||
vec3_t null(0, 0, 0);
|
vec3_t null(0, 0, 0);
|
||||||
TEMPENTITY *model = gEngfuncs.pEfxAPI->R_TempModel( (float*)p_vOrigin,
|
TEMPENTITY *model = gEngfuncs.pEfxAPI->R_TempModel( (float*)p_vOrigin,
|
||||||
null,
|
null,
|
||||||
(float*)p_vAngles,
|
(float*)p_vAngles,
|
||||||
gEngfuncs.pfnGetCvarFloat("cl_corpsestay"),
|
gEngfuncs.pfnGetCvarFloat("cl_corpsestay"),
|
||||||
modelIdx,
|
modelIdx,
|
||||||
0 );
|
0 );
|
||||||
|
|
||||||
if(model)
|
if(model)
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ void EV_CreateSmoke(event_args_s *args)
|
|||||||
{
|
{
|
||||||
// don't die when animation is ended
|
// don't die when animation is ended
|
||||||
pTemp->flags |= (FTENT_SPRANIMATELOOP | FTENT_COLLIDEWORLD);
|
pTemp->flags |= (FTENT_SPRANIMATELOOP | FTENT_COLLIDEWORLD);
|
||||||
pTemp->die = 80.0f;
|
pTemp->die = gEngfuncs.GetClientTime() + 10.0f;
|
||||||
pTemp->entity.curstate.framerate = 4.0f;
|
pTemp->entity.curstate.framerate = 4.0f;
|
||||||
pTemp->entity.curstate.rendermode = kRenderTransTexture;
|
pTemp->entity.curstate.rendermode = kRenderTransTexture;
|
||||||
pTemp->entity.curstate.renderfx = kRenderFxNone;
|
pTemp->entity.curstate.renderfx = kRenderFxNone;
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "events.h"
|
#include "events.h"
|
||||||
|
|
||||||
|
bool g_bGlockBurstMode = false;
|
||||||
|
|
||||||
enum glock18_e
|
enum glock18_e
|
||||||
{
|
{
|
||||||
GLOCK18_IDLE1 = 0,
|
GLOCK18_IDLE1 = 0,
|
||||||
@ -88,7 +90,7 @@ void EV_Fireglock18( event_args_t *args )
|
|||||||
if( g_bHoldingShield )
|
if( g_bHoldingShield )
|
||||||
seq = GLOCK18_SHIELD_SHOOT;
|
seq = GLOCK18_SHIELD_SHOOT;
|
||||||
else
|
else
|
||||||
seq = g_iWeaponFlags & WPNSTATE_GLOCK18_BURST_MODE != 0 ? GLOCK18_SHOOT1: GLOCK18_SHOOT3;
|
seq = g_iWeaponFlags & WPNSTATE_GLOCK18_BURST_MODE != 0 || g_bGlockBurstMode? GLOCK18_SHOOT1: GLOCK18_SHOOT3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -104,7 +106,7 @@ void EV_Fireglock18( event_args_t *args )
|
|||||||
EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, -right, up, 12, -10, -7 );
|
EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, -right, up, 12, -10, -7 );
|
||||||
EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHELL);
|
EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHELL);
|
||||||
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON,
|
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON,
|
||||||
g_iWeaponFlags & WPNSTATE_GLOCK18_BURST_MODE != 0 ? "weapons/glock18-1.wav": "weapons/glock18-2.wav",
|
g_iWeaponFlags & WPNSTATE_GLOCK18_BURST_MODE != 0 || g_bGlockBurstMode ? "weapons/glock18-1.wav": "weapons/glock18-2.wav",
|
||||||
1, ATTN_NORM, 0,
|
1, ATTN_NORM, 0,
|
||||||
94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
|
94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
|
||||||
EV_GetGunPosition( args, vecSrc, origin );
|
EV_GetGunPosition( args, vecSrc, origin );
|
||||||
|
@ -448,7 +448,7 @@ int CHudHealth::DrawDamage(float flTime)
|
|||||||
pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire );
|
pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire );
|
||||||
|
|
||||||
if ( pdmg->fExpire <= flTime // when the time has expired
|
if ( pdmg->fExpire <= flTime // when the time has expired
|
||||||
&& a < 40 ) // and the flash is at the low point of the cycle
|
&& a < 40 ) // and the flash is at the low point of the cycle
|
||||||
{
|
{
|
||||||
pdmg->fExpire = 0;
|
pdmg->fExpire = 0;
|
||||||
|
|
||||||
@ -598,7 +598,7 @@ void CHudHealth :: DrawRadar( float flTime )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( g_PlayerExtraInfo[gHUD.m_Scoreboard.m_iPlayerNum].teamnumber == 1)
|
if( g_PlayerExtraInfo[gHUD.m_Scoreboard.m_iPlayerNum].teamnumber == 1)
|
||||||
// draw bomb for T
|
// draw bomb for T
|
||||||
{
|
{
|
||||||
if( g_PlayerExtraInfo[33].radarflashon )
|
if( g_PlayerExtraInfo[33].radarflashon )
|
||||||
{
|
{
|
||||||
@ -609,7 +609,7 @@ void CHudHealth :: DrawRadar( float flTime )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// draw hostages for CT
|
// draw hostages for CT
|
||||||
{
|
{
|
||||||
for( int i = 0; i < MAX_HOSTAGES; i++ )
|
for( int i = 0; i < MAX_HOSTAGES; i++ )
|
||||||
{
|
{
|
||||||
|
@ -50,6 +50,7 @@ extern "C" char PM_FindTextureType( char *name );
|
|||||||
|
|
||||||
extern globalvars_t *gpGlobals;
|
extern globalvars_t *gpGlobals;
|
||||||
extern int g_iUser1;
|
extern int g_iUser1;
|
||||||
|
extern bool g_bGlockBurstMode;
|
||||||
|
|
||||||
// Pool of client side entities/entvars_t
|
// Pool of client side entities/entvars_t
|
||||||
static entvars_t ev[ 32 ];
|
static entvars_t ev[ 32 ];
|
||||||
@ -1449,7 +1450,8 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
|||||||
player.m_rgAmmo[ pCurrent->m_iSecondaryAmmoType ] = (int)from->client.vuser4[ 2 ];
|
player.m_rgAmmo[ pCurrent->m_iSecondaryAmmoType ] = (int)from->client.vuser4[ 2 ];
|
||||||
}
|
}
|
||||||
|
|
||||||
g_iWeaponFlags = from->weapondata[ from->client.m_iId - 1 ].m_iWeaponState;
|
if( g_pWpns[ from->client.m_iId - 1 ] )
|
||||||
|
g_iWeaponFlags = g_pWpns[ from->client.m_iId - 1 ]->m_iWeaponState;
|
||||||
|
|
||||||
// For random weapon events, use this seed to seed random # generator
|
// For random weapon events, use this seed to seed random # generator
|
||||||
player.random_seed = random_seed;
|
player.random_seed = random_seed;
|
||||||
@ -1725,6 +1727,7 @@ void _DLLEXPORT HUD_PostRunCmd( local_state_t *from, local_state_t *to, struct u
|
|||||||
g_iFreezeTimeOver = !(from->client.iuser3 & PLAYER_FREEZE_TIME_OVER);
|
g_iFreezeTimeOver = !(from->client.iuser3 & PLAYER_FREEZE_TIME_OVER);
|
||||||
g_bInBombZone = (from->client.iuser3 & PLAYER_IN_BOMB_ZONE) != 0;
|
g_bInBombZone = (from->client.iuser3 & PLAYER_IN_BOMB_ZONE) != 0;
|
||||||
g_bHoldingShield = (from->client.iuser3 & PLAYER_HOLDING_SHIELD) != 0;
|
g_bHoldingShield = (from->client.iuser3 & PLAYER_HOLDING_SHIELD) != 0;
|
||||||
|
g_bGlockBurstMode = false; // will be taken from g_iWeaponFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
// All games can use FOV state
|
// All games can use FOV state
|
||||||
|
@ -44,18 +44,18 @@ cvar_t *cl_lw = NULL;
|
|||||||
wrect_t nullrc = { 0, 0, 0, 0 };
|
wrect_t nullrc = { 0, 0, 0, 0 };
|
||||||
char *sPlayerModelFiles[12] =
|
char *sPlayerModelFiles[12] =
|
||||||
{
|
{
|
||||||
"models/player.mdl",
|
"models/player.mdl",
|
||||||
"models/player/leet/leet.mdl", // t
|
"models/player/leet/leet.mdl", // t
|
||||||
"models/player/gign/gign.mdl", // ct
|
"models/player/gign/gign.mdl", // ct
|
||||||
"models/player/vip/vip.mdl", //ct
|
"models/player/vip/vip.mdl", //ct
|
||||||
"models/player/gsg9/gsg9.mdl", // ct
|
"models/player/gsg9/gsg9.mdl", // ct
|
||||||
"models/player/guerilla/guerilla.mdl", // t
|
"models/player/guerilla/guerilla.mdl", // t
|
||||||
"models/player/arctic/arctic.mdl", // t
|
"models/player/arctic/arctic.mdl", // t
|
||||||
"models/player/sas/sas.mdl", // ct
|
"models/player/sas/sas.mdl", // ct
|
||||||
"models/player/terror/terror.mdl", // t
|
"models/player/terror/terror.mdl", // t
|
||||||
"models/player/urban/urban.mdl", // ct
|
"models/player/urban/urban.mdl", // ct
|
||||||
"models/player/spetsnaz/spetsnaz.mdl", // ct
|
"models/player/spetsnaz/spetsnaz.mdl", // ct
|
||||||
"models/player/militia/militia.mdl" // t
|
"models/player/militia/militia.mdl" // t
|
||||||
};
|
};
|
||||||
|
|
||||||
void ShutdownInput (void);
|
void ShutdownInput (void);
|
||||||
@ -136,14 +136,14 @@ void CHud :: Init( void )
|
|||||||
m_flTime = 1.0;
|
m_flTime = 1.0;
|
||||||
m_iNoConsolePrint = 0;
|
m_iNoConsolePrint = 0;
|
||||||
|
|
||||||
// fullscreen overlays
|
// fullscreen overlays
|
||||||
m_SniperScope.Init();
|
m_SniperScope.Init();
|
||||||
m_NVG.Init();
|
m_NVG.Init();
|
||||||
|
|
||||||
// Game HUD things
|
// Game HUD things
|
||||||
m_Ammo.Init();
|
m_Ammo.Init();
|
||||||
m_Health.Init();
|
m_Health.Init();
|
||||||
m_Radio.Init();
|
m_Radio.Init();
|
||||||
m_Timer.Init();
|
m_Timer.Init();
|
||||||
m_Money.Init();
|
m_Money.Init();
|
||||||
m_AmmoSecondary.Init();
|
m_AmmoSecondary.Init();
|
||||||
@ -151,8 +151,8 @@ void CHud :: Init( void )
|
|||||||
m_Battery.Init();
|
m_Battery.Init();
|
||||||
m_StatusIcons.Init();
|
m_StatusIcons.Init();
|
||||||
|
|
||||||
// chat, death notice, status bars and other
|
// chat, death notice, status bars and other
|
||||||
m_SayText.Init();
|
m_SayText.Init();
|
||||||
m_Spectator.Init();
|
m_Spectator.Init();
|
||||||
m_Geiger.Init();
|
m_Geiger.Init();
|
||||||
m_Flash.Init();
|
m_Flash.Init();
|
||||||
@ -162,7 +162,7 @@ void CHud :: Init( void )
|
|||||||
m_TextMessage.Init();
|
m_TextMessage.Init();
|
||||||
m_MOTD.Init();
|
m_MOTD.Init();
|
||||||
|
|
||||||
// all things that have own background and must be drawn last
|
// all things that have own background and must be drawn last
|
||||||
m_ProgressBar.Init();
|
m_ProgressBar.Init();
|
||||||
m_Menu.Init();
|
m_Menu.Init();
|
||||||
m_Scoreboard.Init();
|
m_Scoreboard.Init();
|
||||||
@ -236,7 +236,7 @@ void CHud :: VidInit( void )
|
|||||||
// ----------
|
// ----------
|
||||||
// Load Sprites
|
// Load Sprites
|
||||||
// ---------
|
// ---------
|
||||||
// m_hsprFont = LoadSprite("sprites/%d_font.spr");
|
// m_hsprFont = LoadSprite("sprites/%d_font.spr");
|
||||||
|
|
||||||
m_hsprLogo = 0;
|
m_hsprLogo = 0;
|
||||||
m_hsprCursor = 0;
|
m_hsprCursor = 0;
|
||||||
@ -266,7 +266,7 @@ void CHud :: VidInit( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// allocated memory for sprite handle arrays
|
// allocated memory for sprite handle arrays
|
||||||
m_rghSprites = new HSPRITE[m_iSpriteCount];
|
m_rghSprites = new HSPRITE[m_iSpriteCount];
|
||||||
m_rgrcRects = new wrect_t[m_iSpriteCount];
|
m_rgrcRects = new wrect_t[m_iSpriteCount];
|
||||||
m_rgszSpriteNames = new char[m_iSpriteCount * MAX_SPRITE_NAME_LENGTH];
|
m_rgszSpriteNames = new char[m_iSpriteCount * MAX_SPRITE_NAME_LENGTH];
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ void CHud::AddHudElem(CHudBase *phudelem)
|
|||||||
{
|
{
|
||||||
HUDLIST *pdl, *ptemp;
|
HUDLIST *pdl, *ptemp;
|
||||||
|
|
||||||
//phudelem->Think();
|
//phudelem->Think();
|
||||||
|
|
||||||
if (!phudelem)
|
if (!phudelem)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
//
|
//
|
||||||
// CHud handles the message, calculation, and drawing the HUD
|
// CHud handles the message, calculation, and drawing the HUD
|
||||||
//
|
//
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#define RGB_YELLOWISH 0x00FFA000 //255,160,0
|
#define RGB_YELLOWISH 0x00FFA000 //255,160,0
|
||||||
#define RGB_REDISH 0x00FF1010 //255,16,16
|
#define RGB_REDISH 0x00FF1010 //255,16,16
|
||||||
@ -468,7 +468,7 @@ public:
|
|||||||
CHudMsgFunc(SayText);
|
CHudMsgFunc(SayText);
|
||||||
void SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex = -1 );
|
void SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex = -1 );
|
||||||
void EnsureTextFitsInOneLineAndWrapIfHaveTo( int line );
|
void EnsureTextFitsInOneLineAndWrapIfHaveTo( int line );
|
||||||
friend class CHudSpectator;
|
friend class CHudSpectator;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "studio_util.h"
|
#include "studio_util.h"
|
||||||
#include "screenfade.h"
|
#include "screenfade.h"
|
||||||
|
|
||||||
|
|
||||||
#pragma warning(disable: 4244)
|
#pragma warning(disable: 4244)
|
||||||
|
|
||||||
extern "C" int iJumpSpectator;
|
extern "C" int iJumpSpectator;
|
||||||
@ -77,7 +76,7 @@ void SpectatorSpray(void)
|
|||||||
if ( trace->fraction != 1.0 )
|
if ( trace->fraction != 1.0 )
|
||||||
{
|
{
|
||||||
sprintf(string, "drc_spray %.2f %.2f %.2f %i",
|
sprintf(string, "drc_spray %.2f %.2f %.2f %i",
|
||||||
trace->endpos[0], trace->endpos[1], trace->endpos[2], trace->ent );
|
trace->endpos[0], trace->endpos[1], trace->endpos[2], trace->ent );
|
||||||
gEngfuncs.pfnServerCmd(string);
|
gEngfuncs.pfnServerCmd(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +89,7 @@ void SpectatorHelp(void)
|
|||||||
}
|
}
|
||||||
else*/
|
else*/
|
||||||
{
|
{
|
||||||
char *text = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" );
|
char *text = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" );
|
||||||
|
|
||||||
if ( text )
|
if ( text )
|
||||||
{
|
{
|
||||||
@ -154,11 +153,13 @@ int CHudSpectator::Init()
|
|||||||
gEngfuncs.pfnAddCommand ("spec_menu", SpectatorMenu );
|
gEngfuncs.pfnAddCommand ("spec_menu", SpectatorMenu );
|
||||||
gEngfuncs.pfnAddCommand ("togglescores", ToggleScores );
|
gEngfuncs.pfnAddCommand ("togglescores", ToggleScores );
|
||||||
|
|
||||||
m_drawnames = gEngfuncs.pfnRegisterVariable("spec_drawnames","1",0);
|
m_drawnames = gEngfuncs.pfnRegisterVariable("spec_drawnames_internal","1",0);
|
||||||
m_drawcone = gEngfuncs.pfnRegisterVariable("spec_drawcone","1",0);
|
m_specmode = gEngfuncs.pfnRegisterVariable("spec_mode_internal","1",0);
|
||||||
m_drawstatus = gEngfuncs.pfnRegisterVariable("spec_drawstatus","1",0);
|
m_drawcone = gEngfuncs.pfnRegisterVariable("spec_drawcone_internal","1",0);
|
||||||
m_autoDirector = gEngfuncs.pfnRegisterVariable("spec_autodirector","1",0);
|
m_drawstatus = gEngfuncs.pfnRegisterVariable("spec_drawstatus_internal","1",0);
|
||||||
|
m_autoDirector = gEngfuncs.pfnRegisterVariable("spec_autodirector_internal","1",0);
|
||||||
m_pip = gEngfuncs.pfnRegisterVariable("spec_pip","1",0);
|
m_pip = gEngfuncs.pfnRegisterVariable("spec_pip","1",0);
|
||||||
|
m_lastAutoDirector = 0.0f;
|
||||||
|
|
||||||
if ( !m_drawnames || !m_drawcone || !m_drawstatus || !m_autoDirector || !m_pip)
|
if ( !m_drawnames || !m_drawcone || !m_drawstatus || !m_autoDirector || !m_pip)
|
||||||
{
|
{
|
||||||
@ -391,6 +392,26 @@ int CHudSpectator::Draw(float flTime)
|
|||||||
if ( !g_iUser1 )
|
if ( !g_iUser1 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
if ( m_lastAutoDirector != m_autoDirector->value )
|
||||||
|
{
|
||||||
|
m_lastAutoDirector = m_autoDirector->value;
|
||||||
|
char cmd[64];
|
||||||
|
snprintf(cmd, sizeof(cmd), "spec_set_ad %f", m_autoDirector->value);
|
||||||
|
gEngfuncs.pfnClientCmd(cmd);
|
||||||
|
if ( m_lastAutoDirector == 0.0 )
|
||||||
|
{
|
||||||
|
if ( m_lastAutoDirector == 0.0 && g_iUser1 == OBS_CHASE_LOCKED )
|
||||||
|
{
|
||||||
|
SetModes(OBS_CHASE_FREE, INSET_OFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( g_iUser1 == OBS_CHASE_FREE )
|
||||||
|
{
|
||||||
|
SetModes(OBS_CHASE_LOCKED, INSET_OFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if user pressed zoom, aplly changes
|
// if user pressed zoom, aplly changes
|
||||||
if ( (m_zoomDelta != 0.0f) && ( g_iUser1 == OBS_MAP_FREE ) )
|
if ( (m_zoomDelta != 0.0f) && ( g_iUser1 == OBS_MAP_FREE ) )
|
||||||
{
|
{
|
||||||
@ -441,7 +462,7 @@ int CHudSpectator::Draw(float flTime)
|
|||||||
m_vPlayerPos[i][1] > YRES( m_OverviewData.insetWindowY ) &&
|
m_vPlayerPos[i][1] > YRES( m_OverviewData.insetWindowY ) &&
|
||||||
m_vPlayerPos[i][0] < XRES( m_OverviewData.insetWindowX + m_OverviewData.insetWindowWidth ) &&
|
m_vPlayerPos[i][0] < XRES( m_OverviewData.insetWindowX + m_OverviewData.insetWindowWidth ) &&
|
||||||
m_vPlayerPos[i][1] < YRES( m_OverviewData.insetWindowY + m_OverviewData.insetWindowHeight)
|
m_vPlayerPos[i][1] < YRES( m_OverviewData.insetWindowY + m_OverviewData.insetWindowHeight)
|
||||||
) continue;
|
) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
color = GetClientColor( i+1 );
|
color = GetClientColor( i+1 );
|
||||||
@ -472,130 +493,130 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf )
|
|||||||
|
|
||||||
switch ( cmd ) // director command byte
|
switch ( cmd ) // director command byte
|
||||||
{
|
{
|
||||||
case DRC_CMD_START :
|
case DRC_CMD_START :
|
||||||
// now we have to do some things clientside, since the proxy doesn't know our mod
|
// now we have to do some things clientside, since the proxy doesn't know our mod
|
||||||
g_iPlayerClass = 0;
|
g_iPlayerClass = 0;
|
||||||
g_iTeamNumber = 0;
|
g_iTeamNumber = 0;
|
||||||
|
|
||||||
// fake a InitHUD & ResetHUD message
|
// fake a InitHUD & ResetHUD message
|
||||||
gHUD.MsgFunc_InitHUD(NULL,0, NULL);
|
gHUD.MsgFunc_InitHUD(NULL,0, NULL);
|
||||||
gHUD.MsgFunc_ResetHUD(NULL, 0, NULL);
|
gHUD.MsgFunc_ResetHUD(NULL, 0, NULL);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_EVENT :
|
case DRC_CMD_EVENT :
|
||||||
m_lastPrimaryObject = READ_WORD();
|
m_lastPrimaryObject = READ_WORD();
|
||||||
m_lastSecondaryObject = READ_WORD();
|
m_lastSecondaryObject = READ_WORD();
|
||||||
m_iObserverFlags = READ_LONG();
|
m_iObserverFlags = READ_LONG();
|
||||||
|
|
||||||
if ( m_autoDirector->value )
|
if ( m_autoDirector->value )
|
||||||
{
|
{
|
||||||
if ( (g_iUser2 != m_lastPrimaryObject) || (g_iUser3 != m_lastSecondaryObject) )
|
if ( (g_iUser2 != m_lastPrimaryObject) || (g_iUser3 != m_lastSecondaryObject) )
|
||||||
V_ResetChaseCam();
|
V_ResetChaseCam();
|
||||||
|
|
||||||
g_iUser2 = m_lastPrimaryObject;
|
g_iUser2 = m_lastPrimaryObject;
|
||||||
g_iUser3 = m_lastSecondaryObject;
|
g_iUser3 = m_lastSecondaryObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
// gEngfuncs.Con_Printf("Director Camera: %i %i\n", firstObject, secondObject);
|
// gEngfuncs.Con_Printf("Director Camera: %i %i\n", firstObject, secondObject);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_MODE :
|
case DRC_CMD_MODE :
|
||||||
if ( m_autoDirector->value )
|
if ( m_autoDirector->value )
|
||||||
{
|
{
|
||||||
SetModes( READ_BYTE(), -1 );
|
SetModes( READ_BYTE(), -1 );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_CAMERA :
|
case DRC_CMD_CAMERA :
|
||||||
if ( m_autoDirector->value )
|
if ( m_autoDirector->value )
|
||||||
{
|
{
|
||||||
vJumpOrigin[0] = READ_COORD(); // position
|
vJumpOrigin[0] = READ_COORD(); // position
|
||||||
vJumpOrigin[1] = READ_COORD();
|
vJumpOrigin[1] = READ_COORD();
|
||||||
vJumpOrigin[2] = READ_COORD();
|
vJumpOrigin[2] = READ_COORD();
|
||||||
|
|
||||||
vJumpAngles[0] = READ_COORD(); // view angle
|
vJumpAngles[0] = READ_COORD(); // view angle
|
||||||
vJumpAngles[1] = READ_COORD();
|
vJumpAngles[1] = READ_COORD();
|
||||||
vJumpAngles[2] = READ_COORD();
|
vJumpAngles[2] = READ_COORD();
|
||||||
|
|
||||||
gEngfuncs.SetViewAngles( vJumpAngles );
|
gEngfuncs.SetViewAngles( vJumpAngles );
|
||||||
|
|
||||||
iJumpSpectator = 1;
|
iJumpSpectator = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_MESSAGE:
|
case DRC_CMD_MESSAGE:
|
||||||
{
|
{
|
||||||
client_textmessage_t * msg = &m_HUDMessages[m_lastHudMessage];
|
client_textmessage_t * msg = &m_HUDMessages[m_lastHudMessage];
|
||||||
|
|
||||||
msg->effect = READ_BYTE(); // effect
|
msg->effect = READ_BYTE(); // effect
|
||||||
|
|
||||||
UnpackRGB( (int&)msg->r1, (int&)msg->g1, (int&)msg->b1, READ_LONG() ); // color
|
UnpackRGB( (int&)msg->r1, (int&)msg->g1, (int&)msg->b1, READ_LONG() ); // color
|
||||||
msg->r2 = msg->r1;
|
msg->r2 = msg->r1;
|
||||||
msg->g2 = msg->g1;
|
msg->g2 = msg->g1;
|
||||||
msg->b2 = msg->b1;
|
msg->b2 = msg->b1;
|
||||||
msg->a2 = msg->a1 = 0xFF; // not transparent
|
msg->a2 = msg->a1 = 0xFF; // not transparent
|
||||||
|
|
||||||
msg->x = READ_FLOAT(); // x pos
|
msg->x = READ_FLOAT(); // x pos
|
||||||
msg->y = READ_FLOAT(); // y pos
|
msg->y = READ_FLOAT(); // y pos
|
||||||
|
|
||||||
msg->fadein = READ_FLOAT(); // fadein
|
msg->fadein = READ_FLOAT(); // fadein
|
||||||
msg->fadeout = READ_FLOAT(); // fadeout
|
msg->fadeout = READ_FLOAT(); // fadeout
|
||||||
msg->holdtime = READ_FLOAT(); // holdtime
|
msg->holdtime = READ_FLOAT(); // holdtime
|
||||||
msg->fxtime = READ_FLOAT(); // fxtime;
|
msg->fxtime = READ_FLOAT(); // fxtime;
|
||||||
|
|
||||||
strncpy( m_HUDMessageText[m_lastHudMessage], READ_STRING(), 128 );
|
strncpy( m_HUDMessageText[m_lastHudMessage], READ_STRING(), 128 );
|
||||||
m_HUDMessageText[m_lastHudMessage][127]=0; // text
|
m_HUDMessageText[m_lastHudMessage][127]=0; // text
|
||||||
|
|
||||||
msg->pMessage = m_HUDMessageText[m_lastHudMessage];
|
msg->pMessage = m_HUDMessageText[m_lastHudMessage];
|
||||||
msg->pName = "HUD_MESSAGE";
|
msg->pName = "HUD_MESSAGE";
|
||||||
|
|
||||||
gHUD.m_Message.MessageAdd( msg );
|
gHUD.m_Message.MessageAdd( msg );
|
||||||
|
|
||||||
m_lastHudMessage++;
|
m_lastHudMessage++;
|
||||||
m_lastHudMessage %= MAX_SPEC_HUD_MESSAGES;
|
m_lastHudMessage %= MAX_SPEC_HUD_MESSAGES;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_SOUND :
|
case DRC_CMD_SOUND :
|
||||||
string = READ_STRING();
|
string = READ_STRING();
|
||||||
value = READ_FLOAT();
|
value = READ_FLOAT();
|
||||||
|
|
||||||
// gEngfuncs.Con_Printf("DRC_CMD_FX_SOUND: %s %.2f\n", string, value );
|
// gEngfuncs.Con_Printf("DRC_CMD_FX_SOUND: %s %.2f\n", string, value );
|
||||||
gEngfuncs.pEventAPI->EV_PlaySound(0, v_origin, CHAN_BODY, string, value, ATTN_NORM, 0, PITCH_NORM );
|
gEngfuncs.pEventAPI->EV_PlaySound(0, v_origin, CHAN_BODY, string, value, ATTN_NORM, 0, PITCH_NORM );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_TIMESCALE :
|
case DRC_CMD_TIMESCALE :
|
||||||
value = READ_FLOAT();
|
value = READ_FLOAT();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case DRC_CMD_STATUS:
|
case DRC_CMD_STATUS:
|
||||||
READ_LONG(); // total number of spectator slots
|
READ_LONG(); // total number of spectator slots
|
||||||
m_iSpectatorNumber = READ_LONG(); // total number of spectator
|
m_iSpectatorNumber = READ_LONG(); // total number of spectator
|
||||||
READ_WORD(); // total number of relay proxies
|
READ_WORD(); // total number of relay proxies
|
||||||
|
|
||||||
//gViewPort->UpdateSpectatorPanel();
|
//gViewPort->UpdateSpectatorPanel();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_BANNER:
|
case DRC_CMD_BANNER:
|
||||||
// gEngfuncs.Con_DPrintf("GUI: Banner %s\n",READ_STRING() ); // name of banner tga eg gfx/temp/7454562234563475.tga
|
// gEngfuncs.Con_DPrintf("GUI: Banner %s\n",READ_STRING() ); // name of banner tga eg gfx/temp/7454562234563475.tga
|
||||||
//gViewPort->m_pSpectatorPanel->m_TopBanner->LoadImage( READ_STRING() );
|
//gViewPort->m_pSpectatorPanel->m_TopBanner->LoadImage( READ_STRING() );
|
||||||
//gViewPort->UpdateSpectatorPanel();
|
//gViewPort->UpdateSpectatorPanel();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRC_CMD_FADE:
|
/*case DRC_CMD_FADE:
|
||||||
break;
|
break;*/
|
||||||
|
|
||||||
case DRC_CMD_STUFFTEXT:
|
case DRC_CMD_STUFFTEXT:
|
||||||
ClientCmd( READ_STRING() );
|
ClientCmd( READ_STRING() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default : gEngfuncs.Con_DPrintf("CHudSpectator::DirectorMessage: unknown command %i.\n", cmd );
|
default : gEngfuncs.Con_DPrintf("CHudSpectator::DirectorMessage: unknown command %i.\n", cmd );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -679,12 +700,12 @@ void CHudSpectator::HandleButtonsDown( int ButtonPressed )
|
|||||||
int newInsetMode = m_pip->value;
|
int newInsetMode = m_pip->value;
|
||||||
|
|
||||||
// gEngfuncs.Con_Printf(" HandleButtons:%i\n", ButtonPressed );
|
// gEngfuncs.Con_Printf(" HandleButtons:%i\n", ButtonPressed );
|
||||||
// if ( !gViewPort )
|
// if ( !gViewPort )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Not in intermission.
|
//Not in intermission.
|
||||||
if ( gHUD.m_iIntermission )
|
if ( gHUD.m_iIntermission )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !g_iUser1 )
|
if ( !g_iUser1 )
|
||||||
return; // dont do anything if not in spectator mode
|
return; // dont do anything if not in spectator mode
|
||||||
@ -772,9 +793,9 @@ void CHudSpectator::HandleButtonsDown( int ButtonPressed )
|
|||||||
void CHudSpectator::HandleButtonsUp( int ButtonPressed )
|
void CHudSpectator::HandleButtonsUp( int ButtonPressed )
|
||||||
{
|
{
|
||||||
//if ( !gViewPort )
|
//if ( !gViewPort )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// if ( !gViewPort->m_pSpectatorPanel->isVisible() )
|
// if ( !gViewPort->m_pSpectatorPanel->isVisible() )
|
||||||
// return; // dont do anything if not in spectator mode
|
// return; // dont do anything if not in spectator mode
|
||||||
|
|
||||||
if ( ButtonPressed & (IN_FORWARD | IN_BACK) )
|
if ( ButtonPressed & (IN_FORWARD | IN_BACK) )
|
||||||
@ -825,36 +846,36 @@ void CHudSpectator::SetModes(int iNewMainMode, int iNewInsetMode)
|
|||||||
|
|
||||||
switch ( iNewMainMode )
|
switch ( iNewMainMode )
|
||||||
{
|
{
|
||||||
case OBS_CHASE_LOCKED: g_iUser1 = OBS_CHASE_LOCKED;
|
case OBS_CHASE_LOCKED: g_iUser1 = OBS_CHASE_LOCKED;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBS_CHASE_FREE : g_iUser1 = OBS_CHASE_FREE;
|
case OBS_CHASE_FREE : g_iUser1 = OBS_CHASE_FREE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBS_ROAMING : // jump to current vJumpOrigin/angle
|
case OBS_ROAMING : // jump to current vJumpOrigin/angle
|
||||||
g_iUser1 = OBS_ROAMING;
|
g_iUser1 = OBS_ROAMING;
|
||||||
if ( g_iUser2 )
|
if ( g_iUser2 )
|
||||||
{
|
{
|
||||||
V_GetChasePos( g_iUser2, v_cl_angles, vJumpOrigin, vJumpAngles );
|
V_GetChasePos( g_iUser2, v_cl_angles, vJumpOrigin, vJumpAngles );
|
||||||
gEngfuncs.SetViewAngles( vJumpAngles );
|
gEngfuncs.SetViewAngles( vJumpAngles );
|
||||||
iJumpSpectator = 1;
|
iJumpSpectator = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBS_IN_EYE : g_iUser1 = OBS_IN_EYE;
|
case OBS_IN_EYE : g_iUser1 = OBS_IN_EYE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBS_MAP_FREE : g_iUser1 = OBS_MAP_FREE;
|
case OBS_MAP_FREE : g_iUser1 = OBS_MAP_FREE;
|
||||||
// reset user values
|
// reset user values
|
||||||
m_mapZoom = m_OverviewData.zoom;
|
m_mapZoom = m_OverviewData.zoom;
|
||||||
m_mapOrigin = m_OverviewData.origin;
|
m_mapOrigin = m_OverviewData.origin;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBS_MAP_CHASE : g_iUser1 = OBS_MAP_CHASE;
|
case OBS_MAP_CHASE : g_iUser1 = OBS_MAP_CHASE;
|
||||||
// reset user values
|
// reset user values
|
||||||
m_mapZoom = m_OverviewData.zoom;
|
m_mapZoom = m_OverviewData.zoom;
|
||||||
m_mapOrigin = m_OverviewData.origin;
|
m_mapOrigin = m_OverviewData.origin;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (g_iUser1 == OBS_IN_EYE) || (g_iUser1 == OBS_ROAMING) )
|
if ( (g_iUser1 == OBS_IN_EYE) || (g_iUser1 == OBS_ROAMING) )
|
||||||
@ -887,8 +908,8 @@ bool CHudSpectator::IsActivePlayer(cl_entity_t * ent)
|
|||||||
return ( ent &&
|
return ( ent &&
|
||||||
ent->player &&
|
ent->player &&
|
||||||
ent->curstate.solid != SOLID_NOT &&
|
ent->curstate.solid != SOLID_NOT &&
|
||||||
ent != gEngfuncs.GetLocalPlayer() &&
|
ent != gEngfuncs.GetLocalPlayer() &&
|
||||||
g_PlayerInfoList[ent->index].name != NULL
|
g_PlayerInfoList[ent->index].name != NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,17 +1146,17 @@ void CHudSpectator::DrawOverviewLayer()
|
|||||||
gEngfuncs.pTriAPI->SpriteTexture( dummySprite, 0 );
|
gEngfuncs.pTriAPI->SpriteTexture( dummySprite, 0 );
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
|
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
|
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x, y, z);
|
gEngfuncs.pTriAPI->Vertex3f (x, y, z);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 1, 0 );
|
gEngfuncs.pTriAPI->TexCoord2f( 1, 0 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x+xStep ,y, z);
|
gEngfuncs.pTriAPI->Vertex3f (x+xStep ,y, z);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
|
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x+xStep, y+yStep, z);
|
gEngfuncs.pTriAPI->Vertex3f (x+xStep, y+yStep, z);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
|
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x, y+yStep, z);
|
gEngfuncs.pTriAPI->Vertex3f (x, y+yStep, z);
|
||||||
gEngfuncs.pTriAPI->End();
|
gEngfuncs.pTriAPI->End();
|
||||||
|
|
||||||
frame++;
|
frame++;
|
||||||
@ -1168,17 +1189,17 @@ void CHudSpectator::DrawOverviewLayer()
|
|||||||
gEngfuncs.pTriAPI->SpriteTexture( dummySprite, 0 );
|
gEngfuncs.pTriAPI->SpriteTexture( dummySprite, 0 );
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
|
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
|
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x, y, z);
|
gEngfuncs.pTriAPI->Vertex3f (x, y, z);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
|
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x+xStep ,y, z);
|
gEngfuncs.pTriAPI->Vertex3f (x+xStep ,y, z);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
|
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x+xStep, y+yStep, z);
|
gEngfuncs.pTriAPI->Vertex3f (x+xStep, y+yStep, z);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 1, 0 );
|
gEngfuncs.pTriAPI->TexCoord2f( 1, 0 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x, y+yStep, z);
|
gEngfuncs.pTriAPI->Vertex3f (x, y+yStep, z);
|
||||||
gEngfuncs.pTriAPI->End();
|
gEngfuncs.pTriAPI->End();
|
||||||
|
|
||||||
frame++;
|
frame++;
|
||||||
@ -1380,14 +1401,14 @@ void CHudSpectator::DrawOverviewEntities()
|
|||||||
VectorTransform(forward, rmatrix , left );
|
VectorTransform(forward, rmatrix , left );
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->Begin (TRI_TRIANGLES);
|
gEngfuncs.pTriAPI->Begin (TRI_TRIANGLES);
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
|
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x+right[0], y+right[1], (z+right[2]) * zScale);
|
gEngfuncs.pTriAPI->Vertex3f (x+right[0], y+right[1], (z+right[2]) * zScale);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
|
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x, y, z * zScale);
|
gEngfuncs.pTriAPI->Vertex3f (x, y, z * zScale);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
|
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
|
||||||
gEngfuncs.pTriAPI->Vertex3f (x+left[0], y+left[1], (z+left[2]) * zScale);
|
gEngfuncs.pTriAPI->Vertex3f (x+left[0], y+left[1], (z+left[2]) * zScale);
|
||||||
gEngfuncs.pTriAPI->End ();
|
gEngfuncs.pTriAPI->End ();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1440,10 +1461,10 @@ bool CHudSpectator::AddOverviewEntity( int type, struct cl_entity_s *ent, const
|
|||||||
{
|
{
|
||||||
switch ( g_PlayerExtraInfo[ent->index].teamnumber )
|
switch ( g_PlayerExtraInfo[ent->index].teamnumber )
|
||||||
{
|
{
|
||||||
// blue and red teams are swapped in CS and TFC
|
// blue and red teams are swapped in CS and TFC
|
||||||
case TEAM_TERRORIST: hSprite = m_hsprPlayerRed; break;
|
case TEAM_TERRORIST: hSprite = m_hsprPlayerRed; break;
|
||||||
case TEAM_CT: hSprite = m_hsprPlayerBlue; break;
|
case TEAM_CT: hSprite = m_hsprPlayerBlue; break;
|
||||||
default: hSprite = m_hsprPlayer; break;
|
default: hSprite = m_hsprPlayer; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1547,7 +1568,7 @@ void CHudSpectator::CheckSettings()
|
|||||||
m_pip->value = INSET_OFF;
|
m_pip->value = INSET_OFF;
|
||||||
|
|
||||||
// draw small border around inset view, adjust upper black bar
|
// draw small border around inset view, adjust upper black bar
|
||||||
// gViewPort->m_pSpectatorPanel->EnableInsetView( m_pip->value != INSET_OFF );
|
// gViewPort->m_pSpectatorPanel->EnableInsetView( m_pip->value != INSET_OFF );
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHudSpectator::ToggleInset(bool allowOff)
|
int CHudSpectator::ToggleInset(bool allowOff)
|
||||||
@ -1622,3 +1643,7 @@ void CHudSpectator::InitHUDData()
|
|||||||
gHUD.m_iFOV = CVAR_GET_FLOAT("default_fov");
|
gHUD.m_iFOV = CVAR_GET_FLOAT("default_fov");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CHudSpectator::MsgFunc_Spectator(const char *pszName, int iSize, void *buf)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "cl_entity.h"
|
#include "cl_entity.h"
|
||||||
|
#include "hud.h"
|
||||||
|
|
||||||
|
|
||||||
#define INSET_OFF 0
|
#define INSET_OFF 0
|
||||||
@ -78,6 +78,7 @@ public:
|
|||||||
void FindNextPlayer( bool bReverse );
|
void FindNextPlayer( bool bReverse );
|
||||||
void DirectorMessage( int iSize, void *pbuf );
|
void DirectorMessage( int iSize, void *pbuf );
|
||||||
void SetSpectatorStartPosition();
|
void SetSpectatorStartPosition();
|
||||||
|
CHudMsgFunc(Spectator);
|
||||||
int Init();
|
int Init();
|
||||||
int VidInit();
|
int VidInit();
|
||||||
|
|
||||||
@ -95,9 +96,11 @@ public:
|
|||||||
float m_mapZoom; // zoom the user currently uses
|
float m_mapZoom; // zoom the user currently uses
|
||||||
vec3_t m_mapOrigin; // origin where user rotates around
|
vec3_t m_mapOrigin; // origin where user rotates around
|
||||||
cvar_t * m_drawnames;
|
cvar_t * m_drawnames;
|
||||||
|
cvar_t * m_specmode;
|
||||||
cvar_t * m_drawcone;
|
cvar_t * m_drawcone;
|
||||||
cvar_t * m_drawstatus;
|
cvar_t * m_drawstatus;
|
||||||
cvar_t * m_autoDirector;
|
cvar_t * m_autoDirector;
|
||||||
|
float m_lastAutoDirector;
|
||||||
cvar_t * m_pip;
|
cvar_t * m_pip;
|
||||||
|
|
||||||
|
|
||||||
|
183
cl_dll/view.cpp
183
cl_dll/view.cpp
@ -1,4 +1,4 @@
|
|||||||
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
//========= Copyright ? 1996-2002, Valve LLC, All rights reserved. ============
|
||||||
//
|
//
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//
|
//
|
||||||
@ -30,11 +30,11 @@
|
|||||||
// Spectator Mode
|
// Spectator Mode
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
float vecNewViewAngles[3];
|
float vecNewViewAngles[3];
|
||||||
int iHasNewViewAngles;
|
int iHasNewViewAngles;
|
||||||
float vecNewViewOrigin[3];
|
float vecNewViewOrigin[3];
|
||||||
int iHasNewViewOrigin;
|
int iHasNewViewOrigin;
|
||||||
int iIsSpectator;
|
int iIsSpectator;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
@ -43,21 +43,21 @@ extern "C"
|
|||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
int CL_IsThirdPerson( void );
|
int CL_IsThirdPerson( void );
|
||||||
void CL_CameraOffset( float *ofs );
|
void CL_CameraOffset( float *ofs );
|
||||||
|
|
||||||
void DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams );
|
void DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams );
|
||||||
|
|
||||||
void PM_ParticleLine( float *start, float *end, int pcolor, float life, float vert);
|
void PM_ParticleLine( float *start, float *end, int pcolor, float life, float vert);
|
||||||
int PM_GetVisEntInfo( int ent );
|
int PM_GetVisEntInfo( int ent );
|
||||||
int PM_GetPhysEntInfo( int ent );
|
int PM_GetPhysEntInfo( int ent );
|
||||||
void InterpolateAngles( float * start, float * end, float * output, float frac );
|
void InterpolateAngles( float * start, float * end, float * output, float frac );
|
||||||
void NormalizeAngles( float * angles );
|
void NormalizeAngles( float * angles );
|
||||||
float Distance(const float * v1, const float * v2);
|
float Distance(const float * v1, const float * v2);
|
||||||
float AngleBetweenVectors( const float * v1, const float * v2 );
|
float AngleBetweenVectors( const float * v1, const float * v2 );
|
||||||
|
|
||||||
float vJumpOrigin[3];
|
float vJumpOrigin[3];
|
||||||
float vJumpAngles[3];
|
float vJumpAngles[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
void V_DropPunchAngle ( float frametime, float *ev_punchangle );
|
void V_DropPunchAngle ( float frametime, float *ev_punchangle );
|
||||||
@ -227,23 +227,23 @@ Used by view and sv_user
|
|||||||
*/
|
*/
|
||||||
float V_CalcRoll (vec3_t angles, vec3_t velocity, float rollangle, float rollspeed )
|
float V_CalcRoll (vec3_t angles, vec3_t velocity, float rollangle, float rollspeed )
|
||||||
{
|
{
|
||||||
float sign;
|
float sign;
|
||||||
float side;
|
float side;
|
||||||
float value;
|
float value;
|
||||||
vec3_t forward, right, up;
|
vec3_t forward, right, up;
|
||||||
|
|
||||||
AngleVectors ( angles, forward, right, up );
|
AngleVectors ( angles, forward, right, up );
|
||||||
|
|
||||||
side = DotProduct (velocity, right);
|
side = DotProduct (velocity, right);
|
||||||
sign = side < 0 ? -1 : 1;
|
sign = side < 0 ? -1 : 1;
|
||||||
side = fabs( side );
|
side = fabs( side );
|
||||||
|
|
||||||
value = rollangle;
|
value = rollangle;
|
||||||
if (side < rollspeed)
|
if (side < rollspeed)
|
||||||
{
|
{
|
||||||
side = side * value / rollspeed;
|
side = side * value / rollspeed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
side = value;
|
side = value;
|
||||||
}
|
}
|
||||||
@ -703,7 +703,7 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams )
|
|||||||
|
|
||||||
steptime = pparams->time - lasttime;
|
steptime = pparams->time - lasttime;
|
||||||
if (steptime < 0)
|
if (steptime < 0)
|
||||||
//FIXME I_Error ("steptime < 0");
|
//FIXME I_Error ("steptime < 0");
|
||||||
steptime = 0;
|
steptime = 0;
|
||||||
|
|
||||||
oldz += steptime * 150;
|
oldz += steptime * 150;
|
||||||
@ -738,7 +738,7 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams )
|
|||||||
|
|
||||||
// Smooth out whole view in multiplayer when on trains, lifts
|
// Smooth out whole view in multiplayer when on trains, lifts
|
||||||
if ( cl_vsmoothing && cl_vsmoothing->value &&
|
if ( cl_vsmoothing && cl_vsmoothing->value &&
|
||||||
( pparams->smoothing && ( pparams->maxclients > 1 ) ) )
|
( pparams->smoothing && ( pparams->maxclients > 1 ) ) )
|
||||||
{
|
{
|
||||||
int foundidx;
|
int foundidx;
|
||||||
int i;
|
int i;
|
||||||
@ -791,7 +791,7 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams )
|
|||||||
// Store off v_angles before munging for third person
|
// Store off v_angles before munging for third person
|
||||||
v_angles = pparams->viewangles;
|
v_angles = pparams->viewangles;
|
||||||
v_lastAngles = pparams->viewangles;
|
v_lastAngles = pparams->viewangles;
|
||||||
// v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles !
|
// v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles !
|
||||||
if ( CL_IsThirdPerson() )
|
if ( CL_IsThirdPerson() )
|
||||||
{
|
{
|
||||||
VectorCopy( camAngles, pparams->viewangles);
|
VectorCopy( camAngles, pparams->viewangles);
|
||||||
@ -923,11 +923,8 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r
|
|||||||
|
|
||||||
ent = gEngfuncs.GetEntityByIndex( PM_GetPhysEntInfo( trace->ent ) );
|
ent = gEngfuncs.GetEntityByIndex( PM_GetPhysEntInfo( trace->ent ) );
|
||||||
|
|
||||||
if ( ent == NULL )
|
|
||||||
break;
|
|
||||||
|
|
||||||
// hit non-player solid BSP , stop here
|
// hit non-player solid BSP , stop here
|
||||||
if ( ent->curstate.solid == SOLID_BSP && !ent->player )
|
if ( ent == NULL && ent->curstate.solid == SOLID_BSP && !ent->player )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// if close enought to end pos, stop, otherwise continue trace
|
// if close enought to end pos, stop, otherwise continue trace
|
||||||
@ -944,20 +941,23 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r
|
|||||||
maxLoops--;
|
maxLoops--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if ( ent )
|
/*if ( ent )
|
||||||
{
|
{
|
||||||
gEngfuncs.Con_Printf("Trace loops %i , entity %i, model %s, solid %i\n",(8-maxLoops),ent->curstate.number, ent->model->name , ent->curstate.solid );
|
gEngfuncs.Con_Printf("Trace loops %i , entity %i, model %s, solid %i\n",(8-maxLoops),ent->curstate.number, ent->model->name , ent->curstate.solid );
|
||||||
} */
|
}*/
|
||||||
|
|
||||||
VectorMA( trace->endpos, 4, trace->plane.normal, returnvec );
|
VectorMA( trace->endpos, 8, trace->plane.normal, returnvec );
|
||||||
|
|
||||||
|
//gEngfuncs.Con_DPrintf("origin(%f %f %f) returnvec(%f %f %f)\n", origin[0], origin[1], origin[2], returnvec[0], returnvec[1], returnvec[2]);
|
||||||
|
|
||||||
v_lastDistance = Distance(trace->endpos, origin); // real distance without offset
|
v_lastDistance = Distance(trace->endpos, origin); // real distance without offset
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void V_GetDeathCam(cl_entity_t * ent1, cl_entity_t * ent2, float * angle, float * origin)
|
void V_GetDeathCam(cl_entity_t * ent1, cl_entity_t * ent2, float * angle, float * origin)
|
||||||
{
|
{
|
||||||
float newAngle[3]; float newOrigin[3];
|
float newAngle[3];
|
||||||
|
float newOrigin[3];
|
||||||
|
static vec3_t nonDestructedOrigin;
|
||||||
float distance = 168.0f;
|
float distance = 168.0f;
|
||||||
|
|
||||||
v_lastDistance+= v_frametime * 96.0f; // move unit per seconds back
|
v_lastDistance+= v_frametime * 96.0f; // move unit per seconds back
|
||||||
@ -968,7 +968,13 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r
|
|||||||
if ( distance > v_lastDistance )
|
if ( distance > v_lastDistance )
|
||||||
distance = v_lastDistance;
|
distance = v_lastDistance;
|
||||||
|
|
||||||
VectorCopy(ent1->origin, newOrigin);
|
if (ent1->origin.x == 0 && ent1->origin.y == 0 && ent1->origin.z == 0)
|
||||||
|
nonDestructedOrigin.CopyToArray(newOrigin);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nonDestructedOrigin = ent1->origin;
|
||||||
|
VectorCopy(ent1->origin, newOrigin);
|
||||||
|
}
|
||||||
|
|
||||||
if ( ent1->player )
|
if ( ent1->player )
|
||||||
newOrigin[2]+= 17; // head level of living player
|
newOrigin[2]+= 17; // head level of living player
|
||||||
@ -976,7 +982,7 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r
|
|||||||
// get new angle towards second target
|
// get new angle towards second target
|
||||||
if ( ent2 )
|
if ( ent2 )
|
||||||
{
|
{
|
||||||
VectorSubtract( ent2->origin, ent1->origin, newAngle );
|
VectorSubtract(ent2->origin, nonDestructedOrigin, newAngle);
|
||||||
VectorAngles( newAngle, newAngle );
|
VectorAngles( newAngle, newAngle );
|
||||||
newAngle[0] = -newAngle[0];
|
newAngle[0] = -newAngle[0];
|
||||||
}
|
}
|
||||||
@ -994,7 +1000,7 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r
|
|||||||
V_GetChaseOrigin( angle, newOrigin, distance, origin );
|
V_GetChaseOrigin( angle, newOrigin, distance, origin );
|
||||||
|
|
||||||
VectorCopy(angle, v_lastAngles);
|
VectorCopy(angle, v_lastAngles);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
void V_GetSingleTargetCam(cl_entity_t * ent1, float * angle, float * origin)
|
void V_GetSingleTargetCam(cl_entity_t * ent1, float * angle, float * origin)
|
||||||
{
|
{
|
||||||
@ -1234,11 +1240,12 @@ void V_GetDirectedChasePosition(cl_entity_t * ent1, cl_entity_t * ent2,float *
|
|||||||
void V_GetChasePos(int target, float * cl_angles, float * origin, float * angles)
|
void V_GetChasePos(int target, float * cl_angles, float * origin, float * angles)
|
||||||
{
|
{
|
||||||
cl_entity_t * ent = NULL;
|
cl_entity_t * ent = NULL;
|
||||||
|
cl_entity_t *local = gEngfuncs.GetLocalPlayer();
|
||||||
|
|
||||||
if ( target )
|
if ( target )
|
||||||
{
|
{
|
||||||
ent = gEngfuncs.GetEntityByIndex( target );
|
ent = gEngfuncs.GetEntityByIndex( target );
|
||||||
};
|
}
|
||||||
|
|
||||||
if (!ent)
|
if (!ent)
|
||||||
{
|
{
|
||||||
@ -1249,15 +1256,23 @@ void V_GetChasePos(int target, float * cl_angles, float * origin, float * angles
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( ent->index == local->index )
|
||||||
if ( gHUD.m_Spectator.m_autoDirector->value )
|
|
||||||
{
|
{
|
||||||
if ( g_iUser3 )
|
if ( g_iUser3 && g_iUser3 != 1 )
|
||||||
V_GetDirectedChasePosition( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ),
|
V_GetDeathCam( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ),
|
||||||
angles, origin );
|
angles, origin );
|
||||||
else
|
else
|
||||||
V_GetDirectedChasePosition( ent, ( cl_entity_t*)0xFFFFFFFF,
|
V_GetDeathCam( ent, NULL,
|
||||||
angles, origin );
|
angles, origin );
|
||||||
|
}
|
||||||
|
else if ( gHUD.m_Spectator.m_autoDirector->value )
|
||||||
|
{
|
||||||
|
if ( g_iUser3 && g_iUser3 != 1 )
|
||||||
|
V_GetDirectedChasePosition( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ),
|
||||||
|
angles, origin );
|
||||||
|
else
|
||||||
|
V_GetDirectedChasePosition( ent, (cl_entity_t*)0xFFFFFFFF,
|
||||||
|
angles, origin );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1529,26 +1544,32 @@ void V_CalcSpectatorRefdef ( struct ref_params_s * pparams )
|
|||||||
|
|
||||||
switch ( g_iUser1 )
|
switch ( g_iUser1 )
|
||||||
{
|
{
|
||||||
case OBS_CHASE_LOCKED: V_GetChasePos( g_iUser2, NULL, v_origin, v_angles );
|
case OBS_CHASE_LOCKED:
|
||||||
break;
|
V_GetChasePos( g_iUser2, NULL, v_origin, v_angles );
|
||||||
|
break;
|
||||||
|
|
||||||
case OBS_CHASE_FREE: V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles );
|
case OBS_CHASE_FREE:
|
||||||
break;
|
V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles );
|
||||||
|
break;
|
||||||
|
|
||||||
case OBS_ROAMING : VectorCopy (v_cl_angles, v_angles);
|
case OBS_ROAMING:
|
||||||
VectorCopy (v_sim_org, v_origin);
|
VectorCopy (v_cl_angles, v_angles);
|
||||||
break;
|
VectorCopy (v_sim_org, v_origin);
|
||||||
|
break;
|
||||||
|
|
||||||
case OBS_IN_EYE : V_CalcNormalRefdef ( pparams );
|
case OBS_IN_EYE:
|
||||||
break;
|
V_CalcNormalRefdef ( pparams );
|
||||||
|
break;
|
||||||
|
|
||||||
case OBS_MAP_FREE : pparams->onlyClientDraw = true;
|
case OBS_MAP_FREE:
|
||||||
V_GetMapFreePosition( v_cl_angles, v_origin, v_angles );
|
pparams->onlyClientDraw = true;
|
||||||
break;
|
V_GetMapFreePosition( v_cl_angles, v_origin, v_angles );
|
||||||
|
break;
|
||||||
|
|
||||||
case OBS_MAP_CHASE : pparams->onlyClientDraw = true;
|
case OBS_MAP_CHASE:
|
||||||
V_GetMapChasePosition( g_iUser2, v_cl_angles, v_origin, v_angles );
|
pparams->onlyClientDraw = true;
|
||||||
break;
|
V_GetMapChasePosition( g_iUser2, v_cl_angles, v_origin, v_angles );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gHUD.m_Spectator.m_pip->value )
|
if ( gHUD.m_Spectator.m_pip->value )
|
||||||
@ -1571,24 +1592,28 @@ void V_CalcSpectatorRefdef ( struct ref_params_s * pparams )
|
|||||||
// override some settings in certain modes
|
// override some settings in certain modes
|
||||||
switch ( (int)gHUD.m_Spectator.m_pip->value )
|
switch ( (int)gHUD.m_Spectator.m_pip->value )
|
||||||
{
|
{
|
||||||
case INSET_CHASE_FREE : V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles );
|
case INSET_CHASE_FREE:
|
||||||
break;
|
V_GetChasePos( g_iUser2, v_cl_angles, v_origin, v_angles );
|
||||||
|
break;
|
||||||
|
|
||||||
case INSET_IN_EYE : V_CalcNormalRefdef ( pparams );
|
case INSET_IN_EYE:
|
||||||
break;
|
V_CalcNormalRefdef ( pparams );
|
||||||
|
break;
|
||||||
|
|
||||||
case INSET_MAP_FREE : pparams->onlyClientDraw = true;
|
case INSET_MAP_FREE:
|
||||||
V_GetMapFreePosition( v_cl_angles, v_origin, v_angles );
|
pparams->onlyClientDraw = true;
|
||||||
break;
|
V_GetMapFreePosition( v_cl_angles, v_origin, v_angles );
|
||||||
|
break;
|
||||||
|
|
||||||
case INSET_MAP_CHASE : pparams->onlyClientDraw = true;
|
case INSET_MAP_CHASE:
|
||||||
|
pparams->onlyClientDraw = true;
|
||||||
|
|
||||||
if ( g_iUser1 == OBS_ROAMING )
|
if ( g_iUser1 == OBS_ROAMING )
|
||||||
V_GetMapChasePosition( 0, v_cl_angles, v_origin, v_angles );
|
V_GetMapChasePosition( 0, v_cl_angles, v_origin, v_angles );
|
||||||
else
|
else
|
||||||
V_GetMapChasePosition( g_iUser2, v_cl_angles, v_origin, v_angles );
|
V_GetMapChasePosition( g_iUser2, v_cl_angles, v_origin, v_angles );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gHUD.m_Spectator.m_iDrawCycle = 1;
|
gHUD.m_Spectator.m_iDrawCycle = 1;
|
||||||
@ -1597,7 +1622,7 @@ void V_CalcSpectatorRefdef ( struct ref_params_s * pparams )
|
|||||||
// write back new values into pparams
|
// write back new values into pparams
|
||||||
VectorCopy ( v_cl_angles, pparams->cl_viewangles );
|
VectorCopy ( v_cl_angles, pparams->cl_viewangles );
|
||||||
VectorCopy ( v_angles, pparams->viewangles )
|
VectorCopy ( v_angles, pparams->viewangles )
|
||||||
VectorCopy ( v_origin, pparams->vieworg );
|
VectorCopy ( v_origin, pparams->vieworg );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1619,7 +1644,7 @@ void DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams )
|
|||||||
V_CalcNormalRefdef ( pparams );
|
V_CalcNormalRefdef ( pparams );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Example of how to overlay the whole screen with red at 50 % alpha
|
// Example of how to overlay the whole screen with red at 50 % alpha
|
||||||
#define SF_TEST
|
#define SF_TEST
|
||||||
#if defined SF_TEST
|
#if defined SF_TEST
|
||||||
|
@ -6,6 +6,9 @@ LOCAL_MODULE := server
|
|||||||
|
|
||||||
include $(XASH3D_CONFIG)
|
include $(XASH3D_CONFIG)
|
||||||
|
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
|
||||||
|
LOCAL_MODULE_FILENAME = libserver_hardfp
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_CFLAGS += -w -D_LINUX -DCLIENT_WEAPONS -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf \
|
LOCAL_CFLAGS += -w -D_LINUX -DCLIENT_WEAPONS -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf \
|
||||||
-fno-exceptions
|
-fno-exceptions
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool g_bGlockBurstMode;
|
||||||
|
|
||||||
DLL_GLOBAL short g_sModelIndexLaser;
|
DLL_GLOBAL short g_sModelIndexLaser;
|
||||||
DLL_GLOBAL const char *g_pModelNameLaser = "sprites/laserbeam.spr";
|
DLL_GLOBAL const char *g_pModelNameLaser = "sprites/laserbeam.spr";
|
||||||
DLL_GLOBAL short g_sModelIndexLaserDot;
|
DLL_GLOBAL short g_sModelIndexLaserDot;
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "weapons.h"
|
#include "weapons.h"
|
||||||
|
|
||||||
|
#ifdef CLIENT_WEAPONS
|
||||||
|
extern bool g_bGlockBurstMode;
|
||||||
|
#endif
|
||||||
|
|
||||||
enum glock18_e
|
enum glock18_e
|
||||||
{
|
{
|
||||||
GLOCK18_IDLE1,
|
GLOCK18_IDLE1,
|
||||||
@ -131,11 +135,17 @@ void CGLOCK18::SecondaryAttack(void)
|
|||||||
{
|
{
|
||||||
ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_SemiAuto");
|
ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_SemiAuto");
|
||||||
m_iWeaponState &= ~WPNSTATE_GLOCK18_BURST_MODE;
|
m_iWeaponState &= ~WPNSTATE_GLOCK18_BURST_MODE;
|
||||||
|
#ifdef CLIENT_WEAPONS
|
||||||
|
g_bGlockBurstMode = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_BurstFire");
|
ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_BurstFire");
|
||||||
m_iWeaponState |= WPNSTATE_GLOCK18_BURST_MODE;
|
m_iWeaponState |= WPNSTATE_GLOCK18_BURST_MODE;
|
||||||
|
#ifdef CLIENT_WEAPONS
|
||||||
|
g_bGlockBurstMode = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3;
|
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3;
|
||||||
|
Loading…
Reference in New Issue
Block a user