-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
//++ BulliT | ||
|
||
#include "hud.h" | ||
#include "cl_util.h" | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <time.h> | ||
#include "parsemsg.h" | ||
|
||
DECLARE_MESSAGE(m_Longjump, Longjump ) | ||
|
||
int CHudLongjump::Init(void) | ||
{ | ||
HOOK_MESSAGE( Longjump ); | ||
|
||
m_flTurnoff = 0; | ||
m_iFlags = 0; | ||
|
||
gHUD.AddHudElem(this); | ||
|
||
return 1; | ||
} | ||
|
||
int CHudLongjump::VidInit(void) | ||
{ | ||
return 1; | ||
} | ||
|
||
void CHudLongjump::Reset(void) | ||
{ | ||
m_iFlags &= ~HUD_ACTIVE; | ||
} | ||
|
||
int CHudLongjump::Draw(float fTime) | ||
{ | ||
if ( m_flTurnoff < gHUD.m_flTime || gHUD.m_iIntermission ) | ||
{ | ||
Reset(); | ||
return 1; | ||
} | ||
|
||
char szText[32]; | ||
int r, g, b; | ||
UnpackRGB(r, g, b, gHUD.m_iDefaultHUDColor); | ||
sprintf(szText,"Longjump %d",(int)(m_flTurnoff - gHUD.m_flTime)); | ||
gHUD.DrawHudStringCentered(ScreenWidth / 2, gHUD.m_scrinfo.iCharHeight * 2, szText, r, g, b ); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
int CHudLongjump::MsgFunc_Longjump(const char *pszName, int iSize, void *pbuf) | ||
{ | ||
BEGIN_READ( pbuf, iSize ); | ||
int iTime = READ_BYTE(); | ||
|
||
m_flTurnoff = gHUD.m_flTime + iTime; | ||
m_iFlags |= HUD_ACTIVE; | ||
|
||
return 1; | ||
} | ||
|
||
//-- Martin Webrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//++ BulliT | ||
#pragma once | ||
|
||
class CHudLongjump: public CHudBase | ||
{ | ||
public: | ||
int Init( void ); | ||
int VidInit( void ); | ||
int Draw(float flTime); | ||
void Reset(void); | ||
int MsgFunc_Longjump(const char *pszName, int iSize, void *pbuf); | ||
|
||
private: | ||
float m_flTurnoff; | ||
}; | ||
|
||
//-- Martin Webrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
//++ BulliT | ||
|
||
#include "hud.h" | ||
#include "cl_util.h" | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <demo_api.h> | ||
#include "parsemsg.h" | ||
|
||
DECLARE_MESSAGE(m_Splash, Splash ) | ||
|
||
int CHudSplash::Init(void) | ||
{ | ||
HOOK_MESSAGE( Splash ); | ||
|
||
m_flTurnoff = 0.0; | ||
m_iFlags = 0; | ||
gHUD.AddHudElem(this); | ||
|
||
return 1; | ||
} | ||
|
||
int CHudSplash::VidInit(void) | ||
{ | ||
m_hSprite = SPR_Load("sprites/ag_splash.spr"); | ||
return 1; | ||
} | ||
|
||
void CHudSplash::Reset(void) | ||
{ | ||
m_iFlags &= ~HUD_ACTIVE; | ||
} | ||
|
||
#define RGB_WHITEISH 0x00FFFFFF //255,255,255 | ||
|
||
int CHudSplash::Draw(float fTime) | ||
{ | ||
if (m_flTurnoff < gHUD.m_flTime || 0 == m_hSprite) | ||
{ | ||
Reset(); | ||
return 1; | ||
} | ||
|
||
int r, g, b, x, y; | ||
|
||
UnpackRGB(r,g,b, RGB_WHITEISH); | ||
ScaleColors(r, g, b, 255); | ||
SPR_Set(m_hSprite, r, g, b ); | ||
|
||
// This should show up to the top right corner | ||
y = SPR_Height(m_hSprite,0); | ||
x = ScreenWidth - SPR_Width(m_hSprite,0); | ||
SPR_DrawHoles( 0, x, y, NULL); | ||
|
||
return 0; | ||
} | ||
|
||
int CHudSplash::MsgFunc_Splash(const char *pszName, int iSize, void *pbuf) | ||
{ | ||
BEGIN_READ( pbuf, iSize ); | ||
|
||
// update data | ||
int iTime = READ_BYTE(); | ||
m_flTurnoff = gHUD.m_flTime + iTime; | ||
m_iFlags |= HUD_ACTIVE; | ||
|
||
if (iTime > 0) | ||
m_iFlags |= HUD_ACTIVE; | ||
else | ||
m_iFlags &= ~HUD_ACTIVE; | ||
return 1; | ||
} | ||
|
||
//-- Martin Webrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//++ BulliT | ||
#pragma once | ||
|
||
class CHudSplash: public CHudBase | ||
{ | ||
public: | ||
int Init( void ); | ||
int VidInit( void ); | ||
int Draw(float flTime); | ||
void Reset(void); | ||
int MsgFunc_Splash(const char *pszName, int iSize, void *pbuf); | ||
|
||
private: | ||
float m_flTurnoff; | ||
HSPRITE m_hSprite; | ||
}; | ||
|
||
//-- Martin Webrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters