OP_LOAD_FLD and OP_STOREP_FLD

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
andrewj
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

OP_LOAD_FLD and OP_STOREP_FLD

Post by andrewj »

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).
taniwha
Posts: 401
Joined: Thu Jan 14, 2010 7:11 am
Contact:

Re: OP_LOAD_FLD and OP_STOREP_FLD

Post by taniwha »

They'd be fore storing fields in an entity. I imagine it would be something like the following:

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
}
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.
Leave others their otherness.
http://quakeforge.net/
Post Reply