Commit Graph

72 Commits

Author SHA1 Message Date
Bill Currie 4491ce213b [client] Merge cl_screen.c
The client state that was accessed by cl_screen is now put in viewstate
and maintained by the client before calling CL_UpdateScreen.
2022-11-02 15:11:09 +09:00
Bill Currie a17deb3ef2 [nq] Don't double-allocate timedemo data buffer
Looks like a copy/paste error (wild guess: got my fingers tangled in
vim).
2022-05-12 22:48:31 +09:00
Bill Currie e9ad7b748b [renderer] Use scene_t to set the model data
This replaces *_NewMap with *_NewScene and adds SCR_NewScene to handle
loading a new map (for quake) in the renderer, and will eventually be
how any new scene is loaded.
2022-05-05 14:46:02 +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 d69355f521 [renderer] Support multiple entity queues
While there's currently only the one still, this will allow the entities
to be multiply queued for multi-pass rendering (eg, shadows). As the
avoidance of putting an entity in the same queue more than once relies
on the entity id, all entities now come from the scene (which is stored
in cl_world in the client code for nq and qw), thus the extensive
changes in the clients.
2022-03-05 02:05:39 +09:00
Bill Currie 43a329dcb5 [client] Get the basic chase camera working
The more advanced modes are rather broken (continuous spinning), but
they may have been for a while. The bulk of the various changes were due
to renaming viewstate's origin and angles to make their meaning more
explicit.
2022-03-01 11:43:23 +09:00
Bill Currie 413cea6b4a [qw,nq] Connect up key_demo
And clean up some remaining keydest refs (still a few more to go).

Need to sort out default bindings for key_demo, though.
2021-11-26 20:27:42 +09:00
Bill Currie 972b0f8a70 [util] Make sizebuf and msg sizes unisgned
And clean up the mess.
2021-04-04 15:53:53 +09:00
Bill Currie dac9166339 [nq] Sort out some of the issues with keydest
Switches to "game" properly when starting a new game after playing
menus. Of course, basic bindings are still broken in "demo".
2021-03-29 22:39:43 +09:00
Bill Currie 5d703c1f3e First stab at keydest sanitization 2021-03-27 20:43:51 +09:00
Bill Currie 5bf21931c7 [renderer] Remove more old fields from entity_t
The only transform related field remaining is old_origin. This also
brings the renderer closer to using simd (lots of stuff to fix still,
though).
2021-03-20 00:08:21 +09:00
Bill Currie 8466de2325 [client] Use vec4_t in entity_state_t
And clean up the mess (sort of:P)
2021-03-11 16:19:49 +09:00
Bill Currie bb6c6963d2 [model] Clean up the globals around model loading
Covers only the generic load code (alias etc to follow), but this should
take care of a lot of issues in the future.
2021-02-01 14:39:00 +09:00
Bill Currie 7970525ef4 [util] Make va thread-safe
It now takes a context pointer (opaque data) that holds the buffers it
uses for the temporary strings. If the context pointer is null, a static
context is used (making those uses of va NOT thread-safe). Most calls to
va use the static context, but all such calls have been formatted
consistently so they are easy to find when it comes time to do a full
audit.
2021-01-31 16:05:48 +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 59e85b7d5e Fix a pile of dead assignments.
Some were actual bugs!
2018-09-08 22:23: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 6edf8133aa Handle hipnotic demos when checking for .dem.
hipdemo1.dem has a single leading space. They probably did "%2d" for the
track number, as there is no space before the minus sign in the other
hipnotic demos.
2013-01-31 17:03:59 +09:00
Bill Currie ace8d9ebc5 Implement dynamic IMTs.
Now the user can create and destroy IMTs at will, though currently
destroying IMTs is currently all or nothing (imt_drop_all).

An IMT is created via imt_create which takes the keydest name (key_game
etc), the name of the IMT (must be unique for all IMTs) and optionally the
name of the IMT to which the key binding search will fall back if there is
no binding in the current IMT, but must be already defined and on the same
keydest. This means that IMTs now have user determined fallback paths. The
requirements for the fallback IMT prevent loops and other weird behaviour.

Actual key binding via in_bind is unaffected. This is why the IMT name must
be unique across all IMTs.

The "imt" command works with the key_game keydest, but imt_keydest is
provided for specifying the active IMT for a specific keydest.

At startup, default IMTs are setup to emulate the previous static IMTs so
old configs will continue to work (mostly). New config files will be
written with commands to drop all of the current IMTs and build new ones,
with the bindings and active IMT set as well.
2013-01-16 19:48:54 +09:00
Bill Currie cf48d5ab04 Make "playdemo" without args replay the last demo. 2012-06-29 18:44:42 +09:00
Bill Currie ca1a5dfe8f Fix the missing console prompt on demo stop.
CL_StopPlayback was incorrectly calling Key_SetKeyDest with key_game. As
CL_SetState calls Key_SetKeyDest with the appropriate parameter,
CL_StopPlayback calling Key_SetKeyDest is actually redundate, so just
change key_game_target back to IMT_0.
2012-06-16 16:05:24 +09:00
Bill Currie fc67f8ce93 Fix up some comments.
Lowsy grammar and inaccurate info...
2012-06-15 22:02:18 +09:00
Bill Currie 3a1e065a57 Use Sys_DoubleTime instead of realtime for timedemos.
Currently, realtime is not really real time thanks to demo_speed.
2012-06-15 22:02:18 +09:00
Bill Currie 01466e4e43 Factor out the next packet check code. 2012-06-15 22:02:18 +09:00
Bill Currie e04777571d Factor out the demo packet reading. 2012-06-15 22:02:18 +09:00
Bill Currie cc1bf68d1f Dead code nukage.
Commented out even in q1source :P
2012-06-15 22:02:18 +09:00
Bill Currie 93e35d7ec0 Add demo format auto-detection.
nq now rejects anything that doesn't look like a .dem, and qw not only
rejects anything that looks like neither a .qwd nor a .mvd, but even
detects which one is being played by the contents rather than the file name
(foo.mvd.gz would be mis-detected as a qwd!!).
2012-06-03 20:04:02 +09:00
Bill Currie dfc8f8bb20 Minor cleanup of CL_Record() and give nq default demo names. 2012-06-03 20:03:43 +09:00
Bill Currie 82a41017ec Create a proper ca_active state.
Yay, no more ugly "SIGNONS" hack for whether to render :)
2012-06-03 20:01:42 +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 423e08ce21 Add demo to "movie" conversion.
It currently writes a series of png files (QF/qfmvNNNNNN.png), at a fixed
rate of 30fps, with no sound recording.
2012-01-05 19:19:37 +09:00
Bill Currie c3d41326b3 Do key dest changing properly.
key_demo wasn't so well thought out. This seems to be much better (and nq
is known to be working nicely).
2011-12-10 16:14:25 +09:00
Bill Currie 16c8b2a18d Use the new demo imt.
There are some problems with menus and the console messing up the key_dest
state (they assume console/menu or game, nothing else), but otherwise
things seem to work.
2011-12-10 15:18:50 +09:00
Bill Currie 9ace9f2bfa Fix some bad timing with a dstring_delete.
Opps :P, double free.
2011-09-04 09:58:12 +09:00
Bill Currie 514f085e88 Reduce the diffs in cl_demo.c.
Starting to look like a change in protocol rather than a complete rewrite.
2011-09-04 09:58:12 +09:00
Bill Currie d88c09a033 Fix the crash on timedemo interrupting a timedemo. 2011-06-04 18:14:30 +09:00
Bill Currie 2ecdec91a8 Clean up the demo api a little.
This way, I can be more assured of what might be called from outside
cl_demo.c.
2011-06-03 22:47:32 +09:00
Bill Currie 0e677ce0f0 Give nw qw's timedemo statistics. 2010-12-14 08:59:15 +09:00
Bill Currie a51e888a1b Nuke MAX_OSPATH and clean up the mess. 2010-08-25 13:31:08 +09:00
Bill Currie d66934942d nuke Con_Printf and Con_DPrintf and use Sys_* instead 2007-11-06 10:17:14 +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 34d2e0163c improve the timedemo fps output a little 2003-08-13 16:08:06 +00:00
Bill Currie c2c3a62956 nuke Qexpand_squiggle. instead, expand ~ to $HOME on qfs initialization and
cache the value.

don't call Qopen directly in the engine. instead call QFS_Open (generic) or
QFS_WOpen (write only, zip flag).

rework QFS_NextFilename to use a dstring (avoiding a potential buffer
overflow), support 10000 files and work from the top-level fs_userpath
directory. adjust QFS_WriteFile and QFS_WriteBuffers etc to suit.

make sw32 screenshots actually get written.

hopefully everything gets written to the right places :)
2003-05-23 17:17:01 +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 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