lua_ThemeUVs.cpp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. // Autogenerated by gameplay-luagen
  2. #include "Base.h"
  3. #include "ScriptController.h"
  4. #include "lua_ThemeUVs.h"
  5. #include "Base.h"
  6. #include "FileSystem.h"
  7. #include "Game.h"
  8. #include "Ref.h"
  9. #include "Theme.h"
  10. #include "ThemeStyle.h"
  11. namespace gameplay
  12. {
  13. void luaRegister_ThemeUVs()
  14. {
  15. const luaL_Reg lua_members[] =
  16. {
  17. {"u1", lua_ThemeUVs_u1},
  18. {"u2", lua_ThemeUVs_u2},
  19. {"v1", lua_ThemeUVs_v1},
  20. {"v2", lua_ThemeUVs_v2},
  21. {NULL, NULL}
  22. };
  23. const luaL_Reg lua_statics[] =
  24. {
  25. {"empty", lua_ThemeUVs_static_empty},
  26. {"full", lua_ThemeUVs_static_full},
  27. {NULL, NULL}
  28. };
  29. std::vector<std::string> scopePath;
  30. scopePath.push_back("Theme");
  31. gameplay::ScriptUtil::registerClass("ThemeUVs", lua_members, lua_ThemeUVs__init, lua_ThemeUVs__gc, lua_statics, scopePath);
  32. }
  33. static Theme::UVs* getInstance(lua_State* state)
  34. {
  35. void* userdata = luaL_checkudata(state, 1, "ThemeUVs");
  36. luaL_argcheck(state, userdata != NULL, 1, "'ThemeUVs' expected.");
  37. return (Theme::UVs*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  38. }
  39. int lua_ThemeUVs__gc(lua_State* state)
  40. {
  41. // Get the number of parameters.
  42. int paramCount = lua_gettop(state);
  43. // Attempt to match the parameters to a valid binding.
  44. switch (paramCount)
  45. {
  46. case 1:
  47. {
  48. if ((lua_type(state, 1) == LUA_TUSERDATA))
  49. {
  50. void* userdata = luaL_checkudata(state, 1, "ThemeUVs");
  51. luaL_argcheck(state, userdata != NULL, 1, "'ThemeUVs' expected.");
  52. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
  53. if (object->owns)
  54. {
  55. Theme::UVs* instance = (Theme::UVs*)object->instance;
  56. SAFE_DELETE(instance);
  57. }
  58. return 0;
  59. }
  60. lua_pushstring(state, "lua_ThemeUVs__gc - Failed to match the given parameters to a valid function signature.");
  61. lua_error(state);
  62. break;
  63. }
  64. default:
  65. {
  66. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  67. lua_error(state);
  68. break;
  69. }
  70. }
  71. return 0;
  72. }
  73. int lua_ThemeUVs__init(lua_State* state)
  74. {
  75. // Get the number of parameters.
  76. int paramCount = lua_gettop(state);
  77. // Attempt to match the parameters to a valid binding.
  78. switch (paramCount)
  79. {
  80. case 0:
  81. {
  82. void* returnPtr = ((void*)new Theme::UVs());
  83. if (returnPtr)
  84. {
  85. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  86. object->instance = returnPtr;
  87. object->owns = true;
  88. luaL_getmetatable(state, "ThemeUVs");
  89. lua_setmetatable(state, -2);
  90. }
  91. else
  92. {
  93. lua_pushnil(state);
  94. }
  95. return 1;
  96. break;
  97. }
  98. case 4:
  99. {
  100. do
  101. {
  102. if (lua_type(state, 1) == LUA_TNUMBER &&
  103. lua_type(state, 2) == LUA_TNUMBER &&
  104. lua_type(state, 3) == LUA_TNUMBER &&
  105. lua_type(state, 4) == LUA_TNUMBER)
  106. {
  107. // Get parameter 1 off the stack.
  108. float param1 = (float)luaL_checknumber(state, 1);
  109. // Get parameter 2 off the stack.
  110. float param2 = (float)luaL_checknumber(state, 2);
  111. // Get parameter 3 off the stack.
  112. float param3 = (float)luaL_checknumber(state, 3);
  113. // Get parameter 4 off the stack.
  114. float param4 = (float)luaL_checknumber(state, 4);
  115. void* returnPtr = ((void*)new Theme::UVs(param1, param2, param3, param4));
  116. if (returnPtr)
  117. {
  118. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  119. object->instance = returnPtr;
  120. object->owns = true;
  121. luaL_getmetatable(state, "ThemeUVs");
  122. lua_setmetatable(state, -2);
  123. }
  124. else
  125. {
  126. lua_pushnil(state);
  127. }
  128. return 1;
  129. }
  130. } while (0);
  131. lua_pushstring(state, "lua_ThemeUVs__init - Failed to match the given parameters to a valid function signature.");
  132. lua_error(state);
  133. break;
  134. }
  135. default:
  136. {
  137. lua_pushstring(state, "Invalid number of parameters (expected 0 or 4).");
  138. lua_error(state);
  139. break;
  140. }
  141. }
  142. return 0;
  143. }
  144. int lua_ThemeUVs_static_empty(lua_State* state)
  145. {
  146. // Get the number of parameters.
  147. int paramCount = lua_gettop(state);
  148. // Attempt to match the parameters to a valid binding.
  149. switch (paramCount)
  150. {
  151. case 0:
  152. {
  153. void* returnPtr = (void*)&(Theme::UVs::empty());
  154. if (returnPtr)
  155. {
  156. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  157. object->instance = returnPtr;
  158. object->owns = false;
  159. luaL_getmetatable(state, "ThemeUVs");
  160. lua_setmetatable(state, -2);
  161. }
  162. else
  163. {
  164. lua_pushnil(state);
  165. }
  166. return 1;
  167. break;
  168. }
  169. default:
  170. {
  171. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  172. lua_error(state);
  173. break;
  174. }
  175. }
  176. return 0;
  177. }
  178. int lua_ThemeUVs_static_full(lua_State* state)
  179. {
  180. // Get the number of parameters.
  181. int paramCount = lua_gettop(state);
  182. // Attempt to match the parameters to a valid binding.
  183. switch (paramCount)
  184. {
  185. case 0:
  186. {
  187. void* returnPtr = (void*)&(Theme::UVs::full());
  188. if (returnPtr)
  189. {
  190. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  191. object->instance = returnPtr;
  192. object->owns = false;
  193. luaL_getmetatable(state, "ThemeUVs");
  194. lua_setmetatable(state, -2);
  195. }
  196. else
  197. {
  198. lua_pushnil(state);
  199. }
  200. return 1;
  201. break;
  202. }
  203. default:
  204. {
  205. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  206. lua_error(state);
  207. break;
  208. }
  209. }
  210. return 0;
  211. }
  212. int lua_ThemeUVs_u1(lua_State* state)
  213. {
  214. // Validate the number of parameters.
  215. if (lua_gettop(state) > 2)
  216. {
  217. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  218. lua_error(state);
  219. }
  220. Theme::UVs* instance = getInstance(state);
  221. if (lua_gettop(state) == 2)
  222. {
  223. // Get parameter 2 off the stack.
  224. float param2 = (float)luaL_checknumber(state, 2);
  225. instance->u1 = param2;
  226. return 0;
  227. }
  228. else
  229. {
  230. float result = instance->u1;
  231. // Push the return value onto the stack.
  232. lua_pushnumber(state, result);
  233. return 1;
  234. }
  235. }
  236. int lua_ThemeUVs_u2(lua_State* state)
  237. {
  238. // Validate the number of parameters.
  239. if (lua_gettop(state) > 2)
  240. {
  241. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  242. lua_error(state);
  243. }
  244. Theme::UVs* instance = getInstance(state);
  245. if (lua_gettop(state) == 2)
  246. {
  247. // Get parameter 2 off the stack.
  248. float param2 = (float)luaL_checknumber(state, 2);
  249. instance->u2 = param2;
  250. return 0;
  251. }
  252. else
  253. {
  254. float result = instance->u2;
  255. // Push the return value onto the stack.
  256. lua_pushnumber(state, result);
  257. return 1;
  258. }
  259. }
  260. int lua_ThemeUVs_v1(lua_State* state)
  261. {
  262. // Validate the number of parameters.
  263. if (lua_gettop(state) > 2)
  264. {
  265. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  266. lua_error(state);
  267. }
  268. Theme::UVs* instance = getInstance(state);
  269. if (lua_gettop(state) == 2)
  270. {
  271. // Get parameter 2 off the stack.
  272. float param2 = (float)luaL_checknumber(state, 2);
  273. instance->v1 = param2;
  274. return 0;
  275. }
  276. else
  277. {
  278. float result = instance->v1;
  279. // Push the return value onto the stack.
  280. lua_pushnumber(state, result);
  281. return 1;
  282. }
  283. }
  284. int lua_ThemeUVs_v2(lua_State* state)
  285. {
  286. // Validate the number of parameters.
  287. if (lua_gettop(state) > 2)
  288. {
  289. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  290. lua_error(state);
  291. }
  292. Theme::UVs* instance = getInstance(state);
  293. if (lua_gettop(state) == 2)
  294. {
  295. // Get parameter 2 off the stack.
  296. float param2 = (float)luaL_checknumber(state, 2);
  297. instance->v2 = param2;
  298. return 0;
  299. }
  300. else
  301. {
  302. float result = instance->v2;
  303. // Push the return value onto the stack.
  304. lua_pushnumber(state, result);
  305. return 1;
  306. }
  307. }
  308. }