Commit Graph

177 Commits

Author SHA1 Message Date
Bill Currie 59044d3827 Fix a bunch of distcheck issues 2022-02-14 19:28:19 +09:00
Bill Currie 2f6c3c8ffb [ruamoko] Use pr_type_names.h for Ruamoko
Keeping the two sets of definitions in sync has always been a pain.
2022-01-18 14:21:09 +09:00
Bill Currie 23613ca985 [simd] Get the new functions working on older hardware
In some cases, gcc-11 does a good enough job translating normal looking
C expressions so use just those, but other times need to dig around for
an appropriate intrinsic.

Also, now need to disable psapi warnings when compiling for anything
less than avx.
2022-01-07 11:48:28 +09:00
Bill Currie 0b92cd3a88 [gamecode] Generate the new opcode table
As I expect to be tweaking things for a while, it's part of the build
process. This will make it a lot easier to adjust mnemonics and argument
formats (tweaking the old table was a pain when conventions changed).

It's not quite done as it still needs arg widths and types.
2022-01-05 19:09:07 +09:00
Bill Currie 33e48025dd [ruamoko] Replace rua_key with rua_input
And create rua_game to coordinate other game builtins.

Menus are broken for key handling, but have been since the input rewrite
anyway. rua_input adds the ability to create buttons and axes (but not
destroy them). More work needs to be done to flesh things out, though.
2021-12-24 06:45:13 +09:00
Bill Currie 577959ec6b [build] Use AS_HELP_STRING on all the help strings
Cleans up the inconsistently wrapped lines.
2021-12-24 06:45:13 +09:00
Bill Currie 3ac6d2aa22 [x11] Use barriers to trap the pointer in the window
This should be a much friendlier way of "grabbing" input, though I
suspect that using raw keyboard events will result in a keyboard grab,
which is part of the reason for wanting a friendly grab.

There does seem to be a problem with the mouse sneaking out of the
top-right and bottom-left corners. I currently suspect a bug in the X
server, but further investigation is needed.
2021-11-22 14:59:27 +09:00
Bill Currie e45d19835c [x11] Add initial support for XInput2
Right now, only raw pointer motion and button events are handled, and
the mouse escapes the window, and there are some issues with focus in
focus-follows-mouse environments. However, this should be a much nicer
setup than DGA.
2021-11-21 23:42:33 +09:00
Bill Currie ba8da88f56 [build] Update for autoconf 2.71
Only because I didn't appreciate the warnings about things being
obsolete.
2021-11-20 12:54:05 +09:00
Bill Currie 83abdfa7b9 [qw] Rmove include of rpc/types.h
I have no idea why it was necessary, and certainly should not be now as
any such portability issues should be tucked away such that the client
code never sees such.
2021-11-19 11:57:16 +09:00
Bill Currie 665790f562 [video] Remove libQFjs
It is now redundant with the libQFinput, though nothing actually works yet.
2021-11-01 12:30:45 +09:00
Bill Currie 7fcf6bfef5 [build] Autoconfiscate evdev 2021-09-28 10:57:12 +09:00
Bill Currie d99fb01b65 [build] Fix some distcheck bitrot 2021-08-02 13:47:00 +09:00
Bill Currie 40a26e4bc8 [scene] Rename libQFentity to libQFscene
And start working on scene management.
2021-07-24 14:20:59 +09:00
Bill Currie ae58a8ba5d [qwaq] Create a commandline-only version of qwaq
qwaq-curses has its place, but its use for running vkgen was really a
placeholder because I didn't feel like sorting out the different
initialization requirements at the time. qwaq-cmd has the (currently
unnecessary) threading power of qwaq-curses, but doesn't include any UI
stuff and thus doesn't need curses. The work also paves the way for
qwaq-x11 to become a proper engine (though sorting out its init will be
taken care of later).

Fixes #15.
2021-07-06 12:25:24 +09:00
Bill Currie c554dee0f8 [build] Autoconfiscate simd support
The default is to enable (and autodetect based on lscpu) simd support,
or the mode can be specified via --enable-simd=mode. --disable-simd
disables the support but ensures gcc will still compile the float vector
types.
2021-06-29 15:39:15 +09:00
Bill Currie 53a7fbfe95 [audio] Move jack from renderer to targets
The JACK Audio Connection Kit support is now just an output target
rather than a full duplicate of the renderer (in pull mode). This is
what I wanted to to back when I first added jack support, but I needed
to get the renderer working asynchronously without affecting any of the
other outputs.

Fixes #16.
2021-06-25 18:32:48 +09:00
Bill Currie 770187372d [audio] Get testsound working again 2021-06-21 16:40:40 +09:00
Bill Currie bcc5686606 [util] Add fuzzy and reentrant bsearch
Fuzzy bsearch is useful for finding an entry in a prefix sum array
(value is >= ele[0], < ele[1]), and the reentrant version is good when
data needs to be passed to the compare function. Adapted from the code
used in pr_resolve.
2021-06-01 18:53:53 +09:00
Bill Currie 0293167bd2 [util] Get simd tests working for emulated simd
A bit of a mess for optimized vs unoptimized, but the tests acknowledge
the differences in precision while checking that the code produces the
right results allowing for that precision.
2021-06-01 18:53:53 +09:00
Bill Currie ef9b04ba83 [util] Get tests working with sse2
It seems that i686 code generation is all over the place reguarding sse2
vs fp, with the resulting differences in carried precision. I'm not sure
I'm happy with the situation, but at least it's being tested to a
certain extent. Not sure if this broke basic (no sse) i686 tests.
2021-06-01 18:53:53 +09:00
Bill Currie c5f2aca07d [vulkan] Conditionalize vulkan tests 2021-06-01 18:53:53 +09:00
Bill Currie 778c07e91f [util] Get vectors working for non-SSE archs
GCC does a fairly nice job of producing code for vector types when the
hardware doesn't support SIMD, but it seems to break certain math
optimization rules due to excess precision (?). Still, it works well
enough for the core engine, but may not be well suited to the tools.
However, so far, only qfvis uses vector types (and it's not tested yet),
and tools should probably be used on suitable machines anyway (not
forces, of course).
2021-06-01 18:53:53 +09:00
Bill Currie 0a6cb3ad53 [vulkan] Don't build vkgen when vulkan is unavailable 2021-06-01 18:53:52 +09:00
Bill Currie b2ec1aaf37 [build] Disable SDL by default
Finally, there is no more need to keep it (though I won't nuke the
support just yet) as native windows support is now working.
2021-04-01 20:07:37 +09:00
Bill Currie 596cd164a3 [win] Handle focus in/out events
This fixes the errant console behavior (cursor wasn't showing because QF
thought it had never received focus).
2021-03-31 02:48:25 +09:00
Bill Currie 63e30e6ae0 [win] Fix a handful of small bugs for windows
Only 64-bit windows is tested, and there are still various failures, but
QF is limping along in windows again.

nq-sdl works for sw, and sw32, gl and glsl are mostly black (but not
entirely for gl?),  vulkan is not supported with sdl.

nq-win works for sw and sw32, and sort of for vulkan (very dark and
upside-down?). gl and glsl complain about vid mode,

qw-client-[sdl,win] seem to be the same, but something is wrong with the
console (reading keyboard input).
2021-03-30 20:19:20 +09:00
Bill Currie 15a5254f04 [build] Get ncurses support working again
Some minor errors dues to getting win32 building (and not testing the
results properly in Linux).
2021-03-29 17:54:39 +09:00
Bill Currie 64f51bda6e [build] Get make distcheck working again
again...

This covers only the basic check with a build in debian, but it's a good
start.
2021-03-29 17:35:30 +09:00
Bill Currie 6fea5f5e1a [build] Add -Wformat-non-literal option
While this caused some trouble for pr_strings and configurable strftime
(evil hacks abound), it's the result of discovering an ancient (from
maybe as early as 2004, definitely before 2012) bug in qwaq's printing
that somehow got past months of trial-by-fire testing (origin understood
thanks to the warning finding it).
2021-03-29 17:27:06 +09:00
Bill Currie 88ff254f42 Get QF cross-compiling using MXE/mingw32
This includes -win clients (no clue if anything actually works yet).
2021-03-27 20:09:37 +09:00
Bill Currie a9bd436837 [build] Autoconfiscate printf format attribute
I don't know if gnu_printf is appropriate for all cases, but it is
needed for mingw32.
2021-03-27 19:52:59 +09:00
Bill Currie 4cc6e05140 [build] Fix a silly error that got through testing 2021-03-26 17:34:59 +09:00
Bill Currie 238e80c89b [build] Fix selective build of tools
A couple of things get built when they shouldn't (eg, vkgen) but this
gets the build system back to its pre-non-recursive-make
configurability.
2021-03-26 16:11:29 +09:00
Bill Currie 7dc7bf138f [build] Rename QF_PROCESS_NEED_DIRS
QF_PROCESS_NEED_LIST is a better name as for one, building no longer
depends on directories, and the directories were lists anyway, so the
name is more generally applicable.
2021-03-26 15:26:13 +09:00
Bill Currie 669f9a6500 Revert "[build] Clean up obsolete QF_PROCESS_NEED_DIRS"
This reverts commit 22c0bec03a.

It turns out to have been a critical part of selective build control.
2021-03-26 15:17:46 +09:00
Bill Currie a32e2319e2 Merge branch 'master' into win-merge 2021-03-25 22:42:16 +09:00
Bill Currie 14bc560624 [build] Add option to enable gcov data generation
Nice to be able to check how good the tests are (or aren't, as the case
may be).
2021-03-07 17:39:22 +09:00
Bill Currie 9617bbef97 [build] Create static libs for render targets
The static libs are used to build the plugins, but make it easy to use
only those modules needed for tests. Fixes the link error when running
"make check" with non-static plugins.
2021-03-03 16:34:16 +09:00
Bill Currie 22c0bec03a [build] Clean up obsolete QF_PROCESS_NEED_DIRS
Its need went away with the shift to non-recursive make. The macro is
still available just in case.
2021-03-03 13:02:35 +09:00
Bill Currie 7a353d5aee [model] Build vulkan model libs
The contents are currently empty (required .c files), but this gets the
build system updated.
2021-01-19 14:12:49 +09:00
Bill Currie 09a10f80e1 [util] Add basic SIMD implemented vector functions
They take advantage of gcc's vector_size attribute and so only cross,
dot, qmul, qvmul and qrot (create rotation quaternion from two vectors)
are needed at this stage as basic (per-component) math is supported
natively by gcc.

The provided functions work on horizontal (array-of-structs) data, ie a
vec4d_t or vec4f_t represents a single vector, or traditional vector
layout. Vertical layout (struct-of-arrays) does not need any special
functions as the regular math can be used to operate on four vectors at
a time.

Functions are provided for loading a vec4 from a vec3 (4th element set
to 0) and storing a vec4 into a vec3 (discarding the 4th element).

With this, QF will require AVX2 support (needed for vec4d_t). Without
support for doubles, SSE is possible, but may not be worthwhile for
horizontal data.

Fused-multiply-add is NOT used because it alters the results between
unoptimized and optimized code, resulting in -mfma really meaning
-mfast-math-anyway. I really do not want to have to debug issues that
occur only in optimized code.
2020-12-30 18:20:11 +09:00
Bill Currie 7fb335a215 [vulkan] Add support for building and loading shaders
Shaders can be built as spv files and installed into
$libdir/quakeforge/shaders or as spvc files and compiled into the
engine. Loading supports $builtin/name to access builtin shaders,
$shader/path to access external standard shaders and quake filesystem
access for all other paths.
2020-12-23 14:32:29 +09:00
Bill Currie 86b5b30b45 Merge branch 'master' into vulkan 2020-06-25 14:03:52 +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 9ce64a5cfb [build] Fix curses.h header check 2020-03-22 01:14:57 +09:00
Bill Currie 1a7add3f6d Merge branch 'master' into vulkan 2020-03-20 13:04:41 +09:00
Bill Currie de01cff70e [build] Install QF/keys.h into qfcc's include directory
As well as $prefix/include, of course. This fixes the problem with
external ruamoko builds failing due to keys.h and qfcc's "lockdown" on
system headers.
2020-03-03 22:22:53 +09:00
Bill Currie df2ed4b086 [qwaq] Move from tools to ruamoko
This fixes the dependency issues between qwaq and ruamoko. qwaq is
actually older than ruamoko. That little language feature test has come
a long way.

However, I'm considering moving to non-recursive make, but...
2020-03-01 00:55:15 +09:00
Bill Currie 126f8502bd Start working on a qwaq console tool
The intention is it will hopefully become a debugger. It will certainly
help with development of the progs engine.
2020-02-26 22:10:59 +09:00