1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-26 13:52:06 +00:00
TegraExplorer/source/script/arrayReferenceClass.c
suchmememanyskill 2ddc7ae2a9 tsv3 start ig
2021-07-09 22:56:13 +02:00

24 lines
No EOL
964 B
C

#include "model.h"
#include "compat.h"
#include "genericClass.h"
#include "intClass.h"
#include "arrayReferenceClass.h"
ClassFunction(projectArray) {
Variable_t newArray = { .variableType = caller->solvedArray.arrayClassReference->variableType, .reference = 1, .readOnly = 1 };
newArray.solvedArray.vector = caller->solvedArray.arrayClassReference->solvedArray.vector;
newArray.solvedArray.vector.data = (u8*)caller->solvedArray.arrayClassReference->solvedArray.vector.data + (caller->solvedArray.offset * caller->solvedArray.arrayClassReference->solvedArray.vector.elemSz);
newArray.solvedArray.vector.count = caller->solvedArray.len;
return copyVariableToPtr(newArray);
}
ClassFunctionTableEntry_t arrayReferenceFunctions[] = {
{"project", projectArray, 0, 0},
};
Variable_t getArrayReferenceMember(Variable_t* var, char* memberName) {
return getGenericFunctionMember(var, memberName, arrayReferenceFunctions, ARRAY_SIZE(arrayReferenceFunctions));
}