Commit Graph

105 Commits

Author SHA1 Message Date
Bill Currie 94db9c8ab1 [quakefs] Add a data parameter to gamedir callbacks
While this didn't fix the problem for which I needed the data pointer,
having data pointers in callbacks is far too useful to throw out the
change.
2022-06-04 16:06:04 +09:00
Bill Currie 1e65ec22f9 [gl] Use a scrap for lightmaps
This gives a rather significant speed boost to timedemo demo1: from
about 2300-2360fps up to 2520-2600fps, at least when using
multi-texture.

Since it was necessary for testing the scrap, gl got the ability to set
the console background texture, too.
2022-05-11 00:33:47 +09:00
Bill Currie be7a7d8bec [renderer] Fix the other renderers for qwaq not loading gfx.wad
The whole draw system needs an overhaul :/
2022-05-09 16:30:05 +09:00
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 8f6ee4f5ac [gl] Work aground clang not liking variable structs with followers
Really, it's an ugly hack made uglier, but I don't feel like dealing
with it right now.
2022-03-31 02:56:14 +09:00
Bill Currie d8a4c8dbe9 [renderer] Clean up r_bsp a little
Move r_pcurrentvertbase into the sw renderer, cleaning up gl's use of
(not really needed there). Not ready to move r_bsp into the main bin yet
as there are linking issues since only the low-level code references any
of its symbols.
2022-03-17 13:09:20 +09:00
Bill Currie 5a57280aa9 [gl] Use glGenTextures to allocate texture numbers
While the scheme of using our own allocated did work just fine, fisheye
rendering uses glGenTextures which caused a texture id clash and thus
invalid operations (the cube map texture happened to be the same as the
console background texture). Sure, I could have just "fixed" the fisheye
init code, but this brings gl closer in line with glsl (which makes
extensive use of glGenTextures and glDeleteTextures). This doesn't fix
any texture leaks gl has (plenty, I imagine), but it's a step in the
right direction.
2022-03-15 13:29:05 +09:00
Bill Currie 56c39c34ba [renderer] Remove namehack.h
Finally. I never liked it (felt bad adding it in the first place), and
it has caused confusion with function and global variable names, but it
did let me get the render plugins working.
2022-03-14 14:31:23 +09:00
Bill Currie 755ef524e4 [video] Use views instead of conwidth and conheight
conwidth and conheight have been moved into vid.conview (probably change
the name at some time), and scr_vrect has been replaced by a view as
well. This makes it much easier to create 2d elements that follow the
screen size (taking advantage of a view's gravity) which will, in the
end, make changing the window size easier.
2021-07-10 18:04:34 +09:00
Bill Currie 5f93c115ff [util] Make developer flag names easier to manage
They're now an enum, and the flag part of the name is all lowercase, but
now the flag definitions and names list will never get out of sync.
2021-03-29 22:38:47 +09:00
Bill Currie e50430e00c [image] Add parameter to load only the header
I want to be able to calculate texture sizes without actually loading
the images.
2021-01-19 10:15:57 +09:00
Bill Currie 4f58429137 Fix an unhealthy pile of gcc 8 warnings.
While some of the warnings were merely annoying, some where actual bugs or
unearthed bugs in related code.
2018-08-20 00:05:00 +09:00
Bill Currie 3efb0c538f Separate file search from loading.
QFS_LoadFile (and its wrappers) now  take a file handle rather than a
path. This will make vpath usage a little cleaner to implement.
2014-01-28 16:22:05 +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 65bd29353c Make a start on putting the pieces together.
Still many undefined and multiply defined symbols, but there seems to be a
light in this darkness. I just hope it's not an oncoming train :)
2012-04-11 14:58:54 +09:00
Bill Currie 36504547a8 Rename the public symbols for gl, glsl and sw32.
Evil hack, but it does the job.
2012-04-11 14:58:54 +09:00
Bill Currie db4a463727 Remove VISIBLE from the files that will go into the plugins. 2012-04-11 14:58:54 +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 447ff2f2f5 Clean up global symbols for the gl renderer.
Where possible, symbols have been made static, prefixed with gl_/GL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing.
2012-02-18 11:48:52 +09:00
Bill Currie a694eed968 Add Draw_Picf to allow smooth placement on low-res consoles. 2012-02-06 19:32:30 +09:00
Bill Currie b9bb7d95bb Remove calls to Sbar_Changed from the libraries.
If this breaks things, we'll have to sort something out, but again, no libs
reaching into the exe.
2012-02-01 20:06:14 +09:00
Bill Currie bc2aca53c3 Add functions to create/destroy qpics.
The creation uses raw 8-bit data (and the system palette). Destroying a
qpic loaded via other means will probably produce nasal demons.
2012-02-01 17:46:15 +09:00
Bill Currie 7e406c20e5 Allow uncaching of qpics.
qpics loaded via Draw_CachePic can now be uncached via Draw_UncachePic.
2012-02-01 16:55:35 +09:00
Bill Currie 7e078c7f9c Revamp cshifts and implement in glsl.
The renderer should now be free of any direct access to client code. Even
3d rendering is now done via a function pointer.

The cshift code is done as a 2d screen function.
2012-01-28 20:45:14 +09:00
Bill Currie db8573b774 Make the cross-hair data sharable between renderers. 2011-12-26 21:43:15 +09:00
Bill Currie 933120d44f Fake vertex arrays for text and particles.
Getting gl_vaelements_max -1 to work produced a rather nasty surprise :P
2011-12-16 20:09:05 +09:00
Bill Currie 774f049646 Fix garbage at edges of conchar characters.
Move the texture coordinates in 1/4 of a pixel. To avoid unnecessary
calculations, pre-caclulate the character cell texture coordinates and
blast them into the the texture coordinate array.
2010-12-11 12:09:30 +09:00
Bill Currie cacd2fb895 FiztQuake's lerping system.
Seems to be mostly working. I get some funny results for zombies, but that
might be moving and turning at the same time causing issues.
2010-11-26 16:20:05 +09:00
Bill Currie 8c4fe2f844 Rename Sys_DPrintf to Sys_MaskPrintf.
We now have finer runtime control over what gets printed. Need to do a
SYS_DEV audit, creating new masks as apropriate.
2010-11-26 16:19:26 +09:00
Bill Currie 4b0320f341 glx, gly, glwidth and glheight are now gone too. also GL_BeginRendering 2009-12-23 08:20:29 +00:00
Bill Currie a2fa2d425b fix viewsize interaction with the cleaned up screen size handling 2009-12-23 06:29:11 +00:00
Bill Currie 018a0b3bb6 fix the missing crosshair 2009-12-23 01:26:14 +00:00
Bill Currie 28601c8ea4 more screen size cleanup 2009-12-22 13:12:03 +00:00
Bill Currie b14fcccd8f get qf compiling with gcc 4.4 2009-12-19 10:54:23 +00:00
Bill Currie 6d6dc27592 make startup and shutdown a little quieter 2007-11-06 10:39:49 +00:00
Bill Currie d66934942d nuke Con_Printf and Con_DPrintf and use Sys_* instead 2007-11-06 10:17:14 +00:00
Bill Currie 0301cd6fa8 fix hud scaling 2007-05-13 04:21:37 +00:00
Bill Currie b5809eaa4f this /should/ fix the scaling of high-res hud items 2007-05-13 01:29:29 +00:00
Bill Currie 02c41feabc make gamedir change a two phase operation so things can be done both before and after the cache is flushed. (still having problems with cached sounds, though) 2007-03-24 10:13:10 +00:00
Bill Currie 99c0954b47 the big dso visibility patch :). Sure, we have to have unique names for static builds, but with controlled visibitly we should get faster program loads (although this isn't C++, so it's not as bad) and complex plugins are cleaner. 2007-03-10 12:00:59 +00:00
Bill Currie 5062930bad bit more cleanup and some documentation 2006-12-03 06:25:57 +00:00
Bill Currie 7bca4cf8af clean up the draw interface a bit 2006-12-02 10:07:08 +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 8a237169c3 patches to allow for multiple view ports 2004-05-07 03:54:35 +00:00
Bill Currie a97b722d7b get the placement of the nice crosshairs right. make cs_data a square to
avoid weird mapping effects
2004-02-14 00:18:22 +00:00
Bill Currie f34335a0c9 provide a builtin to draw a crosshair. 2004-02-13 23:16:33 +00:00
Bill Currie 4cabb40303 break the crosshair draw code into separate functions and give sw and sw32
crosshair 3
2004-02-13 22:16:53 +00:00
Bill Currie 9784ba5954 Grievre's gamedir callback patch to fix mangled sounds on gamedir change
plus a couple minor tweaks I notcied needed doing.
2004-02-03 03:01:06 +00:00
Ragnvald Maartmann-Moe IV dc84232079 Whitespace, remove misleading .png extension from external conchars loader. 2003-09-20 04:29:42 +00:00