OP_LOAD_FLD and OP_STOREP_FLD
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
OP_LOAD_FLD and OP_STOREP_FLD
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).
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).
- andrewj
- Posts: 133
- Joined: Mon Aug 30, 2010 3:29 pm
- Location: Australia
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
}
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
Leave others their otherness.
http://quakeforge.net/
http://quakeforge.net/
- taniwha
- Posts: 399
- Joined: Thu Jan 14, 2010 7:11 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest