Commit Graph

15 Commits

Author SHA1 Message Date
Bill Currie 8acd5c558b [scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).

While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 22:24:36 +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 3c86764eb2 [scene] Move entity_t etc into scene headers
I meant to do this a while ago but forgot about it. Things are a bit of
a mess in that the renderer knows too much about entities, but
eventually the renderer will know about only things to render (meshes,
particles, etc).
2022-03-29 14:43:38 +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 098ceed5ff [client] Merge nq and qw temp entity handling
This finally gets cl_tent merged away.
2021-03-10 18:04:18 +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 3eb859a88f Move the entity transform setup into the clients.
This has several benifits:
  o The silly issue with alias model pitches being backwards is kept out
    of the renderer (it's a quakec thing: entites do their pitch
    backwards, but originally, only alias models were rotated. Hipnotic
    did brush entity rotations in the correct direction).
  o Angle to frame vector conversions are done only when the entity's
    angles vector changes, rather than every frame. This avoids a lot of
    unnecessary trig function calls.
  o Once transformed, an entity's frame vectors are always available.
    However, the vectors are left handed rather than right handed (ie,
    forward/left/up instead of forward/right/up): just a matter of
    watching the sign. This avoids even more trig calls (flag models in
    qw).
  o This paves the way for merging brush entity surface rendering with the
    world model surface rendering (the actual goal of this patch).
  o This also paves the way for using quaternions to represent entity
    orientation, as that would be a protocol change.
2011-12-15 17:09:01 +09:00
Bill Currie 765b9ebb65 Split up the qw entity handling code.
More pre-merge organization.
2011-09-04 09:58:11 +09:00
Bill Currie 2383340031 mvd playback support. seems to work (get some weird entities hanging around
but I suspect that's the mod used in the demo I was testing with), but
probably needs some cleanup.
2002-10-02 21:56:45 +00:00
Bill Currie c5aec15569 This prepares for moving the net_svc code to a branch allowing both network
code cleanups and general performance work to be developed in relative peace.
While cleaning up the networking code /is/ important, fixing QF's perfomance
issues is of much higher priority.
2001-11-07 08:24:56 +00:00
Adam Olsen dd19f7b500 - convert svc_deltapacketentities
- add a Host_NetError that dumps a packet log and disconnects, and use
  it instead of Host_EndGame in most cases
- fix a couple multiply-defined vars
2001-10-24 15:23:02 +00:00
Adam Olsen 818f5de658 - rename CL_ParsePacketEntities to CL_ParseDeltaPacketEntities
- fix various spots in the above that called Host_EndGame but didn't
  return
- switched the order of modellist and soundlist in net_svc*, to
  conform with the rest of the files
- create a new CL_ParsePacketEntities, that only handles
  svc_packetentities (so it's much simpler).  it uses net_svc*
2001-10-21 14:21:30 +00:00
Ragnvald Maartmann-Moe IV f6374b48ce First pass at updating nq particles. Compiles. Crashes. Taniwha wanted a look. Flee in terror.
Also has bunches of cleanups, including string.h/strings.h ifdefs, whitespace, and removal of pointless comments.
2001-05-09 05:41:34 +00:00
Bill Currie f78b973978 move the api headers into include/QF and clean up (most of) the resulting mess.
target specific files that I don't build won't compile yet. just put QF/
infront of the offending headers.

Also move ver_check into libqfutils
2001-03-27 20:33:07 +00:00
Bill Currie 87854e1a0c initial checkin of most recent newtree and nuq(?) source 2001-02-19 21:15:25 +00:00