Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from phoenixprojectsoftware/master
Browse files Browse the repository at this point in the history
Update demo
  • Loading branch information
sabianroberts authored Apr 28, 2020
2 parents f05481c + 7f5b915 commit 95f116f
Show file tree
Hide file tree
Showing 35 changed files with 3,275 additions and 1,387 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
!lib/public/SDL2.lib
!utils/procinfo/lib/win32_vc6/procinfo.lib
!utils/vgui/lib/win32_vc6/vgui.lib
.vs/
3 changes: 0 additions & 3 deletions .vs/ProjectSettings.json

This file was deleted.

9 changes: 0 additions & 9 deletions .vs/VSWorkspaceState.json

This file was deleted.

Binary file removed .vs/halflife-won/v16/.suo
Binary file not shown.
Binary file removed .vs/halflife-won/v16/Browse.VC.db
Binary file not shown.
Binary file removed .vs/slnx.sqlite
Binary file not shown.
18 changes: 9 additions & 9 deletions cl_dll/ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ int CHudAmmo::Draw(float flTime)
if (m_fFade > 0)
m_fFade -= (gHUD.m_flTimeDelta * 20);

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

ScaleColors(r, g, b, a );

Expand Down Expand Up @@ -896,7 +896,7 @@ int CHudAmmo::Draw(float flTime)

x += AmmoWidth/2;

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

// draw the | bar
FillRGBA(x, y, iBarWidth, gHUD.m_iFontHeight, r, g, b, a);
Expand Down Expand Up @@ -969,7 +969,7 @@ int DrawBar(int x, int y, int width, int height, float f)
width -= w;
}

UnpackRGB(r, g, b, RGB_YELLOWISH);
UnpackRGB(r, g, b, RGB_DEFAULT);

FillRGBA(x, y, width, height, r, g, b, 128);

Expand Down Expand Up @@ -1045,7 +1045,7 @@ int CHudAmmo::DrawWList(float flTime)
{
int iWidth;

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

if ( iActiveSlot == i )
a = 255;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ int CHudAmmo::DrawWList(float flTime)
if ( !p || !p->iId )
continue;

UnpackRGB( r,g,b, RGB_YELLOWISH );
UnpackRGB( r,g,b, RGB_DEFAULT );

// if active, then we must have ammo.

Expand All @@ -1117,7 +1117,7 @@ int CHudAmmo::DrawWList(float flTime)
ScaleColors(r, g, b, 192);
else
{
UnpackRGB(r,g,b, RGB_REDISH);
UnpackRGB(r,g,b, RGB_GREY);
ScaleColors(r, g, b, 128);
}

Expand All @@ -1139,7 +1139,7 @@ int CHudAmmo::DrawWList(float flTime)
{
// Draw Row of weapons.

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

for ( int iPos = 0; iPos < MAX_WEAPON_POSITIONS; iPos++ )
{
Expand All @@ -1150,12 +1150,12 @@ int CHudAmmo::DrawWList(float flTime)

if ( gWR.HasAmmo(p) )
{
UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);
a = 128;
}
else
{
UnpackRGB(r,g,b, RGB_REDISH);
UnpackRGB(r,g,b, RGB_GREY);
a = 96;
}

Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ammo_secondary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int CHudAmmoSecondary :: Draw(float flTime)

// draw secondary ammo icons above normal ammo readout
int a, x, y, r, g, b, AmmoWidth;
UnpackRGB( r, g, b, RGB_YELLOWISH );
UnpackRGB( r, g, b, RGB_DEFAULT );
a = (int) V_max( MIN_ALPHA, m_fFade );
if (m_fFade > 0)
m_fFade -= (gHUD.m_flTimeDelta * 20); // slowly lower alpha to fade out icons
Expand Down
8 changes: 4 additions & 4 deletions cl_dll/ammohistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int HistoryResource :: DrawAmmoHistory( float flTime )
HSPRITE *spr = gWR.GetAmmoPicFromWeapon( rgAmmoHistory[i].iId, rcPic );

int r, g, b;
UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);
float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80;
ScaleColors(r, g, b, V_min(scale, 255) );

Expand All @@ -148,10 +148,10 @@ int HistoryResource :: DrawAmmoHistory( float flTime )
return 1; // we don't know about the weapon yet, so don't draw anything

int r, g, b;
UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

if ( !gWR.HasAmmo( weap ) )
UnpackRGB(r,g,b, RGB_REDISH); // if the weapon doesn't have ammo, display it as red
UnpackRGB(r,g,b, RGB_GREY); // if the weapon doesn't have ammo, display it as red

float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80;
ScaleColors(r, g, b, V_min(scale, 255) );
Expand All @@ -170,7 +170,7 @@ int HistoryResource :: DrawAmmoHistory( float flTime )

wrect_t rect = gHUD.GetSpriteRect( rgAmmoHistory[i].iId );

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);
float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80;
ScaleColors(r, g, b, V_min(scale, 255) );

Expand Down
2 changes: 1 addition & 1 deletion cl_dll/battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int CHudBattery::Draw(float flTime)
rc.top += m_iHeight * ((float)(100-(V_min(100,m_iBat))) * 0.01); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
#endif

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
return 1;
Expand Down
4 changes: 2 additions & 2 deletions cl_dll/flashlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ int CHudFlashlight::Draw(float flTime)
a = MIN_ALPHA;

if (m_flBat < 0.20)
UnpackRGB(r,g,b, RGB_REDISH);
UnpackRGB(r,g,b, RGB_GREY);
else
UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

ScaleColors(r, g, b, a);

Expand Down
4 changes: 2 additions & 2 deletions cl_dll/health.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b )
#else
if (m_iHealth > 25)
{
UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);
}
else
{
Expand Down Expand Up @@ -372,7 +372,7 @@ int CHudHealth::DrawDamage(float flTime)
if (!m_bitsDamage)
return 1;

UnpackRGB(r,g,b, RGB_YELLOWISH);
UnpackRGB(r,g,b, RGB_DEFAULT);

a = (int)( fabs(sin(flTime*2)) * 256.0);

Expand Down
9 changes: 5 additions & 4 deletions cl_dll/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ extern client_sprite_t *GetSpriteList(client_sprite_t *pList, const char *psz, i

extern cvar_t *sensitivity;
cvar_t *cl_lw = NULL;
cvar_t* cl_viewrollangle;
cvar_t* cl_viewrollspeed;
cvar_t* cl_rollangle;
cvar_t* cl_rollspeed;

void ShutdownInput (void);

Expand Down Expand Up @@ -321,10 +321,11 @@ void CHud :: Init( void )
// VGUI Menus
HOOK_MESSAGE( VGUIMenu );

cl_rollangle = CVAR_CREATE("cl_rollangle", "0.65", FCVAR_CLIENTDLL | FCVAR_ARCHIVE);
cl_rollspeed = CVAR_CREATE("cl_rollspeed", "300", FCVAR_CLIENTDLL | FCVAR_ARCHIVE);

CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch
CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round
cl_viewrollangle = CVAR_CREATE("cl_viewrollangle", "0.65", FCVAR_CLIENTDLL | FCVAR_ARCHIVE);
cl_viewrollspeed = CVAR_CREATE("cl_viewrollspeed", "300", FCVAR_CLIENTDLL | FCVAR_ARCHIVE);


m_iLogo = 0;
Expand Down
4 changes: 2 additions & 2 deletions cl_dll/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
//

// define HUD colors. hex codes are different here, rather than starting with "#" they start with "0x00"
#define RGB_YELLOWISH 0x000062ff //255,160,0
#define RGB_REDISH 0x00FF1010 //255,160,0
#define RGB_DEFAULT 0x003692f8 //54, 146, 248
#define RGB_GREY 0x008e8f91 //255,160,0
#define RGB_GREENISH 0x0000A000 //0,160,0

#ifndef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/hud_spectator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ void CHudSpectator::DrawOverviewEntities()

z = m_OverviewData.layersHeights[0] * zScale;
// get yellow/brown HUD color
UnpackRGB(ir,ig,ib, RGB_YELLOWISH);
UnpackRGB(ir,ig,ib, RGB_DEFAULT);
r = (float)ir/255.0f;
g = (float)ig/255.0f;
b = (float)ib/255.0f;
Expand Down
Loading

0 comments on commit 95f116f

Please sign in to comment.