diff options
author | truebrain <truebrain@openttd.org> | 2011-11-29 22:24:30 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-29 22:24:30 +0000 |
commit | 00877dd6d36ca52b1a8720cbbd4a013c958f7fad (patch) | |
tree | ac1c05499e12228624c695b93368246217425469 /src/ai/api/ai_industrytypelist.hpp.sq | |
parent | 96249564fd219f8747c9cd54bc934215fb1b5e44 (diff) | |
download | openttd-00877dd6d36ca52b1a8720cbbd4a013c958f7fad.tar.xz |
(svn r23352) -Add: support dynamically adding an API prefix when returning a C++ class to Squirrel
Diffstat (limited to 'src/ai/api/ai_industrytypelist.hpp.sq')
-rw-r--r-- | src/ai/api/ai_industrytypelist.hpp.sq | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_industrytypelist.hpp.sq b/src/ai/api/ai_industrytypelist.hpp.sq index dbeded04b..4187572ee 100644 --- a/src/ai/api/ai_industrytypelist.hpp.sq +++ b/src/ai/api/ai_industrytypelist.hpp.sq @@ -17,7 +17,7 @@ namespace SQConvert { template <> inline AIIndustryTypeList &GetParam(ForceType<AIIndustryTypeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryTypeList *)instance; } template <> inline const AIIndustryTypeList *GetParam(ForceType<const AIIndustryTypeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryTypeList *)instance; } template <> inline const AIIndustryTypeList &GetParam(ForceType<const AIIndustryTypeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryTypeList *)instance; } - template <> inline int Return<AIIndustryTypeList *>(HSQUIRRELVM vm, AIIndustryTypeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryTypeList", res, NULL, DefSQDestructorCallback<AIIndustryTypeList>); return 1; } + template <> inline int Return<AIIndustryTypeList *>(HSQUIRRELVM vm, AIIndustryTypeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "IndustryTypeList", res, NULL, DefSQDestructorCallback<AIIndustryTypeList>, true); return 1; } } // namespace SQConvert template <> const char *GetClassName<AIIndustryTypeList, ST_AI>() { return "AIIndustryTypeList"; } |