Browse Source

Rework pain and death vision drawing code.

noffice
Andrey Akhmichin 5 years ago
parent
commit
a3209dc8e6
  1. 48
      cl_dll/health.cpp
  2. 15
      cl_dll/health.h
  3. 2
      cl_dll/hud.cpp
  4. 22
      cl_dll/hud.h
  5. 5
      cl_dll/hud_redraw.cpp
  6. 27
      cl_dll/noffice/cinematic.cpp
  7. 83
      cl_dll/noffice/deathvision.cpp
  8. 172
      cl_dll/noffice/pain.cpp
  9. 36
      cl_dll/tri.cpp
  10. 9
      dlls/player.cpp

48
cl_dll/health.cpp

@ -104,11 +104,6 @@ int CHudHealth::VidInit( void )
m_iHeight = m_prc2->bottom - m_prc1->top; m_iHeight = m_prc2->bottom - m_prc1->top;
m_hPainFront = LoadSprite( "sprites/pain_front.spr" );
m_hPainLeft = LoadSprite( "sprites/pain_left.spr" );
m_hPainRight = LoadSprite( "sprites/pain_right.spr" );
m_hPainRear = LoadSprite( "sprites/pain_rear.spr" );
return 1; return 1;
} }
@ -179,6 +174,9 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b )
r = 255 - g; r = 255 - g;
b = 0; b = 0;
#else #else
if( m_iHealth <= 0 )
DrawDeathVision();
if( m_iHealth > 25 ) if( m_iHealth > 25 )
{ {
UnpackRGB( r, g, b, RGB_WHITEISH ); UnpackRGB( r, g, b, RGB_WHITEISH );
@ -301,7 +299,8 @@ int CHudHealth::Draw( float flTime )
} }
DrawDamage( flTime ); DrawDamage( flTime );
return 1;
return DrawPain( flTime );
} }
void CHudHealth::CalcDamageDirection( vec3_t vecFrom ) void CHudHealth::CalcDamageDirection( vec3_t vecFrom )
@ -377,28 +376,14 @@ int CHudHealth::DrawPain( float flTime )
// SPR_Draw top // SPR_Draw top
if( m_fAttackFront > 0.4f ) if( m_fAttackFront > 0.4f )
{ {
GetPainColor( r, g, b ); DrawPainFront();
shade = a * Q_max( m_fAttackFront, 0.5f );
ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 0 ) / 2;
y = ScreenHeight / 2 - SPR_Height( m_hSprite, 0 ) * 3;
SPR_DrawAdditive( 0, x, y, NULL );
m_fAttackFront = Q_max( 0, m_fAttackFront - fFade ); m_fAttackFront = Q_max( 0, m_fAttackFront - fFade );
} else } else
m_fAttackFront = 0; m_fAttackFront = 0;
if( m_fAttackRight > 0.4f ) if( m_fAttackRight > 0.4f )
{ {
GetPainColor( r, g, b ); DrawPainRight();
shade = a * Q_max( m_fAttackRight, 0.5f );
ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 + SPR_Width( m_hSprite, 1 ) * 2;
y = ScreenHeight / 2 - SPR_Height( m_hSprite,1 ) / 2;
SPR_DrawAdditive( 1, x, y, NULL );
m_fAttackRight = Q_max( 0, m_fAttackRight - fFade ); m_fAttackRight = Q_max( 0, m_fAttackRight - fFade );
} }
else else
@ -406,14 +391,7 @@ int CHudHealth::DrawPain( float flTime )
if( m_fAttackRear > 0.4f ) if( m_fAttackRear > 0.4f )
{ {
GetPainColor( r, g, b ); DrawPainRear();
shade = a * Q_max( m_fAttackRear, 0.5f );
ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 2 ) / 2;
y = ScreenHeight / 2 + SPR_Height( m_hSprite, 2 ) * 2;
SPR_DrawAdditive( 2, x, y, NULL );
m_fAttackRear = Q_max( 0, m_fAttackRear - fFade ); m_fAttackRear = Q_max( 0, m_fAttackRear - fFade );
} }
else else
@ -421,15 +399,7 @@ int CHudHealth::DrawPain( float flTime )
if( m_fAttackLeft > 0.4f ) if( m_fAttackLeft > 0.4f )
{ {
GetPainColor( r, g, b ); DrawPainLeft();
shade = a * Q_max( m_fAttackLeft, 0.5f );
ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 3 ) * 3;
y = ScreenHeight / 2 - SPR_Height( m_hSprite,3 ) / 2;
SPR_DrawAdditive( 3, x, y, NULL );
m_fAttackLeft = Q_max( 0, m_fAttackLeft - fFade ); m_fAttackLeft = Q_max( 0, m_fAttackLeft - fFade );
} else } else
m_fAttackLeft = 0; m_fAttackLeft = 0;

15
cl_dll/health.h

@ -113,18 +113,22 @@ public:
float m_fAttackFront, m_fAttackRear, m_fAttackLeft, m_fAttackRight; float m_fAttackFront, m_fAttackRear, m_fAttackLeft, m_fAttackRight;
void GetPainColor( int &r, int &g, int &b ); void GetPainColor( int &r, int &g, int &b );
float m_fFade; float m_fFade;
void DrawPain2( void );
private: private:
HSPRITE m_hSprite; HSPRITE m_hSprite;
HSPRITE m_hDamage; HSPRITE m_hDamage;
DAMAGE_IMAGE m_dmg[NUM_DMG_TYPES]; DAMAGE_IMAGE m_dmg[NUM_DMG_TYPES];
int m_bitsDamage; int m_bitsDamage;
int DrawPain( float fTime ); int DrawPain( float fTime );
int DrawDamage( float fTime ); int DrawDamage( float fTime );
void CalcDamageDirection( vec3_t vecFrom ); void CalcDamageDirection( vec3_t vecFrom );
void UpdateTiles( float fTime, long bits ); void UpdateTiles( float fTime, long bits );
void DrawPainFront();
void DrawPainRear();
void DrawPainLeft();
void DrawPainRight();
void DrawDeathVision();
HSPRITE m_hSprite1; HSPRITE m_hSprite1;
HSPRITE m_hSprite2; HSPRITE m_hSprite2;
@ -136,5 +140,12 @@ private:
HSPRITE m_hPainLeft; HSPRITE m_hPainLeft;
HSPRITE m_hPainRight; HSPRITE m_hPainRight;
HSPRITE m_hPainRear; HSPRITE m_hPainRear;
HSPRITE m_hDeathVision;
struct model_s *m_hPainFrontModel;
struct model_s *m_hPainRearModel;
struct model_s *m_hPainLeftModel;
struct model_s *m_hPainRightModel;
struct model_s *m_hDeathVisionModel;
}; };
#endif // HEALTH_H #endif // HEALTH_H

2
cl_dll/hud.cpp

@ -232,7 +232,6 @@ void CHud::Init( void )
m_AmmoSecondary.Init(); m_AmmoSecondary.Init();
m_TextMessage.Init(); m_TextMessage.Init();
m_StatusIcons.Init(); m_StatusIcons.Init();
m_DeathVision.Init();
m_MOTD.Init(); m_MOTD.Init();
m_Scoreboard.Init(); m_Scoreboard.Init();
@ -414,7 +413,6 @@ void CHud::VidInit( void )
m_AmmoSecondary.VidInit(); m_AmmoSecondary.VidInit();
m_TextMessage.VidInit(); m_TextMessage.VidInit();
m_StatusIcons.VidInit(); m_StatusIcons.VidInit();
m_DeathVision.VidInit();
m_Scoreboard.VidInit(); m_Scoreboard.VidInit();
m_MOTD.VidInit(); m_MOTD.VidInit();
} }

22
cl_dll/hud.h

@ -562,23 +562,6 @@ private:
icon_sprite_t m_IconList[MAX_ICONSPRITES]; icon_sprite_t m_IconList[MAX_ICONSPRITES];
}; };
//
//-----------------------------------------------------
//
class CHudDeathVision : public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw( float flTime );
int MsgFunc_DeathVision( const char *pszName, int iSize, void *pbuf );
void DrawDeathVision( void );
private:
HSPRITE m_hSprite;
};
// //
//----------------------------------------------------- //-----------------------------------------------------
// //
@ -656,7 +639,6 @@ public:
CHudAmmoSecondary m_AmmoSecondary; CHudAmmoSecondary m_AmmoSecondary;
CHudTextMessage m_TextMessage; CHudTextMessage m_TextMessage;
CHudStatusIcons m_StatusIcons; CHudStatusIcons m_StatusIcons;
CHudDeathVision m_DeathVision;
CHudScoreboard m_Scoreboard; CHudScoreboard m_Scoreboard;
CHudMOTD m_MOTD; CHudMOTD m_MOTD;
@ -703,4 +685,8 @@ extern int g_iTeamNumber;
extern int g_iUser1; extern int g_iUser1;
extern int g_iUser2; extern int g_iUser2;
extern int g_iUser3; extern int g_iUser3;
void HUD_DrawRectangle( struct model_s *hSpriteModel, int mode );
#endif #endif

5
cl_dll/hud_redraw.cpp

@ -80,8 +80,6 @@ void CHud::Think( void )
} }
} }
void HUD_DrawOrthoTriangles( void );
// Redraw // Redraw
// step through the local data, placing the appropriate graphics & text as appropriate // step through the local data, placing the appropriate graphics & text as appropriate
// returns 1 if they've changed, 0 otherwise // returns 1 if they've changed, 0 otherwise
@ -136,9 +134,6 @@ int CHud::Redraw( float flTime, int intermission )
} }
} }
//omega;draw orthogonal triangles
HUD_DrawOrthoTriangles();
// are we in demo mode? do we need to draw the logo in the top corner? // are we in demo mode? do we need to draw the logo in the top corner?
if( m_iLogo ) if( m_iLogo )
{ {

27
cl_dll/noffice/cinematic.cpp

@ -28,8 +28,6 @@
#include "event_args.h" #include "event_args.h"
#include "triangleapi.h" #include "triangleapi.h"
#include "parsemsg.h"
void CHudMessage::DrawCinematic() void CHudMessage::DrawCinematic()
{ {
if( !m_hSprite ) if( !m_hSprite )
@ -38,29 +36,6 @@ void CHudMessage::DrawCinematic()
m_hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hSprite ); m_hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hSprite );
} }
gEngfuncs.pTriAPI->RenderMode( kRenderTransAlpha ); HUD_DrawRectangle( m_hSpriteModel, kRenderTransAlpha );
gEngfuncs.pTriAPI->SpriteTexture( m_hSpriteModel, 0 );
gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f );
gEngfuncs.pTriAPI->CullFace( TRI_NONE );
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
// top right
gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f );
gEngfuncs.pTriAPI->Vertex3f( 0, 0, 0 );
// top left
gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f );
gEngfuncs.pTriAPI->Vertex3f( 0, ScreenHeight, 0 );
// bottom left
gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f );
gEngfuncs.pTriAPI->Vertex3f( ScreenWidth, ScreenHeight, 0 );
// bottom right
gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f );
gEngfuncs.pTriAPI->Vertex3f( ScreenWidth, 0, 0 );
gEngfuncs.pTriAPI->End(); //end our list of vertexes
gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); //return to normal
} }

83
cl_dll/noffice/deathvision.cpp

@ -23,82 +23,13 @@
#include "event_args.h" #include "event_args.h"
#include "triangleapi.h" #include "triangleapi.h"
#include "parsemsg.h" void CHudHealth::DrawDeathVision()
DECLARE_MESSAGE(m_DeathVision, DeathVision)
int CHudDeathVision::Init(void)
{
HOOK_MESSAGE(DeathVision);
m_iFlags = 0;
m_hSprite = 0;
gHUD.AddHudElem(this);
return 1;
};
int CHudDeathVision::VidInit(void)
{
m_iFlags = 0;
m_hSprite = SPR_Load("sprites/death_vision.spr");
return 1;
};
int CHudDeathVision::MsgFunc_DeathVision(const char *pszName, int iSize, void *pbuf)
{
m_iFlags |= HUD_ACTIVE;
BEGIN_READ(pbuf, iSize);
READ_BYTE();
return 1;
}
int CHudDeathVision::Draw(float flTime)
{ {
return 1; if( !m_hDeathVision )
} {
m_hDeathVision = SPR_Load( "sprites/death_vision.spr" );
void CHudDeathVision::DrawDeathVision(void) m_hDeathVisionModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hDeathVision );
{ }
if (gHUD.m_iHideHUDDisplay & HIDEHUD_ALL)
return;
if (!(m_iFlags & HUD_ACTIVE))
return;
if (!m_hSprite)
m_hSprite = SPR_Load("sprites/death_vision.spr");
struct model_s * hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer(m_hSprite);
gEngfuncs.pTriAPI->RenderMode(kRenderTransAdd);
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->SpriteTexture(hSpriteModel, 0);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(0, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(0, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, ScreenHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, 0, 0);
gEngfuncs.pTriAPI->End(); //end our list of vertexes
gEngfuncs.pTriAPI->RenderMode(kRenderNormal); //return to normal
return; HUD_DrawRectangle( m_hDeathVisionModel, kRenderTransAdd );
} }

172
cl_dll/noffice/pain.cpp

@ -30,8 +30,6 @@
#include "com_model.h" #include "com_model.h"
#include "studio_util.h" #include "studio_util.h"
#include "parsemsg.h"
// ========================================== // ==========================================
// Code changes for- Night at the Office: // Code changes for- Night at the Office:
// ========================================== // ==========================================
@ -40,157 +38,47 @@
// the side of the screen will be white. If shot from the right, // the side of the screen will be white. If shot from the right,
// the right side of the screen will flash white. etc. // the right side of the screen will flash white. etc.
void CHudHealth::DrawPain2(void) void CHudHealth::DrawPainFront()
{ {
if (!(m_fAttackFront || m_fAttackRear || m_fAttackLeft || m_fAttackRight)) if( !m_hPainFront )
return;
int a, shade;
// TODO: get the shift value of the health
a = 255; // max brightness until then
float fFade = gHUD.m_flTimeDelta * 2;
gEngfuncs.pTriAPI->RenderMode(kRenderTransAdd); //additive
gEngfuncs.pTriAPI->CullFace(TRI_NONE); //no culling
// SPR_Draw top
if (m_fAttackFront > 0.4)
{ {
if (!m_hPainFront) m_hPainFront = SPR_Load( "sprites/pain_front.spr" );
m_hPainFront = SPR_Load("sprites/pain_front.spr"); m_hPainFrontModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hPainFront );
shade = a * Q_max(m_fAttackFront, 0.5);
gEngfuncs.pTriAPI->SpriteTexture((struct model_s *) gEngfuncs.GetSpritePointer(m_hPainFront), 0);
gEngfuncs.pTriAPI->Color4f(1, 1, 1, shade);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(0, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(0, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, ScreenHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, 0, 0);
gEngfuncs.pTriAPI->End();
m_fAttackFront = Q_max(0, m_fAttackFront - fFade);
} }
else
m_fAttackFront = 0;
if (m_fAttackRight > 0.4)
{
if (!m_hPainRight)
m_hPainRight = SPR_Load("sprites/pain_right.spr");
shade = a * Q_max(m_fAttackRight, 0.5);
gEngfuncs.pTriAPI->SpriteTexture((struct model_s *) gEngfuncs.GetSpritePointer(m_hPainRight), 0);
gEngfuncs.pTriAPI->Color4f(1, 1, 1, shade);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left HUD_DrawRectangle( m_hPainFrontModel, kRenderTransAdd );
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f); }
gEngfuncs.pTriAPI->Vertex3f(0, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(0, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, ScreenHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, 0, 0);
gEngfuncs.pTriAPI->End();
m_fAttackRight = Q_max(0, m_fAttackRight - fFade);
}
else
m_fAttackRight = 0;
if (m_fAttackRear > 0.4) void CHudHealth::DrawPainRight()
{
if( !m_hPainRight )
{ {
if (!m_hPainRear) m_hPainRight = SPR_Load( "sprites/pain_right.spr" );
m_hPainRear = SPR_Load("sprites/pain_rear.spr"); m_hPainRightModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hPainRight );
shade = a * Q_max(m_fAttackRear, 0.5);
gEngfuncs.pTriAPI->SpriteTexture((struct model_s *) gEngfuncs.GetSpritePointer(m_hPainRear), 0);
gEngfuncs.pTriAPI->Color4f(1, 1, 1, shade);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(0, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(0, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, ScreenHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, 0, 0);
gEngfuncs.pTriAPI->End();
m_fAttackRear = Q_max(0, m_fAttackRear - fFade);
} }
else
m_fAttackRear = 0;
if (m_fAttackLeft > 0.4)
{
if (!m_hPainLeft)
m_hPainLeft = SPR_Load("sprites/pain_left.spr");
shade = a * Q_max(m_fAttackLeft, 0.5); HUD_DrawRectangle( m_hPainRightModel, kRenderTransAdd );
}
gEngfuncs.pTriAPI->SpriteTexture((struct model_s *) gEngfuncs.GetSpritePointer(m_hPainLeft), 0);
gEngfuncs.pTriAPI->Color4f(1, 1, 1, shade);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(0, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(0, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, ScreenHeight, 0);
//top right void CHudHealth::DrawPainLeft()
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f); {
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, 0, 0); if( !m_hPainLeft )
{
m_hPainLeft = SPR_Load( "sprites/pain_front.spr" );
m_hPainLeftModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hPainLeft );
}
gEngfuncs.pTriAPI->End(); HUD_DrawRectangle( m_hPainLeftModel, kRenderTransAdd );
}
m_fAttackLeft = Q_max(0, m_fAttackLeft - fFade); void CHudHealth::DrawPainRear()
{
if( !m_hPainRear )
{
m_hPainRear = SPR_Load( "sprites/pain_rear.spr" );
m_hPainRearModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hPainRear );
} }
else
m_fAttackLeft = 0;
gEngfuncs.pTriAPI->RenderMode(kRenderNormal); //return to normal HUD_DrawRectangle( m_hPainRearModel, kRenderTransAdd );
} }

36
cl_dll/tri.cpp

@ -123,15 +123,31 @@ void DLLEXPORT HUD_DrawTransparentTriangles( void )
// http://twhl.info/articulator.php?art=114 // http://twhl.info/articulator.php?art=114
// //
/* void HUD_DrawRectangle( struct model_s *hSpriteModel, int mode )
=================
HUD_DrawOrthoTriangles
Orthogonal Triangles -- (relative to resolution,
smackdab on the screen) add them here
=================
*/
void HUD_DrawOrthoTriangles( void )
{ {
gHUD.m_Health.DrawPain2(); gEngfuncs.pTriAPI->RenderMode( mode );
gHUD.m_DeathVision.DrawDeathVision(); gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 );
gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f );
gEngfuncs.pTriAPI->CullFace( TRI_NONE );
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
// top right
gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f );
gEngfuncs.pTriAPI->Vertex3f( 0, 0, 0 );
// top left
gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f );
gEngfuncs.pTriAPI->Vertex3f( 0, ScreenHeight, 0 );
// bottom left
gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f );
gEngfuncs.pTriAPI->Vertex3f( ScreenWidth, ScreenHeight, 0 );
// bottom right
gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f );
gEngfuncs.pTriAPI->Vertex3f( ScreenWidth, 0, 0 );
gEngfuncs.pTriAPI->End(); //end our list of vertexes
gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); //return to normal
} }

9
dlls/player.cpp

@ -191,8 +191,6 @@ int gmsgBhopcap = 0;
int gmsgStatusText = 0; int gmsgStatusText = 0;
int gmsgStatusValue = 0; int gmsgStatusValue = 0;
int gmsgDeathVision = 0;
void LinkUserMessages( void ) void LinkUserMessages( void )
{ {
// Already taken care of? // Already taken care of?
@ -239,8 +237,6 @@ void LinkUserMessages( void )
gmsgStatusText = REG_USER_MSG( "StatusText", -1 ); gmsgStatusText = REG_USER_MSG( "StatusText", -1 );
gmsgStatusValue = REG_USER_MSG( "StatusValue", 3 ); gmsgStatusValue = REG_USER_MSG( "StatusValue", 3 );
gmsgDeathVision = REG_USER_MSG( "DeathVision", 1 );
} }
LINK_ENTITY_TO_CLASS( player, CBasePlayer ) LINK_ENTITY_TO_CLASS( player, CBasePlayer )
@ -923,11 +919,6 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
// Fade screen to white. // Fade screen to white.
UTIL_ScreenFade( this, Vector( 255, 255, 255 ), 6, 15, 255, FFADE_OUT ); UTIL_ScreenFade( this, Vector( 255, 255, 255 ), 6, 15, 255, FFADE_OUT );
// Tell client to draw death vision.
MESSAGE_BEGIN( MSG_ONE, gmsgDeathVision, NULL, pev );
WRITE_BYTE( 0 );
MESSAGE_END();
if( ( pev->health < -40 && iGib != GIB_NEVER ) || iGib == GIB_ALWAYS ) if( ( pev->health < -40 && iGib != GIB_NEVER ) || iGib == GIB_ALWAYS )
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;

Loading…
Cancel
Save