Commit Graph

77 Commits

Author SHA1 Message Date
Bill Currie 12c84046f3 [cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.

As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.

The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).

While not used yet (partly due to working out the design), cvars can
have a validation function.

Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.

nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-24 19:15:22 +09:00
Bill Currie 495dd759f0 [renderer] Clean up FOV and viewport handling
Viewport and FOV updates are now separate so updating one doesn't cause
recalculations of the other. Also, perspective setup is now done
directly from the tangents of the half angles for fov_x and fov_y making
the renderers independent of fov/aspect mode. I imagine things are a bit
of a mess with view size changes, and especially screen size changes
(not supported yet anyway), and vulkan winds up updating its projection
matrices every frame, but everything that's expected to work does
(vulkan errors out for fisheye or warp due to frame buffer creation not
being supported yet).
2022-03-30 14:55:32 +09:00
Bill Currie ee51d06aa3 [renderer] Clean up a lot of recalc_refdef use
I think the widespread use of recalc_refdef (and force_fullscreen) was
the result of a rushed merge of the renderer and video code (I do seem
to remember sprinkling them around). This cleans the two out of the
client code.
2022-03-19 00:56:30 +09:00
Bill Currie 3414eb12a3 [renderer] Move r_ambient and r_drawflat to client code
It makes more sense for these cvars to be under client control via
r_refdef. Completely disabled in qw, and currently ignored in nq.
2022-03-09 22:51:21 +09:00
Bill Currie 2eae2e5d74 [renderer] Move some functions from plugins to main lib
One step in cleaning up vid_render_funcs.
2022-03-07 13:40:04 +09:00
Bill Currie 8d2791752e [particles] Merge particle spawning into client
After yesterday's crazy marathon editing all the particles files, and
starting to do another big change to them today, I realized that I
really do need to merge them down. All the actual spawning is now in the
client library (though particle insertion will need to be moved). GLSL
particle rendering is semi-broken in that it now does only points (until
I come up with a way to select between points and quads (probably a
context object, which I need anyway for Vulkan)).
2021-12-24 06:45:13 +09:00
Bill Currie 6b84ae5554 [renderer] Update crosshair color on palette changes
This gets the crosshair working in Vulkan (next commit) and fixes issues
with changing the palette (though I've never seen a different palette
for quate, there's still the change from "all black" to an actual
palette).
2021-12-24 06:45:13 +09:00
Bill Currie c9f1d770e0 Merge master into csqc-improvements
That was a mess
2021-03-25 22:01:31 +09:00
Bill Currie 91e3769c05 Recalculate the fov when the cvar changes.
This separate the FOV calculations from other refdef calcs, cleaning up the
renderer proper and making it easier for other parts of the engine (eg,
csqc) to update the fov.
2021-03-25 18:14:03 +09:00
Bill Currie 858ac19327 [renderer] Move r_screen and r_cvar into main bin
r_screen because of SCR_UpdateScreen, and r_cvar because the cvars
really should never have been in a plugin in the first place (and
r_screen needed access).
2021-01-12 16:14:46 +09:00
Bill Currie d6a1daaf30 Force a refdef update when nearclip or farclip change. 2012-08-29 09:55:17 +09:00
Bill Currie e730608dd7 Implement r_flatlightstyles from fitzquake. 2012-06-15 22:02:14 +09:00
Bill Currie 23a38738fc Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie 525dbcc13e Ensure code paths stay within the one renderer.
The gl renderer calling sw functions is bad news. Still all black, but I
think that's because palette setting is disabled.
2012-04-11 22:45:23 +09:00
Bill Currie 42868d308e Initialize the skins and particles subsystems. 2012-04-11 14:58:55 +09:00
Bill Currie 4d9c3408a1 Start putting the pieces back together.
The renderer now gets initialized and things sort of work (qw-client will
idle, though nothing is displayed). However, as the viddef stuff is broken,
it segs on trying to run the overkill demo.
2012-04-11 14:58:55 +09:00
Bill Currie 772af29cb3 Move the gl cvars into gl.
That gets rid of the gl_overbrite_f clash. They were put in r_cvar for
saving to the config file, but that was before seta existed.
2012-04-11 14:58:54 +09:00
Bill Currie 8e91fb7bc1 Get the basics linking.
Still, nothing will work: no plugins are loaded and they're all broken
anyway.

glx, sgl, glslx etc are going away, just the basics will be built: fbdev
(probably go away eventually), sdl, x11 and hopefully someday win. That's
actually the only reason anything links.
2012-04-11 14:58:53 +09:00
Bill Currie a4c280f2b2 Take the first step towards render plugins.
No clients link. Even if they did, nothing would work.
2012-04-11 14:58:53 +09:00
Bill Currie 5efc78b920 Move the call to R_Particles_Init_Cvars into R_Init_Cvars. 2012-02-01 20:05:11 +09:00
Bill Currie 151cc05882 Add support for vertex colors.
As I need to control the alpha, they're sent as rgba rather than quake
palette indices. Text works well. All other 2d stuff does not :(.
2011-12-28 09:04:26 +09:00
Bill Currie 669771681a split up and modernize configure.ac
Most of the guts of configure.ac have been moved to config.d and are then
brought in by m4_include. This will make maintaining configure.ac much easier.

Also drop use of PROGRAM and VERSION, using PACKAGE_NAME, PACKAGE_VERSION, and
on occasion, PACKAGE_STRING instead, and clean out some old files we no longer
need.
2010-08-19 15:01:43 +09:00
Bill Currie e0cfe795b0 fix a bogus range check. this could have caused an infinite loop 2009-12-23 06:28:11 +00:00
Bill Currie 3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie 1f9d75a7c7 add r_norefresh support to sw and sw32 and rename the console side of the
cvar to get around the evil in customtf
2004-04-16 03:24:10 +00:00
Ragnvald Maartmann-Moe IV 7b5535cb8f Less surprising default. 2004-02-29 05:32:23 +00:00
Ragnvald Maartmann-Moe IV 44c89c1904 Optimize fullbright testing for brushes, assorted other cleanups, test for
functions built into current GL drivers, as well as the old extensions, and
add incorrectly rendering BGRA support.
Whee!
2004-02-24 20:50:55 +00:00
Ragnvald Maartmann-Moe IV fef9b30bd7 QF, now complete with underbrights, thanks to Grievre.
Play with gl_overbright and gl_doublebright. That's an order.
2004-02-15 00:02:04 +00:00
Bill Currie 6063fb75d9 make the console run at full speed no matter what demo_speed is at. what a
lot of work for such a simple concept :P
2003-07-25 22:21:47 +00:00
Ragnvald Maartmann-Moe IV 6c7701a38b Prevent bad gl_max_size settings from causing buggy drivers to freak out. 2003-03-24 20:21:24 +00:00
Bill Currie 4bd1718475 re-arrange viewsize handling to fix the hud bug in glx 2003-02-11 21:24:27 +00:00
Bill Currie 0ea15c3f82 sw and gl fisheye patches from Arkadi Shishlov (arkadi@it.lv). I don't
think /I/ can play that way (dizzy:)
2003-01-15 16:53:34 +00:00
Bill Currie 761a7546dd re-arrange things so __attribute__ and __builtin_expect are properly
autoconfiscated so rcsid will continue to work with gcc 3.3
2003-01-15 15:31:36 +00:00
Bill Currie 71196fedf6 make gcc more anal about prototypes, string constants and function
visibility (ie, global functions must have a prototype)
2003-01-06 18:28:13 +00:00
Ragnvald Maartmann-Moe IV ef47bf6e12 gl_skymultipass -> gl_sky_multipass. Much nicer tab completion. 2002-10-10 19:49:36 +00:00
Ragnvald Maartmann-Moe IV 147f940510 Kill dead gl_occlusion cvar. 2002-08-23 21:55:59 +00:00
Ragnvald Maartmann-Moe IV 3c7d65a798 Whitespace. 2002-07-25 14:42:41 +00:00
Ragnvald Maartmann-Moe IV 1f8a1d613f Fix r_particles_nearclip being forced to max. 2002-07-08 00:05:33 +00:00
Ragnvald Maartmann-Moe IV fd1ded5c4a Add r_nearclip and r_particles_nearclip. Also put some limits on r_farclip. And fix id's insane max and min float, and some minor improvements in frustum setup in GL. 2002-06-26 22:20:12 +00:00
Ragnvald Maartmann-Moe IV 87741d2b90 Tweak r_firecolor to reduce haloing on rocket dlights. 2002-06-12 04:37:33 +00:00
Bill Currie 7a3b63418b `adequate' temporary fix for r_lightmap_components 1 2002-05-28 04:11:40 +00:00
Brian Koropoff ee5d0b7a99 Added r_farclip to control the far clipping plane. 2002-05-20 05:11:12 +00:00
Jeff Teunissen 7c134a6f95 Fix up the watervis stuff. Whoops! :) 2002-04-25 14:34:15 +00:00
Jeff Teunissen 5b069de40c Redo r_wateralpha so that it doesn't force its value based on the watervis
serverinfo. Instead, create a new cl_wateralpha float variable that is set to
r_wateralpha->value in Host_Frame, and use that float during rendering.
2002-04-25 12:51:04 +00:00
Bill Currie 29706477d4 gl_driver default is now configurable 2002-02-22 08:55:24 +00:00
Ragnvald Maartmann-Moe IV b13efc3a83 Particle updates. Some cleanups, small speedups, and reimplement id's effects. r_particle_styles 0 to see id's effects. 2002-01-04 03:32:59 +00:00
Bill Currie 9312681182 some more const correctness (in gl_sky_clip.c) and make the sky poly debug
drawing avialable via the gl_sky_debug cvar.
2002-01-03 18:18:45 +00:00
Ragnvald Maartmann-Moe IV f66b7a93e5 Major particle interface cleanup, several bugfixes, and minor performance improvements. Oh, check out "/help easter_eggs" (gl-only, at the moment). 2001-12-11 22:37:30 +00:00
Ragnvald Maartmann-Moe IV f9d3f9f017 Remove dead cvar. 2001-12-09 07:43:58 +00:00