Skip to content

Commit

Permalink
Lowered crosshair stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueNightHawk committed Oct 27, 2023
1 parent 02d6f6c commit 7859161
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions cl_dll/ev_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ extern cvar_t *cl_viewmodel_ofs_up;

extern CGameStudioModelRenderer g_StudioRenderer;

extern cvar_s* crosshair_low;

/*
=================
GetEntity
Expand Down Expand Up @@ -112,6 +114,7 @@ void EV_GetGunPosition( event_args_t *args, float *pos, float *origin )
{
int idx;
vec3_t view_ofs;
vec3_t up;

idx = args->entindex;

Expand All @@ -133,6 +136,12 @@ void EV_GetGunPosition( event_args_t *args, float *pos, float *origin )
}

VectorAdd( origin, view_ofs, pos );

if (EV_IsLocal(idx) && !IS_FIRSTPERSON_SPEC)
{
// TODO : Add CVAR check
pos[2] -= 5.0f;
}
}

/*
Expand Down
9 changes: 4 additions & 5 deletions cl_dll/hud_crosshairs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
#include "parsemsg.h"
#include "hudgl.h"

extern cvar_t *crosshair_low;

int CHudCrosshairs::Init()
{
m_iFlags = HUD_ACTIVE;

cl_cross = CVAR_CREATE("cl_cross", "0", FCVAR_ARCHIVE);
cl_cross_low = CVAR_CREATE("cl_cross_low", "1", FCVAR_ARCHIVE);
cl_cross_low = crosshair_low;//CVAR_CREATE("cl_cross_low", "1", FCVAR_ARCHIVE);
cl_cross_color = CVAR_CREATE("cl_cross_color", "0 255 0", FCVAR_ARCHIVE);
cl_cross_alpha = CVAR_CREATE("cl_cross_alpha", "200", FCVAR_ARCHIVE);
cl_cross_thickness = CVAR_CREATE("cl_cross_thickness", "2", FCVAR_ARCHIVE);
Expand Down Expand Up @@ -52,10 +54,7 @@ int CHudCrosshairs::Draw(float time)
}


Vector2D center(ScreenWidth / 2.0f, ScreenHeight / 1.8f);



Vector2D center(ScreenWidth / 2.0f, ScreenHeight / ((int)cl_cross_low->value > 0 ? 1.8f : 2.0f));

HudGL gl;

Expand Down
6 changes: 6 additions & 0 deletions cl_dll/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ cvar_t v_ipitch_level = { "v_ipitch_level", "0.3", 0, 0.3 };

float v_idlescale; // used by TFC for concussion grenade effect

cvar_s* crosshair_low;

//=============================================================================
/*
void V_NormalizeAngles( vec3_t angles )
Expand Down Expand Up @@ -479,6 +481,8 @@ void V_CalcGunAngle(struct ref_params_s* pparams)

VectorCopy(viewent->angles, viewent->curstate.angles);
VectorCopy(viewent->angles, viewent->latched.prevangles);

pparams->crosshairangle[0] = -((int)crosshair_low->value > 0 ? 5.0f : 0.0f);
}

/*
Expand Down Expand Up @@ -2029,6 +2033,8 @@ void V_Init(void)
cl_mp5_punch_roll_enabled = gEngfuncs.pfnRegisterVariable("cl_mp5_punch_roll_enabled", "1", FCVAR_ARCHIVE);
cl_m249_new_punch_enabled = gEngfuncs.pfnRegisterVariable("cl_m249_new_punch_enabled", "1", FCVAR_ARCHIVE);
cl_shockrifle_punch_enabled = gEngfuncs.pfnRegisterVariable("cl_shockrifle_punch_enabled", "1", FCVAR_ARCHIVE);

crosshair_low = gEngfuncs.pfnRegisterVariable("crosshair_low", "1", FCVAR_ARCHIVE);
}


Expand Down

0 comments on commit 7859161

Please sign in to comment.