quakeforge/include/QF/progs
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
..
pr_comp.h Merge branch 'master' into wip-rua_scene 2022-05-01 14:46:47 +09:00
pr_debug.h [gamecode] Move progs auxiliary headers into a subdirectory 2022-01-09 00:26:52 +09:00
pr_obj.h [gamecode] Rename func_t to pr_func_t 2022-01-18 15:36:58 +09:00
pr_type.h [qfcc] Add a handle type for engine resources 2023-05-25 10:41:28 +09:00
pr_type_names.h [gamecode] Use pr_type_names for debug views 2022-01-30 10:49:33 +09:00