Преглед изворни кода

Fixed another bug with boolean Lua stack values.
Adds support for calling Game::renderOnce and using the ScreenDisplayer from Lua scripts.

Chris Culy пре 13 година
родитељ
комит
7e9c449ffc
51 измењених фајлова са 311 додато и 168 уклоњено
  1. 1 1
      gameplay-luagen/src/FunctionBinding.cpp
  2. 1 0
      gameplay/gameplay.vcxproj
  3. 3 0
      gameplay/gameplay.vcxproj.filters
  4. 8 0
      gameplay/src/Game.h
  5. 6 0
      gameplay/src/Game.inl
  6. 39 0
      gameplay/src/ScreenDisplayer.cpp
  7. 20 13
      gameplay/src/ScreenDisplayer.h
  8. 6 0
      gameplay/src/ScriptController.cpp
  9. 10 9
      gameplay/src/ScriptController.h
  10. 1 1
      gameplay/src/lua/lua_AudioSource.cpp
  11. 5 5
      gameplay/src/lua/lua_Button.cpp
  12. 6 6
      gameplay/src/lua/lua_CheckBox.cpp
  13. 6 6
      gameplay/src/lua/lua_Container.cpp
  14. 5 5
      gameplay/src/lua/lua_Control.cpp
  15. 20 20
      gameplay/src/lua/lua_Font.cpp
  16. 6 6
      gameplay/src/lua/lua_Form.cpp
  17. 3 3
      gameplay/src/lua/lua_Game.cpp
  18. 6 6
      gameplay/src/lua/lua_Joint.cpp
  19. 6 6
      gameplay/src/lua/lua_Joystick.cpp
  20. 5 5
      gameplay/src/lua/lua_Label.cpp
  21. 1 1
      gameplay/src/lua/lua_MaterialParameter.cpp
  22. 2 2
      gameplay/src/lua/lua_Mesh.cpp
  23. 6 6
      gameplay/src/lua/lua_MeshBatch.cpp
  24. 1 1
      gameplay/src/lua/lua_Model.cpp
  25. 6 6
      gameplay/src/lua/lua_Node.cpp
  26. 6 6
      gameplay/src/lua/lua_ParticleEmitter.cpp
  27. 2 2
      gameplay/src/lua/lua_PhysicsCharacter.cpp
  28. 1 1
      gameplay/src/lua/lua_PhysicsCollisionObject.cpp
  29. 3 3
      gameplay/src/lua/lua_PhysicsCollisionShape.cpp
  30. 1 1
      gameplay/src/lua/lua_PhysicsConstraint.cpp
  31. 1 1
      gameplay/src/lua/lua_PhysicsFixedConstraint.cpp
  32. 1 1
      gameplay/src/lua/lua_PhysicsGenericConstraint.cpp
  33. 1 1
      gameplay/src/lua/lua_PhysicsGhostObject.cpp
  34. 1 1
      gameplay/src/lua/lua_PhysicsHingeConstraint.cpp
  35. 2 2
      gameplay/src/lua/lua_PhysicsRigidBody.cpp
  36. 3 3
      gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp
  37. 1 1
      gameplay/src/lua/lua_PhysicsSocketConstraint.cpp
  38. 1 1
      gameplay/src/lua/lua_PhysicsSpringConstraint.cpp
  39. 3 3
      gameplay/src/lua/lua_Platform.cpp
  40. 1 1
      gameplay/src/lua/lua_Properties.cpp
  41. 5 5
      gameplay/src/lua/lua_RadioButton.cpp
  42. 4 4
      gameplay/src/lua/lua_RenderStateStateBlock.cpp
  43. 4 4
      gameplay/src/lua/lua_Scene.cpp
  44. 71 1
      gameplay/src/lua/lua_ScreenDisplayer.cpp
  45. 2 0
      gameplay/src/lua/lua_ScreenDisplayer.h
  46. 5 5
      gameplay/src/lua/lua_Slider.cpp
  47. 3 3
      gameplay/src/lua/lua_SpriteBatch.cpp
  48. 5 5
      gameplay/src/lua/lua_TextBox.cpp
  49. 3 3
      gameplay/src/lua/lua_Texture.cpp
  50. 1 1
      gameplay/src/lua/lua_TextureSampler.cpp
  51. 1 1
      gameplay/src/lua/lua_VerticalLayout.cpp

+ 1 - 1
gameplay-luagen/src/FunctionBinding.cpp

@@ -712,7 +712,7 @@ static inline void outputGetParam(ostream& o, const FunctionBinding::Param& p, i
         if (p.kind == FunctionBinding::Param::KIND_POINTER)
             o << "ScriptController::getInstance()->getBoolPointer(" << paramIndex << ");\n";
         else
-            o << "(luaL_checkint(state, " << paramIndex << ") != 0);\n";
+            o << "ScriptController::luaCheckBool(state, " << paramIndex << ");\n";
         break;
     case FunctionBinding::Param::TYPE_CHAR:
         o << "(char)luaL_checkint(state, " << paramIndex << ");\n";

+ 1 - 0
gameplay/gameplay.vcxproj

@@ -203,6 +203,7 @@
     <ClCompile Include="src\RenderTarget.cpp" />
     <ClCompile Include="src\Scene.cpp" />
     <ClCompile Include="src\SceneLoader.cpp" />
+    <ClCompile Include="src\ScreenDisplayer.cpp" />
     <ClCompile Include="src\ScriptController.cpp" />
     <ClCompile Include="src\Slider.cpp" />
     <ClCompile Include="src\SpriteBatch.cpp" />

+ 3 - 0
gameplay/gameplay.vcxproj.filters

@@ -624,6 +624,9 @@
     <ClCompile Include="src\Gamepad.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\ScreenDisplayer.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\Animation.h">

+ 8 - 0
gameplay/src/Game.h

@@ -417,6 +417,14 @@ protected:
     template <class T>
     void renderOnce(T* instance, void (T::*method)(void*), void* cookie);
 
+    /**
+     * Renders a single frame once and then swaps it to the display.
+     * This calls the given Lua function, which should take no parameters and return nothing (void).
+     *
+     * This is useful for rendering splash screens.
+     */
+    inline void renderOnce(const char* function);
+
     /**
      * Updates the game's internal systems (audio, animation, physics) once.
      * 

+ 6 - 0
gameplay/src/Game.inl

@@ -57,6 +57,12 @@ void Game::renderOnce(T* instance, void (T::*method)(void*), void* cookie)
     Platform::swapBuffers();
 }
 
+void Game::renderOnce(const char* function)
+{
+    ScriptController::getInstance()->executeFunction<void>(function, NULL);
+    Platform::swapBuffers();
+}
+
 inline bool Game::hasMouse()
 {
     return Platform::hasMouse();

+ 39 - 0
gameplay/src/ScreenDisplayer.cpp

@@ -0,0 +1,39 @@
+#include "Base.h"
+#include "ScreenDisplayer.h"
+
+namespace gameplay
+{
+
+ScreenDisplayer* ScreenDisplayer::__scriptInstance = NULL;
+
+ScreenDisplayer::ScreenDisplayer() : _time(0L), _startTime(0)
+{
+}
+
+ScreenDisplayer::~ScreenDisplayer()
+{
+    long elapsedTime = (long)(Game::getInstance()->getGameTime() - _startTime);
+    if (elapsedTime < _time)
+        Platform::sleep(_time - elapsedTime);
+}
+
+void ScreenDisplayer::start(const char* function, unsigned long time)
+{
+    if (__scriptInstance == NULL)
+    {
+        __scriptInstance = new ScreenDisplayer();
+    }
+
+    __scriptInstance->_time = time;
+    Game::getInstance()->renderOnce(function);
+    __scriptInstance->_startTime = Game::getInstance()->getGameTime();
+}
+
+void ScreenDisplayer::finish()
+{
+    SAFE_DELETE(__scriptInstance);
+}
+
+
+
+}

+ 20 - 13
gameplay/src/ScreenDisplayer.h

@@ -19,6 +19,11 @@ public:
      */
     ScreenDisplayer();
 
+    /**
+     * Destructor.
+     */
+    ~ScreenDisplayer();
+
     /**
      * Displays a screen using the {@link Game#renderOnce} mechanism for at least the given amount of time.
      * 
@@ -30,20 +35,29 @@ public:
     template <typename T> void run(T* instance, void (T::*method) (void*), void* cookie, unsigned long time);
 
     /**
-     * Destructor.
+     * Starts a new screen displayer running; draws a screen using the {@link Game#renderOnce} mechanism for at least the given amount of time.
+     * 
+     * Note: this is intended for use from Lua scripts.
+     * 
+     * @param function See {@link Game#renderOnce(const char*)}.
+     * @param time The minimum amount of time to display the screen (in milliseconds).
      */
-    ~ScreenDisplayer();
+    static void start(const char* function, unsigned long time);
+
+    /**
+     * Finishes running the current screen displayer.
+     * 
+     * Note: this is intended for use from Lua scripts.
+     */
+    static void finish();
 
 private:
 
     long _time;
     double _startTime;
+    static ScreenDisplayer* __scriptInstance;
 };
 
-inline ScreenDisplayer::ScreenDisplayer() : _time(0L), _startTime(0)
-{
-}
-
 template <typename T> void ScreenDisplayer::run(T* instance, void (T::*method) (void*), void* cookie, unsigned long time)
 {
     _time = time;
@@ -51,13 +65,6 @@ template <typename T> void ScreenDisplayer::run(T* instance, void (T::*method) (
     _startTime = Game::getInstance()->getGameTime();
 }
 
-inline ScreenDisplayer::~ScreenDisplayer()
-{
-    long elapsedTime = (long)(Game::getInstance()->getGameTime() - _startTime);
-    if (elapsedTime < _time)
-        Platform::sleep(_time - elapsedTime);
-}
-
 /**
  * Displays a screen using the {@link Game#renderOnce} mechanism for at least the given amount
  * of time. This function is intended to be called at the beginning of a block of code that is be 

+ 6 - 0
gameplay/src/ScriptController.cpp

@@ -521,6 +521,12 @@ void ScriptController::render(long elapsedTime)
 
 void ScriptController::executeFunctionHelper(int resultCount, const char* func, const char* args, va_list& list)
 {
+    if (func == NULL)
+    {
+        GP_ERROR("Lua function name must be non-null.");
+        return;
+    }
+
     const char* sig = args;
 
     int argumentCount = 0;

+ 10 - 9
gameplay/src/ScriptController.h

@@ -524,6 +524,16 @@ public:
      */
     void setGlobalHierarchy(std::map<std::string, std::vector<std::string> > hierarchy);
 
+    /**
+     * Checks that the parameter at the given stack position is a boolean and returns it.
+     * 
+     * @param state The Lua state.
+     * @param n The stack index.
+     * @return The boolean (if successful; otherwise it logs an error).
+     * @script{ignore}
+     */
+    static bool luaCheckBool(lua_State* state, int n);
+
 private:
 
     /**
@@ -616,15 +626,6 @@ private:
      */
     void registerCallback(ScriptCallback callback, std::string function);
 
-    /**
-     * Checks that the parameter at the given stack position is a boolean and returns it.
-     * 
-     * @param state The Lua state.
-     * @param n The stack index.
-     * @return The boolean (if successful; otherwise it logs an error).
-     */
-    static bool luaCheckBool(lua_State* state, int n);
-
     lua_State* _lua;
     unsigned int _returnCount;
     std::map<std::string, std::vector<std::string> > _hierarchy;

+ 1 - 1
gameplay/src/lua/lua_AudioSource.cpp

@@ -623,7 +623,7 @@ int lua_AudioSource_setLooped(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 AudioSource* instance = getInstance(state);
                 instance->setLooped(param1);

+ 5 - 5
gameplay/src/lua/lua_Button.cpp

@@ -2814,7 +2814,7 @@ int lua_Button_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Button* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -2852,7 +2852,7 @@ int lua_Button_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Button* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3014,7 +3014,7 @@ int lua_Button_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Button* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4046,7 +4046,7 @@ int lua_Button_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Button* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4067,7 +4067,7 @@ int lua_Button_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 6 - 6
gameplay/src/lua/lua_CheckBox.cpp

@@ -2939,7 +2939,7 @@ int lua_CheckBox_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 CheckBox* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -2977,7 +2977,7 @@ int lua_CheckBox_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 CheckBox* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3139,7 +3139,7 @@ int lua_CheckBox_setChecked(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 CheckBox* instance = getInstance(state);
                 instance->setChecked(param1);
@@ -3177,7 +3177,7 @@ int lua_CheckBox_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 CheckBox* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4251,7 +4251,7 @@ int lua_CheckBox_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 CheckBox* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4272,7 +4272,7 @@ int lua_CheckBox_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 6 - 6
gameplay/src/lua/lua_Container.cpp

@@ -3159,7 +3159,7 @@ int lua_Container_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Container* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -3197,7 +3197,7 @@ int lua_Container_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Container* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3359,7 +3359,7 @@ int lua_Container_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Container* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4025,7 +4025,7 @@ int lua_Container_setScrollBarsAutoHide(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Container* instance = getInstance(state);
                 instance->setScrollBarsAutoHide(param1);
@@ -4429,7 +4429,7 @@ int lua_Container_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Container* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4450,7 +4450,7 @@ int lua_Container_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 5 - 5
gameplay/src/lua/lua_Control.cpp

@@ -2812,7 +2812,7 @@ int lua_Control_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Control* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -2850,7 +2850,7 @@ int lua_Control_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Control* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3012,7 +3012,7 @@ int lua_Control_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Control* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4006,7 +4006,7 @@ int lua_Control_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Control* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4027,7 +4027,7 @@ int lua_Control_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 20 - 20
gameplay/src/lua/lua_Font.cpp

@@ -319,7 +319,7 @@ int lua_Font_createText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 Font* instance = getInstance(state);
                 void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6);
@@ -372,10 +372,10 @@ int lua_Font_createText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 Font* instance = getInstance(state);
                 void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6, param7);
@@ -429,10 +429,10 @@ int lua_Font_createText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 // Get parameter 8 off the stack.
                 Rectangle* param8 = ScriptController::getInstance()->getObjectPointer<Rectangle>(9, "Rectangle", false);
@@ -671,7 +671,7 @@ int lua_Font_drawText(lua_State* state)
                 unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 Font* instance = getInstance(state);
                 instance->drawText(param1, param2, param3, *param4, param5, param6);
@@ -702,7 +702,7 @@ int lua_Font_drawText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 Font* instance = getInstance(state);
                 instance->drawText(param1, *param2, *param3, param4, param5, param6);
@@ -743,10 +743,10 @@ int lua_Font_drawText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 Font* instance = getInstance(state);
                 instance->drawText(param1, *param2, *param3, param4, param5, param6, param7);
@@ -788,10 +788,10 @@ int lua_Font_drawText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 // Get parameter 8 off the stack.
                 Rectangle* param8 = ScriptController::getInstance()->getObjectPointer<Rectangle>(9, "Rectangle", false);
@@ -972,7 +972,7 @@ int lua_Font_getIndexAtLocation(lua_State* state)
                 Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 Font* instance = getInstance(state);
                 int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5, param6, param7);
@@ -1020,10 +1020,10 @@ int lua_Font_getIndexAtLocation(lua_State* state)
                 Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 // Get parameter 8 off the stack.
-                bool param8 = (luaL_checkint(state, 9) != 0);
+                bool param8 = ScriptController::luaCheckBool(state, 9);
 
                 Font* instance = getInstance(state);
                 int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5, param6, param7, param8);
@@ -1164,7 +1164,7 @@ int lua_Font_getLocationAtIndex(lua_State* state)
                 Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 Font* instance = getInstance(state);
                 instance->getLocationAtIndex(param1, *param2, param3, param4, param5, param6, param7);
@@ -1209,10 +1209,10 @@ int lua_Font_getLocationAtIndex(lua_State* state)
                 Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 // Get parameter 8 off the stack.
-                bool param8 = (luaL_checkint(state, 9) != 0);
+                bool param8 = ScriptController::luaCheckBool(state, 9);
 
                 Font* instance = getInstance(state);
                 instance->getLocationAtIndex(param1, *param2, param3, param4, param5, param6, param7, param8);
@@ -1481,7 +1481,7 @@ int lua_Font_measureText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 Font* instance = getInstance(state);
                 instance->measureText(param1, *param2, param3, param4, param5, param6);
@@ -1522,10 +1522,10 @@ int lua_Font_measureText(lua_State* state)
                 Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 7) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 7);
 
                 // Get parameter 7 off the stack.
-                bool param7 = (luaL_checkint(state, 8) != 0);
+                bool param7 = ScriptController::luaCheckBool(state, 8);
 
                 Font* instance = getInstance(state);
                 instance->measureText(param1, *param2, param3, param4, param5, param6, param7);

+ 6 - 6
gameplay/src/lua/lua_Form.cpp

@@ -3244,7 +3244,7 @@ int lua_Form_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Form* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -3282,7 +3282,7 @@ int lua_Form_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Form* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3444,7 +3444,7 @@ int lua_Form_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Form* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4148,7 +4148,7 @@ int lua_Form_setScrollBarsAutoHide(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Form* instance = getInstance(state);
                 instance->setScrollBarsAutoHide(param1);
@@ -4552,7 +4552,7 @@ int lua_Form_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Form* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4573,7 +4573,7 @@ int lua_Form_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 3 - 3
gameplay/src/lua/lua_Game.cpp

@@ -168,7 +168,7 @@ int lua_Game_displayKeyboard(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Game* instance = getInstance(state);
                 instance->displayKeyboard(param1);
@@ -1168,7 +1168,7 @@ int lua_Game_setMultiTouch(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Game* instance = getInstance(state);
                 instance->setMultiTouch(param1);
@@ -1364,7 +1364,7 @@ int lua_Game_static_setVsync(lua_State* state)
             if (lua_type(state, 1) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 1) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 1);
 
                 Game::setVsync(param1);
                 

+ 6 - 6
gameplay/src/lua/lua_Joint.cpp

@@ -815,7 +815,7 @@ int lua_Joint_findNode(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 Joint* instance = getInstance(state);
                 void* returnPtr = (void*)instance->findNode(param1, param2);
@@ -852,10 +852,10 @@ int lua_Joint_findNode(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 4) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 4);
 
                 Joint* instance = getInstance(state);
                 void* returnPtr = (void*)instance->findNode(param1, param2, param3);
@@ -4719,7 +4719,7 @@ int lua_Joint_setDynamic(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joint* instance = getInstance(state);
                 instance->setDynamic(param1);
@@ -5457,7 +5457,7 @@ int lua_Joint_setTransparent(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joint* instance = getInstance(state);
                 instance->setTransparent(param1);
@@ -5495,7 +5495,7 @@ int lua_Joint_setVisible(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joint* instance = getInstance(state);
                 instance->setVisible(param1);

+ 6 - 6
gameplay/src/lua/lua_Joystick.cpp

@@ -2839,7 +2839,7 @@ int lua_Joystick_setAbsolute(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joystick* instance = getInstance(state);
                 instance->setAbsolute(param1);
@@ -2985,7 +2985,7 @@ int lua_Joystick_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joystick* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -3023,7 +3023,7 @@ int lua_Joystick_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joystick* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3185,7 +3185,7 @@ int lua_Joystick_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joystick* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4217,7 +4217,7 @@ int lua_Joystick_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Joystick* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4238,7 +4238,7 @@ int lua_Joystick_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 5 - 5
gameplay/src/lua/lua_Label.cpp

@@ -2852,7 +2852,7 @@ int lua_Label_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Label* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -2890,7 +2890,7 @@ int lua_Label_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Label* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3052,7 +3052,7 @@ int lua_Label_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Label* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4084,7 +4084,7 @@ int lua_Label_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Label* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4105,7 +4105,7 @@ int lua_Label_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 1 - 1
gameplay/src/lua/lua_MaterialParameter.cpp

@@ -1105,7 +1105,7 @@ int lua_MaterialParameter_setValue(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 MaterialParameter* instance = getInstance(state);
                 void* returnPtr = (void*)instance->setValue(param1, param2);

+ 2 - 2
gameplay/src/lua/lua_Mesh.cpp

@@ -160,7 +160,7 @@ int lua_Mesh_addPart(lua_State* state)
                 unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 5) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 5);
 
                 Mesh* instance = getInstance(state);
                 void* returnPtr = (void*)instance->addPart(param1, param2, param3, param4);
@@ -1026,7 +1026,7 @@ int lua_Mesh_static_createMesh(lua_State* state)
                 unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 3) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 3);
 
                 void* returnPtr = (void*)Mesh::createMesh(*param1, param2, param3);
                 if (returnPtr)

+ 6 - 6
gameplay/src/lua/lua_MeshBatch.cpp

@@ -326,7 +326,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 const char* param3 = ScriptController::getInstance()->getString(3, false);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4);
                 if (returnPtr)
@@ -359,7 +359,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 Material* param3 = ScriptController::getInstance()->getObjectPointer<Material>(3, "Material", false);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4);
                 if (returnPtr)
@@ -402,7 +402,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 const char* param3 = ScriptController::getInstance()->getString(3, false);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 // Get parameter 5 off the stack.
                 unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
@@ -439,7 +439,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 Material* param3 = ScriptController::getInstance()->getObjectPointer<Material>(3, "Material", false);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 // Get parameter 5 off the stack.
                 unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
@@ -486,7 +486,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 const char* param3 = ScriptController::getInstance()->getString(3, false);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 // Get parameter 5 off the stack.
                 unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
@@ -527,7 +527,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 Material* param3 = ScriptController::getInstance()->getObjectPointer<Material>(3, "Material", false);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 // Get parameter 5 off the stack.
                 unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);

+ 1 - 1
gameplay/src/lua/lua_Model.cpp

@@ -147,7 +147,7 @@ int lua_Model_draw(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Model* instance = getInstance(state);
                 instance->draw(param1);

+ 6 - 6
gameplay/src/lua/lua_Node.cpp

@@ -815,7 +815,7 @@ int lua_Node_findNode(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 Node* instance = getInstance(state);
                 void* returnPtr = (void*)instance->findNode(param1, param2);
@@ -852,10 +852,10 @@ int lua_Node_findNode(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 4) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 4);
 
                 Node* instance = getInstance(state);
                 void* returnPtr = (void*)instance->findNode(param1, param2, param3);
@@ -4673,7 +4673,7 @@ int lua_Node_setDynamic(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Node* instance = getInstance(state);
                 instance->setDynamic(param1);
@@ -5411,7 +5411,7 @@ int lua_Node_setTransparent(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Node* instance = getInstance(state);
                 instance->setTransparent(param1);
@@ -5449,7 +5449,7 @@ int lua_Node_setVisible(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Node* instance = getInstance(state);
                 instance->setVisible(param1);

+ 6 - 6
gameplay/src/lua/lua_ParticleEmitter.cpp

@@ -1715,7 +1715,7 @@ int lua_ParticleEmitter_setEllipsoid(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 ParticleEmitter* instance = getInstance(state);
                 instance->setEllipsoid(param1);
@@ -1835,13 +1835,13 @@ int lua_ParticleEmitter_setOrbit(lua_State* state)
                 lua_type(state, 4) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 4) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 4);
 
                 ParticleEmitter* instance = getInstance(state);
                 instance->setOrbit(param1, param2, param3);
@@ -2063,7 +2063,7 @@ int lua_ParticleEmitter_setSpriteAnimated(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 ParticleEmitter* instance = getInstance(state);
                 instance->setSpriteAnimated(param1);
@@ -2247,7 +2247,7 @@ int lua_ParticleEmitter_setSpriteLooped(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 ParticleEmitter* instance = getInstance(state);
                 instance->setSpriteLooped(param1);

+ 2 - 2
gameplay/src/lua/lua_PhysicsCharacter.cpp

@@ -766,7 +766,7 @@ int lua_PhysicsCharacter_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsCharacter* instance = getInstance(state);
                 instance->setEnabled(param1);
@@ -934,7 +934,7 @@ int lua_PhysicsCharacter_setPhysicsEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsCharacter* instance = getInstance(state);
                 instance->setPhysicsEnabled(param1);

+ 1 - 1
gameplay/src/lua/lua_PhysicsCollisionObject.cpp

@@ -535,7 +535,7 @@ int lua_PhysicsCollisionObject_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsCollisionObject* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 3 - 3
gameplay/src/lua/lua_PhysicsCollisionShape.cpp

@@ -326,7 +326,7 @@ int lua_PhysicsCollisionShape_static_box(lua_State* state)
                 Vector3* param2 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 3) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 3);
 
                 void* returnPtr = (void*)new PhysicsCollisionShape::Definition(PhysicsCollisionShape::box(*param1, *param2, param3));
                 if (returnPtr)
@@ -477,7 +477,7 @@ int lua_PhysicsCollisionShape_static_capsule(lua_State* state)
                 Vector3* param3 = ScriptController::getInstance()->getObjectPointer<Vector3>(3, "Vector3", true);
 
                 // Get parameter 4 off the stack.
-                bool param4 = (luaL_checkint(state, 4) != 0);
+                bool param4 = ScriptController::luaCheckBool(state, 4);
 
                 void* returnPtr = (void*)new PhysicsCollisionShape::Definition(PhysicsCollisionShape::capsule(param1, param2, *param3, param4));
                 if (returnPtr)
@@ -712,7 +712,7 @@ int lua_PhysicsCollisionShape_static_sphere(lua_State* state)
                 Vector3* param2 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 3) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 3);
 
                 void* returnPtr = (void*)new PhysicsCollisionShape::Definition(PhysicsCollisionShape::sphere(param1, *param2, param3));
                 if (returnPtr)

+ 1 - 1
gameplay/src/lua/lua_PhysicsConstraint.cpp

@@ -164,7 +164,7 @@ int lua_PhysicsConstraint_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsConstraint* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 1 - 1
gameplay/src/lua/lua_PhysicsFixedConstraint.cpp

@@ -356,7 +356,7 @@ int lua_PhysicsFixedConstraint_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsFixedConstraint* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 1 - 1
gameplay/src/lua/lua_PhysicsGenericConstraint.cpp

@@ -436,7 +436,7 @@ int lua_PhysicsGenericConstraint_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsGenericConstraint* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 1 - 1
gameplay/src/lua/lua_PhysicsGhostObject.cpp

@@ -496,7 +496,7 @@ int lua_PhysicsGhostObject_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsGhostObject* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 1 - 1
gameplay/src/lua/lua_PhysicsHingeConstraint.cpp

@@ -165,7 +165,7 @@ int lua_PhysicsHingeConstraint_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsHingeConstraint* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 2 - 2
gameplay/src/lua/lua_PhysicsRigidBody.cpp

@@ -1287,7 +1287,7 @@ int lua_PhysicsRigidBody_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsRigidBody* instance = getInstance(state);
                 instance->setEnabled(param1);
@@ -1401,7 +1401,7 @@ int lua_PhysicsRigidBody_setKinematic(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsRigidBody* instance = getInstance(state);
                 instance->setKinematic(param1);

+ 3 - 3
gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp

@@ -318,7 +318,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state)
                 float param5 = (float)luaL_checknumber(state, 5);
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 6) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 6);
 
                 void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6);
                 if (returnPtr)
@@ -369,7 +369,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state)
                 float param5 = (float)luaL_checknumber(state, 5);
 
                 // Get parameter 6 off the stack.
-                bool param6 = (luaL_checkint(state, 6) != 0);
+                bool param6 = ScriptController::luaCheckBool(state, 6);
 
                 // Get parameter 7 off the stack.
                 Vector3* param7 = ScriptController::getInstance()->getObjectPointer<Vector3>(7, "Vector3", true);
@@ -516,7 +516,7 @@ int lua_PhysicsRigidBodyParameters_kinematic(lua_State* state)
     if (lua_gettop(state) == 2)
     {
         // Get parameter 2 off the stack.
-        bool param2 = (luaL_checkint(state, 2) != 0);
+        bool param2 = ScriptController::luaCheckBool(state, 2);
 
         instance->kinematic = param2;
         return 0;

+ 1 - 1
gameplay/src/lua/lua_PhysicsSocketConstraint.cpp

@@ -164,7 +164,7 @@ int lua_PhysicsSocketConstraint_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsSocketConstraint* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 1 - 1
gameplay/src/lua/lua_PhysicsSpringConstraint.cpp

@@ -676,7 +676,7 @@ int lua_PhysicsSpringConstraint_setEnabled(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 PhysicsSpringConstraint* instance = getInstance(state);
                 instance->setEnabled(param1);

+ 3 - 3
gameplay/src/lua/lua_Platform.cpp

@@ -187,7 +187,7 @@ int lua_Platform_static_displayKeyboard(lua_State* state)
             if (lua_type(state, 1) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 1) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 1);
 
                 Platform::displayKeyboard(param1);
                 
@@ -530,7 +530,7 @@ int lua_Platform_static_setMultiTouch(lua_State* state)
             if (lua_type(state, 1) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 1) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 1);
 
                 Platform::setMultiTouch(param1);
                 
@@ -566,7 +566,7 @@ int lua_Platform_static_setVsync(lua_State* state)
             if (lua_type(state, 1) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 1) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 1);
 
                 Platform::setVsync(param1);
                 

+ 1 - 1
gameplay/src/lua/lua_Properties.cpp

@@ -584,7 +584,7 @@ int lua_Properties_getNamespace(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 Properties* instance = getInstance(state);
                 void* returnPtr = (void*)instance->getNamespace(param1, param2);

+ 5 - 5
gameplay/src/lua/lua_RadioButton.cpp

@@ -2938,7 +2938,7 @@ int lua_RadioButton_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RadioButton* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -2976,7 +2976,7 @@ int lua_RadioButton_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RadioButton* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3138,7 +3138,7 @@ int lua_RadioButton_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RadioButton* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4212,7 +4212,7 @@ int lua_RadioButton_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RadioButton* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4233,7 +4233,7 @@ int lua_RadioButton_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 4 - 4
gameplay/src/lua/lua_RenderStateStateBlock.cpp

@@ -237,7 +237,7 @@ int lua_RenderStateStateBlock_setBlend(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RenderState::StateBlock* instance = getInstance(state);
                 instance->setBlend(param1);
@@ -351,7 +351,7 @@ int lua_RenderStateStateBlock_setCullFace(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RenderState::StateBlock* instance = getInstance(state);
                 instance->setCullFace(param1);
@@ -389,7 +389,7 @@ int lua_RenderStateStateBlock_setDepthTest(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RenderState::StateBlock* instance = getInstance(state);
                 instance->setDepthTest(param1);
@@ -427,7 +427,7 @@ int lua_RenderStateStateBlock_setDepthWrite(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 RenderState::StateBlock* instance = getInstance(state);
                 instance->setDepthWrite(param1);

+ 4 - 4
gameplay/src/lua/lua_Scene.cpp

@@ -228,7 +228,7 @@ int lua_Scene_bindAudioListenerToCamera(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Scene* instance = getInstance(state);
                 instance->bindAudioListenerToCamera(param1);
@@ -340,7 +340,7 @@ int lua_Scene_findNode(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 Scene* instance = getInstance(state);
                 void* returnPtr = (void*)instance->findNode(param1, param2);
@@ -377,10 +377,10 @@ int lua_Scene_findNode(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(2, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 3) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 3);
 
                 // Get parameter 3 off the stack.
-                bool param3 = (luaL_checkint(state, 4) != 0);
+                bool param3 = ScriptController::luaCheckBool(state, 4);
 
                 Scene* instance = getInstance(state);
                 void* returnPtr = (void*)instance->findNode(param1, param2, param3);

+ 71 - 1
gameplay/src/lua/lua_ScreenDisplayer.cpp

@@ -15,7 +15,12 @@ void luaRegister_ScreenDisplayer()
     {
         {NULL, NULL}
     };
-    const luaL_Reg* lua_statics = NULL;
+    const luaL_Reg lua_statics[] = 
+    {
+        {"finish", lua_ScreenDisplayer_static_finish},
+        {"start", lua_ScreenDisplayer_static_start},
+        {NULL, NULL}
+    };
     std::vector<std::string> scopePath;
 
     sc->registerClass("ScreenDisplayer", lua_members, lua_ScreenDisplayer__init, lua_ScreenDisplayer__gc, lua_statics, scopePath);
@@ -105,4 +110,69 @@ int lua_ScreenDisplayer__init(lua_State* state)
     return 0;
 }
 
+int lua_ScreenDisplayer_static_finish(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 0:
+        {
+            ScreenDisplayer::finish();
+            
+            return 0;
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 0).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ScreenDisplayer_static_start(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                const char* param1 = ScriptController::getInstance()->getString(1, false);
+
+                // Get parameter 2 off the stack.
+                unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 2);
+
+                ScreenDisplayer::start(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 2 - 0
gameplay/src/lua/lua_ScreenDisplayer.h

@@ -7,6 +7,8 @@ namespace gameplay
 // Lua bindings for ScreenDisplayer.
 int lua_ScreenDisplayer__gc(lua_State* state);
 int lua_ScreenDisplayer__init(lua_State* state);
+int lua_ScreenDisplayer_static_finish(lua_State* state);
+int lua_ScreenDisplayer_static_start(lua_State* state);
 
 void luaRegister_ScreenDisplayer();
 

+ 5 - 5
gameplay/src/lua/lua_Slider.cpp

@@ -3008,7 +3008,7 @@ int lua_Slider_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Slider* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -3046,7 +3046,7 @@ int lua_Slider_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Slider* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3208,7 +3208,7 @@ int lua_Slider_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Slider* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4354,7 +4354,7 @@ int lua_Slider_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 Slider* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4375,7 +4375,7 @@ int lua_Slider_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 3 - 3
gameplay/src/lua/lua_SpriteBatch.cpp

@@ -512,7 +512,7 @@ int lua_SpriteBatch_draw(lua_State* state)
                 float param10 = (float)luaL_checknumber(state, 11);
 
                 // Get parameter 11 off the stack.
-                bool param11 = (luaL_checkint(state, 12) != 0);
+                bool param11 = ScriptController::luaCheckBool(state, 12);
 
                 SpriteBatch* instance = getInstance(state);
                 instance->draw(*param1, param2, param3, param4, param5, param6, param7, *param8, *param9, param10, param11);
@@ -563,7 +563,7 @@ int lua_SpriteBatch_draw(lua_State* state)
                 Vector4* param10 = ScriptController::getInstance()->getObjectPointer<Vector4>(11, "Vector4", true);
 
                 // Get parameter 11 off the stack.
-                bool param11 = (luaL_checkint(state, 12) != 0);
+                bool param11 = ScriptController::luaCheckBool(state, 12);
 
                 SpriteBatch* instance = getInstance(state);
                 instance->draw(param1, param2, param3, param4, param5, param6, param7, param8, param9, *param10, param11);
@@ -750,7 +750,7 @@ int lua_SpriteBatch_draw(lua_State* state)
                 float param12 = (float)luaL_checknumber(state, 13);
 
                 // Get parameter 13 off the stack.
-                bool param13 = (luaL_checkint(state, 14) != 0);
+                bool param13 = ScriptController::luaCheckBool(state, 14);
 
                 SpriteBatch* instance = getInstance(state);
                 instance->draw(param1, param2, param3, param4, param5, param6, param7, param8, param9, *param10, *param11, param12, param13);

+ 5 - 5
gameplay/src/lua/lua_TextBox.cpp

@@ -2890,7 +2890,7 @@ int lua_TextBox_setAutoHeight(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 TextBox* instance = getInstance(state);
                 instance->setAutoHeight(param1);
@@ -2928,7 +2928,7 @@ int lua_TextBox_setAutoWidth(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 TextBox* instance = getInstance(state);
                 instance->setAutoWidth(param1);
@@ -3090,7 +3090,7 @@ int lua_TextBox_setConsumeInputEvents(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 TextBox* instance = getInstance(state);
                 instance->setConsumeInputEvents(param1);
@@ -4122,7 +4122,7 @@ int lua_TextBox_setTextRightToLeft(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 TextBox* instance = getInstance(state);
                 instance->setTextRightToLeft(param1);
@@ -4143,7 +4143,7 @@ int lua_TextBox_setTextRightToLeft(lua_State* state)
                 lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 // Get parameter 2 off the stack.
                 unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);

+ 3 - 3
gameplay/src/lua/lua_Texture.cpp

@@ -606,7 +606,7 @@ int lua_Texture_static_create(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(1, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 2) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 2);
 
                 void* returnPtr = (void*)Texture::create(param1, param2);
                 if (returnPtr)
@@ -631,7 +631,7 @@ int lua_Texture_static_create(lua_State* state)
                 Image* param1 = ScriptController::getInstance()->getObjectPointer<Image>(1, "Image", false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 2) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 2);
 
                 void* returnPtr = (void*)Texture::create(param1, param2);
                 if (returnPtr)
@@ -719,7 +719,7 @@ int lua_Texture_static_create(lua_State* state)
                 unsigned char* param4 = ScriptController::getInstance()->getUnsignedCharPointer(4);
 
                 // Get parameter 5 off the stack.
-                bool param5 = (luaL_checkint(state, 5) != 0);
+                bool param5 = ScriptController::luaCheckBool(state, 5);
 
                 void* returnPtr = (void*)Texture::create(param1, param2, param3, param4, param5);
                 if (returnPtr)

+ 1 - 1
gameplay/src/lua/lua_TextureSampler.cpp

@@ -417,7 +417,7 @@ int lua_TextureSampler_static_create(lua_State* state)
                 const char* param1 = ScriptController::getInstance()->getString(1, false);
 
                 // Get parameter 2 off the stack.
-                bool param2 = (luaL_checkint(state, 2) != 0);
+                bool param2 = ScriptController::luaCheckBool(state, 2);
 
                 void* returnPtr = (void*)Texture::Sampler::create(param1, param2);
                 if (returnPtr)

+ 1 - 1
gameplay/src/lua/lua_VerticalLayout.cpp

@@ -271,7 +271,7 @@ int lua_VerticalLayout_setBottomToTop(lua_State* state)
                 lua_type(state, 2) == LUA_TBOOLEAN)
             {
                 // Get parameter 1 off the stack.
-                bool param1 = (luaL_checkint(state, 2) != 0);
+                bool param1 = ScriptController::luaCheckBool(state, 2);
 
                 VerticalLayout* instance = getInstance(state);
                 instance->setBottomToTop(param1);