Don't draw crosshair if centerstring
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Don't draw crosshair if centerstring
Quicky tutorial shows how to not draw a crosshair if there is centerprint that is going to print.
FitzQuake implementation: Add the yellow ...
Untested. Worst tutorial ever.
FitzQuake implementation: Add the yellow ...
gl_screen.c wrote:/*
==============
SCR_DrawCrosshair -- johnfitz
==============
*/
void SCR_DrawCrosshair (void)
{
qboolean will_draw_centerstring = !((scr_centertime_off - host_frametime <=0 && !cl.intermission) || key_dest != key_game || cl.paused);
if (will_draw_centerstring)
return; // Centerprint is going to print, so exit out and don't draw.
if (!crosshair.value)
return;
GL_SetCanvas (CANVAS_CROSSHAIR);
Draw_Character (-4, -4, '+'); //0,0 is center of viewport
}
Untested. Worst tutorial ever.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..

-
Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Don't draw crosshair if centerstring
if you use TF's statusbar (which is set up via centerprints) this will make you unable to aim.
in FTE, centerprints of 4 lines or less are shifted up by a small amount to keep the text away from the cursor. this at least resolves the common case, but won't help mods that put essays in there.
in FTE, centerprints of 4 lines or less are shifted up by a small amount to keep the text away from the cursor. this at least resolves the common case, but won't help mods that put essays in there.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: Don't draw crosshair if centerstring
Great point. Anything that uses an improvised on-screen "QuakeC" Hud or indicator.
A single player example: Quoth's flashlight battery indicator.
A single player example: Quoth's flashlight battery indicator.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..

-
Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
3 posts
• Page 1 of 1
Return to Programming Tutorials
Who is online
Users browsing this forum: No registered users and 1 guest