Commit Graph

672 Commits

Author SHA1 Message Date
Bill Currie 72900fd16b [qwaq] Move input handling to its own thread
As it is now a completely separate sub-system, there is a bit of trouble
with mouse handling in that curses must be initialized before input for
the mouse to work properly, but the basic scheme seems to be working
nicely. I suspect the solution to the init order issue is to make have
the curses sub-system initialize the terminal input driver, at least for
mouse input (ie, maybe just enable/disable mouse handing).
2021-09-22 16:22:11 +09:00
Bill Currie e942fe6528 [qwaq] Add input test app
The queues in the curses resources struct have been cleaned up and the
threading support code (including for the queues (pipes, really)) has
been moved to its own file.

The input test app currently just prints the devices and the events as
they come in, but demonstrates the new input system working in a
separate thread (though it is currently in with the curses thread).
2021-09-21 12:58:10 +09:00
Bill Currie 106ab86c3e [qwaq] Move the ui code into a library 2021-09-20 15:31:50 +09:00
Bill Currie 5d1e515e9e [qwaq] Hook up input to a certain extent
Really, just enough to show that the initialization process and hotplug
are working. The qwaq input driver is not yet properly integrated.
2021-08-30 09:59:30 +09:00
Bill Currie a91dac60d9 [input] Start work on improved input system
The common input code (input outer loop and event handling) has been
moved into libQFinput, and modified to have the concept of input drivers
that are registered by the appropriate system-level code (x11, win,
etc).

As well, my evdev input library code (with hotplug support) has been
added, but is not yet fully functional. However, the idea is that it
will be available on all systems that support evdev (Linux, and from
what I've read, FreeBSD).
2021-08-27 09:10:21 +09:00
Bill Currie 54604d9aa2 [util] Make hunk (optionally) thread-safe
For now, the functions check for a null hunk pointer and use the global
hunk (initialized via Memory_Init) if necessary. However, Hunk_Init is
available (and used by Memory_Init) to create a hunk from any arbitrary
memory block. So long as that block is 64-byte aligned, allocations
within the hunk will remain 64-byte aligned.
2021-07-29 11:43:27 +09:00
Bill Currie 49c3dacbbc [util] Rename set_size to set_count
After seeing set_size and thinking it redundant (thought it returned the
capacity of the set until I checked), I realized set_count would be a
much better name (set_count (node->successors) in qfcc does make much
more sense).
2021-07-27 11:52:21 +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 e799a7ae45 [qwaq] Readd libQFruamoko_client to qwaq-x11
Turned out it was needed after all (bad build test)
2021-07-22 18:08:13 +09:00
Bill Currie e089234f38 [console] Link against libQFruamoko_console
Fixes shared plugin not loading due to missing symbol.
2021-07-22 18:01:18 +09:00
Bill Currie 34dd434147 [qwaq] Fix missing gib library references
Not sure why static builds worked and dynamic didn't, but...
2021-07-10 18:31:22 +09:00
Bill Currie f18e1366ba [vulkan] Silence vkgen's debug output
It was hidden by qwaq-curses, but the switch to using qwaq-cmd made it
pretty obvious.
2021-07-06 12:27:21 +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 e81d690b51 [input] Create QF input library using keys.c
This refactors (as such) keys.c so that it no longer depends on console
or gib, and pulls keys out of video targets. The eventual plan is to
move all high-level general input handling into libQFinput, and probably
low-level (eg, /dev/input handling for joysticks etc on Linux).

Fixes #8
2021-07-05 16:26:07 +09:00
Bill Currie 12ab283c22 [qwaq] Add a little z-transform program
And fix an error in floatview.

The z-transform program is so I can test out my math and eventually
develop some hopefully interesting sound generators.
2021-06-19 11:25:05 +09:00
Bill Currie 8db1957452 [ruamoko] Add bindings for exp() 2021-06-19 11:23:51 +09:00
Bill Currie 813497a1aa [ui] Create library for UI support code
Currently this has text buffer, input line, vrect and view code.
2021-06-12 22:50:51 +09:00
Bill Currie 2572011a4b [qwaq] Fix various scrollbar related issues
The editor now uses the vertical scrollbar for handling mouse wheel
scrolling, thus keeping the scrollbar in sync.

Scrollbar index can now cover the full range (not sure why I had that
-1), and the potential divide by zero is avoided properly.

Thumb-tab now positioned properly when the range is 0.
2021-06-12 01:30:44 +09:00
Bill Currie f09810b595 [qwaq] Implement the remaining basic cursor motion
This gets all the basic cursor motion from my old editor working.
arrow keys: left/right/up/down char/line
home/end: beginning/end of line
page up/down

and ctrl versions where left/right are prev/next work, up/down skip over
indents, home/end are beginning/end of screen, and page up/down are
beginning/end of text.
2021-06-11 23:34:43 +09:00
Bill Currie 3cd0d68774 [qwaq] Implement word left and right
The word boundaries are currently vary simple, just transitions from
alnum_ (as it was in my old editor and in Borland's editors), but the
basic logic is working.
2021-06-11 10:14:07 +09:00
Bill Currie 75ce07a14c [qwaq] Implement home and end
Currently, home always moves the cursor to the very first column, but
I'm considering making it move the cursor to the first non-space
character of the line if it's not already there, otherwise to the first
column (ie, the cursor will toggle between the two positions if it's in
one of them).
2021-06-10 14:29:32 +09:00
Bill Currie 055ea46337 [qwaq] Fix page up/down and deal with tabs 2021-06-10 12:13:55 +09:00
Bill Currie 2a38135dd9 [qwaq] Fix scrollbar thumbtab covering button
Caused by an out-by-one error.
2021-06-09 08:33:50 +09:00
Bill Currie d23c9582f1 [qwaq] Implement execute-to-cursor
Support for finding the first address associated with a source line was
added to the engine, returning 0 if not found.

A temporary breakpoint is set and the progs allowed to run free.
However, better handling of temporary breakpoitns is needed as currently
a "permanent" breakpoint will be cleared without clearing the temporary
breakpoing if the permanent breakpoing is hit while execut-to-cursor is
running.
2021-06-08 16:54:04 +09:00
Bill Currie c818a2abf9 [qwaq] Support base filename and cursor fetching
Getting the base filename and the current cursor position is needed for
execute-to-line support in the debugger.
2021-06-08 16:50:30 +09:00
Bill Currie c06acd3b53 [qwaq] Update line and char indices with cursor motion 2021-06-08 16:48:24 +09:00
Bill Currie 1f6a4ed941 [qwaq] Implement cursor motion in the editor
Basic arrow key motion, and it's currently limited to not scrolling
horizontally (need to figure out how to handle max scroll), but this
also fixes the cursor handling on focus switching :)
2021-06-07 22:21:48 +09:00
Bill Currie 551236511d [qwaq] Make the editor show the cursor
As well as showing the cursor, it keeps the cursor's position up to date
(for now, just at 0,y as only gotoLine is implemented, no cursor motion
yet)
2021-06-07 16:20:15 +09:00
Bill Currie 5892008306 [qwaq] Add char get/put/insert methods to EditBuffer 2021-06-07 16:05:32 +09:00
Bill Currie 48bf6fff13 [qwaq] Get the cursor mostly working
It's a little flakey with respect to redraws and changes of focus, but I
think that's just updating the cursor state in more places.
2021-06-07 15:58:19 +09:00
Bill Currie d36a75e3de [qwaq] Fix incorrect screen refresh
Or, at least, I think it's incorrect, since stdscr (which was being
refreshed) should not be used when using panels.
2021-06-07 15:56:57 +09:00
Bill Currie 5e8376340d [qwaq] Add method to get group's owning view 2021-06-07 15:56:20 +09:00
Bill Currie 3d42f986c3 [qwaq] Add wrapper for wmove 2021-06-07 15:53:35 +09:00
Bill Currie f50d27ec11 [qwaq] Show dereferenced data for poitner defs
The code currently assumes a single value is referenced rather than the
beginning of an array.
2021-06-04 13:35:53 +09:00
Bill Currie 22b9bb29f6 [qwaq] Calculate type sizes for compound types 2021-06-04 13:34:15 +09:00
Bill Currie 7275d9bbf5 [qwaq] Fully load target types into debugger
Fully loading the types means that code using the target's type
definitions does not need to worry about pulling in sub-types for
structured data.
2021-06-04 13:31:43 +09:00
Bill Currie 5e29cecf44 [ruamoko] Add pr_type_size array to types.[rh] 2021-06-04 13:29:27 +09:00
Bill Currie 53b553e892 [qwaq] Rework def views to support multi-row defs
Needed for structured types (arrays, structs, etc). The multiple rows
aren't implemented yet, but the initial groundwork is done.
2021-06-01 23:52:04 +09:00
Bill Currie 5ca792c40e [ruamoko] Add some stdlib function wrappers
For now, just bsearch (normal and fuzzy), qsort, and prefixsum (not in
C's stdlib that I know of, but I think having native implementations of
float and int prefix sums will be useful.
2021-06-01 18:53:53 +09:00
Bill Currie d98c92a5c4 [qwaq] Start work on cursor management
For now, the cursor is always hidden, but the plan is to have it visible
in only the focused view if that view has enabled the cursor.
2021-06-01 18:53:53 +09:00
Bill Currie 00fb0972a8 [qwaq] Fix some incorrect parameter acesses
They weren't wrong as such (the data was being accessed correctly
anyway, just not ideal as the parameter access was slightly hidden.
2021-06-01 18:53:53 +09:00
Bill Currie 73cffe283a [qwaq] Ensure qwaq_event_t's when is aligned
While qfcc will always align double values to 8 bytes (really, two
global words) regardless of the underlying hardware, gcc does not:
doubles are only 4-byte aligned on 32-bit hardware.

This fixes the invalid debug target handle when running on i686.
2021-06-01 18:53:53 +09:00
Bill Currie 1e9329ccf6 [nq,qw] Stop wring to config.cfg
QF now uses its own configuration file (quakeforge.cfg for now) rather
than overwriting config.cfg so that people trying out QF in their normal
quake installs don't trash their config.cfg for other quake clients. If
quakeforge.cfg is present, all other config files are ignored except
that quake.rc is scanned for a startdemos command and that is executed.
2021-04-12 22:09:09 +09:00
Bill Currie 7e6928d7d5 [qwaq] Work around a gcc non-conformance
*sigh*
2021-04-03 00:27:43 +09:00
Bill Currie a5df5867b6 [qwaq] Avoid ignored return val warning
If those particular writes file (and it matters), we probably have
bigger problems.
2021-04-03 00:14:49 +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 c9f1d770e0 Merge master into csqc-improvements
That was a mess
2021-03-25 22:01:31 +09:00