Commit Graph

94 Commits

Author SHA1 Message Date
Bill Currie e1a0bde5ee [sound] Remove a pile of unwanted sound.h includes
This does mean that the gl and sw renderers can no longer call
S_ExtraUpdate, but really, they shouldn't be anyway. And I seem to
remember it not really helping (been way too long since quake ran that
slowly for me).
2022-06-03 15:43:53 +09:00
Bill Currie 7240d2dc80 [model] Move plane info into mnode_t, and visframe out
The main goal was to get visframe out of mnode_t to make it thread-safe
(each thread can have its own visframe array), but moving the plane info
into mnode_t made for better data access patters when traversing the bsp
tree as the plane is right there with the child indices. Nicely, the
size of mnode_t is the same as before (64 bytes due to alignment), with
4 bytes wasted.

Performance-wise, there seems to be very little difference. Maybe
slightly slower.

The unfortunate thing about the change is the plane distance is negated,
possibly leading to some confusion, particularly since the box and
sphere culling functions were affected. However, this is so point-plane
distance calculations can be done with a single 4d dot product.
2022-05-22 12:41:23 +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 f47e03e606 [model] Remove 64k limit on visible leafs
Modern maps can have many more leafs (eg, ad_tears has 98983 leafs).
Using set_t makes dynamic leaf counts easy to support and the code much
easier to read (though set_is_member and the iterators are a little
slower). The main thing to watch out for is the novis set and the set
returned by Mod_LeafPVS never shrink, and may have excess elements (ie,
indicate that nonexistent leafs are visible).
2021-07-26 11:32:05 +09:00
Bill Currie 6fea5f5e1a [build] Add -Wformat-non-literal option
While this caused some trouble for pr_strings and configurable strftime
(evil hacks abound), it's the result of discovering an ancient (from
maybe as early as 2004, definitely before 2012) bug in qwaq's printing
that somehow got past months of trial-by-fire testing (origin understood
thanks to the warning finding it).
2021-03-29 17:27:06 +09:00
Bill Currie 34dc7cf2df [models] Move brush data into its own struct
This is a big step towards a cleaner api. The struct reference in
model_t really should be a pointer, but bsp submodel(?) loading messed
that up, though that's just a matter of taking more care in the loading
code. It seems sensible to make that a separate step.
2021-02-01 19:31:11 +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 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 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 71be8510e5 Don't do anything when the message is empty.
This clears up some fun valgrind noise in SV_Print.
2011-09-07 09:41:06 +09:00
Bill Currie 0f7390dd60 Clean up all the "set but not used" warnings.
gcc on my system is failing to treat this specific warning as an error :/
2011-06-19 10:48:02 +09:00
Bill Currie 70cc48826c I think I finally got the protocol side of map changes right
"pause" qtv recorders while changing maps
send changing/reconnect via the qtv extensions
2010-01-13 06:50:44 +00:00
Bill Currie 53cd9be90a Progress on map changing with qtv clients
Rename SV_DemoSendMessages to SVR_SendMessages, and make sure SVR_SendMessages
and SV_qtvSendMessages get called when SV_SendMessagesToAll is called.
2010-01-13 06:45:43 +00:00
Bill Currie 997102fea8 audit the usage of "only"
There are still a few iffy places (notably around certain prepositions), but
the relevant sentences are now much easier to read.
2010-01-13 06:42:26 +00:00
Bill Currie 1a307e306f Con_Printf actually has a use after all: it prints to the console /only/ (no redirects, etc) 2007-11-07 08:19:17 +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 839c00b97b back out the large packet/entity related patches. they've provent to be troublesome and it seems FTE has a better solution. 2007-05-07 14:58:53 +00:00
Bill Currie 52f7bd4bb4 MAX_ENTITIES patch from phrosty 2007-04-19 07:36:12 +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 501180aaac gcc-4.0 fixes. even found some bugs :) (names /not/ mangled this time) 2005-06-08 06:35:48 +00:00
Bill Currie a409ea4a74 spawn code complete 2005-05-08 08:04:50 +00:00
Bill Currie 73a34b86e8 recorder interface to ease writing server state to mvds and qtv. ones this
is working properly, adding qtv support will be trivial.
2005-05-01 09:07:20 +00:00
Bill Currie 12eb4eb72e serious cleanup of demo_t in preparation for converting it to a more
general recorder struct to be shared between the demo recorder and qtv
proxy connection(s)
2005-05-01 04:27:05 +00:00
Bill Currie 629a2db63d first stage of rework for qtv support. there might be slight breakage in
mvds, more testing is needed, but things seem ok.
2005-04-30 08:45:17 +00:00
Bill Currie 9dcd2333d9 Serious mvd surgery. Interpolation of player position/angle is no longer
done and playerinfo is now written at the proper time, fixing the
"lagged dlights" issue (as Spike puts it:). Hack to fix broken mvds removed
as it should no longer be needed if everybody fixes their mvd servers :)
2005-04-27 09:54:37 +00:00
Bill Currie 23d728022a small cleanups 2005-04-26 02:54:14 +00:00
Bill Currie 934f5431d4 little cleanups 2005-04-25 07:55:56 +00:00
Bill Currie ca46503607 add -Wsign-compare (default for -Wall only in C++) and fix up the warnings 2004-07-13 19:14:01 +00:00
Bill Currie 6fd41b9e9d don't call SV_SendDemoMessage when it's only going to bail 2004-05-12 19:57:21 +00:00
Bill Currie c188159384 various mvd fixes for bots, especially getting the angles written 2004-04-06 22:02:45 +00:00
Bill Currie c1d5f230a9 minor cleanups 2004-03-31 19:14:55 +00:00
Bill Currie c4807a095d if we're not going to check the pvs, why bother calculating it? 2004-03-07 00:25:09 +00:00
Bill Currie a378581570 fix a couple places where reliable messages were getting sent to bots.
fixes the segs on bot_add in fbxa
2004-02-26 23:15:58 +00:00
Bill Currie b502cfc3ce move ClientReliable* from sv_nchan to MSG_Reliabe* in msg_backbuf so the
backbuffer code can be shared between qw-server and qtv
2004-02-22 05:40:08 +00:00
Daniel Anderson 85beae40f0 Added the missing null terminator for a reliable message send. 2004-01-05 00:25:58 +00:00
Bill Currie c917233165 make sure outputbuf's mem gets initialized (oops:) 2003-12-22 23:40:20 +00:00
Bill Currie 82975dfe1f send the correct number of bytes 2003-11-25 03:22:51 +00:00
Bill Currie ce745c8078 better command output redirection handling: maplist over rcon should show
all (or most, there are limits still) of the maps on a server with many
maps.

move the optional progs funcs into sv_funcs_t and add UserInfoChanged,
ChatMessage and LocalinfoChanged callback support.

clean up PF_setinfo (and SV_SetInfo_f and SV_Localinfo_f) using shared code
where possible und to use the UserInfoChanged and LocalinfoChanged
callbacks.

add chat message callback to SV_Say. if it returns zero, normal chat
handling is done, otherwise it's assumed to have been handled by the progs.

provide a hook for unkown user commands. non-zero return means it's been
handled.
2003-11-21 06:09:21 +00:00
Bill Currie 8e0a464ad7 get server clients updated properly 2003-08-21 20:35:36 +00:00
Bill Currie 63c804310c more inline avoidance 2003-05-07 04:24:50 +00:00
Ragnvald Maartmann-Moe IV 5fb8aa07f3 Code style, people. Love it or leave it! 2003-03-21 21:25:44 +00:00
Bill Currie 2173151560 get packet logging working with mvds 2003-03-16 03:17:50 +00:00
Bill Currie 6c028a57bb bot player stats seem to be working working 2003-03-05 03:56:50 +00:00
Bill Currie 389542fda7 first step in creating an interface for the snagging of client slots by
the progs
2003-03-03 17:08:45 +00:00
Bill Currie f4fdbeee4d make the low level network code and packet logging less incentuous 2003-02-10 21:41:22 +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
Bill Currie ca4b3acd6c big protototype cleanup. Now, except for a few cases, all non-static
prototypes are in headers files.
2002-11-05 19:12:51 +00:00
Bill Currie 80d2f8e27d make it so the demo recorder and normal protocol use common code to
calculate the client stats
2002-10-07 22:15:19 +00:00