mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-12-18 08:22:13 +00:00
0b94d7583c
When ast_member encounters the result of an ast_entfield it has to replace the ast_entfield's codegen as we cannot evaluate the field access first. We then perform the same action as ast_entfield but call vectorMember on the field before issuing the load/address instruction. This effectively turns the codegen of the following ast structure: member_of { field_of { entity, a_vector } memberid } into the one of this structure: field_of { entity, member_of { a_vector memberid } }
13 lines
190 B
C++
13 lines
190 B
C++
.vector v1;
|
|
|
|
float set(entity e, float v) {
|
|
e.v1.y = v;
|
|
return e.v1.y;
|
|
}
|
|
|
|
void main() {
|
|
entity e = spawn();
|
|
e.v1 = '1 2 3';
|
|
print(ftos(set(e, 42)), " => ");
|
|
print(vtos(e.v1), "\n");
|
|
}
|