Commit Graph

28 Commits

Author SHA1 Message Date
Bill Currie bff0847761 [cvar] Clean up most misinterpreted cvar types
The misinterpretations were due to either the cvar not being accessed
directly by the engine, but via only the callback, or the cvars were
accesssed only by progs (in which case, they should be float). The
remainder are a potential enum (hud gravity) and a "too hard basket"
(rcon password: need to figure out how I want to handle secret strings).
2022-04-24 20:04:06 +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 6d5ffa9f8e [build] Move to non-recursive make
There's still some cleanup to do, but everything seems to be working
nicely: `make -j` works, `make distcheck` passes. There is probably
plenty of bitrot in the package directories (RPM, debian), though.

The vc project files have been removed since those versions are way out
of date and quakeforge is pretty much dependent on gcc now anyway.

Most of the old Makefile.am files  are now Makemodule.am.  This should
allow for new Makefile.am files that allow local building (to be added
on an as-needed bases).  The current remaining Makefile.am files are for
standalone sub-projects.a

The installable bins are currently built in the top-level build
directory. This may change if the clutter gets to be too much.

While this does make a noticeable difference in build times, the main
reason for the switch was to take care of the growing dependency issues:
now it's possible to build tools for code generation (eg, using qfcc and
ruamoko programs for code-gen).
2020-06-25 11:35:37 +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 ad7834631c Clean out some dead code and vars from the registered checks.
The data needed for the checks has been gone from QF for a very long time
(since Jan 2000), and good riddance to it, really: I suspect it's in
violation of id's copyright on the game data (ok, it might be fair use, but
still...).
2013-02-19 13:39:09 +09:00
Bill Currie f921005a5d Nuke com.c.
It's contents have been moved into game.c and massaged appropriately.
2011-09-11 14:55:13 +09:00
Bill Currie 8d853589e3 Use the gamedir callback for the serverinfo key.
This gits rid of a bit of nastiness in the gamedir code :)
2011-09-04 09:58:13 +09:00
Bill Currie fb9a095586 Fix include style mixup.
"" for local, <> for system
2011-09-04 09:58:11 +09:00
Bill Currie 907efe03a4 use "must" instead of "should" 2010-01-13 06:43:54 +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 851d203916 work towards a more secure qfs 2003-02-14 22:36:10 +00:00
Bill Currie 6a687f5e45 rename all the globals in quakefs.[ch] to be QFS_* or qfs_* 2003-02-14 19:46:07 +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 2e0ed3377c basic (very!) implementation of the new filesystem directory struture code.
All the details of game directories will be fully configurable (search
paths and gamecode file name currently supported). Downloading of skins to
qw/skins only currently broken (will download to $gamedir/skins for now).
2003-01-10 22:47:18 +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
Bill Currie ec47e08e1c go back to using QFile, quakeio.h and quakefs.h 2002-08-27 07:16:28 +00:00
Bill Currie dcd9b0040e rewrite the info strings to use hash tables instead of a static string.
This required changes to the api (info_t instead of char *) but should be
a net gain in speed (not a lot, admittedly: it was pretty fast to begin
with, but this paves the way for some other changes I have in mind).
2001-11-04 07:50:39 +00:00
Bill Currie 78a3e398d5 * taniwha gets medieval on extern 2001-10-28 04:23:37 +00:00
Bill Currie b1f4a778f9 the rcsid commit from hell }:> 2001-09-28 06:26:31 +00:00
Ragnvald Maartmann-Moe IV 2f5e0cf603 whitespace and headers. 2001-08-29 02:12:57 +00:00
Bill Currie fb26d8b18a make Info_Set* take flags indicating wether funchars should be stripped or not 2001-07-31 18:27:49 +00:00
Bill Currie 1c9e1b176f fear the mighty const correct patch 2001-07-15 07:04:17 +00:00
Adam Olsen 155b46b8c8 More diff noise reductions. yay! 2001-07-15 01:48:03 +00:00
Joseph Carter 05adfd0e53 quakefs.h -> vfs.h
quakeio.h -> vfile.h

More diff reduction between trunk and my VFS code.  Also took the time to
put some headers in order and fix a few #include's pointed out by moving
things around a bit.
2001-05-30 04:34:06 +00:00
Joseph Carter 2bc55b7828 Cvar cleanups.. NULL is now used in place of 0 for callbacks, this should
make Cvar_Get's a lot easier to read.
2001-04-10 23:39:30 +00:00
Bill Currie e939ccc40a cvars now sport a callback function that gets called whenever the cvar changes
or on initial get.
2001-03-31 01:02:52 +00:00
Bill Currie 4f2e22bfb8 merge and move quakefs.c into libQFutil where it belongs. at long last 2001-03-30 00:44:35 +00:00
Bill Currie b432d0ea17 pull the game specific stuff out of quakefs.c in preparation for merging it 2001-03-30 00:30:38 +00:00