Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/include/vgui/VGUI_Dar.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ template<class ELEMTYPE> class VGUIAPI Dar
}
_count=count;
}
int getCount()
unsigned int getCount()
{
return _count;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/include/vgui/VGUI_String.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class VGUIAPI String

public:

int getCount();
unsigned int getCount();
String operator+(String text);
String operator+(const char* text);
bool operator==(String text);
Expand Down
8 changes: 3 additions & 5 deletions src/game/client/ammo.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
#ifndef __AMMO_H__
#define __AMMO_H__

#define MAX_WEAPON_NAME 128

#define WEAPON_FLAGS_SELECTONEMPTY 1

#define WEAPON_IS_ONTARGET 0x40
constexpr int MAX_WEAPON_NAME = 128;
constexpr int WEAPON_FLAGS_SELECTONEMPTY = 1;
constexpr int WEAPON_IS_ONTARGET = 0x40;

struct WEAPON
{
Expand Down
8 changes: 4 additions & 4 deletions src/game/client/ammo_secondary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int CHudAmmoSecondary ::Init(void)
gHUD.AddHudElem(this);
m_HUD_ammoicon = 0;

for (int i = 0; i < MAX_SEC_AMMO_VALUES; i++)
for (unsigned int i = 0; i < MAX_SEC_AMMO_VALUES; i++)
m_iAmmoAmounts[i] = -1; // -1 means don't draw this value

Reset();
Expand Down Expand Up @@ -68,8 +68,8 @@ int CHudAmmoSecondary ::Draw(float flTime)

AmmoWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left;

y = ScreenHeight - (gHUD.m_iFontHeight * 4); // this is one font height higher than the weapon ammo values
x = ScreenWidth - AmmoWidth;
y = ScreenHeight() - (gHUD.m_iFontHeight * 4); // this is one font height higher than the weapon ammo values
x = ScreenWidth() - AmmoWidth;

if (m_HUD_ammoicon)
{
Expand Down Expand Up @@ -139,7 +139,7 @@ int CHudAmmoSecondary ::MsgFunc_SecAmmoVal(const char *pszName, int iSize, void

// check to see if there is anything left to draw
int count = 0;
for (int i = 0; i < MAX_SEC_AMMO_VALUES; i++)
for (unsigned int i = 0; i < MAX_SEC_AMMO_VALUES; i++)
{
count += V_max(0, m_iAmmoAmounts[i]);
}
Expand Down
16 changes: 8 additions & 8 deletions src/game/client/ammohistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ HistoryResource gHR;

#define AMMO_PICKUP_GAP (gHR.iHistoryGap + 5)
#define AMMO_PICKUP_PICK_HEIGHT (32 + (gHR.iHistoryGap * 2))
#define AMMO_PICKUP_HEIGHT_MAX (ScreenHeight - 100)
#define AMMO_PICKUP_HEIGHT_MAX (ScreenHeight() - 100)

#define MAX_ITEM_NAME 32
int HISTORY_DRAW_TIME = 5;
Expand Down Expand Up @@ -91,7 +91,7 @@ void HistoryResource ::AddToHistory(int iType, const char *szName, int iCount)

void HistoryResource ::CheckClearHistory(void)
{
for (int i = 0; i < MAX_HISTORY; i++)
for (unsigned int i = 0; i < MAX_HISTORY; i++)
{
if (rgAmmoHistory[i].type)
return;
Expand Down Expand Up @@ -127,8 +127,8 @@ int HistoryResource ::DrawAmmoHistory(float flTime)
ScaleColors(r, g, b, min(scale, 255) );

// Draw the pic
int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth - 24;
int ypos = ScreenHeight() - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth() - 24;
if ( spr && *spr ) // weapon isn't loaded yet so just don't draw the pic
{ // the dll has to make sure it has sent info the weapons you need
SPR_Set( *spr, r, g, b );
Expand All @@ -154,8 +154,8 @@ int HistoryResource ::DrawAmmoHistory(float flTime)
float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80;
ScaleColors(r, g, b, min(scale, 255) );

int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth - (weap->rcInactive.right - weap->rcInactive.left);
int ypos = ScreenHeight() - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth() - (weap->rcInactive.right - weap->rcInactive.left);
SPR_Set( weap->hInactive, r, g, b );
SPR_DrawAdditive( 0, xpos, ypos, &weap->rcInactive );
}
Expand All @@ -172,8 +172,8 @@ int HistoryResource ::DrawAmmoHistory(float flTime)
float scale = (rgAmmoHistory[i].DisplayTime - flTime) * 80;
ScaleColors(r, g, b, min(scale, 255) );

int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth - (rect.right - rect.left) - 10;
int ypos = ScreenHeight() - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth() - (rect.right - rect.left) - 10;

SPR_Set( gHUD.GetSprite( rgAmmoHistory[i].iId ), r, g, b );
SPR_DrawAdditive( 0, xpos, ypos, &rect );
Expand Down
5 changes: 2 additions & 3 deletions src/game/client/ammohistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//

// this is the max number of items in each bucket
#define MAX_WEAPON_POSITIONS MAX_WEAPON_SLOTS

class WeaponsResource
{
Expand Down Expand Up @@ -65,7 +64,7 @@ class WeaponsResource

void DropAllWeapons(void)
{
for (int i = 0; i < MAX_WEAPONS; i++)
for (unsigned int i = 0; i < MAX_WEAPONS; i++)
{
if (rgWeapons[i].iId)
DropWeapon(&rgWeapons[i]);
Expand Down Expand Up @@ -94,7 +93,7 @@ class WeaponsResource

extern WeaponsResource gWR;

#define MAX_HISTORY 12
constexpr int MAX_HISTORY = 12;
enum
{
HISTSLOT_EMPTY,
Expand Down
28 changes: 14 additions & 14 deletions src/game/client/angelscript/ASClientBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static CBeam* AS_CreateBeamEntPoint(int startIdx, int attachment, const Vector3&

static void AS_CreateSpark(const Vector3& origin)
{
vec3_t pos = {origin.x, origin.y, origin.z};
Vector pos = {origin.x, origin.y, origin.z};
gEngfuncs.pEfxAPI->R_SparkEffect(pos, 5, -200, 200);
}

Expand All @@ -862,7 +862,7 @@ static void AS_CreateSparkOnModel(int entityIndex, int attachment)
cl_entity_t* pEnt = gEngfuncs.GetEntityByIndex(entityIndex);
if (pEnt)
{
vec3_t pos;
Vector pos;
VectorCopy(pEnt->origin, pos);
gEngfuncs.pEfxAPI->R_SparkEffect(pos, 5, -200, 200);
}
Expand Down Expand Up @@ -956,7 +956,7 @@ class CClientSound

void PlaySoundAtPosition(const Vector3& pos, const std::string& soundPath, float volume)
{
vec3_t position = {pos.x, pos.y, pos.z};
Vector position = {pos.x, pos.y, pos.z};
gEngfuncs.pEfxAPI->R_RicochetSound((float*)&position);
}
};
Expand All @@ -975,51 +975,51 @@ static CClientSound* AS_GetClientSound()
static Vector3 AS_GetGroundHeight(const Vector3& origin)
{
pmtrace_t trace;
vec3_t start = {origin.x, origin.y, origin.z};
vec3_t end = {origin.x, origin.y, origin.z - 8192.0f};
Vector start = {origin.x, origin.y, origin.z};
Vector end = {origin.x, origin.y, origin.z - 8192.0f};
gEngfuncs.pEventAPI->EV_PlayerTrace(start, end, PM_WORLD_ONLY, -1, &trace);
return Vector3(trace.endpos[0], trace.endpos[1], trace.endpos[2]);
}

static Vector3 AS_GetSkyHeight(const Vector3& origin)
{
pmtrace_t trace;
vec3_t start = {origin.x, origin.y, origin.z};
vec3_t end = {origin.x, origin.y, origin.z + 8192.0f};
Vector start = {origin.x, origin.y, origin.z};
Vector end = {origin.x, origin.y, origin.z + 8192.0f};
gEngfuncs.pEventAPI->EV_PlayerTrace(start, end, PM_WORLD_ONLY, -1, &trace);
return Vector3(trace.endpos[0], trace.endpos[1], trace.endpos[2]);
}

static bool AS_IsUnderSky(const Vector3& origin)
{
pmtrace_t trace;
vec3_t start = {origin.x, origin.y, origin.z};
vec3_t end = {origin.x, origin.y, origin.z + 8192.0f};
Vector start = {origin.x, origin.y, origin.z};
Vector end = {origin.x, origin.y, origin.z + 8192.0f};
gEngfuncs.pEventAPI->EV_PlayerTrace(start, end, PM_WORLD_ONLY, -1, &trace);
return trace.fraction >= 1.0f || trace.ent == 0;
}

static Vector3 AS_TraceLine(const Vector3& start, const Vector3& end, bool worldOnly)
{
pmtrace_t trace;
vec3_t vStart = {start.x, start.y, start.z};
vec3_t vEnd = {end.x, end.y, end.z};
Vector vStart = {start.x, start.y, start.z};
Vector vEnd = {end.x, end.y, end.z};
gEngfuncs.pEventAPI->EV_PlayerTrace(vStart, vEnd, worldOnly ? PM_WORLD_ONLY : PM_NORMAL, -1, &trace);
return Vector3(trace.endpos[0], trace.endpos[1], trace.endpos[2]);
}

static int AS_TraceLineEntity(const Vector3& start, const Vector3& end)
{
pmtrace_t trace;
vec3_t vStart = {start.x, start.y, start.z};
vec3_t vEnd = {end.x, end.y, end.z};
Vector vStart = {start.x, start.y, start.z};
Vector vEnd = {end.x, end.y, end.z};
gEngfuncs.pEventAPI->EV_PlayerTrace(vStart, vEnd, PM_NORMAL, -1, &trace);
return trace.ent;
}

static int AS_GetContents(const Vector3& origin)
{
vec3_t pos = {origin.x, origin.y, origin.z};
Vector pos = {origin.x, origin.y, origin.z};
return gEngfuncs.PM_PointContents(pos, nullptr);
}

Expand Down
4 changes: 2 additions & 2 deletions src/game/client/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// NOTE: must include quakedef.h first

#ifndef _CAMERA_H_
#define _CAMEA_H_
#define _CAMERA_H_

// pitch, yaw, dist
extern vec3_t cam_ofs;
extern Vector cam_ofs;
// Using third person camera
//extern int cam_thirdperson; //Master Sword - Moved to MSCLGlobals

Expand Down
2 changes: 1 addition & 1 deletion src/game/client/cdll_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void DLLEXPORT HUD_ChatInputPosition(int* x, int* y)
{
if (g_iUser1 != 0 || gEngfuncs.IsSpectateOnly())
{
if (gHUD.m_Spectator.m_pip->value == INSET_OFF)
if ((int)gHUD.m_Spectator.m_pip->value == INSET_OFF)
{
*y = YRES(64);
}
Expand Down
Loading
Loading