Commit graph

123 commits

Author SHA1 Message Date
Bill Currie
72f6048a20 [scene] Put lights into the bsp tree via efrags
This eliminates the O(N^2) (N = map leaf count) operation of finding
visible lights and will later allow for finer culling of the lights as
they can be tested against the leaf volume (which they currently are
not as this was just getting things going). However, this has severely
hurt ad_tears' performance (I suspect due to the extreme number of
leafs), but the speed seems to be very steady. Hopefully, reconstructing
the vis clusters will help (I imagine it will help in many places, not
just lights).
2023-07-22 17:53:07 +09:00
Bill Currie
c0f8d102ad [scene] Implement Scene_FreeAllEntities (and use it)
I guess I wasn't sure how to find all the allocated entities from within
the registry, but it turned out to be trivial. This takes care of leaked
static entities (and, in a later commit, leaked light entities, which is
how I found the problem).
2023-07-22 16:50:18 +09:00
Bill Currie
706995f6b3 [client] Correct the description of move.up axis
My 3d mouse has +Z as down (makes sense, really), which is what I set
the code to, but I guess I forgot to correct the description.
2023-07-12 00:40:37 +09:00
Bill Currie
bf05da26cc [ui] Make Canvas_SetLen operate on only one canvas
I plan on using sub-canvases to fix the imui window overlap issue and
don't want the windows being affected by (eg) hud canvas size changes.
2023-07-08 20:56:40 +09:00
Bill Currie
9ff38418d3 [client] Move cshift into client screen canvas
This fixes cshifts affecting the console and debug canvases. The
crosshair and center print have also been moved for the same reason.
2023-07-08 14:32:02 +09:00
Bill Currie
3138c7ae3b [client] Clean up screen view creation 2023-07-08 14:04:29 +09:00
Bill Currie
0b0271ee76 [console] Provide control of cursor visibility
It's usually desirable to hide the cursor when playing quake, but when
using the console, or in various other states, being able to see the
cursor can be quite important.
2023-06-30 14:57:04 +09:00
Bill Currie
ecb9a15946 [model] Clean up the brush leaf api a little
Those functions now all take mod_brush_t since they don't work with any
other type of model.
2023-06-28 21:45:41 +09:00
Bill Currie
dbd3d6502a Nuke qboolean from orbit
I never liked it, but with C2x coming out, it's best to handle bools
properly. I haven't gone through all the uses of int as bool (I'll leave
that for fixing when I encounter them), but this gets QF working with
both c2x (really, gnu2x because of raw strings).
2023-06-13 18:06:11 +09:00
Bill Currie
7d4c1d79b1 [plist] Use reference counts for items
This makes it much easier to share items between property lists (eg,
targets and the main entity list in cl_light).
2023-03-13 11:26:13 +09:00
Bill Currie
99d32d5e54 [client] Add a comment on light attenuation
Saves me having to look in the shader every time.
2023-02-14 12:45:04 +09:00
Bill Currie
a561558748 [console] Switch to using a canvas for the console
While the console background is broken in that alpha doesn't work, it's
now rendered correctly in all renderers.
2023-01-22 03:45:50 +09:00
Bill Currie
d10cfb348e [client] Ensure status char buffers are cleared
Fixes uninitialized values when hud_pl is enabled for overkill in qw (pl
is never updated, so it never gets set).
2023-01-21 16:33:45 +09:00
Bill Currie
03e867f0f8 [ui] Remove some extra debug outlines
Forcing hidden views and doing the outlines for the screen canvas were
part of sorting out weirdnesses with canvases and component sub-pools.
2023-01-21 11:20:09 +09:00
Bill Currie
3c8f02c655 [client] Switch to using canvases for screen and hud
Canvases provide layered rendering as for each canvas all components are
rendered in turn.
2023-01-21 03:43:18 +09:00
Bill Currie
4949f52b58 [console] Move gib hud control into hud
I don't know why it was ever in console.
2023-01-21 02:57:05 +09:00
Bill Currie
31c1420682 [client] Further decouple screen and console
The wording might seem a little odd, but cl_screen is really the full 2D
client HUD while the console is completely independent of the client and
shouldn't know that the client even exists. Ideally, the resize events
would be handled by the canvas system, to which end this is a small
step.
2023-01-16 13:29:20 +09:00
Bill Currie
24a85dbadc [ui] Add a component set for passage hierarchy refs
While "set" is a tad strong (there's just the one component for now), I
had missed the changes when adding ECS systems. Fixes the segfault at
the end of demo1 (ie, when any center text is printed).
2022-12-16 18:12:38 +09:00
Bill Currie
61f61baf48 [client] Remove hud_href component
I had missed this when adapting the ecs system for modular systems.
2022-12-15 12:50:27 +09:00
Bill Currie
41d25df0d2 [ui] Attach text views to passage entities
Instead of creating new entities for the text views. This approximately
halves the number of entities required to display flowed text, but also
tests the ability to have an entity in multiple hierarchies (the goal of
the ECS component and system changes).
2022-12-14 22:38:37 +09:00
Bill Currie
b230fe18ce [ecs] Split component registration from pool creation
While this does require an extra call after registering components, it
allows for multiple component sets (ie, sub-systems) to be registered
before the component pools are created. The base id for the registered
component set is returned so it can be passed to the subsystem as
needed.
2022-12-13 22:58:44 +09:00
Bill Currie
bb677a1a7c [ecs] Move href_comp into hierarchy_t
This means that the component id used for hierarchy references must be
passed to Hierarchy_New and Hierarchy_Copy, but does all an entity to
have more than one hierarchy, which is useful for canvases (hierarchies
of views) in the 3d world (the canvas root would have a 3d hierarchy
reference and a 2d (view) hierarchy reference).
2022-12-12 00:20:20 +09:00
Bill Currie
7a64bb1149 [client] Use realtime for net icon check
viewstate's time is from cl.time which is not what's used to set
last_servermessage (that uses realtime). After careful investigation, I
found that cl.time is not at all suitable and that the original id code
used realtime (I think it was just me being lazy when I merged the
code). Fixes the stuck net icon.
2022-12-01 17:52:40 +09:00
Bill Currie
07fd93a56f [client] Use a separate explosion type for nq
quake changes rocket and grenade models to explosion models, but
quakeworld does not. This resulted in nq drawing two explosion sprites
instead of one. Separating the types allows nq to skip adding a sprite
for the explosion.
2022-12-01 15:59:14 +09:00
Bill Currie
9ba2d26542 [client] Move sbar.h into client
Where it belongs :P
2022-12-01 15:00:09 +09:00
Bill Currie
9f6c367fce [console] Resurrect console scaling
Currently only for gl/glsl/vulkan. However, rather than futzing with
con_width and con_height (and trying to guess good values), con_scale
(currently an integer) gives consistent pixel scaling regardless of
window size.
2022-11-14 09:49:13 +09:00
Bill Currie
0e64f959e2 [scene] Move visibility management into scene code
Well, sort of: it's still really in the renderer, but now calling
R_AddEfrags automatically updates the visibility structure as necessary,
and deleting an entity cleans up the efrags automatically. I wanted this
over twenty years ago.
2022-11-13 15:08:18 +09:00
Bill Currie
767b39b7bd [client] Implement the scoreboards and spectator
This gets the status bar/hud back into function state.
2022-11-13 04:15:26 +09:00
Bill Currie
1a9ec15a41 [client] Include hud overlay in hud_debug 2022-11-12 01:50:31 +09:00
Bill Currie
0d9b475759 [client] Implement finale overlay and death-solo
Deathmatch overlay isn't working properly for end of level or death in
qw.
2022-11-12 01:47:17 +09:00
Bill Currie
5333c78f7a [client] Implement rogue's team (ctf) face
I don't like that teamplay is just a local cvar that doesn't get set by
the server.
2022-11-11 19:41:47 +09:00
Bill Currie
7b167b2f35 [client] Implement rogue inventory bar switching
And fix rogue ammo icons.
2022-11-11 18:27:51 +09:00
Bill Currie
acedc906dd [client] Implement hipnotic and rogue items
This involved disabling sigils for hipnotic and rogue (not used),
adjusting the number of items views, and moving the two keys views for
hipnotic. Rogue is not yet using the correct status bar pics.
2022-11-11 15:18:31 +09:00
Bill Currie
a91ae7aeb9 [client] Implement hipnotic and rogue weapon views
The functionality of the hipnotic and rogue weapon power-ups is now done
by a various mappings instead of separate functions. In theory, this
should make things more flexible, but most importantly, there's a lot
less code duplication.
2022-11-11 13:00:40 +09:00
Bill Currie
017bba8869 [client] Fix some view placement and buffer sizes 2022-11-10 21:27:49 +09:00
Bill Currie
c6b79d49a4 [client] Fix incorrect function component setup
Need to pass the address of the pointer :/
2022-11-10 21:23:04 +09:00
Bill Currie
74e64d7228 [client] Implement sbar flashes for items
Sigils can't be flashed as they don't have any animations provided, and
they're not normally as critical. I don't know why items weren't
flashed, but since the pics are there, might as well use them (and the
flashing keys do look pretty good).
2022-11-10 15:35:14 +09:00
Bill Currie
39074ba3c1 [qw] Implement hud ping and pl indicators
As well as the periodic update of pings when the scoreboard or hud ping
are shown.
2022-11-10 15:34:31 +09:00
Bill Currie
e0fa853f47 [client] Implement the update functions
nq's frags don't update properly yet, and there's still a lot of
optimization to sort out, but it seems to be fairly usable again.
2022-11-10 01:35:33 +09:00
Bill Currie
1b90f2320e [client] Extend sbar's api
I think this makes the purpose of the functions more clear and makes the
protocol logic less dependent on the meaning of some of the updates.
Most of the update functions are not fully implemented yet.
2022-11-09 19:41:59 +09:00
Bill Currie
73e62de2fb [client] Clean up sbar's globals access
I had forgotten that the cl structs in nq and qw were different layouts,
which resulted in qw's sbar/hud being quite broken. Rather than messing
with the structs, I decided it would be far better in the long run to
clean up sbar's access to the cl struct and the few other nq/qw specific
globals it used. There are still plenty of bugs to fix, but now almost
everything is in the one place.
2022-11-09 19:38:54 +09:00
Bill Currie
34f0a59441 [client] Merge sbar
At long last, the status bar code is now shared between nq and qw. There
are many bugs to fix, but at least now they're all in the one place.
2022-11-08 17:42:27 +09:00
Bill Currie
42963f97c0 [client] Clean up some hud redundancies
hud_view is set up by sbar, and the other views are no longer used.
2022-11-05 16:47:52 +09:00
Bill Currie
3d30e78da9 [client] Add hud_debug cvar to draw view outlines
It's much easier to debug the hud when even otherwise invisible views
can be seen.
2022-11-05 16:38:07 +09:00
Bill Currie
5f98dac214 [client] Add a hud outline component for debug
Very handy for verifying views are placed correctly. Also fix some type
issues with the func and update components.
2022-11-05 10:55:45 +09:00
Bill Currie
5f01dc9fb5 [client] Make the hud update function type explicit 2022-11-04 11:10:56 +09:00
Bill Currie
bdbb8f1e0b [nq] Get intermission view working again
This is currently just the basic intermission view (not the finale view
or the deathmatch intermission view).
2022-11-03 17:49:05 +09:00
Bill Currie
82d407e3c2 [nq] Get hud time and fps displays working
This includes moving the related cvars from botn nq and qw into the
client hud code. In addition, the hud code supports update and
update-once function components. The update component is for updates
that occur every frame, but update-once components (not used yet) are
for one-shot updates (eg, when a value updates very infrequently).
2022-11-03 14:46:44 +09:00
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
708978eea9 [client] Clean up some entity component accesses 2022-11-02 09:53:52 +09:00