Commit graph

650 commits

Author SHA1 Message Date
Bill Currie
abedb465af [qwaq] Use separate conditions for queue read/write
While writing the code I suspected this would be necessary, but it's
nice to know. Now the window seems to be correctly fetched, but
get_event locks up.
2020-03-21 12:58:07 +09:00
Bill Currie
af137937bd [qwaq] Add missing mutex unlock 2020-03-21 12:58:07 +09:00
Bill Currie
5f887c4773 [qwaq] Fix missed logic conversion 2020-03-21 12:58:07 +09:00
Bill Currie
7beaa567e6 [qwaq] Pass resource data into the thread
Things have come crashing down, but no fire (ie, no deadlocks so far).
2020-03-21 12:58:07 +09:00
Bill Currie
ac3fef6dd8 [qwaq] Fix a harmless typo
Amusing, though... it was cursed (segaulted).
2020-03-21 12:58:07 +09:00
Bill Currie
cf9455293b [qwaq] Start threads for progs and curses
No idea if anything works, probably come crashing down in a flaming pile
of debris.
2020-03-21 12:58:07 +09:00
Bill Currie
6c1a026bf1 [qwaq] Change thread data array to pointers
I realized that with dynamic thread creation the arrays resizing could
cause them to move around in memory which would be bad for anything
holding a pointer to the data, and even using indices wouldn't help that
much as the array would need to be mutex protected.
2020-03-21 12:58:07 +09:00
Bill Currie
f14f2f518a [qwaq] Rename thread_args to thread_data 2020-03-21 12:58:07 +09:00
Bill Currie
93886d6cd7 [qwaq] Use main args non-options as progs files
If none are specified, default to qwaq-app.dat (for now, anyway). For
each progs file, an optional args set can be specified in the same order
(separated by --). Missing sets default to empty, excess sets are
ignored.
2020-03-21 12:58:07 +09:00
Bill Currie
0cc28c8641 [qwaq] Run main thread
And only thread, still, so things lock up still, but they're coming
together.
2020-03-21 12:58:07 +09:00
Bill Currie
a5f57a8a4c [qwaq] Parse arguments into sets
The sets are separated by --, and the first set is passed to
getopt_long which currently recognizes only --qargs and non-options. The
--qargs options parses out a set (to -- or end of args) that is passed
to the qargs sub-system for standard qf command line parsing. Set 0 is
for the main qwaq application. Any additional sets (excluding --qargs)
will be used to spawn additional threads when that's working.
2020-03-21 12:58:07 +09:00
Bill Currie
52a46f5d5c [qwaq] Use allocate progs instead of static 2020-03-21 12:58:07 +09:00
Bill Currie
74ed057a5f [qwaq] Begin move over to threading
Of course, it currently locks up, but there aren't any other threads as
of yet so the queues starve.
2020-03-21 12:58:07 +09:00
Bill Currie
1a7add3f6d Merge branch 'master' into vulkan 2020-03-20 13:04:41 +09:00
Bill Currie
ec12941fcb Move the ring buffer macros to their own header
They seem to have proven themselves to be robust.
2020-03-19 23:53:54 +09:00
Bill Currie
65538104bf [qwaq] Tweak listener message names
I didn't like the message:message bit
2020-03-19 23:18:01 +09:00
Bill Currie
ac23156ecd [qwaq] Clamp window motion to owner's bounds 2020-03-19 21:28:55 +09:00
Bill Currie
f329ca83b6 [qwaq] Ensure background color clearing works
Even with 0 for the character, colors should get into the buffer.
2020-03-19 20:41:29 +09:00
Bill Currie
3a28d84c3f [qwaq] Implement window dragging
Other than the stray panel_free, that was surprisingly easy. However, do
need to check that the window can be moved otherwise window pos and
panel pos will get out of sync.
2020-03-19 20:31:59 +09:00
Bill Currie
fe4f831512 [qwaq] Remove a pile of stray panel_free calls
C&P programming FTW :P
2020-03-19 20:31:01 +09:00
Bill Currie
f027a42e72 [qwaq] Treat 0 as transparent character 2020-03-19 19:53:32 +09:00
Bill Currie
14fbdc7df9 [qwaq] Clean up debug in TextContext 2020-03-19 19:35:19 +09:00
Bill Currie
e8d947ed8a [qwaq] Get click and drag reporting working 2020-03-19 19:25:57 +09:00
Bill Currie
95d20d67c7 [qwaq] Implement mouse grabbing
Button will need it for dragging.
2020-03-19 19:00:03 +09:00
Bill Currie
2c20a031e4 [qwaq] Do up a little button test "scene"
Hmm... "scene"... too much Unity?
2020-03-19 18:41:53 +09:00
Bill Currie
cce6837fe8 [qwaq] Offset event mouse coordinates
Each level of the object hierarchy has its own offset relative to the
level above, but mouse coordinates are absolute.
2020-03-19 18:40:21 +09:00
Bill Currie
28a9e041e6 [qwaq] Implement Group redraw 2020-03-19 18:39:11 +09:00
Bill Currie
8bd702ab1a [qwaq] Fetch View origin and size separately 2020-03-19 18:38:24 +09:00
Bill Currie
e49ba896aa [qwaq] Support background and clearing in DrawBuffer 2020-03-19 18:37:25 +09:00
Bill Currie
490f1ad4b8 [qwaq] Add wrappers for werase 2020-03-19 18:37:05 +09:00
Bill Currie
ec2409ceba [qwaq] Mention that Window knows addView 2020-03-19 17:34:29 +09:00
Bill Currie
1306d9fcdd [qwaq] Fix some issues in Listener* 2020-03-19 17:33:47 +09:00
Bill Currie
19161ea80a [qwaq] Clean things up in prep for button testing 2020-03-19 16:27:30 +09:00
Bill Currie
23e6b49845 [qwaq] Implement mouse enter/leave events 2020-03-19 15:55:57 +09:00
Bill Currie
3e9977c272 [qwaq] Give up on pass-by-reference for now
It's too much hassle to ensure the passed variable isn't a local. It's
just not worth the grief right now.
2020-03-19 15:54:10 +09:00
Bill Currie
db39f7ed3e [qwaq] Add hover listener to button
Forgot about this (very useful for tooltips etc).
2020-03-19 13:57:10 +09:00
Bill Currie
bd3884f6fa [qwaq] Add a button class
It may or may not work just yet, but I think it's the right direction.
2020-03-19 13:52:14 +09:00
Bill Currie
6a18b1dd55 [qwaq] Add function to merge extents
It's pretty much the union of two rectangles with the same origin.
2020-03-19 13:51:14 +09:00
Bill Currie
03f87d6f27 [qwaq] Add pos Point alias 2020-03-19 13:50:35 +09:00
Bill Currie
8c3cf83f02 [qwaq] Add Listener and ListenerGroup delegates
Simple single parameter (caller) direct messages.
2020-03-19 13:49:27 +09:00
Bill Currie
01835cbd94 [qwaq] Add blitFromBuffer to TextContext protocol 2020-03-19 13:48:48 +09:00
Bill Currie
2f3ca9d9e4 [qwaq] Clean up the hierarchy
I think I've finally figured out what I want the core hierarchy to be.
Right now, it's just the two classes: View and Window (derived from
View). Window has a Group, and Group is just a collection of Views that
it manages. QwaqApplication is just an object but like a Window, it has
a Group of views.

    View
      Window has a Group
    Group contains Views
    QwaqApplication has a group

More work needs to be done on drawing and event handling, but things are
working again.
2020-03-19 11:32:44 +09:00
Bill Currie
b16093a533 [qwaq] Split out Array(Group) interface 2020-03-19 11:04:02 +09:00
Bill Currie
f6f6b2cba3 [qwaq] Doc the issue number for blit slug 2020-03-18 01:40:58 +09:00
Bill Currie
affadc3d25 [qwaq] Create protocols for DrawBuffer and TextContext
Plenty of flaws at the moment (casts to id :/), but the basic idea seems
to be ok.
2020-03-18 01:40:41 +09:00
Bill Currie
e5bc6dd8b6 [qwaq] Split Array(Group) into its own file 2020-03-18 01:12:23 +09:00
Bill Currie
28a8c1fda7 [qwaq] Implement more curses wrappers 2020-03-17 14:05:31 +09:00
Bill Currie
877ad35a82 [qwaq] Rework the hierarchy again
It doesn't work right now because View unconditionally sends refresh to
its textContext, but textContext can be a draw buffer which does not
respond to refresh. Still, these changes (notably the assignment chain
in qwaq-group.r really pushed qfcc).
2020-03-14 19:45:07 +09:00
Bill Currie
6001abbfdb [qwaq] Use the now working compound init more 2020-03-13 10:00:05 +09:00
Bill Currie
45acbddb79 [qwaq] Make DrawBuffer and TextContext sizes available 2020-03-13 03:09:42 +09:00
Bill Currie
1d3c8d8a6c [qwaq] Sort out mess around placement of getwrect 2020-03-13 03:09:42 +09:00
Bill Currie
d0f21ec2b4 [qwaq] Add -refresh to TextContext
This does the right thing in the presence of panels and dealing with
stdscr.
2020-03-13 03:09:42 +09:00
Bill Currie
3defe50be6 [qwaq] Add printf builtin to ease debugging 2020-03-13 02:41:08 +09:00
Bill Currie
7f9a415cbc [qwaq] Get DrawBuffer and TextContext working
Especially blitting whole regions. Partial regions not tested yet.
2020-03-13 02:36:53 +09:00
Bill Currie
0d4c7ba10f [cl_menu] Update plist usage of obj_msg_sendv
Wonder if there's anywhere else...
2020-03-12 00:52:42 +09:00
Bill Currie
ce67d9b202 [qwaq] Flesh out DrawBuffer's methods 2020-03-10 19:27:26 +09:00
Bill Currie
b3850bbc69 [qwaq] Implement blitting from draw buffer to text
Sending the data out to curses.
2020-03-10 19:23:51 +09:00
Bill Currie
f91fb4f840 [qwaq] Add an mvwblit_line builtin
I had to do my own thing with curses as the function I had planned to
use turned out to be quite different from what I wanted (misread the man
page).
2020-03-10 18:21:06 +09:00
Bill Currie
694ad2e840 [ruamoko] Add str_char builtin
This returns the character (as an int) at the index. Equivalent to
string[index], but qc code doesn't have char-level access and not having
it means that strings can internally change to wchar without too much
fuss (maybe).
2020-03-10 18:16:55 +09:00
Bill Currie
1b1249bdb0 [ruamoko] Add vsprintf builtin 2020-03-10 18:16:07 +09:00
Bill Currie
b517b95e45 [libr] Add -performv:: 2020-03-10 14:29:43 +09:00
Bill Currie
fb92ee12d6 [qwaq] Set event type to none when no events
Fixes the endless looping on the last event.
2020-03-10 03:11:21 +09:00
Bill Currie
f9d798c314 [qwaq] Use forwarding for some text methods
refresh won't be in the drawing buffer protocol, and the move commands
need to be offset by the view's position in its window, but it works as
intended.
2020-03-10 02:58:30 +09:00
Bill Currie
e9eab68366 [qwaq] Begin work on local drawing buffers 2020-03-10 02:39:18 +09:00
Bill Currie
4978713dee [libr] Add __obj_responds_to proto and definition 2020-03-10 00:09:46 +09:00
Bill Currie
a487595149 [ruamoko,libr] Begin implementation of __obj_forward
libr supplies an __obj_forward definition that links to a builtin, but
as it is the only def in its object file, it is readily replaceable by
an alternative Ruamoko implementation.

The builtin version currently simply errors out (rather facetiously),
but only as a stub to allow progs to load.
2020-03-09 19:09:08 +09:00
Bill Currie
0780cca496 [qwaq] Fixed swapped method implementations
That was fun
2020-03-08 22:21:15 +09:00
Bill Currie
8fc007648c [qwaq] Add missed command enum string 2020-03-08 22:20:46 +09:00
Bill Currie
89cf9f9523 [qwaq] Use Sys_Printf for load error messages
It gets them into the log file.
2020-03-08 22:19:37 +09:00
Bill Currie
bb0e65e9d4 [cl_menu] Silence some debug output 2020-03-08 21:45:51 +09:00
Bill Currie
f0ecf7b30a [qwaq] Clean out log file with make clean 2020-03-06 20:43:38 +09:00
Bill Currie
1250fe7446 [qwaq] Use a log file instead of stderr
Now I don't have to worry about remembering to redirect the output, but
debugging is still easy.
2020-03-06 18:29:16 +09:00
Bill Currie
b8b74fc074 [qwaq] Implement missing addch
I either forgot about it, or just didn't need it at the time, but I'm
sure it will be useful later when more stuff is implemented.
2020-03-06 17:57:33 +09:00
Bill Currie
9a96a9b2c9 [qwaq] Use own version of positional drawing in Window
Double offsetting the prints doesn't quite look right ;)
2020-03-06 17:46:36 +09:00
Bill Currie
d0a249590c [qwaq] Use self where possible for drawing in Window 2020-03-06 17:45:58 +09:00
Bill Currie
bea64838cc [qwaq] Use new TextContext
Not quite right yet, but it worked first try (once I got another
compiler bug sorted).
2020-03-06 17:38:27 +09:00
Bill Currie
ba9c43d2d3 [qwaq] Create a TextContext class
It is essentially just a wrapper around the window versions of ncurses
functions.
2020-03-06 13:54:46 +09:00
Bill Currie
40ae7a7f19 [qwaq] Implement ofDontDraw
The conditional selector performance seems to work nicely, but I've
found a mistake with View.window (partly, realizing why my old lib (and
probably TV in the first place) had separate textContext and buffers
between views and groups).
2020-03-06 11:53:40 +09:00
Bill Currie
6bf2fd546d [qwaq] Extend Array makeObjectsPerform methods
Added conditional message sending and reversed traversal of the array.
2020-03-06 11:27:31 +09:00
Bill Currie
ad4cde15b5 [qwaq] Get Window working
It even draws a border around itself.
2020-03-06 00:32:09 +09:00
Bill Currie
f18e3c3ad7 [qwaq] Add wborder command 2020-03-06 00:31:29 +09:00
Bill Currie
971caf553d [qwaq] Add debug output to the command queue
Be sure to redirect stderr or the screen will get messed up
2020-03-06 00:30:11 +09:00
Bill Currie
c377b324a1 [qwaq] Add Group and clean up lots of mess
Things are finally doing something again, and getting closer to having a
moveable window.
2020-03-05 15:44:53 +09:00
Bill Currie
a4582e526d [cl_menu,scheme] Clean up after tightened pointer checks 2020-03-05 15:02:40 +09:00
Bill Currie
2ddfe2ef07 [libr] Accept void * for performSelector:withObject:
It's up to the receiver what the object should be.
2020-03-05 15:00:42 +09:00
Bill Currie
f3236410d0 [qwaq] Make the event system more informative
Doesn't have timestamps at this stage, but otherwise it reflects the
event system I had in my old text UI which was heavily based on
TurboVision. TV is pretty good (after looking at things a bit closer I
found it wasn't as deep as I thought), and better yet, Borland released
it to the public domain 23 years ago! (wish I'd known that).

Anyway, this commit gets something happening on the screen, even though
the current hierarchy is still a mess.
2020-03-04 22:09:40 +09:00
Bill Currie
815ae02121 [qwaq] Allocate enough bytes for the args list
d'oh
2020-03-04 21:17:17 +09:00
Bill Currie
d57e05258c [qwaq] Remove now unnecessary union field name
\o/
2020-03-04 19:10:09 +09:00
Bill Currie
c58cf2c2d0 [qwaq] Fail at object oriented design 101
This is horrible, doesn't work, isn't really the direction I want to go
(that became apparent while implementing Screen's handleEvent) and
crashes anyway (Array and not-id...)

*sigh*

Still, this does have some good stuff in it, and it pushed qfcc along
some more.
2020-03-03 21:32:19 +09:00
Bill Currie
7976eec2ce [scheme] Clean up a pile of rotten bits 2020-03-03 17:35:14 +09:00
Bill Currie
051a572bcc [build] Dependency checking for all ruamoko code
Including dependency on qfcc itself. Getting automake to chooch the way
I want it to chooch can be a pain in the... see AvE
2020-03-03 17:24:53 +09:00
Bill Currie
cdc1f0c5e7 [libr] Treat ruamoko headers as system headers
Now that qfcc actually supports them properly.
2020-03-03 15:24:41 +09:00
Bill Currie
bb25057feb [qwaq] Quickly Workaround Access Qualifications
:)
2020-03-03 10:47:34 +09:00
Bill Currie
c2138183dd [libr] Initialize SetIterator the right way
I'd written Set.[rh] after the big rewrite so never noticed the access
error.
2020-03-03 10:43:29 +09:00
Bill Currie
50d39d64cb [qwaq] Link against build ruamoko libs, not installed 2020-03-03 09:30:20 +09:00
Bill Currie
679744fc7d [libr] Fix incorrect bounds check on array insert 2020-03-03 00:11:07 +09:00
Bill Currie
d91289ea1b [qwaq] Remove unnecessary wrefresh calls 2020-03-02 18:43:27 +09:00
Bill Currie
33a07c0f6b [qwaq] Make command buffer larger for now
A small one should be fine once threading is working.
2020-03-02 18:30:58 +09:00
Bill Currie
6f1386fa0d [qwaq] Test out acs chars and the classes
Crashes due to flooding the command buffer, but otherwise works (with
larger buffer).
2020-03-02 18:29:31 +09:00
Bill Currie
b9ab30ff59 [qwaq] Add mvwaddch and ACS support 2020-03-02 18:27:08 +09:00
Bill Currie
a0c4d56668 [qwaq] Continue processing on void commands
If the last command in the buffer had no parameters, its length would be
only 2 and thus processing would stop before reading the command from
the buffer.
2020-03-02 18:19:41 +09:00
Bill Currie
fa66e9fc2f [qwaq] Move queue handling into separate functions
This makes it so I need to edit only one place when I get threads
working. Also, it fixes some bugs (eg, panel creation wasn't implemented
correctly).
2020-03-02 18:15:31 +09:00
Bill Currie
d88a091fc6 [qwaq] Use protocols to distinguish object abilities
Well, that took a fair bit more than it should have to get working: had
to implement the protocol support in qfcc and engine-side ruamoko.
2020-03-02 15:22:54 +09:00
Bill Currie
92cb3a5285 [qwaq] Flatten the hierarchy and do some cleanup 2020-03-01 18:25:02 +09:00
Bill Currie
4d076da4b6 [qwaq] Fix warning hidden by type alias bug 2020-03-01 16:15:33 +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
6fccfdf1b9 Fix a thinko in the save game menu
I thought I had to prepend the gamedir when using QFS_FOpenFile (or
QFS_OpenFile in rua).

Nope, it's gamedir based
2020-02-26 18:03:00 +09:00
Bill Currie
383a7fe5e1 Remove File_Open
Other than its blocking of access to certain files, it really wasn't
that useful compared to the functions in qfs, and pointless with access
to qfs anyway.
2020-02-26 13:45:14 +09:00
Bill Currie
caf78b5422 Rename ty_none to ty_basic
This far better reflects the actual meaning. It is very likely that
ty_none is a holdover from long before there was full type encoding and
it meant that the union in qfcc's type_t had no data. This is still
true for basic types, but only if not a function, field or pointer type.
If the type was function, field or pointer, it was not true, so it was
misnamed pretty much from the start.
2020-02-21 17:52:00 +09:00
Bill Currie
2f18364364 Start work on encoding typedef chains 2020-02-19 21:41:46 +09:00
Bill Currie
a6f3e1753a Fix ruamoko's hashtab_t typedef
Being typedefed directly to a pointer is a holdover from when pointer
declarations were really awkward.
2020-02-19 21:41:46 +09:00
Bill Currie
67e183c8b6 Put the guts of qwaq's reflection code into ruamoko 2020-02-19 21:41:46 +09:00
Bill Currie
39df9c0c87 Fix some more double related warnings
Fewer than I expected
2020-02-15 23:49:12 +09:00
Bill Currie
7e7e0526dd Fix a double constant issue
There will be more of these :/
2020-02-15 23:49:12 +09:00
Bill Currie
df7c08a010 Add support for doubles to Ruamoko
Only as scalars, I still need to think about what to do for vectors and
quaternions due to param size issues. Also, doubles are not yet
guaranteed to be correctly aligned.
2020-02-15 23:49:12 +09:00
Bill Currie
9248e8cf01 Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
Bill Currie
c98d1ff08c Document some problems with nil
While he's a pretty cool character in HZD, he seems to have some
identity problems when in a compiler.
2019-06-09 22:29:51 +09:00
Bill Currie
f163e35f21 Add a builtin to get keydown. 2016-01-10 13:33:05 +09:00
Bill Currie
c25fd410a5 Update doxygen config files for 1.8.9.1 2016-01-04 11:17:09 +09:00
Jeff Teunissen
396338a543 Rua: flesh out docs for BOOL. 2014-10-16 13:05:57 -04:00
Bill Currie
f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie
2e8d9e7636 Correct the menu code to sortof work with the new IMTs.
The menu code at least compiles now. It should work for the default IMT
tables (ie, if imt_0 is there).
2013-01-16 20:31:46 +09:00
Bill Currie
2974bedd78 Add ruamoko declarations for the new menu functions. 2013-01-13 20:13:19 +09:00
Bill Currie
4868a245b3 Fix the "for new syntax" FIXME.
Empty structs are now (correctly) invalid. The hack of using an empty
struct to represent a handle returned from a builtin has been unnecessary
since opaque structs were implemented: now a pointer to an opaque struct
can be used. This is mostly safe as handles are aways negative and thus
attempting to dereference such a pointer should result in a VM error. It
will be even safer once const is implemented and the pointers can be made
constant (eg, typedef struct handle * const handle;)
2012-12-20 10:10:41 +09:00
Bill Currie
e17d8ac9db Add ruamoko wrappers for the set api.
This includes both normal functions and a Set class (and SetIterator
class). Most of the methods are implemented as builtins.
2012-12-16 13:48:36 +09:00
Bill Currie
7ed490c434 Allow nil when replacing objects in an array.
I want this in a little project, but I also want to consult with Deek about
it, so I've only commented out the code.
2012-12-16 13:38:19 +09:00
Bill Currie
814f902e88 Add a new crosshair.
Now all 4 slots of the crosshair table are used :)

Also, fix the offset for pic based crosshairs in glsl, and use just one
func for them.
2012-12-12 19:36:18 +09:00
Bill Currie
f358364ef2 Fix assignment of nil to a structure.
constfold.c seems to be getting a little long in the tooth :P
2012-12-11 11:53:01 +09:00
Bill Currie
cd62755ce4 Fix some warnings found by qfcc's flow analysis.
Ok, maybe it works too well? Nah, not really. It's nice having proper
unisnitialized checks on structs.
2012-12-10 22:20:44 +09:00
Bill Currie
ff0c51e52c Build our ruamoko stuff with optimizations :) 2012-12-01 11:20:06 +09:00
Bill Currie
2aaa380098 Fix some uninitialized variable warnings.
While they're false positives (qfcc doesn't know about noreturn), at least
qfcc is doing its job :)
2012-11-21 10:25:29 +09:00
Bill Currie
db92a7b9f9 Fix an out-by-one error.
That "qfvalgrind" is proving worthwhile :)
2012-11-20 19:49:57 +09:00
Bill Currie
abd9704d26 Avoid over-releasing the autorelease pool.
It seems that the engine menu code must be calling menu_post too often, but
I don't feel like fixing it just yet.
2012-11-20 14:54:40 +09:00
Bill Currie
951bed6206 Allow the retain count to become 0.
With the new retain count scheme, it must reach 0 or double frees won't be
caught.
2012-11-20 14:41:13 +09:00
Bill Currie
d5c831b6da Add a little test case for accessing types.
Using ruamoko to access ruamoko type encodings is actually quite pleasant
:)
2012-11-15 13:40:11 +09:00
Bill Currie
9a53531d3b Fix a braino in Object's -init.
I'd forgotten AutoreleasePool doesn't like receiving -retain when I did the
retainCount change, and thus Object's -init was a little too naive.
2012-11-14 20:45:29 +09:00
Bill Currie
c96718493a A bit of a cleanup before fixing class type defs.
All internal structs now have "proper" names, and fit the naming convention
(eg, obj_module (like objective-c's types, but obj instead of objc). Some
redundant types got removed (holdovers from before proper struct tag
handling).

Also, it has proven to be unnecessary to build internal classes, so
make_class and make_class_struct are gone, too.
2012-11-12 11:12:33 +09:00
Bill Currie
dc22d06905 Fix an out-by-one in the definition of INT_MAX.
INT_MAX wound up being INT_MIN :/
2012-11-12 10:28:31 +09:00
Bill Currie
218424d0ae Add debug.r to libcsqc. 2012-11-09 19:11:30 +09:00
Bill Currie
07e67da838 Add class versions of retain and friends.
As class objects don't have retain counts (they're usually static, even!!),
allowing the instance implementations of retain, release, and autorelease
attempt to modify the non-existant retainCount would be a recipe for severe
headaches. We also don't want the retainCount returning "random" values.
2012-11-08 20:41:56 +09:00
Bill Currie
6b46cde7c8 Move retainCount out of Object.
Going by "standard" Objective-C, retainCount really doesn't belong in
Object itself. The way GNUStep does it is to stash retainCount in memory
just below the object by allocating extra bytes for the count and returning
a pointer just beyond those extra bytes. Now Ruamoko does the same. This
fixes the inconsistencies in structure layouts for Protocol and class
structs between qfcc generated (internal) structs and user visible structs.
2012-11-08 20:24:25 +09:00
Bill Currie
3042c2bb1a Create backups of quick.sav.
F6 is fantastic, until you hit it by mistake after dieing when you meant
to hit F9 (I've done that way too often). quick.sav is still the last file
written via F6 (so F9 is unaffected), but now the previous quick.sav
becomes quick1.sav. Up to 5 (currently) backups will be kept: quick1 is
the newest, quick5 the oldest. A menu for accessing the backups has been
added as a sub-menu of the load menu.
2012-07-21 22:41:57 +09:00
Sander van Dijk
4725d5a973 Add a "Prev. weapon" menu option. 2012-07-17 06:28:32 +09:00
Bill Currie
f1854c85b2 Fix some doxygen warnings and errors. 2012-07-15 07:39:50 +09:00
Bill Currie
37dda1ef99 Update for doxygen 1.8.1 2012-07-15 07:39:50 +09:00
Bill Currie
d9288c0837 Don't double-draw the bindings menus. 2012-07-14 20:16:45 +09:00
Bill Currie
23a38738fc Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie
95a06c20b2 Move qfcc's libs and headers to ${prefix}/share
On discussion with Despair, share makes more sense than lib as they are
really cross-platform (though qfcc itself is not).
2012-05-05 19:34:35 +09:00
Bill Currie
bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie
b69d527507 Nuke another AM_CONDITIONAL 2012-02-13 16:08:03 +09:00
Bill Currie
546a7e7aac Avoid recusing into tools and ruamoko when not needed. 2012-02-12 19:29:31 +09:00
Bill Currie
7c76415f9d Add math.r to libr. 2012-02-06 19:33:08 +09:00
Bill Currie
a694eed968 Add Draw_Picf to allow smooth placement on low-res consoles. 2012-02-06 19:32:30 +09:00
Bill Currie
14c0e22494 Tweak Draw_MakePic to be a little more usable. 2012-02-06 15:50:32 +09:00
Bill Currie
d6ddbe4efe Create decls for the new draw functions. 2012-02-06 15:50:32 +09:00
Bill Currie
c98ffa4eda Create a message buffer API for Ruamoko
The api hides all the gory details of message buffer setup and usage
(particularly the differences between writing and reading). Most
importantly, the api provides a safe way to read and write binary data
(always little endian).
2012-02-06 15:50:32 +09:00
Bill Currie
6e10d847ef Make the qpic_t struct consistent with the internal layout.
Now that the renderer ruamoko builtins use handles, there's no need to
hide data, and it's safer anyway.
2012-02-06 12:50:44 +09:00
Bill Currie
c8163fc0de Add an option to prevent the use of default paths.
Despair has things locked down such that running qfcc during a build fails
due to lack of read access to /usr/local/lib. This is actually a good
thing as accidentally hitting old includes/libs (when a file gets deleted
in the tree) hides bugs. Thus, --no-default-paths to turn off default
search paths.
2012-01-04 13:53:04 +09:00
Jeff Teunissen
7d6430edd4 Rua: move the old cvar() and cvar_set() functions
Move the old cvar get/set funcs to cvar.[rh] from system.[rh].
2011-12-14 20:33:33 -05:00
Jeff Teunissen
6ead583195 Ruamoko: Implement infinity.
The special token __INFINITY__, like __FILE__ and friends, will expand to
a floating-point expression containing a value the C compiler considers
infinite. Obviously, this assumes that the system has relatively modern
float hardware -- but if it doesn't, having Ruamoko be able to represent
float infinity is the least of your problems. :)
2011-12-14 12:20:10 -05:00
Jeff Teunissen
4f4d6b5675 OK, now import them...
Duh.
2011-12-09 22:42:43 -05:00
Jeff Teunissen
361255cf31 Ruamoko: New math constants, some new math functions
Also, switch all of the math builtins functions we use from Rua to the
ones that accept and return floats, avoiding conversions to/from double.
2011-12-09 22:36:41 -05:00
Jeff Teunissen
c7c646a53f Makefile portability fixes
Allow our makefiles to build with non-GNU 'make' implementations.
Required some renaming of not-really-QuakeC source to .r to get it right.
2011-07-25 17:22:44 -04:00
Jeff Teunissen
5ef92009f0 Switch to SVG images for docs.
Doxygen 1.7.3 added support for SVG output from dot, so let's use it.
2011-07-25 17:22:44 -04:00
Bill Currie
ef8b1821d2 Fix the bindings menus.
That was a lot easier than I expected.
2011-07-10 18:58:50 +09:00
Bill Currie
15cb8849c3 Docs for MenuGroup 2011-07-10 18:58:16 +09:00
Bill Currie
7c23817cbe Some changes I missed from the previous commit. 2011-07-10 18:57:24 +09:00
Bill Currie
2c85a3ccc0 Make a start on documenting the gui stuff. 2011-07-10 17:33:43 +09:00
Bill Currie
361e76aa7b Convert prototypes to C-style for doxygen. 2011-07-10 08:56:04 +09:00
Bill Currie
8ac5079ada Get inputlines mostly working.
It should be only behind-the-scenes updates that are still a problem.
2011-07-09 21:16:38 +09:00
Bill Currie
652b434e7b Rework the inputline wrapper.
Use the resource map code for handle management (much safer).
Add support for the enter callback (function or method).

Unfortunately, it still doesn't work due to poor design of the inputline
user data.
2011-07-09 09:44:37 +09:00
Bill Currie
838e35af96 Fix the escape problem for Join Game.
Allowing the menus to override the Escape key was necessary, but there was
badly written code floating around that broke when that was implemented.
Oops.
2011-07-07 17:08:21 +09:00
Bill Currie
01463b0e77 Fix the color view key gobbling bug. 2011-07-06 19:48:27 +09:00
Bill Currie
508fd22d27 Convert the player menu to using the plist.
Various things are decidedly broken:
  * shirt and pants colors cannot be changed
  * shirt and pants color views gobble the cursor keys (cannot leave them)
  * input fields do not get updated if the cvar is changed elsewhere
  * name input field (at least) does not set the new name
However, at least the escape problem is fixed :)
2011-07-06 19:21:35 +09:00
Bill Currie
4e66a5b327 Add rua rappers for the cvar alias functions. 2011-07-06 19:17:28 +09:00
Jeff Teunissen
82e934af47 Rualib: nuke some unnecessary classes
List, ListNode, and Stack aren't necessary; all three are obviated by the
new, richer Array class.
2011-06-14 13:33:10 -04:00
Jeff Teunissen
b18302eac1 Array: sorta-implement -description
An #if 0'ed out implementation of the -description method, which currently
returns a Quake string containing whatever the contained objects return
from -description, between parens and separated by commas (just like plist
format). Ideally, we'd have string objects interchangeable with primitive
strings, but having string objects (which are being worked on) should help.
2011-06-14 13:31:30 -04:00
Jeff Teunissen
21c46b9081 View: add brief description 2011-06-14 13:31:30 -04:00
Jeff Teunissen
cb86e09029 Rualib: documentation updates.
Add a layout file for Rua docs and create groups for its library functions.
2011-06-14 13:31:30 -04:00
Bill Currie
30bd1c0134 Create classes for inputing cvar strings and script the network menu.
Hitting enter after inputting text is currently broken, but that's because
support for it was never put in the inputline wrapper code.
2011-03-25 18:26:10 +09:00
Bill Currie
896791b209 Correct the spelling of "int" and clean up the mess. 2011-03-25 16:53:04 +09:00
Bill Currie
8c1d948586 And qfcc finds another bug :) 2011-03-24 13:36:36 +09:00
Bill Currie
1822290b1a Fix the double offset of inputline text. 2011-03-24 08:50:32 +09:00
Bill Currie
e878ace83b Make input lines mostly work.
There is still a problem with the placement of the input line text
relative to the text box caused by vertical movement being excessive.
2011-03-23 21:35:49 +09:00
Bill Currie
98f5f84ca3 Clean up the leftovers of converting the controls menu.
The bindings menu is still inaccessible, though.
2011-03-23 15:22:01 +09:00
Bill Currie
15fc325136 Fix the features menu. 2011-03-23 15:19:30 +09:00
Bill Currie
bc0cffc9c6 Fix handling of autorelease pools in the menu code.
Create a "menu_pre" function that creates the autorelease pool, change
menu_post() to release the pool correctly, and make the menu internal code
require and call menu_pre.
2011-03-21 13:14:14 +09:00
Bill Currie
a9e139e14c Correct a minor logic error.
We don't want to always add a new autorelease pool, and we certainly want
one if there are none.
2011-03-21 13:12:30 +09:00
Bill Currie
7b9d70167f Fix some missed language changes. 2011-03-10 20:51:04 +09:00
Bill Currie
59f520f4e7 Fix some parse errors that were lost in the noise. 2011-03-03 10:39:21 +09:00
Bill Currie
aa4ed00090 Fix the message type used to check arguments. 2011-03-02 22:13:16 +09:00
Bill Currie
3a1e467ae8 Non-bogus syntax and warning fixes for ruamoko/cl_menu.
Sadly, there are many bogus warnings and other errors. qfcc is still very
sick :(.
2011-02-14 23:10:46 +09:00
Bill Currie
9ac6929cf7 Syntax fixes for ruamoko/game.
This one actually would compile if object files were working.
2011-02-14 23:10:46 +09:00
Bill Currie
6af747705c Syntax fixes for ruamoko/scheme. 2011-02-14 23:10:46 +09:00
Bill Currie
da3ac388fe Syntax fixes for ruamoko/gui.
Once aggregate initializers are working, ruamoko/gui will "compile"
(no object files, and still the bogus integer constant into ... warning).
2011-02-14 23:10:46 +09:00
Bill Currie
595019d86e Fix some problems found by the new qfcc.
With this, ruamoko/lib almost compiles (though no object files are output).
Just some bogus "redeclared" errors and an improperly implemented
statement that produces an ice.
2011-02-14 23:10:45 +09:00
Bill Currie
daae0284a1 Work around a warning about passing int constants into ...
I'm not sure why this is happening now when it didn't in the old qfcc,
but this will take care of the warning for now until I can get around to
fixing it.
2011-02-14 23:10:45 +09:00
Bill Currie
1195df9686 Update for the new syntax. 2011-02-13 21:25:36 +09:00
Bill Currie
ed3f98eab4 qwaq related compile fixes for the new function syntax rules. 2011-02-13 19:07:30 +09:00
Bill Currie
1f8b453d58 Add some return statments for now.
At the moment, qfcc has no way of knowing that a function will never
return. This is needed until the time qfcc can know that.
2011-02-10 14:48:06 +09:00
Bill Currie
d6b10c99aa Most, if not all, of the fixes needed to get qwaq building.
This is pretty much just changing [] to * and moving [N] to the other side
of the variable name.
2011-02-07 22:16:16 +09:00
Bill Currie
c38ea0b1bc Correct the spelling of "nil". 2011-01-14 12:07:40 +09:00
Bill Currie
f2fb853052 Fix for parallel make. 2011-01-10 13:29:51 +09:00
Bill Currie
cbe245725b Install the symbol file so menus can be debugged. 2011-01-10 12:26:11 +09:00
Bill Currie
9e06220dc5 Missed a class -> class pointer change. 2011-01-10 12:26:11 +09:00
Bill Currie
6ebee4ad0e Get the type of Method right.
It's a direct structure rather than a pointer.
2011-01-10 12:25:31 +09:00
Bill Currie
75ec6bf244 Clean out some unnecessary types from the progs engine and clean up the mess.
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00
Bill Currie
c5edbf147a Move ruamoko libs and headers into ${prefix}/lib/qfcc 2010-12-24 19:39:54 +09:00
Jeff Teunissen
b184739f03 Use qfcc's new unsigned constant qualifier for UINT_MAX 2010-12-24 05:09:14 -05:00
Jeff Teunissen
81d927c702 rename Runtime.h -- it's not a class. 2010-12-24 05:03:31 -05:00
Jeff Teunissen
cdb9783d69 Actually commit the new header...
@#$@$#^%^
2010-12-16 06:46:59 -05:00
Jeff Teunissen
ff57b96bc6 Add Runtime header for obj* stuff.
Also, move lots of stuff out of the Object header.
2010-12-16 06:42:28 -05:00
Jeff Teunissen
7cb2ce3263 whitespace, clean up AutoreleasePool warnings
d'oh! How did I forget to include that header?
2010-12-16 06:24:54 -05:00
Jeff Teunissen
061f56ea2d Add missing methods
Array: Implement -indexOfObject: and -indexOfObjectIdenticalTo:
2010-12-16 06:24:54 -05:00
Jeff Teunissen
4968b65b2f Minor doc updates
Reveal more Rua documentation that I had already written years ago, and
clean up Array a little.
2010-12-16 06:24:54 -05:00
Jeff Teunissen
a8e3d5d527 Doc fixes
Tweak colors, add borders around some images, remove static definitions
from engine docs.
2010-12-16 06:24:54 -05:00
Bill Currie
096d7f5791 Turn on -Wall -Wno-integer-divide
This will break Array.r until Deek gets his changes in.
2010-12-16 20:14:06 +09:00
Bill Currie
6d494bfcdf Fix a slew of warnings found by -Wall.
-Wall still isn't used yet due to a missing method in Array, and
overzealous warnings in qfcc, but this covers the necessary fixes.
2010-12-16 20:01:49 +09:00
Jeff Teunissen
28338bc74e Turn off timestamping in HTML docs
The pointless deltas were slowing rsync down more than I'd like, and it's
not as if that information is all THAT useful. Nuke it.
2010-12-13 13:20:26 -05:00
Jeff Teunissen
d9e97e27a2 Doxygen formatting updates
Doxygen-produced HTML docs now look a lot more like the web site, and
are now more attractive in general. :)
2010-12-13 03:28:34 -05:00
Bill Currie
d89893682e Tweak an "only".
*twitch*
2010-12-12 22:55:53 +09:00
Bill Currie
736c9a3a60 Create a reference to Array(Private).
This is the real fix for the problem worked around by 5c8cb8fe.
2010-12-12 20:44:46 +09:00
Bill Currie
c262229478 Revert "Move private Array methods into main file"
This reverts commit 5c8cb8fec8.

The fix comes next.
2010-12-12 20:43:28 +09:00
Jeff Teunissen
15ba4091bc Doc fixes.
Document some more Array methods, mark the private methods as private in
the docs.
2010-12-12 05:45:12 -05:00
Jeff Teunissen
4a8ff8aee8 A little strictness: error out in some nasty conditions. 2010-12-12 05:41:52 -05:00
Jeff Teunissen
f86e933c6a Array API fixes
NQ menus work now.
2010-12-12 05:40:24 -05:00
Jeff Teunissen
5c8cb8fec8 Move private Array methods into main file
#if 0 out the "normal" implementation, so that it doesn't hurt. When it
becomes possible to have the private Array methods separate, remove them
from the main file and remove the #if 0 block from Array+Private.r.
2010-12-12 05:39:17 -05:00
Bill Currie
c08c072da7 Make ruamoko docs build properly in out-of-tree builds. 2010-12-12 14:20:23 +09:00
Jeff Teunissen
22dd7cd20d Avoid wasting a local and giving the compiler a minor aneurysm
qfcc doesn't yet like foo[bar++] = baz; let's be nice and not give it
indigestion.
2010-12-12 00:16:33 -05:00
Jeff Teunissen
0371a825b8 Damn, documented wrong method. 2010-12-11 23:49:48 -05:00
Jeff Teunissen
f13c45a9ae kill extra reference to Array in docs 2010-12-11 23:45:48 -05:00
Jeff Teunissen
537915f5bc Ruamoko: Document AutoreleasePool 2010-12-11 23:45:19 -05:00
Jeff Teunissen
b45ff85f0c Add doxyfile for Ruamoko lib
Whee, Rua docs!
2010-12-11 23:44:11 -05:00
Jeff Teunissen
8d05b07a26 remove empty -release in AutoreleasePool. 2010-12-11 23:32:04 -05:00
Jeff Teunissen
180450e785 declare ARP_FreeAllPools() @extern 2010-12-11 23:23:55 -05:00
Jeff Teunissen
c58a72842f Update users of Array to new API 2010-12-11 20:32:19 -05:00
Jeff Teunissen
505076a98d rewrite Array, AutoreleasePool
This version is a bit more useful, and we should be able to get rid of the
Stack class. Also, the Ruamoko parts of the autorelease system should be
almost ready now.
2010-12-11 20:32:19 -05:00
Jeff Teunissen
4bd37e7b64 Switch to C-style function declarations.
Doxygen hates the QuakeC-style function prototypes we use, so switch to the
C-style prototypes.
2010-12-11 20:31:59 -05:00
Bill Currie
3b0dbd29ca make distcheck fixes 2010-12-06 21:24:49 +09:00
Bill Currie
32bf4aed2b get the message name right 2010-11-28 14:36:21 +09:00
Bill Currie
7ce1fc3be5 Break out all the classes into their own files. 2010-11-24 17:01:19 +09:00
Bill Currie
2b3ba0633e Break out the menu plist parser into its own file. 2010-11-24 17:01:19 +09:00
Bill Currie
e471ddff47 Use the new file based property list API.
Also eleminate the menu_plist global (the plist does not hang around).
2010-11-24 17:01:19 +09:00
Bill Currie
addbcaa09c Add PL_GetFromFile builtin.
This is an extension "wrapper" (no such C function). This allows ruamoko
programs to read property lists without worrying about the memory required
to store the string for the property list being read.
2010-11-24 17:01:19 +09:00
Bill Currie
857f8eb6e4 Get the plist controls menu mostly working.
The bindings menu is currently inaccessible.
2010-11-24 17:01:19 +09:00
Bill Currie
9c3c1b9ac1 Use @param instead of id to pass objects within the menu parser.
This allows mixed types (eg, objects and Rects). To be passed around. This
sorts out the changes needed for the conversion of Rect from object to
struct.
2010-11-24 17:01:19 +09:00
Bill Currie
730082a393 Make Group set its position (and those of its subviews) correctly. 2010-11-24 17:01:19 +09:00
Bill Currie
e9fea12e47 Must return self in -autorelease 2010-11-24 17:01:19 +09:00
Bill Currie
3878b76cc5 Start using autorelease.
Much more testing is required (oh, but for qc-valgrind), but there is now
a ~945kB block of free data in the menu progs heap :).

Also, correct the printed size of the memory block to not include the
block header size.
2010-11-24 17:01:18 +09:00
Bill Currie
4518e6af91 First stab at implementing autorelease.
It's probably nowhere near right, but probably ok for now (I need to study
the GNUStep code). I'm unhappy with the menu code hook, but it will have
to do for now.
2010-11-24 17:01:18 +09:00