-
Notifications
You must be signed in to change notification settings - Fork 3
/
crosshaircolor.patch
26 lines (25 loc) · 959 Bytes
/
crosshaircolor.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Index: src/engine/rendergl.cpp
===================================================================
--- src/engine/rendergl.cpp (revision 6490)
+++ src/engine/rendergl.cpp (working copy)
@@ -2079,6 +2098,7 @@
VARP(cursorsize, 0, 30, 50);
VARP(crosshairfx, 0, 1, 1);
VARP(crosshaircolors, 0, 1, 1);
+MOD(HVARP, crosshaircolor, 0, 0xFFFFFF, 0xFFFFFF);
#define MAXCROSSHAIRS 4
static Texture *crosshairs[MAXCROSSHAIRS] = { NULL, NULL, NULL, NULL };
@@ -2138,10 +2158,11 @@
}
else
{
- int index = game::selectcrosshair(color);
+ vec chcolor = vec::hexcolor(crosshaircolor);
+ int index = game::selectcrosshair(chcolor);
if(index < 0) return;
if(!crosshairfx) index = 0;
- if(!crosshairfx || !crosshaircolors) color = vec(1, 1, 1);
+ color = crosshairfx && crosshaircolors ? chcolor : vec::hexcolor(crosshaircolor);
crosshair = crosshairs[index];
if(!crosshair)
{