Commit graph

4 commits

Author SHA1 Message Date
Bill Currie
6d5e8922a5 [qfcc] Add a handle type for engine resources
I never liked the various hacks I had come up with for representing
resource handles in Ruamoko. Structs with an int were awkward to test,
pointers and ints could be modified, etc etc. The new @handle keyword (@
used to keep handle free for use) works just like struct, union and
enum in syntax, but creates an opaque type suitable for a 32-bit handle.
The backing type is a function so v6 progs can use it without (all the
necessary opcodes exist) and no modifications were needed for
type-checking in binary expressions, but only assignment and comparisons
are supported, and (of course) nil. Tested using cbuf_t and QFile: seems
to work as desired.

I had considered 64-bit handles, but really, if more than 4G resource
objects are needed, I'm not sure QF can handle the game. However, that
limit is per resource manager, not total.
2023-05-25 10:41:28 +09:00
Bill Currie
db9a6a9a5c [ruamoko] Make cbuf functions take a cbuf param
A nil param refers to the default cbuf if it has been set by the engine,
otherwise it is invalid. This is the first step to fleshing out the cbuf
API.
2023-05-24 21:01:07 +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
a12fa85506 bring in most of the remaining api bits from cs-code (except string and
stringh: I'm not really that keen on those interfaces and I'ld like to
see them go away) and create libcsqc for most of it (key goes into gui)
2002-08-16 20:15:10 +00:00