Commit graph

875 commits

Author SHA1 Message Date
Bill Currie
ccd42c5c21 [x11] Support the XScreenSaver extension
And use it in preference to the crusty old XSetScreenSaver API. This
should work on modern systems (though might need to support the dbus
method too, but that can wait).
2025-01-12 23:29:57 +09:00
Bill Currie
99632ddb03 [qfcc] Rework function/pointer/array declarations
They should now work in generic contexts, but the pressing need to work
on arrays was due to constant expressions for element counts breaking.
As a side effect, function pointers are now a thing (and seem to work
like they do in C)
2025-01-03 13:22:29 +09:00
Bill Currie
674fbae225 [qfcc] Rework binary_expr to be support matrices
And, nicely, simplify it quite a bit. I'm not sure why I didn't thinkg
of this approach before. While the ruamoko back-end doesn't support
matrices yet, the expressions are handled.

As a side effect, type checking on comparisons is "stricter" in that
more potentially bogus comparisons (eg, int-float) are caught, resulting
in a few warnings in ruamoko code and even finding a couple of bugs.
2024-12-05 00:18:47 +09:00
Bill Currie
d082d39e17 [qfcc] Use count for number of array elements
I got tired of seeing size when count is the real intent (mistake copied
from C++).
2024-11-17 15:27:10 +09:00
Bill Currie
ebb3ec592a [qfcc] Implement bool and lbool types
Since spir-v needs actual bools for its conditional instructions, the
time to do bool properly finally came. As expected, the changes caused
quite a mess, but Ruamoko now does bool/true/false.
2024-11-15 12:36:08 +09:00
Bill Currie
c038670114 [gatest] Add a commutesWith method to blades
It came about from a discussion in the bivector discord about
programmatic testing for blade commutativity and why no texts talked
about it. I came up with an idea that turned out not to work (I guess
I'd overthought how count_flips works). In the end, I decided to keep
it, and simplified metric's sign check.
2024-09-11 17:25:38 +09:00
Bill Currie
698d27c996 [gamecode] Save all param pointers with PR_SaveParams
Builtins calling other functions that call back into progs can get their
parameter pointers messed up resulting in all sorts of errors. Thus wrap
all callbacks to progs in PR_SaveParams/PR_RestoreParams.

Also, ditch PR_RESET_PARAMS in favor of using PR_SetupParams and move
setting pr_argc into PR_SetupParams.
2024-09-05 00:00:44 +09:00
Bill Currie
8db547afec [ruamoko] Remove hack-in matrix type
No need for it now, either.
2024-09-04 10:36:32 +09:00
Bill Currie
a00b17bf71 [qfcc] Check declarator type chains
Arrays of functions or functions that return arrays or functions aren't
valid. While working on how to get generics in properly, I finally
understood what's going on with function types in the specifier, and I
think I'll be able to sort out function pointers vs prototypes, too.
2024-08-21 08:23:12 +09:00
Bill Currie
4fd3d972af [gatest] Correct and clean up Hodge calculation
I had a few signs flipped, I think, but this version is much easier to
read.
2024-06-23 13:25:27 +09:00
Bill Currie
5771cfb2ff [gatest] Use correct layout for multivector reverse
This fixes a bit of fun with reversing directly specified blades.
2024-06-23 13:19:16 +09:00
Bill Currie
b3fed7282e [qfcc] Make @function a type function
This fits in nicely with the rest of the generic type system and makes
it a little more useful. The idea is it will take a return type (already
does since type functions always require a parameter at this stage) and
a parameter list (not implemented yet). It currently resolves to the
basic void (...) function type for QC.
2024-05-31 16:39:50 +09:00
Bill Currie
c70da4fc76 [qfcc] Chain matrix and bool types
Ruamoko doesn't really use either yet, but GLSL needs them and this
ironed out a lot of the issues related to adding the types.
2024-04-25 11:22:35 +09:00
Bill Currie
2f8ffc4862 Merge branch 'master' into wip-ruaspirv 2024-04-18 09:46:10 +09:00
Bill Currie
32a8287fc1 [ruamoko] Add some functions to get joints
Still not very useful, but the internal format for iqm is proving to be
rather limiting.
2024-02-20 16:46:02 +09:00
Bill Currie
e9cea29cae [gatest] Implement undual and antiwedge 2024-02-20 16:46:02 +09:00
Bill Currie
7509916d71 [qwaq] Clean up some debug output
Some leftover prints from getting geometric algebra support working in
qdb.
2024-02-20 16:46:02 +09:00
Bill Currie
3affd3582b [qwaq] Add an init_graphics function
This allows qwaq programs to provide a renderer configuration property
list.
2024-02-01 22:07:48 +09:00
Bill Currie
6f04c555a4 [ruamoko] Add support for cbuf handling
I'm not sure how this will turn out, but the idea is ruamoko code will
be able to create its own scripting "language".
2024-02-01 18:58:41 +09:00
Bill Currie
2996690bd1 [qwaq] Add a function to set imt context cbuf
Hopefully only temporary until I get ruamoko cbuf support done.
2024-02-01 15:28:43 +09:00
Bill Currie
e619b4524e [scene] Add support for a scene camera
Used only by qwaq, but I can fly around my little test scene now :)
2024-02-01 11:20:36 +09:00
Bill Currie
1bcc4dddb6 [ruamoko] Wrap some more input functions
IN_UpdateAxis (for nice handling of axis updates, especially relative
motion for mice) and IN_Binding_HandleEvent because registering an event
handler blocks qwaq's internall call to IN_Binding_HandleEvent.
2024-02-01 11:16:36 +09:00
Bill Currie
d409e595a8 [qwaq] Save and restore params around event handler
It turns out the parameter pointer save/restore I had done for detoured
functions is required for all nested calls. However, I had actually
completely forgotten about it. I updated the docs for that section.
2024-02-01 11:09:22 +09:00
Bill Currie
2e19e2d913 [ruamoko] Add wrapper for IN_SendConnectedDevices
And wrap input/event.h

event.h is a bit messy because of the data pointer in events, but it
works for now.
2024-02-01 01:40:46 +09:00
Bill Currie
0af727341f [qwaq] Use a qwaq-specific dirconf
While it breaks my little toy game I've been working on (long overdue,
really) and my test scene, at least now qwaq is a little more
independent of quake.
2024-01-31 00:19:20 +09:00
Bill Currie
f5e39ba263 [renderer] Allow render config to be specified
The config is a pre-parsed property list. Currently unsupported by
anything but Vulkan (but only a warning is given, not a hard error at
this stage), and Vulkan doesn't use it yet.
2024-01-30 23:13:16 +09:00
Bill Currie
3cd0703249 [ui] Implement scroll bars
There's a bit of nasty hard-coding around passages at the moment, but
the basics are working in a fairly generic way.
2024-01-09 09:12:29 +09:00
Bill Currie
2e00fd1165 [ui] Pass a data pointer to update functions 2024-01-07 11:58:01 +09:00
Bill Currie
c2316a4173 [ui] Add support for passage views to imui
It was a right cow to get working at all due to the tangled mess of
dependencies between different hierarchies (switching to hierarchies as
components helpt), but other that some vertical positioning (paragraphs
and descenders), it's working fairly well now (and fairly quick other
than I think I need to ensure the shaping cache is used).
2024-01-05 16:34:18 +09:00
Bill Currie
bfa7c1722a [build] Implement tracy memory zones
This proved to be quite the challenge, and is probably rather fragile,
but it does seem to work, and might help with tracking down memory
leaks.
2024-01-05 11:50:48 +09:00
Bill Currie
4c704e9a2e [ecs] Give registries a name
This makes debugging a little easier when there are multiple ECS
registries. Currently, the name parameter must be a stable pointer.
2023-12-28 16:08:40 +09:00
Bill Currie
a50c1d0f81 [ui] Implement nested canvases
This is for scroll boxes (the nesting of canvases is for the clipping
they provide). There are some issues with automatic layout, but this
gets things mostly working, in particular the management of the link
between hierarchies as a canvas is always the root of its hierarchy.
2023-12-23 14:36:57 +09:00
Bill Currie
a300e2330d [ui] Make windows respect their size fields
If auto_fit is true, then the old behavior is retained.

This is actually better than the set size thing, but that's probably
still useful.
2023-12-21 19:57:02 +09:00
Bill Currie
4483368319 [ruamoko] Add bindings for imui
Things are a little clunky, but I've got a little window I can
manipulate in my test scene :)
2023-12-21 16:11:30 +09:00
Bill Currie
a3e1a01adf [cl_menu] Set input line width
I have no idea when this became necessary, but at least the API was
already there.
2023-12-21 10:30:57 +09:00
Bill Currie
3dd7678962 [cl_menu] Add CvarIntRange for integer sliders
Fixes viewsize not working (sort of: the slider now works, but the cvar
itself does not, but that's an engine issue).
2023-12-21 10:29:20 +09:00
Bill Currie
92f68844f5 [ruamoko] Remove keys.h and keys.r
The functions haven't existed for two years now. And in the interest of
"throw one away", the controls_o.r has been gutted.
2023-12-21 08:40:09 +09:00
Bill Currie
dd183d3ba6 [qfcc] Handle signed-unsigned int comparison better
This fixes the upostop-- test by auto-casting implicit constants to
unsigned (and it gives a warning for signed-unsigned comparisons
otherwise). The generated code isn't quite the best, but the fix for
that is next.

Also clean up the resulting mess, though not properly. There are a few
bogus warnings, and the legit ones could do with a review.
2023-12-20 23:09:06 +09:00
Bill Currie
fccd06c5bf [vulkan] Add gpu profiling zones
This relies on my fork of tracy: https://github.com/taniwha/tracy
on the wip-c-vulkan branch. Everything is still rather flaky though.

This necessitated the jump to vulkan 1.2 as a requirement.
2023-12-05 22:55:57 +09:00
Bill Currie
e30f2cbacc [util] Add a wrapper for libgcc's backtrace functions
Right now, just backtrace_pcinfo is supported, but it's enough for
testing.
2023-12-04 17:53:12 +09:00
Bill Currie
010c658653 [build] Add support for building with Tracy
Tracy is a frame profiler: https://github.com/wolfpld/tracy

This uses Tracy's C API to instrument the code (already added in several
places). It turns out there is something very weird with the fence
behavior between the staging buffers and render commands as the
inter-frame delay occurs in a very strangle place (in the draw code's
packet acquisition rather than the fence waiter that's there for that
purpose). I suspect some tangled dependencies.
2023-11-28 15:54:55 +09:00
Bill Currie
cba1866360 [menu] Hide the hacky cp command
It's there just to work around automake and libtool requirements for
EXEEXT but allowing qfcc to build menu.dat directly. Maybe someday I'll
come up with a better way.
2023-11-28 14:18:11 +09:00
Bill Currie
f3a428fbdd Fix up windows and the release scripts
I really need more feedback and the best way to get that is to have more
users, and for that, I need packages.
2023-11-23 20:28:19 +09:00
Bill Currie
ba35ce71b3 [qfcc] Support 32-bit and 64-bit handle types
32-bit is nice because it's small, but 64-bit is handy for special
handle encodings.
2023-10-02 23:33:37 +09:00
Bill Currie
5e041ef3f8 [qwaq] Remove the shutdown builtin
It proved to be a bad idea with the error handler stack.
2023-09-15 13:53:46 +09:00
Bill Currie
bce2b7d767 [ruamoko] Add sincos and sincosh functions
sincos is just a wrapper around the GNU libc sincos. sincosh is the
equivalent for sinh and cosh, but there doesn't seem to be any such
function, so it's just the two wrapped. They both return their results
in a vec2/vec2d as (sih[h], cos[h]).
2023-09-10 14:13:56 +09:00
Bill Currie
8a0246c910 [ruamoko] Add type info for algebra types
And get vector type views working in the debugger.
2023-08-26 23:01:01 +09:00
Bill Currie
f2cb62f2c8 [qwaq] Use VID_SendSize
Takes care of a FIXME I'd forgotten about, but was rather relevant to
this morning's changes.
2023-07-14 15:38:55 +09:00
Bill Currie
4e7bd11415 [build] Clean up make distcheck issues 2023-07-10 11:12:22 +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