extern int con_vislines;
-void DrawCrosshair(int num);
static void SCR_ScreenShot_f (void);
static void R_Envmap_f (void);
[Project]
FileName=darkplaces-dedicated.dev
Name=DarkPlaces
-UnitCount=147
+UnitCount=157
Type=1
Ver=1
ObjFiles=
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
OverrideBuildCmd=0
BuildCmd=
-[Unit158]
+[Unit112]
FileName=builddate.c
CompileCpp=0
Folder=Source Files
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 \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 \r
+!MESSAGE\r
!MESSAGE NMAKE /f "darkplaces-dedicated.mak" CFG="dedicated - Win32 Debug"\r
-!MESSAGE \r
+!MESSAGE\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 \r
+!MESSAGE\r
\r
# Begin Project\r
# PROP AllowPerConfigDependencies 0\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
# 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
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 \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 \r
+!MESSAGE\r
!MESSAGE NMAKE /f "darkplaces-sdl.mak" CFG="sdl - Win32 Debug"\r
-!MESSAGE \r
+!MESSAGE\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 \r
+!MESSAGE\r
\r
# Begin Project\r
# PROP AllowPerConfigDependencies 0\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
# 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
[Project]
FileName=darkplaces.dev
Name=DarkPlaces
-UnitCount=157
+UnitCount=156
Type=0
Ver=1
ObjFiles=
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
OverrideBuildCmd=0
BuildCmd=
-[Unit158]
+[Unit117]
FileName=builddate.c
CompileCpp=0
Folder=Source Files
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 \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 \r
+!MESSAGE\r
!MESSAGE NMAKE /f "darkplaces.mak" CFG="darkplaces - Win32 Debug"\r
-!MESSAGE \r
+!MESSAGE\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 \r
+!MESSAGE\r
\r
# Begin Project\r
# PROP AllowPerConfigDependencies 0\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
# 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
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);
R_Shadow_Init();
R_Sky_Init();
GL_Surf_Init();
- R_Crosshairs_Init();
+ Sbar_Init();
R_Light_Init();
R_Particles_Init();
R_Explosion_Init();
- Sbar_Init();
R_LightningBeams_Init();
Mod_RenderInit();
}
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)
prvm_cmds.o \
prvm_edict.o \
prvm_exec.o \
- r_crosshairs.o \
r_explosion.o \
r_lerpanim.o \
r_light.o \
}
-#define OPTIONS_ITEMS 40
+#define OPTIONS_ITEMS 39
static int options_cursor;
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++)
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);
+++ /dev/null
-
-#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);
-}
-
-
-
-
// 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);
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_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);
}
extern cvar_t v_kicktime;
void Sbar_Draw (void)
{
+ cachepic_t *pic;
+
if(cl.csqc_vidvars.drawenginesbar) //[515]: csqc drawsbar
{
if (cl.intermission == 1)
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);
extern cvar_t crosshair;
extern cvar_t crosshair_size;
-extern cvar_t crosshair_static;
extern cvar_t scr_conalpha;
extern cvar_t scr_conbrightness;