Commit graph

14304 commits

Author SHA1 Message Date
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
9e43675c8f [vulkan] Add length and int color to graph labels
Tracy wants string lengths and uint32_t colors, so set them up
automatically from provided info.
2023-11-28 14:15:43 +09:00
Bill Currie
2a80614273 [build] Fix some build issues caused by using tracy
Mostly just macro conflicts (and a little white space in passing).
Commits for integrating tracy will come later when I've come up with a
wrapper-api that I like (so non-tracy builds are easy even with tracy
available).
2023-11-28 13:54:18 +09:00
Bill Currie
962043ca59 [build] Remove obsolete targets
Gone: svga, fbdev, sdl, wgl and probably a few more. Now it's just x11
and win.
2023-11-27 18:10:23 +09:00
Bill Currie
8e4f0f3837 [win] Implement borderless fullscreen mode
And rip out all the crufty DIB mode junk.
Fixes #60
2023-11-26 14:18:54 +09:00
Bill Currie
4eef0889ee [win] Communicate application focus to the client
This fixes the weird slug when running nq on windows. It turns out it
was the "friendly neighbor" sleep code activating due to bitrot. In
addition, there are cvars for enabling unfocused sleep (defaults off)
and disabling minimized sleep (defaults on).
2023-11-26 13:40:00 +09:00
Bill Currie
9a01e71f67 [win] Silence some debug
Missed that one.
2023-11-26 01:16:16 +09:00
Bill Currie
d2af58bfa2 [win] Implement mouse grabbing
This seems be behave quite nicely (at least for the standard win32
message pump).

Fixes #63
2023-11-25 22:33:57 +09:00
Bill Currie
7024e4efb1 [win] Hide the mouse in a system-friendly way
ShowCursor is system-wide and thus not suitable for general use. It
turns out hiding the cursor in windows is the same as x11: use a null
cursor.
2023-11-25 22:03:27 +09:00
Bill Currie
0774f70ca2 [win] Remove the close window confirmation dialog
It's annoying and unless there's data to save (not at this stage, at
least), rather unnecessary.
2023-11-25 22:01:03 +09:00
Bill Currie
c110119196 [win] Track mouse leaving the window
This fixes the incorrect mouse deltas experienced when looping the mouse
cursor through and around the window.
2023-11-25 21:05:37 +09:00
Bill Currie
30489e1812 [win] Set window style correctly
This fixes the incorrectly sized window (I think).
2023-11-25 21:03:51 +09:00
Bill Currie
ed3afeed39 [win] Convert extended scan codes to QF keys
This takes care of the separate arrow keys not working. Fixes #62.
2023-11-25 18:33:38 +09:00
Bill Currie
9c3f0bc5d4 [build] Fix some release script issues
Set sharepath correctly and the menu is not gzipped any more.
2023-11-25 15:45:25 +09:00
Bill Currie
d49c6b0c27 [win] Improve mouse event handling
A lot is broken, especially direct input, but things are working. Better
yet, it seems the X11 and Windows key bindings are at least mostly
compatible.
2023-11-25 15:45:25 +09:00
Bill Currie
866b13b52c [win] Use Windows char events for keys
Fixes #59
2023-11-25 15:44:55 +09:00
Bill Currie
78113919ea [win] Avoid double destroy of window
I suspect it's from the recent event rework, but DestroyWindow seems to
be getting called twice, despite the null protection. Not good.
2023-11-25 10:57:25 +09:00
Bill Currie
43ce0eb3ec [sys] Correct spelling of signals
Is a signlas a girl with a sign?
2023-11-25 09:51:33 +09:00
Bill Currie
5f45c8a0d2 [win] Handle move and size events
Hook up WM_MOVE and WM_SIZE with QF's internal events.

Fixes #61
2023-11-24 22:59:48 +09:00
Bill Currie
f58a14c2d3 [build] Disable 32-bit win32 in release build script
32-bit Windows isn't relevant enough any more. Anybody that wants 32-bit
windows QuakeForge can go through the pain.
2023-11-24 12:29:39 +09:00
Bill Currie
250cac6079 [vid] Remove direct draw interface
It has been dead for a long time.
2023-11-24 12:28:55 +09:00
Bill Currie
f721021fec [win] Clean up event handling and a pile of dead code
The event handling changes take care of VagueLobster's segfaults on
startup for all renderers (vulkan will still be iffy depending on his
hardware: it dies on my GTX 965 M, probably due to memory and QF's
shadows). One nice side effect is it takes care of the broken CD audio
event handling (does anyone even care, though?).
2023-11-24 12:28:06 +09:00
Bill Currie
0a89c513b4 [win] Do not call IN_ClearStates when creating the window
The window is created before input is initialized. Fixes a segfault on
startup of nq-win.exe.
2023-11-23 21:13:47 +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
97a9620cb9 Do the distcheck dance 2023-11-23 17:55:33 +09:00
Bill Currie
c9cfd9e8cf Fix window build for recent config changes
And, more importantly get curl working in the mxe build.
2023-11-23 17:16:53 +09:00
Bill Currie
7a2a61d365 Merge branch 'wip-trails' 2023-11-23 14:00:11 +09:00
Bill Currie
a8ff58baa4 [glsl] Remove a debug print 2023-11-23 13:58:44 +09:00
Bill Currie
43cea64709 [renderer] Get trails looking vaguely acceptable
Still not great, but I like the falloff and the mixing is better. The
path offset seems to be unstable, so that needs work still.
2023-11-23 13:58:44 +09:00
Bill Currie
34daf9032d [renderer] Get trails rendering again
They're not quite working (trail path offset is incorrect) but their
pixels are getting to the screen. Also, lifetimes are off for rocket
trails in that as soon as the entity dies, so does the trail.
2023-11-23 13:58:44 +09:00
Bill Currie
65bf3ab459 [qfcc] Switch to using the internal preprocessor
It's actually good enough for building qfcc: it fails a couple of
obscure c23 preprocessor examples that can be ignored for now (the rest
of QF builds without any apparent issue).
2023-11-23 13:33:44 +09:00
Bill Currie
2fd2a7086f [qfcc] Save disabled preproc expression debug 2023-11-23 13:33:12 +09:00
Bill Currie
5e02716a01 [qfcc] Save force-expanding function-type arg macros
The expansion is necessary for the final test in preproc-2.r, but breaks
preproc-1.r because the closing ')' is *not* visible to collect_args
(its assumption is incorrect). This needs reworking (and probably
rethinking) of the entire macro argument collection, but I need a little
break from the preprocessor (and it's good enough for *most* uses), so
I'm adding the code (disabled) in order to avoid losing it and my notes
about the problem.
2023-11-23 13:28:48 +09:00
Bill Currie
4480453861 [qfcc] Fail function-type macro expansion early
That is, if anything other than '(' (even a macro/argument that expands
to '(')is seen while checking for a function-type macro, the expansion
fails. This gets preproc-1.r working properly.
2023-11-23 13:26:02 +09:00
Bill Currie
4ed25ed616 [qfcc] Correct some misuses of scanner
It really affected only collect_args, but in fixing that I noticed I was
very inconsistent with scanner's type (should be yyscan_t or void *, but
not yyscan_t *).
2023-11-22 11:54:14 +09:00
Bill Currie
8c0b30e4e6 [qfcc] Force object-type macro expansion in args
This seems to get __FILE__ and __LINE__ working as expected, at least
when not used in __VA_OPT__.
2023-11-22 00:31:54 +09:00
Bill Currie
bf44ff3194 [qfcc] Base default object file name on output file
There's no guarantee the source file is in a writable directory (in
fact, it is very definitely in a read-only directory when running
`make distcheck`). However, it is reasonable to assume the output file
is being written to a writable directory thus default the object file
directory to that of the output file, but still use the source file's
name for the object file name.

Fixes #51
2023-11-20 14:19:01 +09:00
Bill Currie
70d07d8026 [quakefs] Document that QFS_LoadFile closes the file
In the end, I decided that the behavior isn't so bad, but it does need to
be documented.

Closes #34
2023-11-19 16:40:24 +09:00
Bill Currie
e8b2822587 [nq] Add more checks for dedicated server in client
When the nq client is run in dedicated server mode, the client state is not
initialized thus none of the client code should be run. This became more
critical with the addition of scenes and an ECS as there are a lot more
pointers involved.

Fixes #46
2023-11-19 15:03:13 +09:00
Bill Currie
ce6e7a32fd [qfcc] Use place-markers for some empty expansions
This gets most of the second preprocessor test working, apparently just
some problems with macro arguments not getting expanded for ## (unless
there's more lurking, of course, which I know there is for __LINE__).
2023-11-19 14:08:09 +09:00
Bill Currie
eb6a5b771a [qfcc] Get __VA_OPT__ non-expansion working
For most cases: function-type macros aren't properly checked for being
empty, but this gets a lot of the next preprocessor test working.
2023-11-19 02:10:44 +09:00
Bill Currie
5c0b2aa891 [qfcc] Clean up some cruft from recent __VA_OPT__ changes
Using a special token id for __VA_OPT__ means the macro is no longer
needed (need to improve checks for misuse of __VA_OPT__, though).
2023-11-18 19:56:19 +09:00
Bill Currie
fc03e7eb7a [qfcc] Recursively expand __VA_OPT__'s argument
This seems to do the right thing, and my test case (copied from the C
spec) passes finally.
2023-11-18 18:09:34 +09:00
Bill Currie
344b79a401 [qfcc] Go back to not pre-expanding macro args
It just feels cleaner than unnecessarily copying token chains. It turns
out that the core problem was just order of operations in next_token:
moving the pending_macro code to after arg/macro detection seems to be
correct (even bare `G LPAREN() 0)` is *not* expanding `G`, as expected).
2023-11-18 17:37:20 +09:00
Bill Currie
d628595589 [qfcc] Collect __VA_OPT__'s arguments early
This makes working with __VA_OPT__ much easier. However, I've come to
dislike expand_args. Still, the code is slowly cleaning up.
2023-11-18 13:41:20 +09:00
Bill Currie
49667b439d [build] Batch-report missing packages
Very debian-centric and the reported packages rely on package dependencies,
but it's better than getting part-way through a build only to find
something is missing and having to restart..
2023-11-18 12:16:35 +09:00
Bill Currie
1545480ecb [debian] Clear out a large pile of bitrot
This gets debian packages building again, though it was mainly a test for
some improvements to configure and missing package reporting.
2023-11-18 11:53:23 +09:00
Bill Currie
053e9f2fb4 Add more library packages for building
freetype, fontconfig, harfbuzz, xinput and xfixes. Also, create a shell
script that installs all the debian packages needed to build QF.
2023-11-17 20:51:12 +09:00
Bill Currie
c322fb68d3 [cexpr] Remove unnecessary config.h include 2023-11-17 20:51:12 +09:00