This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
{ \
|
||||
Porygon::Utilities::HashedString::ConstHash(#fieldName), \
|
||||
new Porygon::UserData::UserDataField(fieldType, \
|
||||
[](void* obj) -> Porygon::Evaluation::EvalValue* { return new getterHelper;}, \
|
||||
[](void* obj, Porygon::Evaluation::EvalValue* val) { ((T_USERDATA*)obj)->fieldName = setterHelper;} \
|
||||
[](void* obj) -> const Porygon::Evaluation::EvalValue* { return new getterHelper;}, \
|
||||
[](void* obj, const Porygon::Evaluation::EvalValue* val) { ((T_USERDATA*)obj)->fieldName = setterHelper;} \
|
||||
) \
|
||||
}, \
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
#define PORYGON_INTEGER_FIELD(fieldName) \
|
||||
PORYGON_FIELD(fieldName, PORYGON_INTEGER_TYPE, \
|
||||
Porygon::Evaluation::IntegerEvalValue(((T_USERDATA*)obj)->fieldName), val->EvaluateInteger())
|
||||
const Porygon::Evaluation::IntegerEvalValue(((T_USERDATA*)obj)->fieldName), val->EvaluateInteger())
|
||||
|
||||
#define PORYGON_READONLY_INTEGER_FIELD(fieldName) \
|
||||
PORYGON_READONLY_FIELD(fieldName, PORYGON_INTEGER_TYPE, \
|
||||
@@ -72,11 +72,11 @@
|
||||
Porygon::UserData::UserDataFunctionOption::FromRawPointers(returnType, {__VA_ARGS__} )), \
|
||||
\
|
||||
\
|
||||
[](void* obj) -> Porygon::Evaluation::EvalValue* { \
|
||||
[](void* obj) -> const Porygon::Evaluation::EvalValue* { \
|
||||
auto t = new Porygon::Evaluation::GenericFunctionEvalValue(make_shared<GenericFunctionScriptType>(), rand()); \
|
||||
t->RegisterOption(new Porygon::UserData::UserDataFunction( \
|
||||
[](void* obj, Porygon::Evaluation::EvalValue* par[], int parameterCount) \
|
||||
-> Porygon::Evaluation::EvalValue*{return ((T_USERDATA*)obj)->invoke__##fieldName(obj, par, parameterCount);}, \
|
||||
[](void* obj, const Porygon::Evaluation::EvalValue* par[], int parameterCount) \
|
||||
-> const Porygon::Evaluation::EvalValue*{return ((const T_USERDATA*)obj)->invoke__##fieldName(obj, par, parameterCount);}, \
|
||||
obj)); \
|
||||
return t;}, \
|
||||
nullptr) \
|
||||
@@ -96,7 +96,7 @@
|
||||
\returns An invokable function.
|
||||
*/
|
||||
#define PORYGON_PREPARE_FUNCTION(userDataTypeName, fieldName, returnType, ...) \
|
||||
static Porygon::Evaluation::EvalValue* invoke__##fieldName(void* obj, Porygon::Evaluation::EvalValue* par[], int parameterCount){ \
|
||||
static const Porygon::Evaluation::EvalValue* invoke__##fieldName(void* obj, const Porygon::Evaluation::EvalValue* par[], int parameterCount){ \
|
||||
return Porygon::Evaluation::EvalValueHelper::Create(((userDataTypeName*)obj)->fieldName( \
|
||||
__VA_ARGS__ \
|
||||
));}
|
||||
|
||||
Reference in New Issue
Block a user