]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
removed crosshair_static cvar (now only the hud crosshair remains)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 11 Jun 2006 13:50:25 +0000 (13:50 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 11 Jun 2006 13:50:25 +0000 (13:50 +0000)
merged r_crosshairs.c into sbar.c

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6465 d7cf8633-e32d-0410-b094-e92efae38249

13 files changed:
cl_screen.c
darkplaces-dedicated.dev
darkplaces-dedicated.dsp
darkplaces-sdl.dsp
darkplaces.dev
darkplaces.dsp
gl_rmain.c
makefile.inc
menu.c
r_crosshairs.c [deleted file]
render.h
sbar.c
screen.h

index c35d11393a89bd9c3a0cba4b296e82a1fc92c08f..ab629fb64af7216f6921d590b189f8de97cddd6f 100644 (file)
@@ -51,7 +51,6 @@ float         scr_con_current;
 
 extern int     con_vislines;
 
 
 extern int     con_vislines;
 
-void DrawCrosshair(int num);
 static void SCR_ScreenShot_f (void);
 static void R_Envmap_f (void);
 
 static void SCR_ScreenShot_f (void);
 static void R_Envmap_f (void);
 
index 18131ee96c2fd7153e15378c6c8b1314c0ffc725..1a4577e1f30bdd8f87dd0037544af7074c2acd2f 100644 (file)
@@ -1,7 +1,7 @@
 [Project]
 FileName=darkplaces-dedicated.dev
 Name=DarkPlaces
 [Project]
 FileName=darkplaces-dedicated.dev
 Name=DarkPlaces
-UnitCount=147
+UnitCount=157
 Type=1
 Ver=1
 ObjFiles=
 Type=1
 Ver=1
 ObjFiles=
@@ -1099,16 +1099,6 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=
 
 OverrideBuildCmd=0
 BuildCmd=
 
-[Unit112]
-FileName=r_crosshairs.c
-CompileCpp=0
-Folder=Source Files
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
 [Unit113]
 FileName=r_explosion.c
 CompileCpp=0
 [Unit113]
 FileName=r_explosion.c
 CompileCpp=0
@@ -1539,7 +1529,7 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=
 
 OverrideBuildCmd=0
 BuildCmd=
 
-[Unit158]
+[Unit112]
 FileName=builddate.c
 CompileCpp=0
 Folder=Source Files
 FileName=builddate.c
 CompileCpp=0
 Folder=Source Files
index 427c353a6881d9be2267da517f02cb419de7f402..7e92eaf8b12d2528380a11ac3e6347700acd8920 100644 (file)
@@ -7,19 +7,19 @@
 CFG=dedicated - Win32 Debug\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
 CFG=dedicated - Win32 Debug\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "darkplaces-dedicated.mak".\r
 !MESSAGE NMAKE /f "darkplaces-dedicated.mak".\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "darkplaces-dedicated.mak" CFG="dedicated - Win32 Debug"\r
 !MESSAGE NMAKE /f "darkplaces-dedicated.mak" CFG="dedicated - Win32 Debug"\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE Possible choices for configuration are:\r
 !MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE "dedicated - Win32 Release" (based on "Win32 (x86) Application")\r
 !MESSAGE "dedicated - Win32 Debug" (based on "Win32 (x86) Application")\r
 !MESSAGE "dedicated - Win32 Release" (based on "Win32 (x86) Application")\r
 !MESSAGE "dedicated - Win32 Debug" (based on "Win32 (x86) Application")\r
-!MESSAGE \r
+!MESSAGE\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
@@ -83,7 +83,7 @@ LINK32=link.exe
 # ADD LINK32 user32.lib gdi32.lib opengl32.lib wsock32.lib winmm.lib comctl32.lib dxguid.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug-Dedicated/darkplaces-dedicated-debug.exe" /pdbtype:sept\r
 # SUBTRACT LINK32 /pdb:none\r
 \r
 # ADD LINK32 user32.lib gdi32.lib opengl32.lib wsock32.lib winmm.lib comctl32.lib dxguid.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug-Dedicated/darkplaces-dedicated-debug.exe" /pdbtype:sept\r
 # SUBTRACT LINK32 /pdb:none\r
 \r
-!ENDIF \r
+!ENDIF\r
 \r
 # Begin Target\r
 \r
 \r
 # Begin Target\r
 \r
@@ -310,10 +310,6 @@ SOURCE=.\prvm_exec.c
 # End Source File\r
 # Begin Source File\r
 \r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\r_crosshairs.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\r_explosion.c\r
 # End Source File\r
 # Begin Source File\r
 SOURCE=.\r_explosion.c\r
 # End Source File\r
 # Begin Source File\r
index 9c40efb1048acf146e9bb5b35252ed432724689e..21397e9d7351cf6975a289ebe0ce951486630631 100644 (file)
@@ -7,19 +7,19 @@
 CFG=sdl - Win32 Debug\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
 CFG=sdl - Win32 Debug\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "darkplaces-sdl.mak".\r
 !MESSAGE NMAKE /f "darkplaces-sdl.mak".\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "darkplaces-sdl.mak" CFG="sdl - Win32 Debug"\r
 !MESSAGE NMAKE /f "darkplaces-sdl.mak" CFG="sdl - Win32 Debug"\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE Possible choices for configuration are:\r
 !MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE "sdl - Win32 Release" (based on "Win32 (x86) Application")\r
 !MESSAGE "sdl - Win32 Debug" (based on "Win32 (x86) Application")\r
 !MESSAGE "sdl - Win32 Release" (based on "Win32 (x86) Application")\r
 !MESSAGE "sdl - Win32 Debug" (based on "Win32 (x86) Application")\r
-!MESSAGE \r
+!MESSAGE\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
@@ -83,7 +83,7 @@ LINK32=link.exe
 # ADD LINK32 user32.lib gdi32.lib opengl32.lib wsock32.lib winmm.lib comctl32.lib dxguid.lib sdl.lib sdlmain.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"Debug-SDL/darkplaces-sdl-debug.exe" /pdbtype:sept /libpath:"SDL/lib"\r
 # SUBTRACT LINK32 /pdb:none\r
 \r
 # ADD LINK32 user32.lib gdi32.lib opengl32.lib wsock32.lib winmm.lib comctl32.lib dxguid.lib sdl.lib sdlmain.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"Debug-SDL/darkplaces-sdl-debug.exe" /pdbtype:sept /libpath:"SDL/lib"\r
 # SUBTRACT LINK32 /pdb:none\r
 \r
-!ENDIF \r
+!ENDIF\r
 \r
 # Begin Target\r
 \r
 \r
 # Begin Target\r
 \r
@@ -310,10 +310,6 @@ SOURCE=.\prvm_exec.c
 # End Source File\r
 # Begin Source File\r
 \r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\r_crosshairs.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\r_explosion.c\r
 # End Source File\r
 # Begin Source File\r
 SOURCE=.\r_explosion.c\r
 # End Source File\r
 # Begin Source File\r
index ef906b630e1ee448215eb026c227828c1a34cab5..6584102b36c591b03ab5429f148471221a0ba86c 100644 (file)
@@ -1,7 +1,7 @@
 [Project]
 FileName=darkplaces.dev
 Name=DarkPlaces
 [Project]
 FileName=darkplaces.dev
 Name=DarkPlaces
-UnitCount=157
+UnitCount=156
 Type=0
 Ver=1
 ObjFiles=
 Type=0
 Ver=1
 ObjFiles=
@@ -1189,16 +1189,6 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=
 
 OverrideBuildCmd=0
 BuildCmd=
 
-[Unit117]
-FileName=r_crosshairs.c
-CompileCpp=0
-Folder=Source Files
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
 [Unit118]
 FileName=r_explosion.c
 CompileCpp=0
 [Unit118]
 FileName=r_explosion.c
 CompileCpp=0
@@ -1589,7 +1579,7 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=
 
 OverrideBuildCmd=0
 BuildCmd=
 
-[Unit158]
+[Unit117]
 FileName=builddate.c
 CompileCpp=0
 Folder=Source Files
 FileName=builddate.c
 CompileCpp=0
 Folder=Source Files
index 15a2c330b2d5e884751fc9e0d998a8305eb1378c..4772a896c5a6b438e6843c871758f15b6a9a4255 100644 (file)
@@ -7,19 +7,19 @@
 CFG=darkplaces - Win32 Debug\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
 CFG=darkplaces - Win32 Debug\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "darkplaces.mak".\r
 !MESSAGE NMAKE /f "darkplaces.mak".\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "darkplaces.mak" CFG="darkplaces - Win32 Debug"\r
 !MESSAGE NMAKE /f "darkplaces.mak" CFG="darkplaces - Win32 Debug"\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE Possible choices for configuration are:\r
 !MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE "darkplaces - Win32 Release" (based on "Win32 (x86) Application")\r
 !MESSAGE "darkplaces - Win32 Debug" (based on "Win32 (x86) Application")\r
 !MESSAGE "darkplaces - Win32 Release" (based on "Win32 (x86) Application")\r
 !MESSAGE "darkplaces - Win32 Debug" (based on "Win32 (x86) Application")\r
-!MESSAGE \r
+!MESSAGE\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
@@ -83,7 +83,7 @@ LINK32=link.exe
 # ADD LINK32 user32.lib gdi32.lib opengl32.lib wsock32.lib winmm.lib comctl32.lib dxguid.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/darkplaces-debug.exe" /pdbtype:sept\r
 # SUBTRACT LINK32 /nodefaultlib\r
 \r
 # ADD LINK32 user32.lib gdi32.lib opengl32.lib wsock32.lib winmm.lib comctl32.lib dxguid.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/darkplaces-debug.exe" /pdbtype:sept\r
 # SUBTRACT LINK32 /nodefaultlib\r
 \r
-!ENDIF \r
+!ENDIF\r
 \r
 # Begin Target\r
 \r
 \r
 # Begin Target\r
 \r
@@ -314,10 +314,6 @@ SOURCE=.\prvm_exec.c
 # End Source File\r
 # Begin Source File\r
 \r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\r_crosshairs.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\r_explosion.c\r
 # End Source File\r
 # Begin Source File\r
 SOURCE=.\r_explosion.c\r
 # End Source File\r
 # Begin Source File\r
index 88c6e0bf63faee98fc84eaf6e3593efe7daf8f62..0cd996a46ed577e4f14b557cdaddf3d4c0d8aa3b 100644 (file)
@@ -1023,7 +1023,6 @@ extern void GL_Main_Init(void);
 extern void R_Shadow_Init(void);
 extern void R_Sky_Init(void);
 extern void GL_Surf_Init(void);
 extern void R_Shadow_Init(void);
 extern void R_Sky_Init(void);
 extern void GL_Surf_Init(void);
-extern void R_Crosshairs_Init(void);
 extern void R_Light_Init(void);
 extern void R_Particles_Init(void);
 extern void R_Explosion_Init(void);
 extern void R_Light_Init(void);
 extern void R_Particles_Init(void);
 extern void R_Explosion_Init(void);
@@ -1041,11 +1040,10 @@ void Render_Init(void)
        R_Shadow_Init();
        R_Sky_Init();
        GL_Surf_Init();
        R_Shadow_Init();
        R_Sky_Init();
        GL_Surf_Init();
-       R_Crosshairs_Init();
+       Sbar_Init();
        R_Light_Init();
        R_Particles_Init();
        R_Explosion_Init();
        R_Light_Init();
        R_Particles_Init();
        R_Explosion_Init();
-       Sbar_Init();
        R_LightningBeams_Init();
        Mod_RenderInit();
 }
        R_LightningBeams_Init();
        Mod_RenderInit();
 }
@@ -1825,12 +1823,6 @@ void R_RenderScene(void)
                if (r_timereport_active)
                        R_TimeReport("coronas");
        }
                if (r_timereport_active)
                        R_TimeReport("coronas");
        }
-       if(cl.csqc_vidvars.drawcrosshair)
-       {
-               R_DrawWorldCrosshair();
-               if (r_timereport_active)
-                       R_TimeReport("crosshair");
-       }
 
        // don't let sound skip if going slow
        if (r_refdef.extraupdate)
 
        // don't let sound skip if going slow
        if (r_refdef.extraupdate)
index 8a455a2e62854ca1067053b81d4b9d0c6195a3f1..efc5cdc470b4e54a845b639dcd8941495aa982de 100644 (file)
@@ -106,7 +106,6 @@ OBJ_COMMON= \
        prvm_cmds.o \
        prvm_edict.o \
        prvm_exec.o \
        prvm_cmds.o \
        prvm_edict.o \
        prvm_exec.o \
-       r_crosshairs.o \
        r_explosion.o \
        r_lerpanim.o \
        r_light.o \
        r_explosion.o \
        r_lerpanim.o \
        r_light.o \
diff --git a/menu.c b/menu.c
index 45236a68902eaa558244671d0ea7988241c00a8f..951fdeb0f38265f10987072d58dcd3230091cc3e 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1539,7 +1539,7 @@ static void M_DrawCheckbox (int x, int y, int on)
 }
 
 
 }
 
 
-#define OPTIONS_ITEMS 40
+#define OPTIONS_ITEMS 39
 
 static int options_cursor;
 
 
 static int options_cursor;
 
@@ -1603,8 +1603,6 @@ static void M_Menu_Options_AdjustSliders (int dir)
                Cvar_SetValueQuick (&crosshair, bound(0, crosshair.integer + dir, 6));
        else if (options_cursor == optnum++)
                Cvar_SetValueQuick (&crosshair_size, bound(1, crosshair_size.value + dir, 5));
                Cvar_SetValueQuick (&crosshair, bound(0, crosshair.integer + dir, 6));
        else if (options_cursor == optnum++)
                Cvar_SetValueQuick (&crosshair_size, bound(1, crosshair_size.value + dir, 5));
-       else if (options_cursor == optnum++)
-               Cvar_SetValueQuick (&crosshair_static, !crosshair_static.integer);
        else if (options_cursor == optnum++)
                Cvar_SetValueQuick (&showfps, !showfps.integer);
        else if (options_cursor == optnum++)
        else if (options_cursor == optnum++)
                Cvar_SetValueQuick (&showfps, !showfps.integer);
        else if (options_cursor == optnum++)
@@ -1721,7 +1719,6 @@ static void M_Options_Draw (void)
        M_Options_PrintCheckbox("       Text Shadow", true, r_textshadow.integer);
        M_Options_PrintSlider(  "         Crosshair", true, crosshair.value, 0, 5);
        M_Options_PrintSlider(  "    Crosshair Size", true, crosshair_size.value, 1, 5);
        M_Options_PrintCheckbox("       Text Shadow", true, r_textshadow.integer);
        M_Options_PrintSlider(  "         Crosshair", true, crosshair.value, 0, 5);
        M_Options_PrintSlider(  "    Crosshair Size", true, crosshair_size.value, 1, 5);
-       M_Options_PrintCheckbox("  Static Crosshair", true, crosshair_static.integer);
        M_Options_PrintCheckbox("    Show Framerate", true, showfps.integer);
        M_Options_PrintCheckbox("         Show Time", true, showtime.integer);
        M_Options_PrintCheckbox("         Show Date", true, showdate.integer);
        M_Options_PrintCheckbox("    Show Framerate", true, showfps.integer);
        M_Options_PrintCheckbox("         Show Time", true, showtime.integer);
        M_Options_PrintCheckbox("         Show Date", true, showdate.integer);
diff --git a/r_crosshairs.c b/r_crosshairs.c
deleted file mode 100644 (file)
index a32226d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-
-#include "quakedef.h"
-#include "cl_collision.h"
-
-cvar_t crosshair_color_red = {CVAR_SAVE, "crosshair_color_red", "1", "customizable crosshair color"};
-cvar_t crosshair_color_green = {CVAR_SAVE, "crosshair_color_green", "0", "customizable crosshair color"};
-cvar_t crosshair_color_blue = {CVAR_SAVE, "crosshair_color_blue", "0", "customizable crosshair color"};
-cvar_t crosshair_color_alpha = {CVAR_SAVE, "crosshair_color_alpha", "1", "how opaque the crosshair should be"};
-cvar_t crosshair_size = {CVAR_SAVE, "crosshair_size", "1", "adjusts size of the crosshair on the screen"};
-cvar_t crosshair_static = {CVAR_SAVE, "crosshair_static", "1", "if 1 the crosshair is a 2D overlay, if 0 it is a sprite in the world indicating where your weapon will hit in standard quake mods (if the mod has the weapon somewhere else this won't be accurate)"};
-
-void R_Crosshairs_Init(void)
-{
-       Cvar_RegisterVariable(&crosshair_color_red);
-       Cvar_RegisterVariable(&crosshair_color_green);
-       Cvar_RegisterVariable(&crosshair_color_blue);
-       Cvar_RegisterVariable(&crosshair_color_alpha);
-       Cvar_RegisterVariable(&crosshair_size);
-       Cvar_RegisterVariable(&crosshair_static);
-}
-
-void R_DrawWorldCrosshair(void)
-{
-       int num;
-       cachepic_t *pic;
-       vec3_t v1, v2, spriteorigin;
-       vec_t spritescale;
-       trace_t trace;
-       if (r_letterbox.value)
-               return;
-       if (crosshair_static.integer)
-               return;
-       num = crosshair.integer;
-       if (num < 1 || num > NUMCROSSHAIRS || cl.intermission)
-               return;
-       if (!cl.viewentity || !cl.entities[cl.viewentity].state_current.active)
-               return;
-       pic = r_crosshairs[num];
-       if (!pic)
-               return;
-
-       // trace the shot path up to a certain distance
-       Matrix4x4_OriginFromMatrix(&cl.entities[cl.viewentity].render.matrix, v1);
-       v1[2] += 16; // HACK: this depends on the QC
-
-       // get the forward vector for the gun (not the view)
-       AngleVectors(cl.viewangles, v2, NULL, NULL);
-       //VectorCopy(r_view.origin, v1);
-       VectorMA(v1, 8192, v2, v2);
-       trace = CL_TraceBox(v1, vec3_origin, vec3_origin, v2, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_SKY, false);
-       spritescale = trace.fraction * (8192.0f / 40.0f) * crosshair_size.value;
-       VectorCopy(trace.endpos, spriteorigin);
-
-       // draw the sprite
-       R_DrawSprite(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, pic->tex, NULL, true, spriteorigin, r_view.right, r_view.up, spritescale, -spritescale, -spritescale, spritescale, crosshair_color_red.value, crosshair_color_green.value, crosshair_color_blue.value, crosshair_color_alpha.value);
-}
-
-void R_Draw2DCrosshair(void)
-{
-       int num;
-       cachepic_t *pic;
-       if (r_letterbox.value)
-               return;
-       if (!crosshair_static.integer)
-               return;
-       num = crosshair.integer;
-       if (num < 1 || num > NUMCROSSHAIRS || cl.intermission)
-               return;
-       if (!cl.viewentity || !cl.entities[cl.viewentity].state_current.active)
-               return;
-       pic = r_crosshairs[num];
-       if (pic)
-               DrawQ_Pic((vid_conwidth.integer - pic->width * crosshair_size.value) * 0.5f, (vid_conheight.integer - pic->height * crosshair_size.value) * 0.5f, pic, pic->width * crosshair_size.value, pic->height * crosshair_size.value, crosshair_color_red.value, crosshair_color_green.value, crosshair_color_blue.value, crosshair_color_alpha.value, 0);
-}
-
-
-
-
index 5f22191d9fed84f7f88564429226af00a8eac945..dd0f04116a60d04d9153f66e1357925a41ac5638 100644 (file)
--- a/render.h
+++ b/render.h
@@ -171,9 +171,6 @@ void R_TimeReport(char *name);
 // r_stain
 void R_Stain(const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2);
 
 // r_stain
 void R_Stain(const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2);
 
-void R_DrawWorldCrosshair(void);
-void R_Draw2DCrosshair(void);
-
 void R_CalcBeam_Vertex3f(float *vert, const vec3_t org1, const vec3_t org2, float width);
 void R_DrawSprite(int blendfunc1, int blendfunc2, rtexture_t *texture, rtexture_t *fogtexture, int depthdisable, const vec3_t origin, const vec3_t left, const vec3_t up, float scalex1, float scalex2, float scaley1, float scaley2, float cr, float cg, float cb, float ca);
 
 void R_CalcBeam_Vertex3f(float *vert, const vec3_t org1, const vec3_t org2, float width);
 void R_DrawSprite(int blendfunc1, int blendfunc2, rtexture_t *texture, rtexture_t *fogtexture, int depthdisable, const vec3_t origin, const vec3_t left, const vec3_t up, float scalex1, float scalex2, float scaley1, float scaley2, float cr, float cg, float cb, float ca);
 
diff --git a/sbar.c b/sbar.c
index 47a45736bf02656c15a47da61e2a7fa0282ea137..95a79f36a91554872ec3f78b42c8815c6f945845 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -96,6 +96,12 @@ cvar_t sbar_alpha_fg = {CVAR_SAVE, "sbar_alpha_fg", "1", "opacity value of the s
 
 cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1", "shows scoreboard (+showscores) while dead"};
 
 
 cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1", "shows scoreboard (+showscores) while dead"};
 
+cvar_t crosshair_color_red = {CVAR_SAVE, "crosshair_color_red", "1", "customizable crosshair color"};
+cvar_t crosshair_color_green = {CVAR_SAVE, "crosshair_color_green", "0", "customizable crosshair color"};
+cvar_t crosshair_color_blue = {CVAR_SAVE, "crosshair_color_blue", "0", "customizable crosshair color"};
+cvar_t crosshair_color_alpha = {CVAR_SAVE, "crosshair_color_alpha", "1", "how opaque the crosshair should be"};
+cvar_t crosshair_size = {CVAR_SAVE, "crosshair_size", "1", "adjusts size of the crosshair on the screen"};
+
 void Sbar_MiniDeathmatchOverlay (int x, int y);
 void Sbar_DeathmatchOverlay (void);
 void Sbar_IntermissionOverlay (void);
 void Sbar_MiniDeathmatchOverlay (int x, int y);
 void Sbar_DeathmatchOverlay (void);
 void Sbar_IntermissionOverlay (void);
@@ -337,16 +343,22 @@ void sbar_newmap(void)
 
 void Sbar_Init (void)
 {
 
 void Sbar_Init (void)
 {
-       Cmd_AddCommand ("+showscores", Sbar_ShowScores, "show scoreboard");
-       Cmd_AddCommand ("-showscores", Sbar_DontShowScores, "hide scoreboard");
-       Cvar_RegisterVariable (&showfps);
-       Cvar_RegisterVariable (&showtime);
-       Cvar_RegisterVariable (&showtime_format);
-       Cvar_RegisterVariable (&showdate);
-       Cvar_RegisterVariable (&showdate_format);
-       Cvar_RegisterVariable (&sbar_alpha_bg);
-       Cvar_RegisterVariable (&sbar_alpha_fg);
-       Cvar_RegisterVariable (&cl_deathscoreboard);
+       Cmd_AddCommand("+showscores", Sbar_ShowScores, "show scoreboard");
+       Cmd_AddCommand("-showscores", Sbar_DontShowScores, "hide scoreboard");
+       Cvar_RegisterVariable(&showfps);
+       Cvar_RegisterVariable(&showtime);
+       Cvar_RegisterVariable(&showtime_format);
+       Cvar_RegisterVariable(&showdate);
+       Cvar_RegisterVariable(&showdate_format);
+       Cvar_RegisterVariable(&sbar_alpha_bg);
+       Cvar_RegisterVariable(&sbar_alpha_fg);
+       Cvar_RegisterVariable(&cl_deathscoreboard);
+
+       Cvar_RegisterVariable(&crosshair_color_red);
+       Cvar_RegisterVariable(&crosshair_color_green);
+       Cvar_RegisterVariable(&crosshair_color_blue);
+       Cvar_RegisterVariable(&crosshair_color_alpha);
+       Cvar_RegisterVariable(&crosshair_size);
 
        R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
 }
 
        R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
 }
@@ -1014,6 +1026,8 @@ extern float v_dmg_time, v_dmg_roll, v_dmg_pitch;
 extern cvar_t v_kicktime;
 void Sbar_Draw (void)
 {
 extern cvar_t v_kicktime;
 void Sbar_Draw (void)
 {
+       cachepic_t *pic;
+
        if(cl.csqc_vidvars.drawenginesbar)      //[515]: csqc drawsbar
        {
                if (cl.intermission == 1)
        if(cl.csqc_vidvars.drawenginesbar)      //[515]: csqc drawsbar
        {
                if (cl.intermission == 1)
@@ -1337,8 +1351,8 @@ void Sbar_Draw (void)
 
        Sbar_ShowFPS();
 
 
        Sbar_ShowFPS();
 
-       if(cl.csqc_vidvars.drawcrosshair)
-               R_Draw2DCrosshair();
+       if (cl.csqc_vidvars.drawcrosshair && crosshair.integer >= 1 && crosshair.integer <= NUMCROSSHAIRS && !cl.intermission && !r_letterbox.value && (pic = r_crosshairs[crosshair.integer]))
+               DrawQ_Pic((vid_conwidth.integer - pic->width * crosshair_size.value) * 0.5f, (vid_conheight.integer - pic->height * crosshair_size.value) * 0.5f, pic, pic->width * crosshair_size.value, pic->height * crosshair_size.value, crosshair_color_red.value, crosshair_color_green.value, crosshair_color_blue.value, crosshair_color_alpha.value, 0);
 
        if (cl_prydoncursor.integer)
                DrawQ_Pic((cl.cmd.cursor_screen[0] + 1) * 0.5 * vid_conwidth.integer, (cl.cmd.cursor_screen[1] + 1) * 0.5 * vid_conheight.integer, Draw_CachePic(va("gfx/prydoncursor%03i", cl_prydoncursor.integer), true), 0, 0, 1, 1, 1, 1, 0);
 
        if (cl_prydoncursor.integer)
                DrawQ_Pic((cl.cmd.cursor_screen[0] + 1) * 0.5 * vid_conwidth.integer, (cl.cmd.cursor_screen[1] + 1) * 0.5 * vid_conheight.integer, Draw_CachePic(va("gfx/prydoncursor%03i", cl_prydoncursor.integer), true), 0, 0, 1, 1, 1, 1, 0);
index dfdb4e56a63344de90e75094f7c7af0285681396..0a020fc0f1bb91737e274ab9b27b1ae294453d7b 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -40,7 +40,6 @@ extern cvar_t showdate;
 
 extern cvar_t crosshair;
 extern cvar_t crosshair_size;
 
 extern cvar_t crosshair;
 extern cvar_t crosshair_size;
-extern cvar_t crosshair_static;
 
 extern cvar_t scr_conalpha;
 extern cvar_t scr_conbrightness;
 
 extern cvar_t scr_conalpha;
 extern cvar_t scr_conbrightness;