summaryrefslogtreecommitdiff
path: root/src/script/squirrel_helper.hpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-11-29 22:23:33 +0000
committertruebrain <truebrain@openttd.org>2011-11-29 22:23:33 +0000
commitbff7c33aa909d00428f81e6b5f89b236343fc13b (patch)
tree8a7617a800d443a19f871b7b7a0eb1382f08dfa5 /src/script/squirrel_helper.hpp
parentb13fa6924b8bca7ec378d4daf87e18318670a44f (diff)
downloadopenttd-bff7c33aa909d00428f81e6b5f89b236343fc13b.tar.xz
(svn r23350) -Add: support different ScriptTypes in the helper functions for GetClassName (Rubidium)
Diffstat (limited to 'src/script/squirrel_helper.hpp')
-rw-r--r--src/script/squirrel_helper.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp
index a5a242539..03f1315fa 100644
--- a/src/script/squirrel_helper.hpp
+++ b/src/script/squirrel_helper.hpp
@@ -19,7 +19,7 @@
#include "../string_func.h"
#include "squirrel_helper_type.hpp"
-template <class CL> const char *GetClassName();
+template <class CL, ScriptType ST> const char *GetClassName();
/**
* The Squirrel convert routines
@@ -731,7 +731,7 @@ namespace SQConvert {
* In here the function_proc is recovered, and the SQCall is called that
* can handle this exact amount of params.
*/
- template <typename Tcls, typename Tmethod>
+ template <typename Tcls, typename Tmethod, ScriptType Ttype>
inline SQInteger DefSQNonStaticCallback(HSQUIRRELVM vm)
{
/* Find the amount of params we got */
@@ -745,7 +745,7 @@ namespace SQConvert {
/* Protect against calls to a non-static method in a static way */
sq_pushroottable(vm);
- const char *className = GetClassName<Tcls>();
+ const char *className = GetClassName<Tcls, Ttype>();
sq_pushstring(vm, OTTD2SQ(className), -1);
sq_get(vm, -2);
sq_pushobject(vm, instance);
@@ -773,7 +773,7 @@ namespace SQConvert {
* In here the function_proc is recovered, and the SQCall is called that
* can handle this exact amount of params.
*/
- template <typename Tcls, typename Tmethod>
+ template <typename Tcls, typename Tmethod, ScriptType Ttype>
inline SQInteger DefSQAdvancedNonStaticCallback(HSQUIRRELVM vm)
{
/* Find the amount of params we got */
@@ -787,7 +787,7 @@ namespace SQConvert {
/* Protect against calls to a non-static method in a static way */
sq_pushroottable(vm);
- const char *className = GetClassName<Tcls>();
+ const char *className = GetClassName<Tcls, Ttype>();
sq_pushstring(vm, OTTD2SQ(className), -1);
sq_get(vm, -2);
sq_pushobject(vm, instance);