Update script. Shutdown method for CHudBase. Fix BufferReader constructor call. Use pregenerated textures in radar.
This commit is contained in:
parent
69ecbcb3e7
commit
956d584c9f
@ -38,7 +38,7 @@ cp -r ../3rdparty/extras/* pak/
|
||||
python2 makepak.py pak/ assets/extras.pak
|
||||
|
||||
# Build
|
||||
ndk-build -j8 NDK_TOOLCHAIN_VERSION=4.8 _CS16CLIENT_ENABLE_OPENMP=$OMP NDK_DEBUG=$RELEASE
|
||||
ndk-build -j8 NDK_TOOLCHAIN_VERSION=4.8 _CS16CLIENT_ENABLE_OPENMP=$OMP NDK_DEBUG=$RELEASE V=1
|
||||
ant $1
|
||||
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../../myks.keystore bin/cs16-client-$1-unaligned.apk xashdroid -tsa https://timestamp.geotrust.com/tsa
|
||||
$HOME/.android/android-sdk-linux/build-tools/23.0.3/zipalign 4 bin/cs16-client-$1-unaligned.apk bin/cs16-client.apk
|
||||
|
4
android/update
Executable file
4
android/update
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo " ------- UPDATING SUBMODULES ------- "
|
||||
git submodule foreach git pull origin master
|
@ -29,6 +29,7 @@
|
||||
//#include "interface.h" // not used here
|
||||
#include "render_api.h"
|
||||
#include "mobility_int.h"
|
||||
#include "vgui_parser.h"
|
||||
|
||||
cl_enginefunc_t gEngfuncs = { };
|
||||
render_api_t gRenderAPI = { };
|
||||
@ -40,6 +41,7 @@ int g_iMobileAPIVersion = 0;
|
||||
void InitInput (void);
|
||||
void Game_HookEvents( void );
|
||||
void IN_Commands( void );
|
||||
void Input_Shutdown (void);
|
||||
|
||||
/*
|
||||
==========================
|
||||
@ -62,6 +64,21 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
HUD_Shutdown
|
||||
|
||||
=============
|
||||
*/
|
||||
void DLLEXPORT HUD_Shutdown( void )
|
||||
{
|
||||
gHUD.Shutdown();
|
||||
Input_Shutdown();
|
||||
Localize_Free();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================================
|
||||
HUD_GetHullBounds
|
||||
|
@ -392,7 +392,10 @@ bool CBasePlayerWeapon::ShieldSecondaryFire(int up_anim, int down_anim)
|
||||
return true;
|
||||
}
|
||||
|
||||
void CBasePlayerWeapon::KickBack(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change){}
|
||||
void CBasePlayerWeapon::KickBack(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CBasePlayerWeapon::SetPlayerShieldAnim(void)
|
||||
{
|
||||
@ -498,8 +501,7 @@ Animate weapon model
|
||||
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal )
|
||||
{
|
||||
m_pPlayer->pev->weaponanim = iAnim;
|
||||
|
||||
HUD_SendWeaponAnim( iAnim, m_iId, m_pPlayer->pev->body, 0 );
|
||||
HUD_SendWeaponAnim( iAnim, m_iId, 0, 0 );
|
||||
}
|
||||
|
||||
Vector CBaseEntity::FireBullets3 ( Vector vecSrc, Vector vecDirShooting, float flSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand )
|
||||
|
@ -55,8 +55,6 @@ const char *sPlayerModelFiles[12] =
|
||||
"models/player/militia/militia.mdl" // t
|
||||
};
|
||||
|
||||
void ShutdownInput (void);
|
||||
|
||||
#define GHUD_DECLARE_MESSAGE(x) int __MsgFunc_##x(const char *pszName, int iSize, void *pbuf ) { return gHUD.MsgFunc_##x(pszName, iSize, pbuf); }
|
||||
|
||||
GHUD_DECLARE_MESSAGE(Logo)
|
||||
@ -215,10 +213,6 @@ CHud :: ~CHud()
|
||||
delete pList;
|
||||
}
|
||||
m_pHudList = NULL;
|
||||
|
||||
//Localize_Free();
|
||||
|
||||
//ServersShutdown();
|
||||
}
|
||||
|
||||
void CHud :: VidInit( void )
|
||||
@ -343,6 +337,14 @@ void CHud :: VidInit( void )
|
||||
m_SpectatorGui.VidInit();
|
||||
}
|
||||
|
||||
void CHud::Shutdown( void )
|
||||
{
|
||||
for( HUDLIST *pList = m_pHudList; pList; pList = m_pHudList->pNext )
|
||||
{
|
||||
pList->p->Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
int CHud::MsgFunc_Logo(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
@ -119,7 +119,7 @@ int CHud :: MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf )
|
||||
|
||||
int CHud::MsgFunc_BombDrop(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
g_PlayerExtraInfo[33].origin.x = reader.ReadCoord();
|
||||
g_PlayerExtraInfo[33].origin.y = reader.ReadCoord();
|
||||
@ -156,7 +156,7 @@ int CHud::MsgFunc_BombPickup(const char *pszName, int iSize, void *pbuf)
|
||||
int CHud::MsgFunc_HostagePos(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
int Flag = reader.ReadByte();
|
||||
int idx = reader.ReadByte();
|
||||
if ( idx <= MAX_HOSTAGES )
|
||||
@ -179,7 +179,7 @@ int CHud::MsgFunc_HostagePos(const char *pszName, int iSize, void *pbuf)
|
||||
|
||||
int CHud::MsgFunc_HostageK(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
int idx = reader.ReadByte();
|
||||
if ( idx <= MAX_HOSTAGES )
|
||||
{
|
||||
@ -193,7 +193,7 @@ int CHud::MsgFunc_HostageK(const char *pszName, int iSize, void *pbuf)
|
||||
|
||||
int CHud::MsgFunc_ShadowIdx(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
int idx = reader.ReadByte();
|
||||
g_StudioRenderer.StudioSetShadowSprite(idx);
|
||||
|
@ -241,7 +241,7 @@ int CHudMenu :: MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf )
|
||||
|
||||
int CHudMenu::MsgFunc_VGUIMenu( const char *pszName, int iSize, void *pbuf )
|
||||
{
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
int menuType = reader.ReadByte();
|
||||
m_bitsValidSlots = reader.ReadShort(); // is ignored
|
||||
|
@ -565,10 +565,10 @@ void CHudMessage::MessageAdd(client_textmessage_t * newMessage )
|
||||
int CHudMessage::MsgFunc_HudTextPro( const char *pszName, int iSize, void *pbuf )
|
||||
{
|
||||
const char *sz;
|
||||
//int hint;
|
||||
BufferReader reader(pbuf, iSize);
|
||||
int hint;
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
sz = reader.ReadString();
|
||||
//hint = reader.ReadByte();
|
||||
hint = reader.ReadByte();
|
||||
|
||||
MessageAdd(sz, gHUD.m_flTime/*, hint, Newfont*/); // TODO
|
||||
|
||||
|
@ -147,7 +147,7 @@ int CHudMoney::Draw(float flTime)
|
||||
|
||||
int CHudMoney::MsgFunc_Money(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader buf( pbuf, iSize );
|
||||
BufferReader buf( pszName, pbuf, iSize );
|
||||
int iOldCount = m_iMoneyCount;
|
||||
m_iMoneyCount = buf.ReadLong();
|
||||
m_iDelta = m_iMoneyCount - iOldCount;
|
||||
@ -158,7 +158,7 @@ int CHudMoney::MsgFunc_Money(const char *pszName, int iSize, void *pbuf)
|
||||
|
||||
int CHudMoney::MsgFunc_BlinkAcct(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader buf( pbuf, iSize );
|
||||
BufferReader buf( pszName, pbuf, iSize );
|
||||
|
||||
m_iBlinkAmt = buf.ReadByte();
|
||||
m_fBlinkTime = 0;
|
||||
|
@ -73,7 +73,7 @@ int CHudNVG::Draw(float flTime)
|
||||
|
||||
int CHudNVG::MsgFunc_NVGToggle(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
m_iEnable = reader.ReadByte();
|
||||
return 1;
|
||||
|
@ -31,7 +31,7 @@ version.
|
||||
#include "cl_util.h"
|
||||
#include "parsemsg.h"
|
||||
#include "draw_util.h"
|
||||
|
||||
#include "triangleapi.h"
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
@ -41,6 +41,46 @@ DECLARE_COMMAND( m_Radar, HideRadar )
|
||||
|
||||
DECLARE_MESSAGE( m_Radar, Radar )
|
||||
|
||||
static byte r_RadarCross[8][8] =
|
||||
{
|
||||
{1,1,0,0,0,0,1,1},
|
||||
{1,1,1,0,0,1,1,1},
|
||||
{0,1,1,1,1,1,1,0},
|
||||
{0,0,1,1,1,1,0,0},
|
||||
{0,0,1,1,1,1,0,0},
|
||||
{0,1,1,1,1,1,1,0},
|
||||
{1,1,1,0,0,1,1,1},
|
||||
{1,1,0,0,0,0,1,1}
|
||||
};
|
||||
|
||||
static byte r_RadarT[8][8] =
|
||||
{
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0}
|
||||
};
|
||||
|
||||
static byte r_RadarFlippedT[8][8] =
|
||||
{
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{0,0,0,1,1,0,0,0},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1}
|
||||
};
|
||||
|
||||
#define BLOCK_SIZE_MAX 1024
|
||||
|
||||
static byte data2D[BLOCK_SIZE_MAX*BLOCK_SIZE_MAX*4]; // intermediate texbuffer
|
||||
|
||||
int CHudRadar::Init()
|
||||
{
|
||||
HOOK_MESSAGE( Radar );
|
||||
@ -51,6 +91,8 @@ int CHudRadar::Init()
|
||||
|
||||
cl_radartype = CVAR_CREATE( "cl_radartype", "0", FCVAR_ARCHIVE );
|
||||
|
||||
bTexturesInitialized = bUseRenderAPI = false;
|
||||
|
||||
gHUD.AddHudElem( this );
|
||||
return 1;
|
||||
}
|
||||
@ -66,8 +108,82 @@ void CHudRadar::Reset()
|
||||
}
|
||||
}
|
||||
|
||||
static void Radar_InitBitmap( int w, int h, byte *buf )
|
||||
{
|
||||
for( int x = 0; x < w; x++ )
|
||||
{
|
||||
for( int y = 0; y < h; y++ )
|
||||
{
|
||||
data2D[(y * 8 + x) * 4 + 0] = 255;
|
||||
data2D[(y * 8 + x) * 4 + 1] = 255;
|
||||
data2D[(y * 8 + x) * 4 + 2] = 255;
|
||||
data2D[(y * 8 + x) * 4 + 3] = buf[y*h + x] * 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CHudRadar::InitBuiltinTextures( void )
|
||||
{
|
||||
texFlags_t defFlags = (texFlags_t)(TF_NOMIPMAP | TF_NOPICMIP | TF_NEAREST | TF_CLAMP | TF_HAS_ALPHA);
|
||||
|
||||
if( bTexturesInitialized )
|
||||
return 1;
|
||||
|
||||
const struct
|
||||
{
|
||||
const char *name;
|
||||
byte *buf;
|
||||
int *texnum;
|
||||
int w, h;
|
||||
void (*init)( int w, int h, byte *buf );
|
||||
int texType;
|
||||
}
|
||||
textures[] =
|
||||
{
|
||||
{ "radarT", (byte*)r_RadarT, &hT, 8, 8, Radar_InitBitmap, TEX_CUSTOM },
|
||||
{ "radarcross", (byte*)r_RadarCross, &hCross, 8, 8, Radar_InitBitmap, TEX_CUSTOM },
|
||||
{ "radarflippedT", (byte*)r_RadarFlippedT, &hFlippedT, 8, 8, Radar_InitBitmap, TEX_CUSTOM }
|
||||
};
|
||||
size_t i, num_builtin_textures = sizeof( textures ) / sizeof( textures[0] );
|
||||
|
||||
for( i = 0; i < num_builtin_textures; i++ )
|
||||
{
|
||||
textures[i].init( textures[i].w, textures[i].h, textures[i].buf );
|
||||
*textures[i].texnum = gRenderAPI.GL_CreateTexture( textures[i].name, textures[i].w, textures[i].h, data2D, defFlags );
|
||||
if( *textures[i].texnum == 0 )
|
||||
{
|
||||
for( size_t j = 0; j < i; i++ )
|
||||
{
|
||||
gRenderAPI.GL_FreeTexture( *textures[i].texnum );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
gRenderAPI.GL_SetTextureType( *textures[i].texnum, textures[i].texType );
|
||||
}
|
||||
|
||||
hDot = gRenderAPI.GL_LoadTexture( "*white", NULL, 0, 0 );
|
||||
|
||||
bTexturesInitialized = true;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CHudRadar::Shutdown( void )
|
||||
{
|
||||
// GL_FreeTexture( hDot ); engine inner texture
|
||||
if( bTexturesInitialized )
|
||||
{
|
||||
gRenderAPI.GL_FreeTexture( hT );
|
||||
gRenderAPI.GL_FreeTexture( hFlippedT );
|
||||
gRenderAPI.GL_FreeTexture( hCross );
|
||||
}
|
||||
}
|
||||
|
||||
int CHudRadar::VidInit(void)
|
||||
{
|
||||
bUseRenderAPI = g_iXash && InitBuiltinTextures();
|
||||
|
||||
m_hRadar.SetSpriteByName( "radar" );
|
||||
m_hRadarOpaque.SetSpriteByName( "radaropaque" );
|
||||
return 1;
|
||||
@ -116,6 +232,14 @@ int CHudRadar::Draw(float flTime)
|
||||
SPR_DrawAdditive( 0, 0, 0, &m_hRadarOpaque.rect );
|
||||
}
|
||||
|
||||
if( bUseRenderAPI )
|
||||
{
|
||||
gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd );
|
||||
gEngfuncs.pTriAPI->CullFace( TRI_NONE );
|
||||
gEngfuncs.pTriAPI->Brightness( 1 );
|
||||
gRenderAPI.GL_SelectTexture( 0 );
|
||||
}
|
||||
|
||||
for(int i = 0; i < 33; i++)
|
||||
{
|
||||
// skip local player and dead players
|
||||
@ -255,29 +379,68 @@ void CHudRadar::DrawPlayerLocation()
|
||||
|
||||
void CHudRadar::DrawRadarDot(int x, int y, int size, int r, int g, int b, int a)
|
||||
{
|
||||
FillRGBA(62.5f + x - size/2.0f, 62.5f + y - size/2.0f, size, size, r, g, b, a);
|
||||
if( bUseRenderAPI )
|
||||
{
|
||||
gRenderAPI.GL_Bind( 0, hDot );
|
||||
gEngfuncs.pTriAPI->Color4ub( r, g, b, a );
|
||||
DrawUtils::Draw2DQuad( 62.5f + x - size/2, 62.5f + y - size/2,
|
||||
62.5f + x + size/2, 62.5f + y + size/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRGBA(62.5f + x - size/2.0f, 62.5f + y - size/2.0f, size, size, r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
void CHudRadar::DrawCross(int x, int y, int size, int r, int g, int b, int a)
|
||||
{
|
||||
FillRGBA(62.5f + x, 62.5f + y, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x - size, 62.5f + y - size, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x - size, 62.5f + y + size, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x + size, 62.5f + y - size, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x + size, 62.5f + y + size, size, size, r, g, b, a);
|
||||
|
||||
if( bUseRenderAPI )
|
||||
{
|
||||
gRenderAPI.GL_Bind( 0, hCross );
|
||||
gEngfuncs.pTriAPI->Color4ub( r, g, b, a );
|
||||
DrawUtils::Draw2DQuad( 62.5f + x - size*2, 62.5f + y - size*2,
|
||||
62.5f + x + size*2, 62.5f + y + size*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRGBA(62.5f + x, 62.5f + y, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x - size, 62.5f + y - size, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x - size, 62.5f + y + size, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x + size, 62.5f + y - size, size, size, r, g, b, a);
|
||||
FillRGBA(62.5f + x + size, 62.5f + y + size, size, size, r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
void CHudRadar::DrawT(int x, int y, int size, int r, int g, int b, int a)
|
||||
{
|
||||
FillRGBA( 62.5f + x - size, 62.5 + y - size, 3*size, size, r, g, b, a);
|
||||
FillRGBA( 62.5f + x, 62.5 + y, size, 2*size, r, g, b, a);
|
||||
if( bUseRenderAPI )
|
||||
{
|
||||
gRenderAPI.GL_Bind( 0, hT );
|
||||
gEngfuncs.pTriAPI->Color4ub( r, g, b, a );
|
||||
DrawUtils::Draw2DQuad( 62.5f + x - size*2, 62.5f + y - size*2,
|
||||
62.5f + x + size*2, 62.5f + y + size*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRGBA( 62.5f + x - size, 62.5 + y - size, 3*size, size, r, g, b, a);
|
||||
FillRGBA( 62.5f + x, 62.5 + y, size, 2*size, r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
void CHudRadar::DrawFlippedT(int x, int y, int size, int r, int g, int b, int a)
|
||||
{
|
||||
FillRGBA( 62.5f + x, 62.5 + y - size, size, 2*size, r, g, b, a);
|
||||
FillRGBA( 62.5f + x - size, 62.5 + y + size, 3*size, size, r, g, b, a);
|
||||
if( bUseRenderAPI )
|
||||
{
|
||||
gRenderAPI.GL_Bind( 0, hFlippedT );
|
||||
gEngfuncs.pTriAPI->Color4ub( r, g, b, a );
|
||||
DrawUtils::Draw2DQuad( 62.5f + x - size*2, 62.5f + y - size*2,
|
||||
62.5f + x + size*2, 62.5f + y + size*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRGBA( 62.5f + x, 62.5 + y - size, size, 2*size, r, g, b, a);
|
||||
FillRGBA( 62.5f + x - size, 62.5 + y + size, 3*size, size, r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
Vector CHudRadar::WorldToRadar(const Vector vPlayerOrigin, const Vector vObjectOrigin, const Vector vAngles )
|
||||
|
@ -100,7 +100,7 @@ void VoiceIconCallback(struct tempent_s *ent, float frametime, float currenttime
|
||||
|
||||
int CHudRadio::MsgFunc_BotVoice( const char *pszName, int iSize, void *buf )
|
||||
{
|
||||
BufferReader reader( buf, iSize );
|
||||
BufferReader reader( pszName, buf, iSize );
|
||||
|
||||
int enable = reader.ReadByte();
|
||||
int entIndex = reader.ReadByte();
|
||||
|
@ -81,7 +81,6 @@ int CHudSayText :: VidInit( void )
|
||||
|
||||
int ScrollTextUp( void )
|
||||
{
|
||||
ConsolePrint( g_szLineBuffer[0] ); // move the first line into the console buffer
|
||||
g_szLineBuffer[MAX_LINES][0] = 0;
|
||||
memmove( g_szLineBuffer[0], g_szLineBuffer[1], sizeof(g_szLineBuffer) - sizeof(g_szLineBuffer[0]) ); // overwrite the first line
|
||||
memmove( &g_pflNameColors[0], &g_pflNameColors[1], sizeof(g_pflNameColors) - sizeof(g_pflNameColors[0]) );
|
||||
|
@ -101,3 +101,9 @@ int CHudSniperScope::Draw(float flTime)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CHudSniperScope::Shutdown()
|
||||
{
|
||||
for( int i = 0; i < 4; i++ )
|
||||
gRenderAPI.GL_FreeTexture( m_iScopeArc[i] );
|
||||
}
|
||||
|
@ -123,6 +123,11 @@ int CHudSpectatorGui::VidInit()
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CHudSpectatorGui::Shutdown()
|
||||
{
|
||||
gRenderAPI.GL_FreeTexture( m_hTimerTexture );
|
||||
}
|
||||
|
||||
inline void DrawButtonWithText( int x1, int y1, int wide, int tall, const char *sz, int r, int g, int b )
|
||||
{
|
||||
DrawUtils::DrawRectangle(x1, y1, wide, tall);
|
||||
@ -327,7 +332,7 @@ void CHudSpectatorGui::Reset()
|
||||
|
||||
int CHudSpectatorGui::MsgFunc_SpecHealth(const char *pszName, int iSize, void *buf)
|
||||
{
|
||||
BufferReader reader( buf, iSize );
|
||||
BufferReader reader( pszName, buf, iSize );
|
||||
|
||||
int health = reader.ReadByte();
|
||||
|
||||
@ -339,7 +344,7 @@ int CHudSpectatorGui::MsgFunc_SpecHealth(const char *pszName, int iSize, void *b
|
||||
|
||||
int CHudSpectatorGui::MsgFunc_SpecHealth2(const char *pszName, int iSize, void *buf)
|
||||
{
|
||||
BufferReader reader( buf, iSize );
|
||||
BufferReader reader( pszName, buf, iSize );
|
||||
|
||||
int health = reader.ReadByte();
|
||||
int client = reader.ReadByte();
|
||||
|
@ -203,7 +203,7 @@ int CHudProgressBar::MsgFunc_BarTime2(const char *pszName, int iSize, void *pbuf
|
||||
BufferReader reader( pszName, pbuf, iSize );
|
||||
|
||||
m_iDuration = reader.ReadShort();
|
||||
m_fPercent = (float)reader.ReadShort() / 100.0f;
|
||||
m_fPercent = m_iDuration * (float)reader.ReadShort() / 100.0f;
|
||||
|
||||
m_fStartTime = gHUD.m_flTime;
|
||||
|
||||
|
@ -99,6 +99,7 @@ public:
|
||||
virtual void Think(void) {return;}
|
||||
virtual void Reset(void) {return;}
|
||||
virtual void InitHUDData( void ) {} // called every time a server is connected to
|
||||
virtual void Shutdown( void ) {}
|
||||
|
||||
};
|
||||
|
||||
@ -758,6 +759,7 @@ public:
|
||||
int Init( void );
|
||||
int VidInit( void );
|
||||
int Draw( float flTime );
|
||||
void Shutdown( void );
|
||||
|
||||
private:
|
||||
float left, right, centerx, centery;
|
||||
@ -796,6 +798,8 @@ public:
|
||||
int Draw( float flTime );
|
||||
void InitHUDData();
|
||||
void Reset();
|
||||
void Shutdown();
|
||||
|
||||
CHudMsgFunc( SpecHealth );
|
||||
CHudMsgFunc( SpecHealth2 );
|
||||
|
||||
@ -846,7 +850,8 @@ public:
|
||||
|
||||
void Init( void );
|
||||
void VidInit( void );
|
||||
void Think(void);
|
||||
void Think( void );
|
||||
void Shutdown( void );
|
||||
int Redraw( float flTime, int intermission );
|
||||
int UpdateClientData( client_data_t *cdata, float time );
|
||||
void AddHudElem(CHudBase *p);
|
||||
@ -891,6 +896,11 @@ public:
|
||||
return m_scrinfo.iCharHeight;
|
||||
}
|
||||
|
||||
inline bool IsCZero( )
|
||||
{
|
||||
return m_bIsCZero;
|
||||
}
|
||||
|
||||
|
||||
float m_flTime; // the current client time
|
||||
float m_fOldTime; // the time at which the HUD was last redrawn
|
||||
@ -992,6 +1002,7 @@ private:
|
||||
int m_iForceCamera;
|
||||
int m_iForceChaseCam;
|
||||
int m_iFadeToBlack;
|
||||
bool m_bIsCZero;
|
||||
|
||||
// the memory for these arrays are allocated in the first call to CHud::VidInit(), when the hud.txt and associated sprites are loaded.
|
||||
// freed in ~CHud()
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
virtual int VidInit();
|
||||
virtual int Draw( float flTime );
|
||||
virtual void Reset();
|
||||
virtual void Shutdown();
|
||||
|
||||
int MsgFunc_Radar(const char *pszName, int iSize, void *pbuf);
|
||||
|
||||
@ -27,6 +28,7 @@ private:
|
||||
|
||||
cvar_t *cl_radartype;
|
||||
|
||||
int InitBuiltinTextures();
|
||||
void DrawPlayerLocation();
|
||||
void DrawRadarDot(int x, int y, int size, int r, int g, int b, int a);
|
||||
void DrawCross(int x, int y, int size, int r, int g, int b, int a );
|
||||
@ -34,6 +36,8 @@ private:
|
||||
void DrawFlippedT( int x, int y, int size, int r, int g, int b, int a );
|
||||
Vector WorldToRadar(const Vector vPlayerOrigin, const Vector vObjectOrigin, const Vector vAngles );
|
||||
|
||||
bool bUseRenderAPI, bTexturesInitialized;
|
||||
int hDot, hCross, hT, hFlippedT;
|
||||
};
|
||||
|
||||
#endif // RADAR_H
|
||||
|
@ -984,17 +984,11 @@ void InitInput (void)
|
||||
|
||||
/*
|
||||
============
|
||||
ShutdownInput
|
||||
Input_Shutdown
|
||||
============
|
||||
*/
|
||||
void ShutdownInput (void)
|
||||
void Input_Shutdown (void)
|
||||
{
|
||||
IN_Shutdown();
|
||||
KB_Shutdown();
|
||||
}
|
||||
|
||||
void DLLEXPORT HUD_Shutdown( void )
|
||||
{
|
||||
ShutdownInput();
|
||||
Localize_Free();
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ void SetPoint( float x, float y, float z, float (*matrix)[4])
|
||||
|
||||
int CHud::MsgFunc_ReceiveW(const char *pszName, int iSize, void *pbuf)
|
||||
{
|
||||
BufferReader reader(pbuf, iSize);
|
||||
BufferReader reader( pszName, pbuf, iSize);
|
||||
|
||||
int iWeatherType = reader.ReadByte();
|
||||
|
||||
|
@ -148,30 +148,18 @@ ConcatTransforms
|
||||
*/
|
||||
void ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4])
|
||||
{
|
||||
out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
|
||||
in1[0][2] * in2[2][0];
|
||||
out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
|
||||
in1[0][2] * in2[2][1];
|
||||
out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
|
||||
in1[0][2] * in2[2][2];
|
||||
out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] +
|
||||
in1[0][2] * in2[2][3] + in1[0][3];
|
||||
out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
|
||||
in1[1][2] * in2[2][0];
|
||||
out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
|
||||
in1[1][2] * in2[2][1];
|
||||
out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
|
||||
in1[1][2] * in2[2][2];
|
||||
out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] +
|
||||
in1[1][2] * in2[2][3] + in1[1][3];
|
||||
out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
|
||||
in1[2][2] * in2[2][0];
|
||||
out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
|
||||
in1[2][2] * in2[2][1];
|
||||
out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
|
||||
in1[2][2] * in2[2][2];
|
||||
out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] +
|
||||
in1[2][2] * in2[2][3] + in1[2][3];
|
||||
out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];
|
||||
out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];
|
||||
out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];
|
||||
out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] + in1[0][2] * in2[2][3] + in1[0][3];
|
||||
out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];
|
||||
out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];
|
||||
out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];
|
||||
out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] + in1[1][2] * in2[2][3] + in1[1][3];
|
||||
out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];
|
||||
out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];
|
||||
out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];
|
||||
out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] + in1[2][2] * in2[2][3] + in1[2][3];
|
||||
}
|
||||
|
||||
// angles index are not the same as ROLL, PITCH, YAW
|
||||
@ -207,10 +195,10 @@ void AngleQuaternion( float *angles, vec4_t quaternion )
|
||||
cr = cos(angle);
|
||||
#endif
|
||||
|
||||
quaternion[0] = sr*cp*cy-cr*sp*sy; // X
|
||||
quaternion[1] = cr*sp*cy+sr*cp*sy; // Y
|
||||
quaternion[2] = cr*cp*sy-sr*sp*cy; // Z
|
||||
quaternion[3] = cr*cp*cy+sr*sp*sy; // W
|
||||
quaternion[0] = sr * cp * cy - cr * sp * sy; // X
|
||||
quaternion[1] = cr * sp * cy + sr * cp * sy; // Y
|
||||
quaternion[2] = cr * cp * sy - sr * sp * cy; // Z
|
||||
quaternion[3] = cr * cp * cy + sr * sp * sy; // W
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user