I'm learning more about how QCC works, and I just noticed that OP_LOAD_FLD and OP_STOREP_FLD instructions are never generated when compiling the standard game code.
Can they actually be used in valid qc code? Or was it some unfinished feature (my guess would be an ability to pass field names as parameters and get or set that field of an entity).
OP_LOAD_FLD and OP_STOREP_FLD
Re: OP_LOAD_FLD and OP_STOREP_FLD
They'd be fore storing fields in an entity. I imagine it would be something like the following:
Another thought is it was just someone over-engineering the VM and implementing load/storep for all types.
I think I got it working in qfcc, but I've never tested it. Arrays, structs, unions and objects (Objective-C style) are much more useful . Even quaternions are much more useful.
Code: Select all
..float foo; // NOTE two dots
.float bar;
entity baz;
void () somefunc=
{
baz.foo = bar;
...
baz..foo = 0; // again, two dots, but I'm not sure if this would be the syntax
}
I think I got it working in qfcc, but I've never tested it. Arrays, structs, unions and objects (Objective-C style) are much more useful . Even quaternions are much more useful.
Leave others their otherness.
http://quakeforge.net/
http://quakeforge.net/