diff --git a/.gitignore b/.gitignore index c630f26741..93e89b5f7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,260 +1,184 @@ -*.suo -*.sdf -*.opensdf -*.layout -*.depend -.DS_Store* -ehthumbs.db -Icon? -Thumbs.db -/.metadata -/169.254.0.1 -/usb -/ipch -/build -/cmake -/Debug -/Release -/Simulator -/Simulator-Coverage -/Simulator-Profile -/Device-Debug -/Device-Coverage -/Device-Profile +*.suo +*.sdf +*.opensdf +*.layout +*.depend +*.pro.user +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db +/.metadata +.settings +/169.254.0.1 +/usb +/ipch +/build +/cmake +/Debug +/Release +/Simulator +/Simulator-Coverage +/Simulator-Profile +/Device-Debug +/Device-Coverage +/Device-Profile /Device-Release -/gameplay-internal -/api/xml -/bin -/external-deps +/gameplay-internal +/api/xml +/bin +/external-deps /gameplay-samples /gameplay-api/html /gameplay-docs /api/html /gameplay-tests gameplay.xcworkspace/xcshareddata/gameplay.xccheckout - -/gameplay/Debug -/gameplay/DebugMem -/gameplay/Release -/gameplay/Simulator -/gameplay/Simulator-Coverage -/gameplay/Simulator-Profile -/gameplay/Device-Debug -/gameplay/Device-Coverage -/gameplay/Device-Profile -/gameplay/Device-Release -/gameplay/windows -/gameplay/android/NUL -/gameplay/android/proguard.cfg -/gameplay/android/proguard-project.txt -/gameplay/android/local.properties -/gameplay/android/project.properties -/gameplay/android/obj -/gameplay.xcworkspace/xcuserdata -/gameplay/gameplay.xcodeproj/xcuserdata - -/tools/gameplay-encoder/Debug -/tools/gameplay-encoder/Release -/tools/gameplay-encoder/gameplay-encoder.xcodeproj/xcuserdata - -/tools/luagen/Release -/tools/luagen/Debug -/tools/luagen/gameplay-luagen.xcodeproj/xcuserdata -/tools/luagen/doxygen_entrydb_680.tmp -/tools/luagen/doxygen_objdb_680.tmp -/tools/luagen/xml + +/gameplay/Debug +/gameplay/DebugMem +/gameplay/Release +/gameplay/Simulator +/gameplay/Simulator-Coverage +/gameplay/Simulator-Profile +/gameplay/Device-Debug +/gameplay/Device-Coverage +/gameplay/Device-Profile +/gameplay/Device-Release +/gameplay/windows +/gameplay/android/NUL +/gameplay/android/proguard.cfg +/gameplay/android/proguard-project.txt +/gameplay/android/local.properties +/gameplay/android/bin +/gameplay/android/gen +/gameplay/android/libs +/gameplay/android/obj +/gameplay.xcworkspace/xcuserdata +/gameplay/gameplay.xcodeproj/xcuserdata + +/tools/encoder/Debug +/tools/encoder/Release +/tools/encoder/gameplay-encoder.xcodeproj/xcuserdata + +/tools/luagen/Release +/tools/luagen/Debug +/tools/luagen/gameplay-luagen.xcodeproj/xcuserdata +/tools/luagen/doxygen_entrydb_680.tmp +/tools/luagen/doxygen_objdb_680.tmp +/tools/luagen/xml /tools/luagen/gameplay-luagen.xcodeproj/project.xcworkspace/ - -/samples/browser/Debug -/samples/browser/DebugMem -/samples/browser/Release -/samples/browser/Simulator -/samples/browser/Simulator-Coverage -/samples/browser/Simulator-Profile -/samples/browser/Device-Debug -/samples/browser/Device-Coverage -/samples/browser/Device-Profile -/samples/browser/Device-Release +/samples/browser/Debug +/samples/browser/DebugMem +/samples/browser/Release +/samples/browser/Simulator +/samples/browser/Simulator-Coverage +/samples/browser/Simulator-Profile +/samples/browser/Device-Debug +/samples/browser/Device-Coverage +/samples/browser/Device-Profile +/samples/browser/Device-Release /samples/browser/res/shaders -/samples/browser/res/ui -/samples/browser/res/logo_powered_white.png -/samples/browser/android/src -/samples/browser/android/assets -/samples/browser/android/bin -/samples/browser/android/gen -/samples/browser/android/libs -/samples/browser/android/obj -/samples/browser/android/NUL -/samples/browser/android/local.properties -/samples/browser/android/proguard-project.txt -/samples/browser/android/project.properties -/samples/browser/sample-browser.xcodeproj/xcuserdata - -/samples/character/Debug -/samples/character/DebugMem -/samples/character/Release -/samples/character/Simulator -/samples/character/Simulator-Coverage -/samples/character/Simulator-Profile -/samples/character/Device-Debug -/samples/character/Device-Debug-QC -/samples/character/Device-Coverage -/samples/character/Device-Profile -/samples/character/Device-Release -/samples/character/Device-Release-QC -/samples/character/game.config +/samples/browser/res/ui +/samples/browser/res/logo_powered_white.png +/samples/browser/src/org +/samples/browser/android/src +/samples/browser/android/assets +/samples/browser/android/bin +/samples/browser/android/gen +/samples/browser/android/libs +/samples/browser/android/obj +/samples/browser/android/NUL +/samples/browser/android/local.properties +/samples/browser/android/proguard-project.txt +/samples/browser/sample-browser.xcodeproj/xcuserdata + +/samples/character/Debug +/samples/character/DebugMem +/samples/character/Release +/samples/character/Simulator +/samples/character/Simulator-Coverage +/samples/character/Simulator-Profile +/samples/character/Device-Debug +/samples/character/Device-Debug-QC +/samples/character/Device-Coverage +/samples/character/Device-Profile +/samples/character/Device-Release +/samples/character/Device-Release-QC +/samples/character/game.config /samples/character/res/shaders -/samples/character/res/ui -/samples/character/res/logo_powered_white.png -/samples/character/android/project.properties -/samples/character/android/proguard.cfg -/samples/character/android/local.properties -/samples/character/android/src -/samples/character/android/assets -/samples/character/android/bin -/samples/character/android/gen -/samples/character/android/libs -/samples/character/android/obj -/samples/character/android/NUL -/samples/character/res/gamepad.xcf -/samples/character/sample-character.xcodeproj/xcuserdata - -/samples/lua/Debug -/samples/lua/DebugMem -/samples/lua/Release -/samples/lua/Simulator -/samples/lua/Simulator-Coverage -/samples/lua/Simulator-Profile -/samples/lua/Device-Debug -/samples/lua/Device-Coverage -/samples/lua/Device-Profile -/samples/lua/Device-Release -/samples/lua/res/shaders -/samples/lua/res/ui -/samples/lua/res/logo_powered_white.png -/samples/lua/android/src -/samples/lua/android/assets -/samples/lua/android/bin -/samples/lua/android/gen -/samples/lua/android/libs -/samples/lua/android/obj -/samples/lua/android/NUL -/samples/lua/android/local.properties -/samples/lua/android/proguard.cfg -/samples/lua/android/project.properties -/samples/lua/sample-lua.xcodeproj/xcuserdata - -/samples/mesh/Debug -/samples/mesh/DebugMem -/samples/mesh/Release -/samples/mesh/Simulator -/samples/mesh/Simulator-Coverage -/samples/mesh/Simulator-Profile -/samples/mesh/Device-Debug -/samples/mesh/Device-Coverage -/samples/mesh/Device-Profile -/samples/mesh/Device-Release -/samples/mesh/res/shaders -/samples/mesh/res/ui -/samples/mesh/res/logo_powered_white.png -/samples/mesh/android/src -/samples/mesh/android/assets -/samples/mesh/android/bin -/samples/mesh/android/gen -/samples/mesh/android/libs -/samples/mesh/android/obj -/samples/mesh/android/NUL -/samples/mesh/android/local.properties -/samples/mesh/android/proguard.cfg -/samples/mesh/android/project.properties -/samples/mesh/sample-mesh.xcodeproj/xcuserdata - -/samples/particles/Debug -/samples/particles/DebugMem -/samples/particles/Release -/samples/particles/Simulator -/samples/particles/Simulator-Coverage -/samples/particles/Simulator-Profile -/samples/particles/Device-Debug -/samples/particles/Device-Coverage -/samples/particles/Device-Profile -/samples/particles/Device-Release -/samples/particles/res/shaders -/samples/particles/res/ui -/samples/particles/res/logo_powered_white.png -/samples/particles/Device-Debug -/samples/particles/Debug -/samples/particles/DebugMem -/samples/particles/android/src -/samples/particles/android/assets -/samples/particles/android/bin -/samples/particles/android/gen -/samples/particles/android/libs -/samples/particles/android/obj -/samples/particles/android/proguard.cfg -/samples/particles/android/local.properties -/samples/particles/android/project.properties -/samples/particles/sample-particles.xcodeproj/xcuserdata - -/samples/racer/Debug -/samples/racer/DebugMem -/samples/racer/Release -/samples/racer/Simulator -/samples/racer/Simulator-Coverage -/samples/racer/Simulator-Profile -/samples/racer/Device-Debug -/samples/racer/Device-Debug-QC -/samples/racer/Device-Coverage -/samples/racer/Device-Profile -/samples/racer/Device-Release -/samples/racer/Device-Release-QC -/samples/racer/game.config +/samples/character/res/ui +/samples/character/res/logo_powered_white.png +/samples/character/src/org +/samples/character/android/src +/samples/character/android/assets +/samples/character/android/bin +/samples/character/android/gen +/samples/character/android/libs +/samples/character/android/obj +/samples/character/android/NUL +/samples/character/android/local.properties +/samples/character/android/proguard-project.txt +/samples/character/android/proguard.cfg +/samples/character/res/gamepad.xcf +/samples/character/sample-character.xcodeproj/xcuserdata + +/samples/racer/Debug +/samples/racer/DebugMem +/samples/racer/Release +/samples/racer/Simulator +/samples/racer/Simulator-Coverage +/samples/racer/Simulator-Profile +/samples/racer/Device-Debug +/samples/racer/Device-Debug-QC +/samples/racer/Device-Coverage +/samples/racer/Device-Profile +/samples/racer/Device-Release +/samples/racer/Device-Release-QC +/samples/racer/game.config /samples/racer/res/shaders -/samples/racer/res/ui -/samples/racer/res/logo_powered_white.png -/samples/racer/android/project.properties -/samples/racer/android/proguard.cfg -/samples/racer/android/local.properties -/samples/racer/android/src -/samples/racer/android/assets -/samples/racer/android/bin -/samples/racer/android/gen -/samples/racer/android/libs -/samples/racer/android/obj -/samples/racer/android/NUL -/samples/racer/android/local.properties -/samples/racer/android/proguard.cfg -/samples/racer/android/project.properties -/samples/racer/sample-racer.xcodeproj/xcuserdata - -/samples/spaceship/Debug -/samples/spaceship/DebugMem -/samples/spaceship/Release -/samples/spaceship/Simulator -/samples/spaceship/Simulator-Coverage -/samples/spaceship/Simulator-Profile -/samples/spaceship/Device-Debug -/samples/spaceship/Device-Coverage -/samples/spaceship/Device-Profile -/samples/spaceship/Device-Release +/samples/racer/res/ui +/samples/racer/res/logo_powered_white.png +/samples/racer/src/org +/samples/racer/android/src +/samples/racer/android/assets +/samples/racer/android/bin +/samples/racer/android/gen +/samples/racer/android/libs +/samples/racer/android/obj +/samples/racer/android/NUL +/samples/racer/android/local.properties +/samples/racer/android/proguard-project.txt +/samples/racer/android/proguard.cfg +/samples/racer/sample-racer.xcodeproj/xcuserdata + +/samples/spaceship/Debug +/samples/spaceship/DebugMem +/samples/spaceship/Release +/samples/spaceship/Simulator +/samples/spaceship/Simulator-Coverage +/samples/spaceship/Simulator-Profile +/samples/spaceship/Device-Debug +/samples/spaceship/Device-Coverage +/samples/spaceship/Device-Profile +/samples/spaceship/Device-Release /samples/spaceship/res/shaders -/samples/spaceship/res/ui -/samples/spaceship/res/logo_powered_white.png -/samples/spaceship/android/NUL -/samples/spaceship/android/project.properties -/samples/spaceship/android/assets -/samples/spaceship/android/bin -/samples/spaceship/android/gen -/samples/spaceship/android/libs -/samples/spaceship/android/obj -/samples/spaceship/android/src -/samples/spaceship/android/proguard.cfg -/samples/spaceship/android/local.properties -/samples/spaceship/sample-spaceship.xcodeproj/xcuserdata - -/tools/encoder/Debug -/tools/encoder/Release - -/tools/luagen/Debug -/tools/luagen/Release +/samples/spaceship/res/ui +/samples/spaceship/res/logo_powered_white.png +/samples/spaceship/src/org +/samples/spaceship/android/src +/samples/spaceship/android/assets +/samples/spaceship/android/bin +/samples/spaceship/android/gen +/samples/spaceship/android/libs +/samples/spaceship/android/obj +/samples/spaceship/android/NUL +/samples/spaceship/android/local.properties +/samples/spaceship/android/proguard.cfg +/samples/spaceship/android/proguard-project.txt +/samples/spaceship/sample-spaceship.xcodeproj/xcuserdata + +/tools/encoder/windows +/tools/luagen/windows +/tools/encoder/gameplay-encoder.xcodeproj/project.xcworkspace/ diff --git a/CHANGES.md b/CHANGES.md index ab4c0530cd..6cfd8aef45 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,10 +1,37 @@ +## v3.0.0 + +- Adds support for 2D Sprite, TileSet and Text. +- Adds support for node instance scripts. +- Adds support for C++11. +- Adds support for MacOSX 64-bit. +- Adds support for iOS 8+. +- Adds support for XCode 6+. +- Adds support for QTCreator for Linux and MacOSX. +- Adds support for Eclipse for Linux. +- Adds support for Eclipse for Android. +- Adds updates to FBX SDK 2015.1 +- Adds support for Bullet Physics 2.82 +- Adds support for cubemap textures. +- Adds support for font kerning. +- Adds support for Android x86. +- Adds support for gamepads on Android. +- Adds supoprt for Android extensions through custom native activity. +- Adds water sample to browser. +- Adds audio player sample to browser. +- Adds GamePlay-deps repository for cross-platform Cmake dependency builds. +- Fixes to Scene Graph for merging Drawables on Node. +- Fixes from setUserPointer to setUserObject(Ref*) +- Fixes for virtual gamepad scaling. +- Fixes Image to support grayscale PNGs. +- Fixes Android to build with arm instead of thumb. + ## v2.0.0 - Adds support for Visual Studio 2013. - Adds support for iOS 7, MacOS X 10.9 and XCode 5. - Adds support for BlackBerry NDK 10.2. - Adds support for CollisionObject group mask filtering. -- Adds support in shaders for mulitple lights using shader defines. +- Adds support in shaders for multiple lights using shader defines. - Adds various improvements to Material binding support. - Adds support for array MaterialParameter's. - Adds support for encoding distance field based fonts. diff --git a/CMakeLists.txt b/CMakeLists.txt index ebb140ae5e..5372ae9bbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(GamePlay) -set(GAMEPLAY_VERSION 2.0.0) +set(GAMEPLAY_VERSION 3.0.0) set(CMAKE_C_COMPILER_INIT g++) # debug @@ -27,3 +27,4 @@ add_subdirectory(samples) # gameplay encoder # A pre-compiled executable can be found in 'gameplay/bin'. Uncomment to build yourself. #add_subdirectory(tools/encoder) +#add_subdirectory(tools/luagen) diff --git a/README.md b/README.md index 72a47500db..891cf24da7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## GamePlay v2.0.0 +## GamePlay v3.0.0 -GamePlay3D is an open-source, cross-platform 3D native C++ game framework making it easy to learn and write mobile and desktop games. +GamePlay is an open-source, cross-platform native C++ game framework making it easy to learn and write mobile and desktop games. gameplay3d @@ -11,15 +11,15 @@ GamePlay3D is an open-source, cross-platform 3D native C++ game framework making - [Development Guide](https://github.com/gameplay3d/GamePlay/wiki#wiki-Development_Guide) ## Supported Platforms -- [Windows](https://github.com/gameplay3d/GamePlay/wiki/Visual-Studio-Setup) (using Microsoft Visual Studio) -- [Linux](https://github.com/gameplay3d/GamePlay/wiki/CMake Setup - Linux) (using CMake) -- [MacOSX](https://github.com/gameplay3d/GamePlay/wiki/Apple-Xcode-Setup) (using Apple XCode) -- [iOS](https://github.com/gameplay3d/GamePlay/wiki/Apple-Xcode-Setup) (using Apple XCode) -- [Android](https://github.com/gameplay3d/GamePlay/wiki/Android-NDK-Setup) (using Google Android NDK) +- [Windows](https://github.com/gameplay3d/GamePlay/wiki/Visual-Studio-Setup) +- [Linux](https://github.com/gameplay3d/GamePlay/wiki/CMake Setup - Linux) +- [MacOSX](https://github.com/gameplay3d/GamePlay/wiki/Apple-Xcode-Setup) +- [iOS](https://github.com/gameplay3d/GamePlay/wiki/Apple-Xcode-Setup) +- [Android](https://github.com/gameplay3d/GamePlay/wiki/Android-NDK-Setup) ## Roadmap for 'next' branch -- [3.0.0](https://github.com/gameplay3d/GamePlay/milestones/3.0.0) -- [backlog](https://github.com/gameplay3d/GamePlay/issues?q=is%3Aopen+no%3Amilestone) +- [4.0.0](https://github.com/gameplay3d/GamePlay/milestones/4.0.0) +- [backlog](https://github.com/gameplay3d/GamePlay/issues?q=is%3Aopen+is%3Aissue+no%3Amilestone) ## License Open-source under [Apache 2.0 license](http://www.tldrlegal.com/license/apache-license-2.0-%28apache-2.0%29). diff --git a/build.xml b/build.xml deleted file mode 100644 index 99cbc7d4c8..0000000000 --- a/build.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/codestyle.xml b/codestyle.xml deleted file mode 100644 index cb5cb001d5..0000000000 --- a/codestyle.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gameplay.doxyfile b/gameplay.doxyfile index 8014061fd1..674ef8723b 100644 --- a/gameplay.doxyfile +++ b/gameplay.doxyfile @@ -32,7 +32,7 @@ PROJECT_NAME = gameplay # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.0.0 +PROJECT_NUMBER = 3.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/gameplay.sln b/gameplay.sln index 91be3bf95a..9d914d664d 100644 --- a/gameplay.sln +++ b/gameplay.sln @@ -1,13 +1,8 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Express 2013 for Windows Desktop VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-mesh", "samples\mesh\sample-mesh.vcxproj", "{D672DC66-3CE0-4878-B0D2-813CA731012F}" - ProjectSection(ProjectDependencies) = postProject - {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameplay", "gameplay\gameplay.vcxproj", "{1032BA4B-57EB-4348-9E03-29DD63E80E4A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-browser", "samples\browser\sample-browser.vcxproj", "{0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}" @@ -15,11 +10,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-browser", "samples\b {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-lua", "samples\lua\sample-lua.vcxproj", "{04EAF3E5-0F9E-AF4D-53F9-269CE114211F}" - ProjectSection(ProjectDependencies) = postProject - {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-spaceship", "samples\spaceship\sample-spaceship.vcxproj", "{CC37B8E9-6402-4841-8D6A-5D908A5909B3}" ProjectSection(ProjectDependencies) = postProject {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} @@ -30,11 +20,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-character", "samples {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-particles", "samples\particles\sample-particles.vcxproj", "{CB5ABFAA-EA69-E439-5A4D-3B9359916C71}" - ProjectSection(ProjectDependencies) = postProject - {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-racer", "samples\racer\sample-racer.vcxproj", "{82522888-E09A-ED48-AD7D-247237B37B3A}" ProjectSection(ProjectDependencies) = postProject {1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A} @@ -42,108 +27,39 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-racer", "samples\rac EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - DebugMem|Win32 = DebugMem|Win32 DebugMem|x64 = DebugMem|x64 - Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Debug|Win32.ActiveCfg = Debug|Win32 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Debug|Win32.Build.0 = Debug|Win32 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Debug|x64.ActiveCfg = Debug|x64 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Debug|x64.Build.0 = Debug|x64 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.DebugMem|Win32.Build.0 = DebugMem|Win32 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.DebugMem|x64.ActiveCfg = DebugMem|x64 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.DebugMem|x64.Build.0 = DebugMem|x64 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|Win32.ActiveCfg = Release|Win32 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|Win32.Build.0 = Release|Win32 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|x64.ActiveCfg = Release|x64 - {D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|x64.Build.0 = Release|x64 - {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Debug|Win32.ActiveCfg = Debug|Win32 - {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Debug|Win32.Build.0 = Debug|Win32 {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Debug|x64.ActiveCfg = Debug|x64 {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Debug|x64.Build.0 = Debug|x64 - {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.DebugMem|Win32.Build.0 = DebugMem|Win32 {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.DebugMem|x64.ActiveCfg = DebugMem|x64 {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.DebugMem|x64.Build.0 = DebugMem|x64 - {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Release|Win32.ActiveCfg = Release|Win32 - {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Release|Win32.Build.0 = Release|Win32 {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Release|x64.ActiveCfg = Release|x64 {1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Release|x64.Build.0 = Release|x64 - {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Debug|Win32.ActiveCfg = Debug|Win32 - {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Debug|Win32.Build.0 = Debug|Win32 {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Debug|x64.ActiveCfg = Debug|x64 {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Debug|x64.Build.0 = Debug|x64 - {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.DebugMem|Win32.Build.0 = DebugMem|Win32 {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.DebugMem|x64.ActiveCfg = DebugMem|x64 {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.DebugMem|x64.Build.0 = DebugMem|x64 - {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Release|Win32.ActiveCfg = Release|Win32 - {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Release|Win32.Build.0 = Release|Win32 {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Release|x64.ActiveCfg = Release|x64 {0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Release|x64.Build.0 = Release|x64 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Debug|Win32.ActiveCfg = Debug|Win32 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Debug|Win32.Build.0 = Debug|Win32 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Debug|x64.ActiveCfg = Debug|x64 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Debug|x64.Build.0 = Debug|x64 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.DebugMem|Win32.Build.0 = DebugMem|Win32 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.DebugMem|x64.ActiveCfg = DebugMem|x64 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.DebugMem|x64.Build.0 = DebugMem|x64 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Release|Win32.ActiveCfg = Release|Win32 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Release|Win32.Build.0 = Release|Win32 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Release|x64.ActiveCfg = Release|x64 - {04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Release|x64.Build.0 = Release|x64 - {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Debug|Win32.ActiveCfg = Debug|Win32 - {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Debug|Win32.Build.0 = Debug|Win32 {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Debug|x64.ActiveCfg = Debug|x64 {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Debug|x64.Build.0 = Debug|x64 - {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.DebugMem|Win32.Build.0 = DebugMem|Win32 {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.DebugMem|x64.ActiveCfg = DebugMem|x64 {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.DebugMem|x64.Build.0 = DebugMem|x64 - {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Release|Win32.ActiveCfg = Release|Win32 - {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Release|Win32.Build.0 = Release|Win32 {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Release|x64.ActiveCfg = Release|x64 {CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Release|x64.Build.0 = Release|x64 - {87388E8B-F3CF-428F-BC2C-C1886248C111}.Debug|Win32.ActiveCfg = Debug|Win32 - {87388E8B-F3CF-428F-BC2C-C1886248C111}.Debug|Win32.Build.0 = Debug|Win32 {87388E8B-F3CF-428F-BC2C-C1886248C111}.Debug|x64.ActiveCfg = Debug|x64 {87388E8B-F3CF-428F-BC2C-C1886248C111}.Debug|x64.Build.0 = Debug|x64 - {87388E8B-F3CF-428F-BC2C-C1886248C111}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {87388E8B-F3CF-428F-BC2C-C1886248C111}.DebugMem|Win32.Build.0 = DebugMem|Win32 {87388E8B-F3CF-428F-BC2C-C1886248C111}.DebugMem|x64.ActiveCfg = DebugMem|x64 {87388E8B-F3CF-428F-BC2C-C1886248C111}.DebugMem|x64.Build.0 = DebugMem|x64 - {87388E8B-F3CF-428F-BC2C-C1886248C111}.Release|Win32.ActiveCfg = Release|Win32 - {87388E8B-F3CF-428F-BC2C-C1886248C111}.Release|Win32.Build.0 = Release|Win32 {87388E8B-F3CF-428F-BC2C-C1886248C111}.Release|x64.ActiveCfg = Release|x64 {87388E8B-F3CF-428F-BC2C-C1886248C111}.Release|x64.Build.0 = Release|x64 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Debug|Win32.ActiveCfg = Debug|Win32 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Debug|Win32.Build.0 = Debug|Win32 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Debug|x64.ActiveCfg = Debug|x64 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Debug|x64.Build.0 = Debug|x64 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.DebugMem|Win32.Build.0 = DebugMem|Win32 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.DebugMem|x64.ActiveCfg = DebugMem|x64 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.DebugMem|x64.Build.0 = DebugMem|x64 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Release|Win32.ActiveCfg = Release|Win32 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Release|Win32.Build.0 = Release|Win32 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Release|x64.ActiveCfg = Release|x64 - {CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Release|x64.Build.0 = Release|x64 - {82522888-E09A-ED48-AD7D-247237B37B3A}.Debug|Win32.ActiveCfg = Debug|Win32 - {82522888-E09A-ED48-AD7D-247237B37B3A}.Debug|Win32.Build.0 = Debug|Win32 {82522888-E09A-ED48-AD7D-247237B37B3A}.Debug|x64.ActiveCfg = Debug|x64 {82522888-E09A-ED48-AD7D-247237B37B3A}.Debug|x64.Build.0 = Debug|x64 - {82522888-E09A-ED48-AD7D-247237B37B3A}.DebugMem|Win32.ActiveCfg = DebugMem|Win32 - {82522888-E09A-ED48-AD7D-247237B37B3A}.DebugMem|Win32.Build.0 = DebugMem|Win32 {82522888-E09A-ED48-AD7D-247237B37B3A}.DebugMem|x64.ActiveCfg = DebugMem|x64 {82522888-E09A-ED48-AD7D-247237B37B3A}.DebugMem|x64.Build.0 = DebugMem|x64 - {82522888-E09A-ED48-AD7D-247237B37B3A}.Release|Win32.ActiveCfg = Release|Win32 - {82522888-E09A-ED48-AD7D-247237B37B3A}.Release|Win32.Build.0 = Release|Win32 {82522888-E09A-ED48-AD7D-247237B37B3A}.Release|x64.ActiveCfg = Release|x64 {82522888-E09A-ED48-AD7D-247237B37B3A}.Release|x64.Build.0 = Release|x64 EndGlobalSection diff --git a/gameplay.xcworkspace/contents.xcworkspacedata b/gameplay.xcworkspace/contents.xcworkspacedata index 37fc5ef393..bb8ebd3042 100644 --- a/gameplay.xcworkspace/contents.xcworkspacedata +++ b/gameplay.xcworkspace/contents.xcworkspacedata @@ -10,15 +10,6 @@ - - - - - - diff --git a/gameplay/.cproject b/gameplay/.cproject index 10a3754370..cb7788e463 100644 --- a/gameplay/.cproject +++ b/gameplay/.cproject @@ -3,222 +3,183 @@ - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + + + + + + + - - - + + + + + + + + + - - + + + - - - - - - - - + - - - - - - + + + - - + + - - + + - - - - - - - - + + - - + + + + + + + - - - + diff --git a/gameplay/.project b/gameplay/.project index de8cbe704d..c182eaa159 100644 --- a/gameplay/.project +++ b/gameplay/.project @@ -1,77 +1,83 @@ - - - gameplay - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/gameplay/Device-Debug} - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - com.qnx.tools.ide.bbt.core.bbtnature - org.eclipse.cdt.core.ccnature - - + + + gameplay + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/gameplay/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/gameplay/CMakeLists.txt b/gameplay/CMakeLists.txt index 73ec1a3efa..ea1ef0841c 100644 --- a/gameplay/CMakeLists.txt +++ b/gameplay/CMakeLists.txt @@ -57,6 +57,8 @@ set(GAMEPLAY_SRC src/DebugNew.h src/DepthStencilTarget.cpp src/DepthStencilTarget.h + src/Drawable.cpp + src/Drawable.h src/Effect.cpp src/Effect.h src/FileSystem.cpp @@ -77,7 +79,6 @@ set(GAMEPLAY_SRC src/Gamepad.cpp src/Gamepad.h src/gameplay-main-android.cpp - src/gameplay-main-blackberry.cpp src/gameplay-main-linux.cpp src/gameplay-main-windows.cpp src/Gesture.h @@ -162,7 +163,6 @@ set(GAMEPLAY_SRC src/Platform.h src/Platform.cpp src/PlatformAndroid.cpp - src/PlatformBlackBerry.cpp src/PlatformLinux.cpp src/PlatformWindows.cpp src/Properties.cpp @@ -189,6 +189,8 @@ set(GAMEPLAY_SRC src/SceneLoader.h src/ScreenDisplayer.cpp src/ScreenDisplayer.h + src/Script.cpp + src/Script.h src/ScriptController.cpp src/ScriptController.h src/ScriptController.inl @@ -196,6 +198,8 @@ set(GAMEPLAY_SRC src/ScriptTarget.h src/Slider.cpp src/Slider.h + src/Sprite.cpp + src/Sprite.h src/SpriteBatch.cpp src/SpriteBatch.h src/Technique.cpp @@ -204,6 +208,8 @@ set(GAMEPLAY_SRC src/Terrain.h src/TerrainPatch.cpp src/TerrainPatch.h + src/Text.cpp + src/Text.h src/TextBox.cpp src/TextBox.h src/Texture.cpp @@ -212,6 +218,8 @@ set(GAMEPLAY_SRC src/Theme.h src/ThemeStyle.cpp src/ThemeStyle.h + src/TileSet.cpp + src/TileSet.h src/Transform.cpp src/Transform.h src/Vector2.cpp @@ -244,8 +252,6 @@ set(GAMEPLAY_LUA src/lua/lua_AIController.h src/lua/lua_AIMessage.cpp src/lua/lua_AIMessage.h - src/lua/lua_AIMessageParameterType.cpp - src/lua/lua_AIMessageParameterType.h src/lua/lua_AIState.cpp src/lua/lua_AIState.h src/lua/lua_AIStateListener.cpp @@ -258,8 +264,6 @@ set(GAMEPLAY_LUA src/lua/lua_AnimationClip.h src/lua/lua_AnimationClipListener.cpp src/lua/lua_AnimationClipListener.h - src/lua/lua_AnimationClipListenerEventType.cpp - src/lua/lua_AnimationClipListenerEventType.h src/lua/lua_AnimationController.cpp src/lua/lua_AnimationController.h src/lua/lua_AnimationTarget.cpp @@ -274,8 +278,6 @@ set(GAMEPLAY_LUA src/lua/lua_AudioListener.h src/lua/lua_AudioSource.cpp src/lua/lua_AudioSource.h - src/lua/lua_AudioSourceState.cpp - src/lua/lua_AudioSourceState.h src/lua/lua_BoundingBox.cpp src/lua/lua_BoundingBox.h src/lua/lua_BoundingSphere.cpp @@ -288,34 +290,20 @@ set(GAMEPLAY_LUA src/lua/lua_Camera.h src/lua/lua_CameraListener.h src/lua/lua_CameraListener.cpp - src/lua/lua_CameraType.cpp - src/lua/lua_CameraType.h src/lua/lua_CheckBox.cpp src/lua/lua_CheckBox.h src/lua/lua_Container.cpp src/lua/lua_Container.h - src/lua/lua_ContainerScroll.cpp - src/lua/lua_ContainerScroll.h src/lua/lua_Control.cpp src/lua/lua_Control.h - src/lua/lua_ControlAlignment.cpp - src/lua/lua_ControlAlignment.h - src/lua/lua_ControlAutoSize.cpp - src/lua/lua_ControlAutoSize.h src/lua/lua_ControlListener.cpp src/lua/lua_ControlListener.h - src/lua/lua_ControlListenerEventType.cpp - src/lua/lua_ControlListenerEventType.h - src/lua/lua_ControlState.cpp - src/lua/lua_ControlState.h src/lua/lua_Curve.cpp src/lua/lua_Curve.h - src/lua/lua_CurveInterpolationType.cpp - src/lua/lua_CurveInterpolationType.h src/lua/lua_DepthStencilTarget.cpp src/lua/lua_DepthStencilTarget.h - src/lua/lua_DepthStencilTargetFormat.cpp - src/lua/lua_DepthStencilTargetFormat.h + src/lua/lua_Drawable.cpp + src/lua/lua_Drawable.h src/lua/lua_Effect.cpp src/lua/lua_Effect.h src/lua/lua_FileSystem.cpp @@ -324,14 +312,6 @@ set(GAMEPLAY_LUA src/lua/lua_FlowLayout.h src/lua/lua_Font.cpp src/lua/lua_Font.h - src/lua/lua_FontFormat.cpp - src/lua/lua_FontFormat.h - src/lua/lua_FontJustify.cpp - src/lua/lua_FontJustify.h - src/lua/lua_FontStyle.cpp - src/lua/lua_FontStyle.h - src/lua/lua_FontText.cpp - src/lua/lua_FontText.h src/lua/lua_Form.cpp src/lua/lua_Form.h src/lua/lua_FrameBuffer.cpp @@ -340,20 +320,10 @@ set(GAMEPLAY_LUA src/lua/lua_Frustum.h src/lua/lua_Game.cpp src/lua/lua_Game.h - src/lua/lua_GameClearFlags.cpp - src/lua/lua_GameClearFlags.h src/lua/lua_Gamepad.cpp src/lua/lua_Gamepad.h - src/lua/lua_GamepadButtonMapping.cpp - src/lua/lua_GamepadButtonMapping.h - src/lua/lua_GamepadGamepadEvent.cpp - src/lua/lua_GamepadGamepadEvent.h - src/lua/lua_GameState.cpp - src/lua/lua_GameState.h src/lua/lua_Gesture.cpp src/lua/lua_Gesture.h - src/lua/lua_GestureGestureEvent.cpp - src/lua/lua_GestureGestureEvent.h src/lua/lua_Global.cpp src/lua/lua_Global.h src/lua/lua_HeightField.cpp @@ -362,32 +332,20 @@ set(GAMEPLAY_LUA src/lua/lua_Image.h src/lua/lua_ImageControl.cpp src/lua/lua_ImageControl.h - src/lua/lua_ImageFormat.cpp - src/lua/lua_ImageFormat.h src/lua/lua_Joint.cpp src/lua/lua_Joint.h src/lua/lua_JoystickControl.cpp src/lua/lua_JoystickControl.h src/lua/lua_Keyboard.cpp src/lua/lua_Keyboard.h - src/lua/lua_KeyboardKey.cpp - src/lua/lua_KeyboardKey.h - src/lua/lua_KeyboardKeyEvent.cpp - src/lua/lua_KeyboardKeyEvent.h src/lua/lua_Label.cpp src/lua/lua_Label.h src/lua/lua_Layout.cpp src/lua/lua_Layout.h - src/lua/lua_LayoutType.cpp - src/lua/lua_LayoutType.h src/lua/lua_Light.cpp src/lua/lua_Light.h - src/lua/lua_LightType.cpp - src/lua/lua_LightType.h src/lua/lua_Logger.cpp src/lua/lua_Logger.h - src/lua/lua_LoggerLevel.cpp - src/lua/lua_LoggerLevel.h src/lua/lua_Material.cpp src/lua/lua_Material.h src/lua/lua_MaterialParameter.cpp @@ -400,30 +358,20 @@ set(GAMEPLAY_LUA src/lua/lua_Mesh.h src/lua/lua_MeshBatch.cpp src/lua/lua_MeshBatch.h - src/lua/lua_MeshIndexFormat.cpp - src/lua/lua_MeshIndexFormat.h src/lua/lua_MeshPart.cpp src/lua/lua_MeshPart.h - src/lua/lua_MeshPrimitiveType.cpp - src/lua/lua_MeshPrimitiveType.h src/lua/lua_MeshSkin.cpp src/lua/lua_MeshSkin.h src/lua/lua_Model.cpp src/lua/lua_Model.h src/lua/lua_Mouse.cpp src/lua/lua_Mouse.h - src/lua/lua_MouseMouseEvent.cpp - src/lua/lua_MouseMouseEvent.h src/lua/lua_Node.cpp src/lua/lua_Node.h src/lua/lua_NodeCloneContext.cpp src/lua/lua_NodeCloneContext.h - src/lua/lua_NodeType.cpp - src/lua/lua_NodeType.h src/lua/lua_ParticleEmitter.cpp src/lua/lua_ParticleEmitter.h - src/lua/lua_ParticleEmitterTextureBlending.cpp - src/lua/lua_ParticleEmitterTextureBlending.h src/lua/lua_Pass.cpp src/lua/lua_Pass.h src/lua/lua_PhysicsCharacter.cpp @@ -432,18 +380,12 @@ set(GAMEPLAY_LUA src/lua/lua_PhysicsCollisionObject.h src/lua/lua_PhysicsCollisionObjectCollisionListener.cpp src/lua/lua_PhysicsCollisionObjectCollisionListener.h - src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.cpp - src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.h src/lua/lua_PhysicsCollisionObjectCollisionPair.cpp src/lua/lua_PhysicsCollisionObjectCollisionPair.h - src/lua/lua_PhysicsCollisionObjectType.cpp - src/lua/lua_PhysicsCollisionObjectType.h src/lua/lua_PhysicsCollisionShape.cpp src/lua/lua_PhysicsCollisionShape.h src/lua/lua_PhysicsCollisionShapeDefinition.cpp src/lua/lua_PhysicsCollisionShapeDefinition.h - src/lua/lua_PhysicsCollisionShapeType.cpp - src/lua/lua_PhysicsCollisionShapeType.h src/lua/lua_PhysicsConstraint.cpp src/lua/lua_PhysicsConstraint.h src/lua/lua_PhysicsController.cpp @@ -454,8 +396,6 @@ set(GAMEPLAY_LUA src/lua/lua_PhysicsControllerHitResult.h src/lua/lua_PhysicsControllerListener.cpp src/lua/lua_PhysicsControllerListener.h - src/lua/lua_PhysicsControllerListenerEventType.cpp - src/lua/lua_PhysicsControllerListenerEventType.h src/lua/lua_PhysicsFixedConstraint.cpp src/lua/lua_PhysicsFixedConstraint.h src/lua/lua_PhysicsGenericConstraint.cpp @@ -482,8 +422,6 @@ set(GAMEPLAY_LUA src/lua/lua_Platform.h src/lua/lua_Properties.cpp src/lua/lua_Properties.h - src/lua/lua_PropertiesType.cpp - src/lua/lua_PropertiesType.h src/lua/lua_Quaternion.cpp src/lua/lua_Quaternion.h src/lua/lua_RadioButton.cpp @@ -496,57 +434,46 @@ set(GAMEPLAY_LUA src/lua/lua_Ref.h src/lua/lua_RenderState.cpp src/lua/lua_RenderState.h - src/lua/lua_RenderStateAutoBinding.cpp - src/lua/lua_RenderStateAutoBinding.h - src/lua/lua_RenderStateBlend.cpp - src/lua/lua_RenderStateBlend.h - src/lua/lua_RenderStateCullFaceSide.cpp - src/lua/lua_RenderStateDepthFunction.cpp - src/lua/lua_RenderStateDepthFunction.h - src/lua/lua_RenderStateFrontFace.cpp - src/lua/lua_RenderStateFrontFace.h src/lua/lua_RenderStateStateBlock.cpp src/lua/lua_RenderStateStateBlock.h - src/lua/lua_RenderStateStencilFunction.cpp - src/lua/lua_RenderStateStencilFunction.h - src/lua/lua_RenderStateStencilOperation.cpp - src/lua/lua_RenderStateStencilOperation.h src/lua/lua_RenderTarget.cpp src/lua/lua_RenderTarget.h src/lua/lua_Scene.cpp src/lua/lua_Scene.h src/lua/lua_ScreenDisplayer.cpp src/lua/lua_ScreenDisplayer.h + src/lua/lua_Script.cpp + src/lua/lua_Script.h src/lua/lua_ScriptController.cpp src/lua/lua_ScriptController.h src/lua/lua_ScriptTarget.cpp src/lua/lua_ScriptTarget.h + src/lua/lua_ScriptTargetEvent.cpp + src/lua/lua_ScriptTargetEvent.h + src/lua/lua_ScriptTargetEventRegistry.cpp + src/lua/lua_ScriptTargetEventRegistry.h src/lua/lua_Slider.cpp src/lua/lua_Slider.h + src/lua/lua_Sprite.cpp + src/lua/lua_Sprite.h src/lua/lua_SpriteBatch.cpp src/lua/lua_SpriteBatch.h + src/lua/lua_SpriteBatchSpriteVertex.cpp + src/lua/lua_SpriteBatchSpriteVertex.h src/lua/lua_Technique.cpp src/lua/lua_Technique.h src/lua/lua_Terrain.cpp src/lua/lua_Terrain.h - src/lua/lua_TerrainFlags.cpp - src/lua/lua_TerrainFlags.h src/lua/lua_TerrainPatch.cpp src/lua/lua_TerrainPatch.h + src/lua/lua_Text.cpp + src/lua/lua_Text.h src/lua/lua_TextBox.cpp src/lua/lua_TextBox.h - src/lua/lua_TextBoxInputMode.cpp - src/lua/lua_TextBoxInputMode.h src/lua/lua_Texture.cpp src/lua/lua_Texture.h - src/lua/lua_TextureFilter.cpp - src/lua/lua_TextureFilter.h - src/lua/lua_TextureFormat.cpp - src/lua/lua_TextureFormat.h src/lua/lua_TextureSampler.cpp src/lua/lua_TextureSampler.h - src/lua/lua_TextureWrap.cpp - src/lua/lua_TextureWrap.h src/lua/lua_Theme.cpp src/lua/lua_Theme.h src/lua/lua_ThemeSideRegions.cpp @@ -557,10 +484,10 @@ set(GAMEPLAY_LUA src/lua/lua_ThemeThemeImage.h src/lua/lua_ThemeUVs.cpp src/lua/lua_ThemeUVs.h + src/lua/lua_TileSet.cpp + src/lua/lua_TileSet.h src/lua/lua_Touch.cpp src/lua/lua_Touch.h - src/lua/lua_TouchTouchEvent.cpp - src/lua/lua_TouchTouchEvent.h src/lua/lua_Transform.cpp src/lua/lua_Transform.h src/lua/lua_TransformListener.cpp @@ -579,8 +506,6 @@ set(GAMEPLAY_LUA src/lua/lua_VertexFormat.h src/lua/lua_VertexFormatElement.cpp src/lua/lua_VertexFormatElement.h - src/lua/lua_VertexFormatUsage.cpp - src/lua/lua_VertexFormatUsage.h src/lua/lua_VerticalLayout.cpp src/lua/lua_VerticalLayout.h ) @@ -617,15 +542,9 @@ set(GAMEPLAY_RES_SHADERS res/ui/default.theme ) -include_directories( +include_directories( src - ../external-deps/lua/include - ../external-deps/bullet/include - ../external-deps/png/include - ../external-deps/zlib/include - ../external-deps/oggvorbis/include - ../external-deps/openal/include - ../external-deps/glew/include + ../external-deps/include ) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -636,6 +555,7 @@ add_definitions(${GTK2_CFLAGS_OTHER}) add_definitions(-D__linux__) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") +add_definitions(-std=c++11) add_definitions(-lstdc++) add_library(gameplay STATIC diff --git a/gameplay/android/.classpath b/gameplay/android/.classpath new file mode 100644 index 0000000000..f040719338 --- /dev/null +++ b/gameplay/android/.classpath @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/gameplay/android/.cproject b/gameplay/android/.cproject new file mode 100644 index 0000000000..153b73e7be --- /dev/null +++ b/gameplay/android/.cproject @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/template/template.project b/gameplay/android/.project similarity index 68% rename from template/template.project rename to gameplay/android/.project index d47b47d12c..90dc3bcad5 100644 --- a/template/template.project +++ b/gameplay/android/.project @@ -1,12 +1,18 @@ - TEMPLATE_PROJECT + gameplay + + org.eclipse.cdt.managedbuilder.core.genmakebuilder clean,full,incremental, + + ?children? + ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|| + ?name? @@ -15,21 +21,13 @@ org.eclipse.cdt.make.core.append_environment true - - org.eclipse.cdt.make.core.autoBuildTarget - all - org.eclipse.cdt.make.core.buildArguments - + NDK_DEBUG=1 -j4 org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/TEMPLATE_PROJECT/Device-Debug} + ndk-build org.eclipse.cdt.make.core.cleanBuildTarget @@ -51,37 +49,56 @@ org.eclipse.cdt.make.core.enableFullBuild true - - org.eclipse.cdt.make.core.fullBuildTarget - all - org.eclipse.cdt.make.core.stopOnError true org.eclipse.cdt.make.core.useDefaultBuildCmd - true + false - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, + com.android.ide.eclipse.adt.ResourceManagerBuilder - com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - com.qnx.tools.ide.bbt.core.bbtnature - org.eclipse.cdt.core.ccnature + + + src + 2 + $%7BPARENT-2-PROJECT_LOC%7D/gameplay/src + + diff --git a/gameplay/android/AndroidManifest.xml b/gameplay/android/AndroidManifest.xml index 40742f8e91..0b48889f72 100644 --- a/gameplay/android/AndroidManifest.xml +++ b/gameplay/android/AndroidManifest.xml @@ -1,14 +1,9 @@ - + - + - - - - \ No newline at end of file + diff --git a/gameplay/android/build.xml b/gameplay/android/build.xml index 763bae0abc..04d4244adb 100644 --- a/gameplay/android/build.xml +++ b/gameplay/android/build.xml @@ -1,81 +1,39 @@ - - - - - + - - - - - - - - - + diff --git a/gameplay/android/jni/Android.mk b/gameplay/android/jni/Android.mk index 875143ef56..edc0beaab2 100644 --- a/gameplay/android/jni/Android.mk +++ b/gameplay/android/jni/Android.mk @@ -1,7 +1,18 @@ +GAMEPLAY_PATH := $(call my-dir)/../../src -LOCAL_PATH := $(call my-dir)/../../src +# external-deps +GAMEPLAY_DEPS := ../../external-deps/lib/android/$(TARGET_ARCH_ABI) +# libgameplay-deps +LOCAL_PATH := $(GAMEPLAY_DEPS) include $(CLEAR_VARS) +LOCAL_MODULE := libgameplay-deps +LOCAL_SRC_FILES := libgameplay-deps.a +include $(PREBUILT_STATIC_LIBRARY) + +# libgameplay +include $(CLEAR_VARS) +LOCAL_PATH := $(GAMEPLAY_PATH) LOCAL_MODULE := libgameplay LOCAL_SRC_FILES := \ AbsoluteLayout.cpp \ @@ -31,6 +42,7 @@ LOCAL_SRC_FILES := \ Curve.cpp \ DebugNew.cpp \ DepthStencilTarget.cpp \ + Drawable.cpp \ Effect.cpp \ FileSystem.cpp \ FlowLayout.cpp \ @@ -89,17 +101,21 @@ LOCAL_SRC_FILES := \ Scene.cpp \ SceneLoader.cpp \ ScreenDisplayer.cpp \ + Script.cpp \ ScriptController.cpp \ ScriptTarget.cpp \ Slider.cpp \ + Sprite.cpp \ SpriteBatch.cpp \ Technique.cpp \ Terrain.cpp \ TerrainPatch.cpp \ + Text.cpp \ TextBox.cpp \ Texture.cpp \ Theme.cpp \ ThemeStyle.cpp \ + TileSet.cpp \ Transform.cpp \ Vector2.cpp \ Vector3.cpp \ @@ -112,7 +128,6 @@ LOCAL_SRC_FILES := \ lua/lua_AIAgentListener.cpp \ lua/lua_AIController.cpp \ lua/lua_AIMessage.cpp \ - lua/lua_AIMessageParameterType.cpp \ lua/lua_AIState.cpp \ lua/lua_AIStateListener.cpp \ lua/lua_AIStateMachine.cpp \ @@ -120,7 +135,6 @@ LOCAL_SRC_FILES := \ lua/lua_Animation.cpp \ lua/lua_AnimationClip.cpp \ lua/lua_AnimationClipListener.cpp \ - lua/lua_AnimationClipListenerEventType.cpp \ lua/lua_AnimationController.cpp \ lua/lua_AnimationTarget.cpp \ lua/lua_AnimationValue.cpp \ @@ -128,97 +142,65 @@ LOCAL_SRC_FILES := \ lua/lua_AudioController.cpp \ lua/lua_AudioListener.cpp \ lua/lua_AudioSource.cpp \ - lua/lua_AudioSourceState.cpp \ lua/lua_BoundingBox.cpp \ lua/lua_BoundingSphere.cpp \ lua/lua_Bundle.cpp \ lua/lua_Button.cpp \ lua/lua_Camera.cpp \ lua/lua_CameraListener.cpp \ - lua/lua_CameraType.cpp \ lua/lua_CheckBox.cpp \ lua/lua_Container.cpp \ - lua/lua_ContainerScroll.cpp \ lua/lua_Control.cpp \ - lua/lua_ControlAlignment.cpp \ - lua/lua_ControlAutoSize.cpp \ lua/lua_ControlListener.cpp \ - lua/lua_ControlListenerEventType.cpp \ - lua/lua_ControlState.cpp \ lua/lua_Curve.cpp \ - lua/lua_CurveInterpolationType.cpp \ lua/lua_DepthStencilTarget.cpp \ - lua/lua_DepthStencilTargetFormat.cpp \ + lua/lua_Drawable.cpp \ lua/lua_Effect.cpp \ lua/lua_FileSystem.cpp \ lua/lua_FlowLayout.cpp \ lua/lua_Font.cpp \ - lua/lua_FontFormat.cpp \ - lua/lua_FontJustify.cpp \ - lua/lua_FontStyle.cpp \ - lua/lua_FontText.cpp \ lua/lua_Form.cpp \ lua/lua_FrameBuffer.cpp \ lua/lua_Frustum.cpp \ lua/lua_Game.cpp \ - lua/lua_GameClearFlags.cpp \ lua/lua_Gamepad.cpp \ - lua/lua_GamepadButtonMapping.cpp \ - lua/lua_GamepadGamepadEvent.cpp \ - lua/lua_GameState.cpp \ lua/lua_Gesture.cpp \ - lua/lua_GestureGestureEvent.cpp \ lua/lua_Global.cpp \ lua/lua_HeightField.cpp \ lua/lua_Image.cpp \ lua/lua_ImageControl.cpp \ - lua/lua_ImageFormat.cpp \ lua/lua_Joint.cpp \ lua/lua_JoystickControl.cpp \ lua/lua_Keyboard.cpp \ - lua/lua_KeyboardKey.cpp \ - lua/lua_KeyboardKeyEvent.cpp \ lua/lua_Label.cpp \ lua/lua_Layout.cpp \ - lua/lua_LayoutType.cpp \ lua/lua_Light.cpp \ - lua/lua_LightType.cpp \ lua/lua_Logger.cpp \ - lua/lua_LoggerLevel.cpp \ lua/lua_Material.cpp \ lua/lua_MaterialParameter.cpp \ lua/lua_MathUtil.cpp \ lua/lua_Matrix.cpp \ lua/lua_Mesh.cpp \ lua/lua_MeshBatch.cpp \ - lua/lua_MeshIndexFormat.cpp \ lua/lua_MeshPart.cpp \ - lua/lua_MeshPrimitiveType.cpp \ lua/lua_MeshSkin.cpp \ lua/lua_Model.cpp \ lua/lua_Mouse.cpp \ - lua/lua_MouseMouseEvent.cpp \ lua/lua_Node.cpp \ lua/lua_NodeCloneContext.cpp \ - lua/lua_NodeType.cpp \ lua/lua_ParticleEmitter.cpp \ - lua/lua_ParticleEmitterTextureBlending.cpp \ lua/lua_Pass.cpp \ lua/lua_PhysicsCharacter.cpp \ lua/lua_PhysicsCollisionObject.cpp \ lua/lua_PhysicsCollisionObjectCollisionListener.cpp \ - lua/lua_PhysicsCollisionObjectCollisionListenerEventType.cpp \ lua/lua_PhysicsCollisionObjectCollisionPair.cpp \ - lua/lua_PhysicsCollisionObjectType.cpp \ lua/lua_PhysicsCollisionShape.cpp \ lua/lua_PhysicsCollisionShapeDefinition.cpp \ - lua/lua_PhysicsCollisionShapeType.cpp \ lua/lua_PhysicsConstraint.cpp \ lua/lua_PhysicsController.cpp \ lua/lua_PhysicsControllerHitFilter.cpp \ lua/lua_PhysicsControllerHitResult.cpp \ lua/lua_PhysicsControllerListener.cpp \ - lua/lua_PhysicsControllerListenerEventType.cpp \ lua/lua_PhysicsFixedConstraint.cpp \ lua/lua_PhysicsGenericConstraint.cpp \ lua/lua_PhysicsGhostObject.cpp \ @@ -232,46 +214,39 @@ LOCAL_SRC_FILES := \ lua/lua_Plane.cpp \ lua/lua_Platform.cpp \ lua/lua_Properties.cpp \ - lua/lua_PropertiesType.cpp \ lua/lua_Quaternion.cpp \ lua/lua_RadioButton.cpp \ lua/lua_Ray.cpp \ lua/lua_Rectangle.cpp \ lua/lua_Ref.cpp \ lua/lua_RenderState.cpp \ - lua/lua_RenderStateAutoBinding.cpp \ - lua/lua_RenderStateBlend.cpp \ - lua/lua_RenderStateCullFaceSide.cpp \ - lua/lua_RenderStateDepthFunction.cpp \ - lua/lua_RenderStateFrontFace.cpp \ lua/lua_RenderStateStateBlock.cpp \ - lua/lua_RenderStateStencilFunction.cpp \ - lua/lua_RenderStateStencilOperation.cpp \ lua/lua_RenderTarget.cpp \ lua/lua_Scene.cpp \ lua/lua_ScreenDisplayer.cpp \ + lua/lua_Script.cpp \ lua/lua_ScriptController.cpp \ lua/lua_ScriptTarget.cpp \ + lua/lua_ScriptTargetEvent.cpp \ + lua/lua_ScriptTargetEventRegistry.cpp \ lua/lua_Slider.cpp \ + lua/lua_Sprite.cpp \ lua/lua_SpriteBatch.cpp \ + lua/lua_SpriteBatchSpriteVertex.cpp \ lua/lua_Technique.cpp \ lua/lua_Terrain.cpp \ - lua/lua_TerrainFlags.cpp \ lua/lua_TerrainPatch.cpp \ + lua/lua_Text.cpp \ lua/lua_TextBox.cpp \ - lua/lua_TextBoxInputMode.cpp \ lua/lua_Texture.cpp \ - lua/lua_TextureFilter.cpp \ - lua/lua_TextureFormat.cpp \ lua/lua_TextureSampler.cpp \ - lua/lua_TextureWrap.cpp \ lua/lua_Theme.cpp \ lua/lua_ThemeSideRegions.cpp \ lua/lua_ThemeStyle.cpp \ lua/lua_ThemeThemeImage.cpp \ lua/lua_ThemeUVs.cpp \ + lua/lua_TileSet.cpp \ lua/lua_Touch.cpp \ - lua/lua_TouchTouchEvent.cpp \ lua/lua_Transform.cpp \ lua/lua_TransformListener.cpp \ lua/lua_Uniform.cpp \ @@ -281,13 +256,15 @@ LOCAL_SRC_FILES := \ lua/lua_VertexAttributeBinding.cpp \ lua/lua_VertexFormat.cpp \ lua/lua_VertexFormatElement.cpp \ - lua/lua_VertexFormatUsage.cpp \ lua/lua_VerticalLayout.cpp - -LOCAL_CFLAGS := -D__ANDROID__ -DGP_USE_SOCIAL -I"../../external-deps/lua/include" -I"../../external-deps/bullet/include" -I"../../external-deps/png/include" -I"../../external-deps/oggvorbis/include" -I"../../external-deps/openal/include" -LOCAL_STATIC_LIBRARIES := android_native_app_glue - -include $(BUILD_STATIC_LIBRARY) +LOCAL_CPPFLAGS += -std=c++11 -frtti -Wno-switch-enum -Wno-switch +LOCAL_ARM_MODE := arm +LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES +LOCAL_CFLAGS := -D__ANDROID__ -I"../../external-deps/include" +LOCAL_ADDITIONAL_DEPENDENCIES := gameplay +LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay-deps +include $(BUILD_SHARED_LIBRARY) $(call import-module,android/native_app_glue) + diff --git a/gameplay/android/jni/Application.mk b/gameplay/android/jni/Application.mk index 592f1d242b..da60c33851 100644 --- a/gameplay/android/jni/Application.mk +++ b/gameplay/android/jni/Application.mk @@ -1,3 +1,7 @@ -APP_STL := stlport_static -APP_MODULES := libgameplay -APP_ABI := armeabi-v7a +NDK_TOOLCHAIN_VERSION := 4.8 +APP_CPPFLAGS += -std=c++11 +APP_STL := gnustl_static +APP_MODULES := libgameplay +APP_ABI := armeabi-v7a x86 +APP_PLATFORM := android-16 + diff --git a/gameplay/android/project.properties b/gameplay/android/project.properties new file mode 100644 index 0000000000..128dd4893f --- /dev/null +++ b/gameplay/android/project.properties @@ -0,0 +1,3 @@ +target=android-16 +android.library=true +source.dir=../src diff --git a/gameplay/android/res/drawable/icon.png b/gameplay/android/res/drawable/icon.png new file mode 100644 index 0000000000..38fd463992 Binary files /dev/null and b/gameplay/android/res/drawable/icon.png differ diff --git a/gameplay/gameplay.pro b/gameplay/gameplay.pro new file mode 100644 index 0000000000..1bb2550bdd --- /dev/null +++ b/gameplay/gameplay.pro @@ -0,0 +1,562 @@ +#------------------------------------------------- +# +# Project created by QtCreator +# +#------------------------------------------------- + +QT -= core gui + +TARGET = gameplay +TEMPLATE = lib +CONFIG += staticlib + +SOURCES += src/AbsoluteLayout.cpp \ + src/AIAgent.cpp \ + src/AIController.cpp \ + src/AIMessage.cpp \ + src/AIState.cpp \ + src/AIStateMachine.cpp \ + src/Animation.cpp \ + src/AnimationClip.cpp \ + src/AnimationController.cpp \ + src/AnimationTarget.cpp \ + src/AnimationValue.cpp \ + src/AudioBuffer.cpp \ + src/AudioController.cpp \ + src/AudioListener.cpp \ + src/AudioSource.cpp \ + src/BoundingBox.cpp \ + src/BoundingBox.inl \ + src/BoundingSphere.cpp \ + src/BoundingSphere.inl \ + src/Bundle.cpp \ + src/Button.cpp \ + src/Camera.cpp \ + src/CheckBox.cpp \ + src/Container.cpp \ + src/Control.cpp \ + src/ControlFactory.cpp \ + src/Curve.cpp \ + src/DepthStencilTarget.cpp \ + src/Drawable.cpp \ + src/Effect.cpp \ + src/FileSystem.cpp \ + src/FlowLayout.cpp \ + src/Font.cpp \ + src/Form.cpp \ + src/FrameBuffer.cpp \ + src/Frustum.cpp \ + src/Game.cpp \ + src/Game.inl \ + src/Gamepad.cpp \ + src/HeightField.cpp \ + src/Image.cpp \ + src/Image.inl \ + src/ImageControl.cpp \ + src/Joint.cpp \ + src/JoystickControl.cpp \ + src/Label.cpp \ + src/Layout.cpp \ + src/Light.cpp \ + src/Logger.cpp \ + src/Material.cpp \ + src/MaterialParameter.cpp \ + src/MathUtil.cpp \ + src/MathUtil.inl \ + src/MathUtilNeon.inl \ + src/Matrix.cpp \ + src/Matrix.inl \ + src/Mesh.cpp \ + src/MeshBatch.cpp \ + src/MeshBatch.inl \ + src/MeshPart.cpp \ + src/MeshSkin.cpp \ + src/Model.cpp \ + src/Node.cpp \ + src/ParticleEmitter.cpp \ + src/Pass.cpp \ + src/PhysicsCharacter.cpp \ + src/PhysicsCollisionObject.cpp \ + src/PhysicsCollisionShape.cpp \ + src/PhysicsConstraint.cpp \ + src/PhysicsConstraint.inl \ + src/PhysicsController.cpp \ + src/PhysicsFixedConstraint.cpp \ + src/PhysicsFixedConstraint.inl \ + src/PhysicsGenericConstraint.cpp \ + src/PhysicsGenericConstraint.inl \ + src/PhysicsGhostObject.cpp \ + src/PhysicsHingeConstraint.cpp \ + src/PhysicsRigidBody.cpp \ + src/PhysicsRigidBody.inl \ + src/PhysicsSocketConstraint.cpp \ + src/PhysicsSpringConstraint.cpp \ + src/PhysicsSpringConstraint.inl \ + src/PhysicsVehicle.cpp \ + src/PhysicsVehicleWheel.cpp \ + src/Plane.cpp \ + src/Plane.inl \ + src/Platform.cpp \ + src/Properties.cpp \ + src/Quaternion.cpp \ + src/Quaternion.inl \ + src/RadioButton.cpp \ + src/Ray.cpp \ + src/Ray.inl \ + src/Rectangle.cpp \ + src/Ref.cpp \ + src/RenderState.cpp \ + src/RenderTarget.cpp \ + src/Scene.cpp \ + src/SceneLoader.cpp \ + src/ScreenDisplayer.cpp \ + src/Script.cpp \ + src/ScriptController.cpp \ + src/ScriptController.inl \ + src/ScriptTarget.cpp \ + src/Slider.cpp \ + src/Sprite.cpp \ + src/SpriteBatch.cpp \ + src/Technique.cpp \ + src/Terrain.cpp \ + src/TerrainPatch.cpp \ + src/Text.cpp \ + src/TextBox.cpp \ + src/Texture.cpp \ + src/Theme.cpp \ + src/ThemeStyle.cpp \ + src/TileSet.cpp \ + src/Transform.cpp \ + src/Vector2.cpp \ + src/Vector2.inl \ + src/Vector3.cpp \ + src/Vector3.inl \ + src/Vector4.cpp \ + src/Vector4.inl \ + src/VertexAttributeBinding.cpp \ + src/VertexFormat.cpp \ + src/VerticalLayout.cpp \ + src/lua/lua_all_bindings.cpp \ + src/lua/lua_AbsoluteLayout.cpp \ + src/lua/lua_AIAgent.cpp \ + src/lua/lua_AIAgentListener.cpp \ + src/lua/lua_AIController.cpp \ + src/lua/lua_AIMessage.cpp \ + src/lua/lua_AIState.cpp \ + src/lua/lua_AIStateListener.cpp \ + src/lua/lua_AIStateMachine.cpp \ + src/lua/lua_Animation.cpp \ + src/lua/lua_AnimationClip.cpp \ + src/lua/lua_AnimationClipListener.cpp \ + src/lua/lua_AnimationController.cpp \ + src/lua/lua_AnimationTarget.cpp \ + src/lua/lua_AnimationValue.cpp \ + src/lua/lua_AudioBuffer.cpp \ + src/lua/lua_AudioController.cpp \ + src/lua/lua_AudioListener.cpp \ + src/lua/lua_AudioSource.cpp \ + src/lua/lua_BoundingBox.cpp \ + src/lua/lua_BoundingSphere.cpp \ + src/lua/lua_Bundle.cpp \ + src/lua/lua_Button.cpp \ + src/lua/lua_Camera.cpp \ + src/lua/lua_CameraListener.cpp \ + src/lua/lua_CheckBox.cpp \ + src/lua/lua_Container.cpp \ + src/lua/lua_Control.cpp \ + src/lua/lua_ControlListener.cpp \ + src/lua/lua_Curve.cpp \ + src/lua/lua_DepthStencilTarget.cpp \ + src/lua/lua_Drawable.cpp \ + src/lua/lua_Effect.cpp \ + src/lua/lua_FileSystem.cpp \ + src/lua/lua_FlowLayout.cpp \ + src/lua/lua_Font.cpp \ + src/lua/lua_Form.cpp \ + src/lua/lua_FrameBuffer.cpp \ + src/lua/lua_Frustum.cpp \ + src/lua/lua_Game.cpp \ + src/lua/lua_Gamepad.cpp \ + src/lua/lua_Gesture.cpp \ + src/lua/lua_Global.cpp \ + src/lua/lua_HeightField.cpp \ + src/lua/lua_Image.cpp \ + src/lua/lua_ImageControl.cpp \ + src/lua/lua_Joint.cpp \ + src/lua/lua_JoystickControl.cpp \ + src/lua/lua_Keyboard.cpp \ + src/lua/lua_Label.cpp \ + src/lua/lua_Layout.cpp \ + src/lua/lua_Light.cpp \ + src/lua/lua_Logger.cpp \ + src/lua/lua_Material.cpp \ + src/lua/lua_MaterialParameter.cpp \ + src/lua/lua_MathUtil.cpp \ + src/lua/lua_Matrix.cpp \ + src/lua/lua_Mesh.cpp \ + src/lua/lua_MeshBatch.cpp \ + src/lua/lua_MeshPart.cpp \ + src/lua/lua_MeshSkin.cpp \ + src/lua/lua_Model.cpp \ + src/lua/lua_Mouse.cpp \ + src/lua/lua_Node.cpp \ + src/lua/lua_NodeCloneContext.cpp \ + src/lua/lua_ParticleEmitter.cpp \ + src/lua/lua_Pass.cpp \ + src/lua/lua_PhysicsCharacter.cpp \ + src/lua/lua_PhysicsCollisionObject.cpp \ + src/lua/lua_PhysicsCollisionObjectCollisionListener.cpp \ + src/lua/lua_PhysicsCollisionObjectCollisionPair.cpp \ + src/lua/lua_PhysicsCollisionShape.cpp \ + src/lua/lua_PhysicsCollisionShapeDefinition.cpp \ + src/lua/lua_PhysicsConstraint.cpp \ + src/lua/lua_PhysicsController.cpp \ + src/lua/lua_PhysicsControllerHitFilter.cpp \ + src/lua/lua_PhysicsControllerHitResult.cpp \ + src/lua/lua_PhysicsControllerListener.cpp \ + src/lua/lua_PhysicsFixedConstraint.cpp \ + src/lua/lua_PhysicsGenericConstraint.cpp \ + src/lua/lua_PhysicsGhostObject.cpp \ + src/lua/lua_PhysicsHingeConstraint.cpp \ + src/lua/lua_PhysicsRigidBody.cpp \ + src/lua/lua_PhysicsRigidBodyParameters.cpp \ + src/lua/lua_PhysicsSocketConstraint.cpp \ + src/lua/lua_PhysicsSpringConstraint.cpp \ + src/lua/lua_PhysicsVehicle.cpp \ + src/lua/lua_PhysicsVehicleWheel.cpp \ + src/lua/lua_Plane.cpp \ + src/lua/lua_Platform.cpp \ + src/lua/lua_Properties.cpp \ + src/lua/lua_Quaternion.cpp \ + src/lua/lua_RadioButton.cpp \ + src/lua/lua_Ray.cpp \ + src/lua/lua_Rectangle.cpp \ + src/lua/lua_Ref.cpp \ + src/lua/lua_RenderState.cpp \ + src/lua/lua_RenderStateStateBlock.cpp \ + src/lua/lua_RenderTarget.cpp \ + src/lua/lua_Scene.cpp \ + src/lua/lua_ScreenDisplayer.cpp \ + src/lua/lua_Script.cpp \ + src/lua/lua_ScriptController.cpp \ + src/lua/lua_ScriptTarget.cpp \ + src/lua/lua_ScriptTargetEvent.cpp \ + src/lua/lua_ScriptTargetEventRegistry.cpp \ + src/lua/lua_Slider.cpp \ + src/lua/lua_Sprite.cpp \ + src/lua/lua_SpriteBatch.cpp \ + src/lua/lua_SpriteBatchSpriteVertex.cpp \ + src/lua/lua_Technique.cpp \ + src/lua/lua_Terrain.cpp \ + src/lua/lua_TerrainPatch.cpp \ + src/lua/lua_Text.cpp \ + src/lua/lua_TextBox.cpp \ + src/lua/lua_Texture.cpp \ + src/lua/lua_TextureSampler.cpp \ + src/lua/lua_Theme.cpp \ + src/lua/lua_ThemeSideRegions.cpp \ + src/lua/lua_ThemeStyle.cpp \ + src/lua/lua_ThemeThemeImage.cpp \ + src/lua/lua_ThemeUVs.cpp \ + src/lua/lua_TileSet.cpp \ + src/lua/lua_Touch.cpp \ + src/lua/lua_Transform.cpp \ + src/lua/lua_TransformListener.cpp \ + src/lua/lua_Uniform.cpp \ + src/lua/lua_Vector2.cpp \ + src/lua/lua_Vector3.cpp \ + src/lua/lua_Vector4.cpp \ + src/lua/lua_VertexAttributeBinding.cpp \ + src/lua/lua_VertexFormat.cpp \ + src/lua/lua_VertexFormatElement.cpp \ + src/lua/lua_VerticalLayout.cpp + +HEADERS += src/AbsoluteLayout.h \ + src/AIAgent.h \ + src/AIController.h \ + src/AIMessage.h \ + src/AIState.h \ + src/AIStateMachine.h \ + src/Animation.h \ + src/AnimationClip.h \ + src/AnimationController.h \ + src/AnimationTarget.h \ + src/AnimationValue.h \ + src/AudioBuffer.h \ + src/AudioController.h \ + src/AudioListener.h \ + src/AudioSource.h \ + src/Base.h \ + src/BoundingBox.h \ + src/BoundingSphere.h \ + src/Bundle.h \ + src/Button.h \ + src/Camera.h \ + src/CheckBox.h \ + src/Container.h \ + src/Control.h \ + src/ControlFactory.h \ + src/Curve.h \ + src/DepthStencilTarget.h \ + src/Drawable.h \ + src/Effect.h \ + src/FileSystem.h \ + src/FlowLayout.h \ + src/Font.h \ + src/Form.h \ + src/FrameBuffer.h \ + src/Frustum.h \ + src/Game.h \ + src/Gamepad.h \ + src/gameplay.h \ + src/Gesture.h \ + src/HeightField.h \ + src/Image.h \ + src/ImageControl.h \ + src/Joint.h \ + src/JoystickControl.h \ + src/Keyboard.h \ + src/Label.h \ + src/Layout.h \ + src/Light.h \ + src/Logger.h \ + src/Material.h \ + src/MaterialParameter.h \ + src/MathUtil.h \ + src/Matrix.h \ + src/Mesh.h \ + src/MeshBatch.h \ + src/MeshPart.h \ + src/MeshSkin.h \ + src/Model.h \ + src/Mouse.h \ + src/Node.h \ + src/ParticleEmitter.h \ + src/Pass.h \ + src/PhysicsCharacter.h \ + src/PhysicsCollisionObject.h \ + src/PhysicsCollisionShape.h \ + src/PhysicsConstraint.h \ + src/PhysicsController.h \ + src/PhysicsFixedConstraint.h \ + src/PhysicsGenericConstraint.h \ + src/PhysicsGhostObject.h \ + src/PhysicsHingeConstraint.h \ + src/PhysicsRigidBody.h \ + src/PhysicsSocketConstraint.h \ + src/PhysicsSpringConstraint.h \ + src/PhysicsVehicle.h \ + src/PhysicsVehicleWheel.h \ + src/Plane.h \ + src/Platform.h \ + src/Properties.h \ + src/Quaternion.h \ + src/RadioButton.h \ + src/Ray.h \ + src/Rectangle.h \ + src/Ref.h \ + src/RenderState.h \ + src/RenderTarget.h \ + src/Scene.h \ + src/SceneLoader.h \ + src/ScreenDisplayer.h \ + src/Script.h \ + src/ScriptController.h \ + src/ScriptTarget.h \ + src/Slider.h \ + src/Sprite.h \ + src/SpriteBatch.h \ + src/Stream.h \ + src/Technique.h \ + src/Terrain.h \ + src/TerrainPatch.h \ + src/Text.h \ + src/TextBox.h \ + src/Texture.h \ + src/Theme.h \ + src/ThemeStyle.h \ + src/TileSet.h \ + src/TimeListener.h \ + src/Touch.h \ + src/Transform.h \ + src/Vector2.h \ + src/Vector3.h \ + src/Vector4.h \ + src/VertexAttributeBinding.h \ + src/VertexFormat.h \ + src/VerticalLayout.h \ + src/lua/lua_AbsoluteLayout.h \ + src/lua/lua_AIAgent.h \ + src/lua/lua_AIAgentListener.h \ + src/lua/lua_AIController.h \ + src/lua/lua_AIMessage.h \ + src/lua/lua_AIState.h \ + src/lua/lua_AIStateListener.h \ + src/lua/lua_AIStateMachine.h \ + src/lua/lua_all_bindings.h \ + src/lua/lua_Animation.h \ + src/lua/lua_AnimationClip.h \ + src/lua/lua_AnimationClipListener.h \ + src/lua/lua_AnimationController.h \ + src/lua/lua_AnimationTarget.h \ + src/lua/lua_AnimationValue.h \ + src/lua/lua_AudioBuffer.h \ + src/lua/lua_AudioController.h \ + src/lua/lua_AudioListener.h \ + src/lua/lua_AudioSource.h \ + src/lua/lua_BoundingBox.h \ + src/lua/lua_BoundingSphere.h \ + src/lua/lua_Bundle.h \ + src/lua/lua_Button.h \ + src/lua/lua_Camera.h \ + src/lua/lua_CameraListener.h \ + src/lua/lua_CheckBox.h \ + src/lua/lua_Container.h \ + src/lua/lua_Control.h \ + src/lua/lua_ControlListener.h \ + src/lua/lua_Curve.h \ + src/lua/lua_DepthStencilTarget.h \ + src/lua/lua_Drawable.h \ + src/lua/lua_Effect.h \ + src/lua/lua_FileSystem.h \ + src/lua/lua_FlowLayout.h \ + src/lua/lua_Font.h \ + src/lua/lua_Form.h \ + src/lua/lua_FrameBuffer.h \ + src/lua/lua_Frustum.h \ + src/lua/lua_Game.h \ + src/lua/lua_Gamepad.h \ + src/lua/lua_Gesture.h \ + src/lua/lua_Global.h \ + src/lua/lua_HeightField.h \ + src/lua/lua_Image.h \ + src/lua/lua_ImageControl.h \ + src/lua/lua_ImageFormat.h \ + src/lua/lua_Joint.h \ + src/lua/lua_JoystickControl.h \ + src/lua/lua_Keyboard.h \ + src/lua/lua_Label.h \ + src/lua/lua_Layout.h \ + src/lua/lua_Light.h \ + src/lua/lua_Logger.h \ + src/lua/lua_Material.h \ + src/lua/lua_MaterialParameter.h \ + src/lua/lua_MathUtil.h \ + src/lua/lua_Matrix.h \ + src/lua/lua_Mesh.h \ + src/lua/lua_MeshBatch.h \ + src/lua/lua_MeshPart.h \ + src/lua/lua_MeshSkin.h \ + src/lua/lua_Model.h \ + src/lua/lua_Mouse.h \ + src/lua/lua_Node.h \ + src/lua/lua_NodeCloneContext.h \ + src/lua/lua_ParticleEmitter.h \ + src/lua/lua_Pass.h \ + src/lua/lua_PhysicsCharacter.h \ + src/lua/lua_PhysicsCollisionObject.h \ + src/lua/lua_PhysicsCollisionObjectCollisionListener.h \ + src/lua/lua_PhysicsCollisionObjectCollisionPair.h \ + src/lua/lua_PhysicsCollisionObjectType.h \ + src/lua/lua_PhysicsCollisionShape.h \ + src/lua/lua_PhysicsCollisionShapeDefinition.h \ + src/lua/lua_PhysicsConstraint.h \ + src/lua/lua_PhysicsController.h \ + src/lua/lua_PhysicsControllerHitFilter.h \ + src/lua/lua_PhysicsControllerHitResult.h \ + src/lua/lua_PhysicsControllerListener.h \ + src/lua/lua_PhysicsFixedConstraint.h \ + src/lua/lua_PhysicsGenericConstraint.h \ + src/lua/lua_PhysicsGhostObject.h \ + src/lua/lua_PhysicsHingeConstraint.h \ + src/lua/lua_PhysicsRigidBody.h \ + src/lua/lua_PhysicsRigidBodyParameters.h \ + src/lua/lua_PhysicsSocketConstraint.h \ + src/lua/lua_PhysicsSpringConstraint.h \ + src/lua/lua_PhysicsVehicle.h \ + src/lua/lua_PhysicsVehicleWheel.h \ + src/lua/lua_Plane.h \ + src/lua/lua_Platform.h \ + src/lua/lua_Properties.h \ + src/lua/lua_Quaternion.h \ + src/lua/lua_RadioButton.h \ + src/lua/lua_Ray.h \ + src/lua/lua_Rectangle.h \ + src/lua/lua_Ref.h \ + src/lua/lua_RenderState.h \ + src/lua/lua_RenderTarget.h \ + src/lua/lua_Scene.h \ + src/lua/lua_ScreenDisplayer.h \ + src/lua/lua_Script.h \ + src/lua/lua_ScriptController.h \ + src/lua/lua_ScriptTarget.h \ + src/lua/lua_ScriptTargetEvent.h \ + src/lua/lua_ScriptTargetEventRegistry.h \ + src/lua/lua_Slider.h \ + src/lua/lua_Sprite.h \ + src/lua/lua_SpriteBatch.h \ + src/lua/lua_SpriteBatchSpriteVertex.h \ + src/lua/lua_Technique.h \ + src/lua/lua_Terrain.h \ + src/lua/lua_TerrainPatch.h \ + src/lua/lua_Text.h \ + src/lua/lua_TextBox.h \ + src/lua/lua_Texture.h \ + src/lua/lua_TextureSampler.h \ + src/lua/lua_Theme.h \ + src/lua/lua_ThemeSideRegions.h \ + src/lua/lua_ThemeStyle.h \ + src/lua/lua_ThemeThemeImage.h \ + src/lua/lua_ThemeUVs.h \ + src/lua/lua_TileSet.h \ + src/lua/lua_Touch.h \ + src/lua/lua_TouchTouchEvent.h \ + src/lua/lua_Transform.h \ + src/lua/lua_TransformListener.h \ + src/lua/lua_Uniform.h \ + src/lua/lua_Vector2.h \ + src/lua/lua_Vector3.h \ + src/lua/lua_Vector4.h \ + src/lua/lua_VertexAttributeBinding.h \ + src/lua/lua_VertexFormat.h \ + src/lua/lua_VertexFormatElement.h \ + src/lua/lua_VerticalLayout.h + +CONFIG += c++11 + +INCLUDEPATH += $$PWD/../gameplay/src +INCLUDEPATH += $$PWD/../external-deps/include + +# linux +linux: SOURCES += src/PlatformLinux.cpp +linux: SOURCES += src/gameplay-main-linux.cpp +linux: QMAKE_CXXFLAGS += -lstdc++ -pthread -w +linux: DEFINES += GP_USE_GAMEPAD +linux: DEFINES += __linux__ +linux: INCLUDEPATH += /usr/include/gtk-2.0 +linux: INCLUDEPATH += /usr/lib/x86_64-linux-gnu/gtk-2.0/include +linux: INCLUDEPATH += /usr/include/atk-1.0 +linux: INCLUDEPATH += /usr/include/cairo +linux: INCLUDEPATH += /usr/include/gdk-pixbuf-2.0 +linux: INCLUDEPATH += /usr/include/pango-1.0 +linux: INCLUDEPATH += /usr/include/gio-unix-2.0 +linux: INCLUDEPATH += /usr/include/freetype2 +linux: INCLUDEPATH += /usr/include/glib-2.0 +linux: INCLUDEPATH += /usr/lib/x86_64-linux-gnu/glib-2.0/include +linux: INCLUDEPATH += /usr/include/pixman-1 +linux: INCLUDEPATH += /usr/include/libpng12 +linux: INCLUDEPATH += /usr/include/harfbuzz + +# macosx +macx: OBJECTIVE_SOURCES += src/PlatformMacOSX.mm +macx: OBJECTIVE_SOURCES += src/gameplay-main-macosx.mm +macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64 +macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64 +macx: DEFINES += GP_USE_GAMEPAD +macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps +macx: LIBS += -F/System/Library/Frameworks -framework GameKit +macx: LIBS += -F/System/Library/Frameworks -framework IOKit +macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore +macx: LIBS += -F/System/Library/Frameworks -framework OpenAL +macx: LIBS += -F/System/Library/Frameworks -framework OpenGL +macx: LIBS += -F/System/Library/Frameworks -framework Cocoa diff --git a/gameplay/gameplay.vcxproj b/gameplay/gameplay.vcxproj index e1b41e88ee..98449cabb8 100644 --- a/gameplay/gameplay.vcxproj +++ b/gameplay/gameplay.vcxproj @@ -1,26 +1,14 @@  - - DebugMem - Win32 - DebugMem x64 - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -53,6 +41,7 @@ + @@ -63,7 +52,6 @@ - @@ -80,7 +68,6 @@ - @@ -88,7 +75,6 @@ - @@ -96,97 +82,65 @@ - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - @@ -200,46 +154,39 @@ - - - - - - - - + + + + + - + - - - - + - @@ -249,7 +196,6 @@ - @@ -281,7 +227,6 @@ - @@ -295,17 +240,21 @@ + + + + @@ -342,6 +291,7 @@ + @@ -368,7 +318,6 @@ - @@ -376,7 +325,6 @@ - @@ -384,97 +332,65 @@ - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - @@ -488,46 +404,39 @@ - - - - - - - - + + + + + - + - - - - + - @@ -537,7 +446,6 @@ - @@ -580,18 +488,22 @@ + + + + @@ -653,168 +565,70 @@ gameplay - - StaticLibrary - true - Unicode - v120 - StaticLibrary true Unicode v120 - - StaticLibrary - true - Unicode - v120 - StaticLibrary true Unicode v120 - - StaticLibrary - false - true - Unicode - v120 - StaticLibrary false - true + false Unicode v120 - - - - - - - - - - - windows\x86\$(Configuration)\ - - - windows\x64\$(Configuration)\ - - - windows\x86\$(Configuration)\ - - - windows\x64\$(Configuration)\ - - - windows\x86\$(Configuration)\ - - windows\x64\$(Configuration)\ - - - windows\x86\$(Configuration)\ + Debug + $(Configuration)\ - windows\x64\$(Configuration)\ - - - windows\x86\$(Configuration)\ - - - windows\x64\$(Configuration)\ - - - windows\x86\$(Configuration)\ + $(Configuration)\ + $(Configuration)\ - windows\x64\$(Configuration)\ + $(Configuration)\ + $(Configuration)\ - - - - - Level3 - Disabled - _ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)src;..\external-deps\lua\include;..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\png\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories) - - - MultiThreadedDebugDLL - - - - - Windows - true - - - MachineX86 - - Level3 Disabled - _ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)src;..\external-deps\lua\include;..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\png\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;GP_USE_GAMEPAD;%(PreprocessorDefinitions) + $(ProjectDir)src;..\external-deps\include;$(MSBuildProgramFiles32)\Microsoft DirectX SDK (June 2010)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - - - Windows - true - - - MachineX64 - - - - - - - Level3 - Disabled - _ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;GP_USE_MEM_LEAK_DETECTION;%(PreprocessorDefinitions) - $(ProjectDir)src;..\external-deps\lua\include;..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\png\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories) - true MultiThreadedDebugDLL - - + true + false Windows true - - - - - - + MachineX64 @@ -823,10 +637,12 @@ Level3 Disabled - _ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;GP_USE_MEM_LEAK_DETECTION;%(PreprocessorDefinitions) - $(ProjectDir)src;..\external-deps\lua\include;..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\png\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;GP_USE_GAMEPAD;GP_USE_MEM_LEAK_DETECTION;%(PreprocessorDefinitions) + $(ProjectDir)src;..\external-deps\include;$(MSBuildProgramFiles32)\Microsoft DirectX SDK (June 2010)\include;%(AdditionalIncludeDirectories) true - MultiThreadedDLL + MultiThreadedDebugDLL + true + false Windows @@ -837,40 +653,19 @@ - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)src;..\external-deps\lua\include;..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\png\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories) - - - - - - - Windows - true - true - true - - Level3 - MaxSpeed + Full true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)src;..\external-deps\lua\include;..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\png\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories) + false + WIN32;NDEBUG;_LIB;GP_USE_GAMEPAD;%(PreprocessorDefinitions) + $(ProjectDir)src;..\external-deps\include;$(MSBuildProgramFiles32)\Microsoft DirectX SDK (June 2010)\include;%(AdditionalIncludeDirectories) + true Windows diff --git a/gameplay/gameplay.vcxproj.filters b/gameplay/gameplay.vcxproj.filters index fd97daaca2..2ef791822e 100644 --- a/gameplay/gameplay.vcxproj.filters +++ b/gameplay/gameplay.vcxproj.filters @@ -24,9 +24,6 @@ src - - src - src @@ -279,9 +276,6 @@ src - - src - src @@ -348,6 +342,24 @@ src + + src + + + src + + + src + + + src + + + src + + + src + src\lua @@ -363,9 +375,6 @@ src\lua - - src\lua - src\lua @@ -387,9 +396,6 @@ src\lua - - src\lua - src\lua @@ -411,9 +417,6 @@ src\lua - - src\lua - src\lua @@ -429,7 +432,7 @@ src\lua - + src\lua @@ -438,37 +441,19 @@ src\lua - - src\lua - src\lua - - src\lua - - - src\lua - src\lua - - src\lua - - - src\lua - src\lua - - src\lua - src\lua - + src\lua @@ -483,18 +468,6 @@ src\lua - - src\lua - - - src\lua - - - src\lua - - - src\lua - src\lua @@ -507,27 +480,12 @@ src\lua - - src\lua - src\lua - - src\lua - - - src\lua - - - src\lua - src\lua - - src\lua - src\lua @@ -540,19 +498,13 @@ src\lua - - src\lua - src\lua - - src\lua - - + src\lua - + src\lua @@ -561,21 +513,12 @@ src\lua - - src\lua - src\lua - - src\lua - src\lua - - src\lua - src\lua @@ -594,15 +537,9 @@ src\lua - - src\lua - src\lua - - src\lua - src\lua @@ -612,24 +549,15 @@ src\lua - - src\lua - src\lua src\lua - - src\lua - src\lua - - src\lua - src\lua @@ -642,24 +570,15 @@ src\lua - - src\lua - src\lua - - src\lua - src\lua src\lua - - src\lua - src\lua @@ -675,9 +594,6 @@ src\lua - - src\lua - src\lua @@ -717,9 +633,6 @@ src\lua - - src\lua - src\lua @@ -738,49 +651,43 @@ src\lua - - src\lua - - - src\lua - - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua @@ -789,30 +696,21 @@ src\lua - + src\lua - + src\lua - + src\lua src\lua - - src\lua - - - src\lua - src\lua - - src\lua - src\lua @@ -828,10 +726,10 @@ src\lua - + src\lua - + src\lua @@ -861,24 +759,9 @@ src\lua - - src\lua - src\lua - - src\lua - - - src\lua - - - src - - - src\lua - @@ -1208,6 +1091,24 @@ src + + src + + + src + + + src + + + src + + + src + + + src + src\lua @@ -1223,9 +1124,6 @@ src\lua - - src\lua - src\lua @@ -1247,9 +1145,6 @@ src\lua - - src\lua - src\lua @@ -1271,9 +1166,6 @@ src\lua - - src\lua - src\lua @@ -1289,7 +1181,7 @@ src\lua - + src\lua @@ -1298,37 +1190,19 @@ src\lua - - src\lua - src\lua - - src\lua - - - src\lua - src\lua - - src\lua - - - src\lua - src\lua - - src\lua - src\lua - + src\lua @@ -1343,18 +1217,6 @@ src\lua - - src\lua - - - src\lua - - - src\lua - - - src\lua - src\lua @@ -1367,27 +1229,12 @@ src\lua - - src\lua - src\lua - - src\lua - - - src\lua - - - src\lua - src\lua - - src\lua - src\lua @@ -1400,19 +1247,13 @@ src\lua - - src\lua - src\lua - - src\lua - - + src\lua - + src\lua @@ -1421,21 +1262,12 @@ src\lua - - src\lua - src\lua - - src\lua - src\lua - - src\lua - src\lua @@ -1454,15 +1286,9 @@ src\lua - - src\lua - src\lua - - src\lua - src\lua @@ -1472,24 +1298,15 @@ src\lua - - src\lua - src\lua src\lua - - src\lua - src\lua - - src\lua - src\lua @@ -1502,24 +1319,15 @@ src\lua - - src\lua - src\lua - - src\lua - src\lua src\lua - - src\lua - src\lua @@ -1535,9 +1343,6 @@ src\lua - - src\lua - src\lua @@ -1577,9 +1382,6 @@ src\lua - - src\lua - src\lua @@ -1598,49 +1400,43 @@ src\lua - - src\lua - - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - + src\lua - - src\lua - - + src\lua - + src\lua - + src\lua - + src\lua @@ -1649,30 +1445,21 @@ src\lua - + src\lua - + src\lua - + src\lua src\lua - - src\lua - - - src\lua - src\lua - - src\lua - src\lua @@ -1688,10 +1475,10 @@ src\lua - + src\lua - + src\lua @@ -1721,24 +1508,9 @@ src\lua - - src\lua - src\lua - - src\lua - - - src\lua - - - src - - - src\lua - diff --git a/gameplay/gameplay.vcxproj.user b/gameplay/gameplay.vcxproj.user deleted file mode 100644 index 695b5c78b9..0000000000 --- a/gameplay/gameplay.vcxproj.user +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/gameplay/gameplay.xcodeproj/project.pbxproj b/gameplay/gameplay.xcodeproj/project.pbxproj index dcc3a5b390..d51483aafb 100644 --- a/gameplay/gameplay.xcodeproj/project.pbxproj +++ b/gameplay/gameplay.xcodeproj/project.pbxproj @@ -7,363 +7,283 @@ objects = { /* Begin PBXBuildFile section */ + 4204EC411A2EB8310074FCE9 /* TileSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4204EC3F1A2EB8310074FCE9 /* TileSet.cpp */; }; + 4204EC421A2EB8310074FCE9 /* TileSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4204EC3F1A2EB8310074FCE9 /* TileSet.cpp */; }; + 4204EC451A2F878C0074FCE9 /* Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4204EC441A2F878C0074FCE9 /* Sprite.cpp */; }; + 4204EC461A2F878C0074FCE9 /* Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4204EC441A2F878C0074FCE9 /* Sprite.cpp */; }; 420BBC0E1817416F00C7B720 /* ControlFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAA21817416D00C7B720 /* ControlFactory.cpp */; }; 420BBC0F1817416F00C7B720 /* ControlFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAA21817416D00C7B720 /* ControlFactory.cpp */; }; - 420BBC121817416F00C7B720 /* lua_AbsoluteLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAA61817416D00C7B720 /* lua_AbsoluteLayout.cpp */; }; - 420BBC131817416F00C7B720 /* lua_AbsoluteLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAA61817416D00C7B720 /* lua_AbsoluteLayout.cpp */; }; - 420BBC161817416F00C7B720 /* lua_AIAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAA81817416D00C7B720 /* lua_AIAgent.cpp */; }; - 420BBC171817416F00C7B720 /* lua_AIAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAA81817416D00C7B720 /* lua_AIAgent.cpp */; }; - 420BBC1A1817416F00C7B720 /* lua_AIAgentListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAAA1817416D00C7B720 /* lua_AIAgentListener.cpp */; }; - 420BBC1B1817416F00C7B720 /* lua_AIAgentListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAAA1817416D00C7B720 /* lua_AIAgentListener.cpp */; }; - 420BBC1E1817416F00C7B720 /* lua_AIController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAAC1817416D00C7B720 /* lua_AIController.cpp */; }; - 420BBC1F1817416F00C7B720 /* lua_AIController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAAC1817416D00C7B720 /* lua_AIController.cpp */; }; - 420BBC221817416F00C7B720 /* lua_AIMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAAE1817416D00C7B720 /* lua_AIMessage.cpp */; }; - 420BBC231817416F00C7B720 /* lua_AIMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAAE1817416D00C7B720 /* lua_AIMessage.cpp */; }; - 420BBC261817416F00C7B720 /* lua_AIMessageParameterType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB01817416D00C7B720 /* lua_AIMessageParameterType.cpp */; }; - 420BBC271817416F00C7B720 /* lua_AIMessageParameterType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB01817416D00C7B720 /* lua_AIMessageParameterType.cpp */; }; - 420BBC2A1817416F00C7B720 /* lua_AIState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB21817416D00C7B720 /* lua_AIState.cpp */; }; - 420BBC2B1817416F00C7B720 /* lua_AIState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB21817416D00C7B720 /* lua_AIState.cpp */; }; - 420BBC2E1817416F00C7B720 /* lua_AIStateListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB41817416D00C7B720 /* lua_AIStateListener.cpp */; }; - 420BBC2F1817416F00C7B720 /* lua_AIStateListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB41817416D00C7B720 /* lua_AIStateListener.cpp */; }; - 420BBC321817416F00C7B720 /* lua_AIStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB61817416D00C7B720 /* lua_AIStateMachine.cpp */; }; - 420BBC331817416F00C7B720 /* lua_AIStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB61817416D00C7B720 /* lua_AIStateMachine.cpp */; }; - 420BBC361817416F00C7B720 /* lua_all_bindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB81817416D00C7B720 /* lua_all_bindings.cpp */; }; - 420BBC371817416F00C7B720 /* lua_all_bindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAB81817416D00C7B720 /* lua_all_bindings.cpp */; }; - 420BBC3A1817416F00C7B720 /* lua_Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBABA1817416D00C7B720 /* lua_Animation.cpp */; }; - 420BBC3B1817416F00C7B720 /* lua_Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBABA1817416D00C7B720 /* lua_Animation.cpp */; }; - 420BBC3E1817416F00C7B720 /* lua_AnimationClip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBABC1817416D00C7B720 /* lua_AnimationClip.cpp */; }; - 420BBC3F1817416F00C7B720 /* lua_AnimationClip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBABC1817416D00C7B720 /* lua_AnimationClip.cpp */; }; - 420BBC421817416F00C7B720 /* lua_AnimationClipListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBABE1817416D00C7B720 /* lua_AnimationClipListener.cpp */; }; - 420BBC431817416F00C7B720 /* lua_AnimationClipListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBABE1817416D00C7B720 /* lua_AnimationClipListener.cpp */; }; - 420BBC461817416F00C7B720 /* lua_AnimationClipListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC01817416D00C7B720 /* lua_AnimationClipListenerEventType.cpp */; }; - 420BBC471817416F00C7B720 /* lua_AnimationClipListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC01817416D00C7B720 /* lua_AnimationClipListenerEventType.cpp */; }; - 420BBC4A1817416F00C7B720 /* lua_AnimationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC21817416D00C7B720 /* lua_AnimationController.cpp */; }; - 420BBC4B1817416F00C7B720 /* lua_AnimationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC21817416D00C7B720 /* lua_AnimationController.cpp */; }; - 420BBC4E1817416F00C7B720 /* lua_AnimationTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC41817416D00C7B720 /* lua_AnimationTarget.cpp */; }; - 420BBC4F1817416F00C7B720 /* lua_AnimationTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC41817416D00C7B720 /* lua_AnimationTarget.cpp */; }; - 420BBC521817416F00C7B720 /* lua_AnimationValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC61817416D00C7B720 /* lua_AnimationValue.cpp */; }; - 420BBC531817416F00C7B720 /* lua_AnimationValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC61817416D00C7B720 /* lua_AnimationValue.cpp */; }; - 420BBC561817416F00C7B720 /* lua_AudioBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC81817416D00C7B720 /* lua_AudioBuffer.cpp */; }; - 420BBC571817416F00C7B720 /* lua_AudioBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAC81817416D00C7B720 /* lua_AudioBuffer.cpp */; }; - 420BBC5A1817416F00C7B720 /* lua_AudioController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBACA1817416D00C7B720 /* lua_AudioController.cpp */; }; - 420BBC5B1817416F00C7B720 /* lua_AudioController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBACA1817416D00C7B720 /* lua_AudioController.cpp */; }; - 420BBC5E1817416F00C7B720 /* lua_AudioListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBACC1817416D00C7B720 /* lua_AudioListener.cpp */; }; - 420BBC5F1817416F00C7B720 /* lua_AudioListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBACC1817416D00C7B720 /* lua_AudioListener.cpp */; }; - 420BBC621817416F00C7B720 /* lua_AudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBACE1817416D00C7B720 /* lua_AudioSource.cpp */; }; - 420BBC631817416F00C7B720 /* lua_AudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBACE1817416D00C7B720 /* lua_AudioSource.cpp */; }; - 420BBC661817416F00C7B720 /* lua_AudioSourceState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD01817416D00C7B720 /* lua_AudioSourceState.cpp */; }; - 420BBC671817416F00C7B720 /* lua_AudioSourceState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD01817416D00C7B720 /* lua_AudioSourceState.cpp */; }; - 420BBC6A1817416F00C7B720 /* lua_BoundingBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD21817416D00C7B720 /* lua_BoundingBox.cpp */; }; - 420BBC6B1817416F00C7B720 /* lua_BoundingBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD21817416D00C7B720 /* lua_BoundingBox.cpp */; }; - 420BBC6E1817416F00C7B720 /* lua_BoundingSphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD41817416D00C7B720 /* lua_BoundingSphere.cpp */; }; - 420BBC6F1817416F00C7B720 /* lua_BoundingSphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD41817416D00C7B720 /* lua_BoundingSphere.cpp */; }; - 420BBC721817416F00C7B720 /* lua_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD61817416D00C7B720 /* lua_Bundle.cpp */; }; - 420BBC731817416F00C7B720 /* lua_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD61817416D00C7B720 /* lua_Bundle.cpp */; }; - 420BBC761817416F00C7B720 /* lua_Button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD81817416D00C7B720 /* lua_Button.cpp */; }; - 420BBC771817416F00C7B720 /* lua_Button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAD81817416D00C7B720 /* lua_Button.cpp */; }; - 420BBC7A1817416F00C7B720 /* lua_Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBADA1817416D00C7B720 /* lua_Camera.cpp */; }; - 420BBC7B1817416F00C7B720 /* lua_Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBADA1817416D00C7B720 /* lua_Camera.cpp */; }; - 420BBC7E1817416F00C7B720 /* lua_CameraType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBADC1817416D00C7B720 /* lua_CameraType.cpp */; }; - 420BBC7F1817416F00C7B720 /* lua_CameraType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBADC1817416D00C7B720 /* lua_CameraType.cpp */; }; - 420BBC821817416F00C7B720 /* lua_CheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBADE1817416D00C7B720 /* lua_CheckBox.cpp */; }; - 420BBC831817416F00C7B720 /* lua_CheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBADE1817416D00C7B720 /* lua_CheckBox.cpp */; }; - 420BBC861817416F00C7B720 /* lua_Container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE01817416D00C7B720 /* lua_Container.cpp */; }; - 420BBC871817416F00C7B720 /* lua_Container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE01817416D00C7B720 /* lua_Container.cpp */; }; - 420BBC8A1817416F00C7B720 /* lua_ContainerScroll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE21817416D00C7B720 /* lua_ContainerScroll.cpp */; }; - 420BBC8B1817416F00C7B720 /* lua_ContainerScroll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE21817416D00C7B720 /* lua_ContainerScroll.cpp */; }; - 420BBC8E1817416F00C7B720 /* lua_Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE41817416D00C7B720 /* lua_Control.cpp */; }; - 420BBC8F1817416F00C7B720 /* lua_Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE41817416D00C7B720 /* lua_Control.cpp */; }; - 420BBC921817416F00C7B720 /* lua_ControlAlignment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE61817416D00C7B720 /* lua_ControlAlignment.cpp */; }; - 420BBC931817416F00C7B720 /* lua_ControlAlignment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE61817416D00C7B720 /* lua_ControlAlignment.cpp */; }; - 420BBC961817416F00C7B720 /* lua_ControlAutoSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE81817416D00C7B720 /* lua_ControlAutoSize.cpp */; }; - 420BBC971817416F00C7B720 /* lua_ControlAutoSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAE81817416D00C7B720 /* lua_ControlAutoSize.cpp */; }; - 420BBC9A1817416F00C7B720 /* lua_ControlListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAEA1817416D00C7B720 /* lua_ControlListener.cpp */; }; - 420BBC9B1817416F00C7B720 /* lua_ControlListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAEA1817416D00C7B720 /* lua_ControlListener.cpp */; }; - 420BBC9E1817416F00C7B720 /* lua_ControlListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAEC1817416D00C7B720 /* lua_ControlListenerEventType.cpp */; }; - 420BBC9F1817416F00C7B720 /* lua_ControlListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAEC1817416D00C7B720 /* lua_ControlListenerEventType.cpp */; }; - 420BBCA21817416F00C7B720 /* lua_ControlState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAEE1817416D00C7B720 /* lua_ControlState.cpp */; }; - 420BBCA31817416F00C7B720 /* lua_ControlState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAEE1817416D00C7B720 /* lua_ControlState.cpp */; }; - 420BBCA61817416F00C7B720 /* lua_Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF01817416D00C7B720 /* lua_Curve.cpp */; }; - 420BBCA71817416F00C7B720 /* lua_Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF01817416D00C7B720 /* lua_Curve.cpp */; }; - 420BBCAA1817416F00C7B720 /* lua_CurveInterpolationType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF21817416D00C7B720 /* lua_CurveInterpolationType.cpp */; }; - 420BBCAB1817416F00C7B720 /* lua_CurveInterpolationType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF21817416D00C7B720 /* lua_CurveInterpolationType.cpp */; }; - 420BBCAE1817416F00C7B720 /* lua_DepthStencilTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF41817416E00C7B720 /* lua_DepthStencilTarget.cpp */; }; - 420BBCAF1817416F00C7B720 /* lua_DepthStencilTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF41817416E00C7B720 /* lua_DepthStencilTarget.cpp */; }; - 420BBCB21817416F00C7B720 /* lua_DepthStencilTargetFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF61817416E00C7B720 /* lua_DepthStencilTargetFormat.cpp */; }; - 420BBCB31817416F00C7B720 /* lua_DepthStencilTargetFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF61817416E00C7B720 /* lua_DepthStencilTargetFormat.cpp */; }; - 420BBCB61817416F00C7B720 /* lua_Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF81817416E00C7B720 /* lua_Effect.cpp */; }; - 420BBCB71817416F00C7B720 /* lua_Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAF81817416E00C7B720 /* lua_Effect.cpp */; }; - 420BBCBA1817416F00C7B720 /* lua_FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAFA1817416E00C7B720 /* lua_FileSystem.cpp */; }; - 420BBCBB1817416F00C7B720 /* lua_FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAFA1817416E00C7B720 /* lua_FileSystem.cpp */; }; - 420BBCBE1817416F00C7B720 /* lua_FlowLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAFC1817416E00C7B720 /* lua_FlowLayout.cpp */; }; - 420BBCBF1817416F00C7B720 /* lua_FlowLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAFC1817416E00C7B720 /* lua_FlowLayout.cpp */; }; - 420BBCC21817416F00C7B720 /* lua_Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAFE1817416E00C7B720 /* lua_Font.cpp */; }; - 420BBCC31817416F00C7B720 /* lua_Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBAFE1817416E00C7B720 /* lua_Font.cpp */; }; - 420BBCC61817416F00C7B720 /* lua_FontFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB001817416E00C7B720 /* lua_FontFormat.cpp */; }; - 420BBCC71817416F00C7B720 /* lua_FontFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB001817416E00C7B720 /* lua_FontFormat.cpp */; }; - 420BBCCA1817416F00C7B720 /* lua_FontJustify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB021817416E00C7B720 /* lua_FontJustify.cpp */; }; - 420BBCCB1817416F00C7B720 /* lua_FontJustify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB021817416E00C7B720 /* lua_FontJustify.cpp */; }; - 420BBCCE1817416F00C7B720 /* lua_FontStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB041817416E00C7B720 /* lua_FontStyle.cpp */; }; - 420BBCCF1817416F00C7B720 /* lua_FontStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB041817416E00C7B720 /* lua_FontStyle.cpp */; }; - 420BBCD21817416F00C7B720 /* lua_FontText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB061817416E00C7B720 /* lua_FontText.cpp */; }; - 420BBCD31817416F00C7B720 /* lua_FontText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB061817416E00C7B720 /* lua_FontText.cpp */; }; - 420BBCD61817416F00C7B720 /* lua_Form.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB081817416E00C7B720 /* lua_Form.cpp */; }; - 420BBCD71817416F00C7B720 /* lua_Form.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB081817416E00C7B720 /* lua_Form.cpp */; }; - 420BBCDA1817416F00C7B720 /* lua_FrameBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB0A1817416E00C7B720 /* lua_FrameBuffer.cpp */; }; - 420BBCDB1817416F00C7B720 /* lua_FrameBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB0A1817416E00C7B720 /* lua_FrameBuffer.cpp */; }; - 420BBCDE1817416F00C7B720 /* lua_Frustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB0C1817416E00C7B720 /* lua_Frustum.cpp */; }; - 420BBCDF1817416F00C7B720 /* lua_Frustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB0C1817416E00C7B720 /* lua_Frustum.cpp */; }; - 420BBCE21817416F00C7B720 /* lua_Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB0E1817416E00C7B720 /* lua_Game.cpp */; }; - 420BBCE31817416F00C7B720 /* lua_Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB0E1817416E00C7B720 /* lua_Game.cpp */; }; - 420BBCE61817416F00C7B720 /* lua_GameClearFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB101817416E00C7B720 /* lua_GameClearFlags.cpp */; }; - 420BBCE71817416F00C7B720 /* lua_GameClearFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB101817416E00C7B720 /* lua_GameClearFlags.cpp */; }; - 420BBCEA1817416F00C7B720 /* lua_Gamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB121817416E00C7B720 /* lua_Gamepad.cpp */; }; - 420BBCEB1817416F00C7B720 /* lua_Gamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB121817416E00C7B720 /* lua_Gamepad.cpp */; }; - 420BBCEE1817416F00C7B720 /* lua_GamepadButtonMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB141817416E00C7B720 /* lua_GamepadButtonMapping.cpp */; }; - 420BBCEF1817416F00C7B720 /* lua_GamepadButtonMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB141817416E00C7B720 /* lua_GamepadButtonMapping.cpp */; }; - 420BBCF21817416F00C7B720 /* lua_GamepadGamepadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB161817416E00C7B720 /* lua_GamepadGamepadEvent.cpp */; }; - 420BBCF31817416F00C7B720 /* lua_GamepadGamepadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB161817416E00C7B720 /* lua_GamepadGamepadEvent.cpp */; }; - 420BBCF61817416F00C7B720 /* lua_GameState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB181817416E00C7B720 /* lua_GameState.cpp */; }; - 420BBCF71817416F00C7B720 /* lua_GameState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB181817416E00C7B720 /* lua_GameState.cpp */; }; - 420BBCFA1817416F00C7B720 /* lua_Gesture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB1A1817416E00C7B720 /* lua_Gesture.cpp */; }; - 420BBCFB1817416F00C7B720 /* lua_Gesture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB1A1817416E00C7B720 /* lua_Gesture.cpp */; }; - 420BBCFE1817416F00C7B720 /* lua_GestureGestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB1C1817416E00C7B720 /* lua_GestureGestureEvent.cpp */; }; - 420BBCFF1817416F00C7B720 /* lua_GestureGestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB1C1817416E00C7B720 /* lua_GestureGestureEvent.cpp */; }; - 420BBD021817416F00C7B720 /* lua_Global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB1E1817416E00C7B720 /* lua_Global.cpp */; }; - 420BBD031817416F00C7B720 /* lua_Global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB1E1817416E00C7B720 /* lua_Global.cpp */; }; - 420BBD061817416F00C7B720 /* lua_HeightField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB201817416E00C7B720 /* lua_HeightField.cpp */; }; - 420BBD071817416F00C7B720 /* lua_HeightField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB201817416E00C7B720 /* lua_HeightField.cpp */; }; - 420BBD0A1817416F00C7B720 /* lua_Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB221817416E00C7B720 /* lua_Image.cpp */; }; - 420BBD0B1817416F00C7B720 /* lua_Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB221817416E00C7B720 /* lua_Image.cpp */; }; - 420BBD0E1817416F00C7B720 /* lua_ImageControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB241817416E00C7B720 /* lua_ImageControl.cpp */; }; - 420BBD0F1817416F00C7B720 /* lua_ImageControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB241817416E00C7B720 /* lua_ImageControl.cpp */; }; - 420BBD121817416F00C7B720 /* lua_ImageFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB261817416E00C7B720 /* lua_ImageFormat.cpp */; }; - 420BBD131817416F00C7B720 /* lua_ImageFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB261817416E00C7B720 /* lua_ImageFormat.cpp */; }; - 420BBD161817416F00C7B720 /* lua_Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB281817416E00C7B720 /* lua_Joint.cpp */; }; - 420BBD171817416F00C7B720 /* lua_Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB281817416E00C7B720 /* lua_Joint.cpp */; }; - 420BBD1E1817416F00C7B720 /* lua_Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB2C1817416E00C7B720 /* lua_Keyboard.cpp */; }; - 420BBD1F1817416F00C7B720 /* lua_Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB2C1817416E00C7B720 /* lua_Keyboard.cpp */; }; - 420BBD221817416F00C7B720 /* lua_KeyboardKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB2E1817416E00C7B720 /* lua_KeyboardKey.cpp */; }; - 420BBD231817416F00C7B720 /* lua_KeyboardKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB2E1817416E00C7B720 /* lua_KeyboardKey.cpp */; }; - 420BBD261817416F00C7B720 /* lua_KeyboardKeyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB301817416E00C7B720 /* lua_KeyboardKeyEvent.cpp */; }; - 420BBD271817416F00C7B720 /* lua_KeyboardKeyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB301817416E00C7B720 /* lua_KeyboardKeyEvent.cpp */; }; - 420BBD2A1817416F00C7B720 /* lua_Label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB321817416E00C7B720 /* lua_Label.cpp */; }; - 420BBD2B1817416F00C7B720 /* lua_Label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB321817416E00C7B720 /* lua_Label.cpp */; }; - 420BBD2E1817416F00C7B720 /* lua_Layout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB341817416E00C7B720 /* lua_Layout.cpp */; }; - 420BBD2F1817416F00C7B720 /* lua_Layout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB341817416E00C7B720 /* lua_Layout.cpp */; }; - 420BBD321817416F00C7B720 /* lua_LayoutType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB361817416E00C7B720 /* lua_LayoutType.cpp */; }; - 420BBD331817416F00C7B720 /* lua_LayoutType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB361817416E00C7B720 /* lua_LayoutType.cpp */; }; - 420BBD361817416F00C7B720 /* lua_Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB381817416E00C7B720 /* lua_Light.cpp */; }; - 420BBD371817416F00C7B720 /* lua_Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB381817416E00C7B720 /* lua_Light.cpp */; }; - 420BBD3A1817416F00C7B720 /* lua_LightType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB3A1817416E00C7B720 /* lua_LightType.cpp */; }; - 420BBD3B1817416F00C7B720 /* lua_LightType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB3A1817416E00C7B720 /* lua_LightType.cpp */; }; - 420BBD3E1817416F00C7B720 /* lua_Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB3C1817416E00C7B720 /* lua_Logger.cpp */; }; - 420BBD3F1817416F00C7B720 /* lua_Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB3C1817416E00C7B720 /* lua_Logger.cpp */; }; - 420BBD421817416F00C7B720 /* lua_LoggerLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB3E1817416E00C7B720 /* lua_LoggerLevel.cpp */; }; - 420BBD431817416F00C7B720 /* lua_LoggerLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB3E1817416E00C7B720 /* lua_LoggerLevel.cpp */; }; - 420BBD461817416F00C7B720 /* lua_Material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB401817416E00C7B720 /* lua_Material.cpp */; }; - 420BBD471817416F00C7B720 /* lua_Material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB401817416E00C7B720 /* lua_Material.cpp */; }; - 420BBD4A1817416F00C7B720 /* lua_MaterialParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB421817416E00C7B720 /* lua_MaterialParameter.cpp */; }; - 420BBD4B1817416F00C7B720 /* lua_MaterialParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB421817416E00C7B720 /* lua_MaterialParameter.cpp */; }; - 420BBD4E1817416F00C7B720 /* lua_MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB441817416E00C7B720 /* lua_MathUtil.cpp */; }; - 420BBD4F1817416F00C7B720 /* lua_MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB441817416E00C7B720 /* lua_MathUtil.cpp */; }; - 420BBD521817416F00C7B720 /* lua_Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB461817416E00C7B720 /* lua_Matrix.cpp */; }; - 420BBD531817416F00C7B720 /* lua_Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB461817416E00C7B720 /* lua_Matrix.cpp */; }; - 420BBD561817416F00C7B720 /* lua_Mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB481817416E00C7B720 /* lua_Mesh.cpp */; }; - 420BBD571817416F00C7B720 /* lua_Mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB481817416E00C7B720 /* lua_Mesh.cpp */; }; - 420BBD5A1817416F00C7B720 /* lua_MeshBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB4A1817416E00C7B720 /* lua_MeshBatch.cpp */; }; - 420BBD5B1817416F00C7B720 /* lua_MeshBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB4A1817416E00C7B720 /* lua_MeshBatch.cpp */; }; - 420BBD5E1817416F00C7B720 /* lua_MeshIndexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB4C1817416E00C7B720 /* lua_MeshIndexFormat.cpp */; }; - 420BBD5F1817416F00C7B720 /* lua_MeshIndexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB4C1817416E00C7B720 /* lua_MeshIndexFormat.cpp */; }; - 420BBD621817416F00C7B720 /* lua_MeshPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB4E1817416E00C7B720 /* lua_MeshPart.cpp */; }; - 420BBD631817416F00C7B720 /* lua_MeshPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB4E1817416E00C7B720 /* lua_MeshPart.cpp */; }; - 420BBD661817416F00C7B720 /* lua_MeshPrimitiveType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB501817416E00C7B720 /* lua_MeshPrimitiveType.cpp */; }; - 420BBD671817416F00C7B720 /* lua_MeshPrimitiveType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB501817416E00C7B720 /* lua_MeshPrimitiveType.cpp */; }; - 420BBD6A1817416F00C7B720 /* lua_MeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB521817416E00C7B720 /* lua_MeshSkin.cpp */; }; - 420BBD6B1817416F00C7B720 /* lua_MeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB521817416E00C7B720 /* lua_MeshSkin.cpp */; }; - 420BBD6E1817416F00C7B720 /* lua_Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB541817416E00C7B720 /* lua_Model.cpp */; }; - 420BBD6F1817416F00C7B720 /* lua_Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB541817416E00C7B720 /* lua_Model.cpp */; }; - 420BBD721817416F00C7B720 /* lua_Mouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB561817416E00C7B720 /* lua_Mouse.cpp */; }; - 420BBD731817416F00C7B720 /* lua_Mouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB561817416E00C7B720 /* lua_Mouse.cpp */; }; - 420BBD761817416F00C7B720 /* lua_MouseMouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB581817416E00C7B720 /* lua_MouseMouseEvent.cpp */; }; - 420BBD771817416F00C7B720 /* lua_MouseMouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB581817416E00C7B720 /* lua_MouseMouseEvent.cpp */; }; - 420BBD7A1817416F00C7B720 /* lua_Node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB5A1817416E00C7B720 /* lua_Node.cpp */; }; - 420BBD7B1817416F00C7B720 /* lua_Node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB5A1817416E00C7B720 /* lua_Node.cpp */; }; - 420BBD7E1817416F00C7B720 /* lua_NodeCloneContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB5C1817416E00C7B720 /* lua_NodeCloneContext.cpp */; }; - 420BBD7F1817416F00C7B720 /* lua_NodeCloneContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB5C1817416E00C7B720 /* lua_NodeCloneContext.cpp */; }; - 420BBD821817416F00C7B720 /* lua_NodeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB5E1817416E00C7B720 /* lua_NodeType.cpp */; }; - 420BBD831817416F00C7B720 /* lua_NodeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB5E1817416E00C7B720 /* lua_NodeType.cpp */; }; - 420BBD861817416F00C7B720 /* lua_ParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB601817416E00C7B720 /* lua_ParticleEmitter.cpp */; }; - 420BBD871817416F00C7B720 /* lua_ParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB601817416E00C7B720 /* lua_ParticleEmitter.cpp */; }; - 420BBD8A1817416F00C7B720 /* lua_ParticleEmitterTextureBlending.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB621817416E00C7B720 /* lua_ParticleEmitterTextureBlending.cpp */; }; - 420BBD8B1817416F00C7B720 /* lua_ParticleEmitterTextureBlending.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB621817416E00C7B720 /* lua_ParticleEmitterTextureBlending.cpp */; }; - 420BBD8E1817416F00C7B720 /* lua_Pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB641817416E00C7B720 /* lua_Pass.cpp */; }; - 420BBD8F1817416F00C7B720 /* lua_Pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB641817416E00C7B720 /* lua_Pass.cpp */; }; - 420BBD921817416F00C7B720 /* lua_PhysicsCharacter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB661817416E00C7B720 /* lua_PhysicsCharacter.cpp */; }; - 420BBD931817416F00C7B720 /* lua_PhysicsCharacter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB661817416E00C7B720 /* lua_PhysicsCharacter.cpp */; }; - 420BBD961817416F00C7B720 /* lua_PhysicsCollisionObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB681817416E00C7B720 /* lua_PhysicsCollisionObject.cpp */; }; - 420BBD971817416F00C7B720 /* lua_PhysicsCollisionObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB681817416E00C7B720 /* lua_PhysicsCollisionObject.cpp */; }; - 420BBD9A1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB6A1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp */; }; - 420BBD9B1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB6A1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp */; }; - 420BBD9E1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB6C1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp */; }; - 420BBD9F1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB6C1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp */; }; - 420BBDA21817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB6E1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp */; }; - 420BBDA31817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB6E1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp */; }; - 420BBDA61817416F00C7B720 /* lua_PhysicsCollisionObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB701817416E00C7B720 /* lua_PhysicsCollisionObjectType.cpp */; }; - 420BBDA71817416F00C7B720 /* lua_PhysicsCollisionObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB701817416E00C7B720 /* lua_PhysicsCollisionObjectType.cpp */; }; - 420BBDAA1817416F00C7B720 /* lua_PhysicsCollisionShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB721817416E00C7B720 /* lua_PhysicsCollisionShape.cpp */; }; - 420BBDAB1817416F00C7B720 /* lua_PhysicsCollisionShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB721817416E00C7B720 /* lua_PhysicsCollisionShape.cpp */; }; - 420BBDAE1817416F00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB741817416E00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp */; }; - 420BBDAF1817416F00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB741817416E00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp */; }; - 420BBDB21817416F00C7B720 /* lua_PhysicsCollisionShapeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB761817416E00C7B720 /* lua_PhysicsCollisionShapeType.cpp */; }; - 420BBDB31817416F00C7B720 /* lua_PhysicsCollisionShapeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB761817416E00C7B720 /* lua_PhysicsCollisionShapeType.cpp */; }; - 420BBDB61817416F00C7B720 /* lua_PhysicsConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB781817416E00C7B720 /* lua_PhysicsConstraint.cpp */; }; - 420BBDB71817416F00C7B720 /* lua_PhysicsConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB781817416E00C7B720 /* lua_PhysicsConstraint.cpp */; }; - 420BBDBA1817416F00C7B720 /* lua_PhysicsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB7A1817416E00C7B720 /* lua_PhysicsController.cpp */; }; - 420BBDBB1817416F00C7B720 /* lua_PhysicsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB7A1817416E00C7B720 /* lua_PhysicsController.cpp */; }; - 420BBDBE1817416F00C7B720 /* lua_PhysicsControllerHitFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB7C1817416E00C7B720 /* lua_PhysicsControllerHitFilter.cpp */; }; - 420BBDBF1817416F00C7B720 /* lua_PhysicsControllerHitFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB7C1817416E00C7B720 /* lua_PhysicsControllerHitFilter.cpp */; }; - 420BBDC21817416F00C7B720 /* lua_PhysicsControllerHitResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB7E1817416E00C7B720 /* lua_PhysicsControllerHitResult.cpp */; }; - 420BBDC31817416F00C7B720 /* lua_PhysicsControllerHitResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB7E1817416E00C7B720 /* lua_PhysicsControllerHitResult.cpp */; }; - 420BBDC61817416F00C7B720 /* lua_PhysicsControllerListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB801817416E00C7B720 /* lua_PhysicsControllerListener.cpp */; }; - 420BBDC71817416F00C7B720 /* lua_PhysicsControllerListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB801817416E00C7B720 /* lua_PhysicsControllerListener.cpp */; }; - 420BBDCA1817416F00C7B720 /* lua_PhysicsControllerListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB821817416E00C7B720 /* lua_PhysicsControllerListenerEventType.cpp */; }; - 420BBDCB1817416F00C7B720 /* lua_PhysicsControllerListenerEventType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB821817416E00C7B720 /* lua_PhysicsControllerListenerEventType.cpp */; }; - 420BBDCE1817416F00C7B720 /* lua_PhysicsFixedConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB841817416E00C7B720 /* lua_PhysicsFixedConstraint.cpp */; }; - 420BBDCF1817416F00C7B720 /* lua_PhysicsFixedConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB841817416E00C7B720 /* lua_PhysicsFixedConstraint.cpp */; }; - 420BBDD21817416F00C7B720 /* lua_PhysicsGenericConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB861817416E00C7B720 /* lua_PhysicsGenericConstraint.cpp */; }; - 420BBDD31817416F00C7B720 /* lua_PhysicsGenericConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB861817416E00C7B720 /* lua_PhysicsGenericConstraint.cpp */; }; - 420BBDD61817416F00C7B720 /* lua_PhysicsGhostObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB881817416E00C7B720 /* lua_PhysicsGhostObject.cpp */; }; - 420BBDD71817416F00C7B720 /* lua_PhysicsGhostObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB881817416E00C7B720 /* lua_PhysicsGhostObject.cpp */; }; - 420BBDDA1817416F00C7B720 /* lua_PhysicsHingeConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB8A1817416E00C7B720 /* lua_PhysicsHingeConstraint.cpp */; }; - 420BBDDB1817416F00C7B720 /* lua_PhysicsHingeConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB8A1817416E00C7B720 /* lua_PhysicsHingeConstraint.cpp */; }; - 420BBDDE1817416F00C7B720 /* lua_PhysicsRigidBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB8C1817416E00C7B720 /* lua_PhysicsRigidBody.cpp */; }; - 420BBDDF1817416F00C7B720 /* lua_PhysicsRigidBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB8C1817416E00C7B720 /* lua_PhysicsRigidBody.cpp */; }; - 420BBDE21817416F00C7B720 /* lua_PhysicsRigidBodyParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB8E1817416E00C7B720 /* lua_PhysicsRigidBodyParameters.cpp */; }; - 420BBDE31817416F00C7B720 /* lua_PhysicsRigidBodyParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB8E1817416E00C7B720 /* lua_PhysicsRigidBodyParameters.cpp */; }; - 420BBDE61817416F00C7B720 /* lua_PhysicsSocketConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB901817416E00C7B720 /* lua_PhysicsSocketConstraint.cpp */; }; - 420BBDE71817416F00C7B720 /* lua_PhysicsSocketConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB901817416E00C7B720 /* lua_PhysicsSocketConstraint.cpp */; }; - 420BBDEA1817416F00C7B720 /* lua_PhysicsSpringConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB921817416E00C7B720 /* lua_PhysicsSpringConstraint.cpp */; }; - 420BBDEB1817416F00C7B720 /* lua_PhysicsSpringConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB921817416E00C7B720 /* lua_PhysicsSpringConstraint.cpp */; }; - 420BBDEE1817416F00C7B720 /* lua_PhysicsVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB941817416E00C7B720 /* lua_PhysicsVehicle.cpp */; }; - 420BBDEF1817416F00C7B720 /* lua_PhysicsVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB941817416E00C7B720 /* lua_PhysicsVehicle.cpp */; }; - 420BBDF21817416F00C7B720 /* lua_PhysicsVehicleWheel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB961817416E00C7B720 /* lua_PhysicsVehicleWheel.cpp */; }; - 420BBDF31817416F00C7B720 /* lua_PhysicsVehicleWheel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB961817416E00C7B720 /* lua_PhysicsVehicleWheel.cpp */; }; - 420BBDF61817416F00C7B720 /* lua_Plane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB981817416E00C7B720 /* lua_Plane.cpp */; }; - 420BBDF71817416F00C7B720 /* lua_Plane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB981817416E00C7B720 /* lua_Plane.cpp */; }; - 420BBDFA1817416F00C7B720 /* lua_Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB9A1817416E00C7B720 /* lua_Platform.cpp */; }; - 420BBDFB1817416F00C7B720 /* lua_Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB9A1817416E00C7B720 /* lua_Platform.cpp */; }; - 420BBDFE1817416F00C7B720 /* lua_Properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB9C1817416E00C7B720 /* lua_Properties.cpp */; }; - 420BBDFF1817416F00C7B720 /* lua_Properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB9C1817416E00C7B720 /* lua_Properties.cpp */; }; - 420BBE021817416F00C7B720 /* lua_PropertiesType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB9E1817416E00C7B720 /* lua_PropertiesType.cpp */; }; - 420BBE031817416F00C7B720 /* lua_PropertiesType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBB9E1817416E00C7B720 /* lua_PropertiesType.cpp */; }; - 420BBE061817416F00C7B720 /* lua_Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA01817416E00C7B720 /* lua_Quaternion.cpp */; }; - 420BBE071817416F00C7B720 /* lua_Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA01817416E00C7B720 /* lua_Quaternion.cpp */; }; - 420BBE0A1817416F00C7B720 /* lua_RadioButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA21817416E00C7B720 /* lua_RadioButton.cpp */; }; - 420BBE0B1817416F00C7B720 /* lua_RadioButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA21817416E00C7B720 /* lua_RadioButton.cpp */; }; - 420BBE0E1817416F00C7B720 /* lua_Ray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA41817416E00C7B720 /* lua_Ray.cpp */; }; - 420BBE0F1817416F00C7B720 /* lua_Ray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA41817416E00C7B720 /* lua_Ray.cpp */; }; - 420BBE121817416F00C7B720 /* lua_Rectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA61817416E00C7B720 /* lua_Rectangle.cpp */; }; - 420BBE131817416F00C7B720 /* lua_Rectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA61817416E00C7B720 /* lua_Rectangle.cpp */; }; - 420BBE161817416F00C7B720 /* lua_Ref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA81817416E00C7B720 /* lua_Ref.cpp */; }; - 420BBE171817416F00C7B720 /* lua_Ref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBA81817416E00C7B720 /* lua_Ref.cpp */; }; - 420BBE1A1817416F00C7B720 /* lua_RenderState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBAA1817416E00C7B720 /* lua_RenderState.cpp */; }; - 420BBE1B1817416F00C7B720 /* lua_RenderState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBAA1817416E00C7B720 /* lua_RenderState.cpp */; }; - 420BBE1E1817416F00C7B720 /* lua_RenderStateAutoBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBAC1817416E00C7B720 /* lua_RenderStateAutoBinding.cpp */; }; - 420BBE1F1817416F00C7B720 /* lua_RenderStateAutoBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBAC1817416E00C7B720 /* lua_RenderStateAutoBinding.cpp */; }; - 420BBE221817416F00C7B720 /* lua_RenderStateBlend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBAE1817416E00C7B720 /* lua_RenderStateBlend.cpp */; }; - 420BBE231817416F00C7B720 /* lua_RenderStateBlend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBAE1817416E00C7B720 /* lua_RenderStateBlend.cpp */; }; - 420BBE261817416F00C7B720 /* lua_RenderStateCullFaceSide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB01817416E00C7B720 /* lua_RenderStateCullFaceSide.cpp */; }; - 420BBE271817416F00C7B720 /* lua_RenderStateCullFaceSide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB01817416E00C7B720 /* lua_RenderStateCullFaceSide.cpp */; }; - 420BBE2A1817416F00C7B720 /* lua_RenderStateDepthFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB21817416E00C7B720 /* lua_RenderStateDepthFunction.cpp */; }; - 420BBE2B1817416F00C7B720 /* lua_RenderStateDepthFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB21817416E00C7B720 /* lua_RenderStateDepthFunction.cpp */; }; - 420BBE2E1817416F00C7B720 /* lua_RenderStateFrontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB41817416E00C7B720 /* lua_RenderStateFrontFace.cpp */; }; - 420BBE2F1817416F00C7B720 /* lua_RenderStateFrontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB41817416E00C7B720 /* lua_RenderStateFrontFace.cpp */; }; - 420BBE321817416F00C7B720 /* lua_RenderStateStateBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB61817416E00C7B720 /* lua_RenderStateStateBlock.cpp */; }; - 420BBE331817416F00C7B720 /* lua_RenderStateStateBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB61817416E00C7B720 /* lua_RenderStateStateBlock.cpp */; }; - 420BBE361817416F00C7B720 /* lua_RenderStateStencilFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB81817416E00C7B720 /* lua_RenderStateStencilFunction.cpp */; }; - 420BBE371817416F00C7B720 /* lua_RenderStateStencilFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBB81817416E00C7B720 /* lua_RenderStateStencilFunction.cpp */; }; - 420BBE3A1817416F00C7B720 /* lua_RenderStateStencilOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBA1817416E00C7B720 /* lua_RenderStateStencilOperation.cpp */; }; - 420BBE3B1817416F00C7B720 /* lua_RenderStateStencilOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBA1817416E00C7B720 /* lua_RenderStateStencilOperation.cpp */; }; - 420BBE3E1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBC1817416E00C7B720 /* lua_RenderTarget.cpp */; }; - 420BBE3F1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBC1817416E00C7B720 /* lua_RenderTarget.cpp */; }; - 420BBE421817416F00C7B720 /* lua_Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBE1817416E00C7B720 /* lua_Scene.cpp */; }; - 420BBE431817416F00C7B720 /* lua_Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBE1817416E00C7B720 /* lua_Scene.cpp */; }; - 420BBE521817416F00C7B720 /* lua_ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */; }; - 420BBE531817416F00C7B720 /* lua_ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */; }; - 420BBE561817416F00C7B720 /* lua_ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */; }; - 420BBE571817416F00C7B720 /* lua_ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */; }; - 420BBE5A1817416F00C7B720 /* lua_ScriptTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBCA1817416E00C7B720 /* lua_ScriptTarget.cpp */; }; - 420BBE5B1817416F00C7B720 /* lua_ScriptTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBCA1817416E00C7B720 /* lua_ScriptTarget.cpp */; }; - 420BBE5E1817416F00C7B720 /* lua_Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBCC1817416E00C7B720 /* lua_Slider.cpp */; }; - 420BBE5F1817416F00C7B720 /* lua_Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBCC1817416E00C7B720 /* lua_Slider.cpp */; }; - 420BBE621817416F00C7B720 /* lua_SpriteBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBCE1817416E00C7B720 /* lua_SpriteBatch.cpp */; }; - 420BBE631817416F00C7B720 /* lua_SpriteBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBCE1817416E00C7B720 /* lua_SpriteBatch.cpp */; }; - 420BBE661817416F00C7B720 /* lua_Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD01817416E00C7B720 /* lua_Technique.cpp */; }; - 420BBE671817416F00C7B720 /* lua_Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD01817416E00C7B720 /* lua_Technique.cpp */; }; - 420BBE6A1817416F00C7B720 /* lua_Terrain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD21817416E00C7B720 /* lua_Terrain.cpp */; }; - 420BBE6B1817416F00C7B720 /* lua_Terrain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD21817416E00C7B720 /* lua_Terrain.cpp */; }; - 420BBE6E1817416F00C7B720 /* lua_TerrainFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD41817416E00C7B720 /* lua_TerrainFlags.cpp */; }; - 420BBE6F1817416F00C7B720 /* lua_TerrainFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD41817416E00C7B720 /* lua_TerrainFlags.cpp */; }; - 420BBE761817416F00C7B720 /* lua_TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD81817416E00C7B720 /* lua_TextBox.cpp */; }; - 420BBE771817416F00C7B720 /* lua_TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBD81817416E00C7B720 /* lua_TextBox.cpp */; }; - 420BBE7A1817416F00C7B720 /* lua_TextBoxInputMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBDA1817416E00C7B720 /* lua_TextBoxInputMode.cpp */; }; - 420BBE7B1817416F00C7B720 /* lua_TextBoxInputMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBDA1817416E00C7B720 /* lua_TextBoxInputMode.cpp */; }; - 420BBE7E1817416F00C7B720 /* lua_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBDC1817416E00C7B720 /* lua_Texture.cpp */; }; - 420BBE7F1817416F00C7B720 /* lua_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBDC1817416E00C7B720 /* lua_Texture.cpp */; }; - 420BBE821817416F00C7B720 /* lua_TextureFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBDE1817416E00C7B720 /* lua_TextureFilter.cpp */; }; - 420BBE831817416F00C7B720 /* lua_TextureFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBDE1817416E00C7B720 /* lua_TextureFilter.cpp */; }; - 420BBE861817416F00C7B720 /* lua_TextureFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE01817416E00C7B720 /* lua_TextureFormat.cpp */; }; - 420BBE871817416F00C7B720 /* lua_TextureFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE01817416E00C7B720 /* lua_TextureFormat.cpp */; }; - 420BBE8A1817416F00C7B720 /* lua_TextureSampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE21817416E00C7B720 /* lua_TextureSampler.cpp */; }; - 420BBE8B1817416F00C7B720 /* lua_TextureSampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE21817416E00C7B720 /* lua_TextureSampler.cpp */; }; - 420BBE8E1817416F00C7B720 /* lua_TextureWrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE41817416E00C7B720 /* lua_TextureWrap.cpp */; }; - 420BBE8F1817416F00C7B720 /* lua_TextureWrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE41817416E00C7B720 /* lua_TextureWrap.cpp */; }; - 420BBE921817416F00C7B720 /* lua_Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE61817416F00C7B720 /* lua_Theme.cpp */; }; - 420BBE931817416F00C7B720 /* lua_Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE61817416F00C7B720 /* lua_Theme.cpp */; }; - 420BBE961817416F00C7B720 /* lua_ThemeSideRegions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE81817416F00C7B720 /* lua_ThemeSideRegions.cpp */; }; - 420BBE971817416F00C7B720 /* lua_ThemeSideRegions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBE81817416F00C7B720 /* lua_ThemeSideRegions.cpp */; }; - 420BBE9A1817416F00C7B720 /* lua_ThemeStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBEA1817416F00C7B720 /* lua_ThemeStyle.cpp */; }; - 420BBE9B1817416F00C7B720 /* lua_ThemeStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBEA1817416F00C7B720 /* lua_ThemeStyle.cpp */; }; - 420BBE9E1817416F00C7B720 /* lua_ThemeThemeImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBEC1817416F00C7B720 /* lua_ThemeThemeImage.cpp */; }; - 420BBE9F1817416F00C7B720 /* lua_ThemeThemeImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBEC1817416F00C7B720 /* lua_ThemeThemeImage.cpp */; }; - 420BBEA21817416F00C7B720 /* lua_ThemeUVs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBEE1817416F00C7B720 /* lua_ThemeUVs.cpp */; }; - 420BBEA31817416F00C7B720 /* lua_ThemeUVs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBEE1817416F00C7B720 /* lua_ThemeUVs.cpp */; }; - 420BBEA61817416F00C7B720 /* lua_Touch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF01817416F00C7B720 /* lua_Touch.cpp */; }; - 420BBEA71817416F00C7B720 /* lua_Touch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF01817416F00C7B720 /* lua_Touch.cpp */; }; - 420BBEAA1817416F00C7B720 /* lua_TouchTouchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF21817416F00C7B720 /* lua_TouchTouchEvent.cpp */; }; - 420BBEAB1817416F00C7B720 /* lua_TouchTouchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF21817416F00C7B720 /* lua_TouchTouchEvent.cpp */; }; - 420BBEAE1817416F00C7B720 /* lua_Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF41817416F00C7B720 /* lua_Transform.cpp */; }; - 420BBEAF1817416F00C7B720 /* lua_Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF41817416F00C7B720 /* lua_Transform.cpp */; }; - 420BBEB21817416F00C7B720 /* lua_TransformListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF61817416F00C7B720 /* lua_TransformListener.cpp */; }; - 420BBEB31817416F00C7B720 /* lua_TransformListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF61817416F00C7B720 /* lua_TransformListener.cpp */; }; - 420BBEB61817416F00C7B720 /* lua_Uniform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF81817416F00C7B720 /* lua_Uniform.cpp */; }; - 420BBEB71817416F00C7B720 /* lua_Uniform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBF81817416F00C7B720 /* lua_Uniform.cpp */; }; - 420BBEBA1817416F00C7B720 /* lua_Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBFA1817416F00C7B720 /* lua_Vector2.cpp */; }; - 420BBEBB1817416F00C7B720 /* lua_Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBFA1817416F00C7B720 /* lua_Vector2.cpp */; }; - 420BBEBE1817416F00C7B720 /* lua_Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBFC1817416F00C7B720 /* lua_Vector3.cpp */; }; - 420BBEBF1817416F00C7B720 /* lua_Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBFC1817416F00C7B720 /* lua_Vector3.cpp */; }; - 420BBEC21817416F00C7B720 /* lua_Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBFE1817416F00C7B720 /* lua_Vector4.cpp */; }; - 420BBEC31817416F00C7B720 /* lua_Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBFE1817416F00C7B720 /* lua_Vector4.cpp */; }; - 420BBEC61817416F00C7B720 /* lua_VertexAttributeBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC001817416F00C7B720 /* lua_VertexAttributeBinding.cpp */; }; - 420BBEC71817416F00C7B720 /* lua_VertexAttributeBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC001817416F00C7B720 /* lua_VertexAttributeBinding.cpp */; }; - 420BBECA1817416F00C7B720 /* lua_VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC021817416F00C7B720 /* lua_VertexFormat.cpp */; }; - 420BBECB1817416F00C7B720 /* lua_VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC021817416F00C7B720 /* lua_VertexFormat.cpp */; }; - 420BBECE1817416F00C7B720 /* lua_VertexFormatElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC041817416F00C7B720 /* lua_VertexFormatElement.cpp */; }; - 420BBECF1817416F00C7B720 /* lua_VertexFormatElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC041817416F00C7B720 /* lua_VertexFormatElement.cpp */; }; - 420BBED21817416F00C7B720 /* lua_VertexFormatUsage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC061817416F00C7B720 /* lua_VertexFormatUsage.cpp */; }; - 420BBED31817416F00C7B720 /* lua_VertexFormatUsage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC061817416F00C7B720 /* lua_VertexFormatUsage.cpp */; }; - 420BBED61817416F00C7B720 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */; }; - 420BBED71817416F00C7B720 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */; }; - 42252DCC1828145B00EE234B /* lua_CameraListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DC81828145B00EE234B /* lua_CameraListener.cpp */; }; - 42252DCD1828145B00EE234B /* lua_CameraListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DC81828145B00EE234B /* lua_CameraListener.cpp */; }; - 42252DD01828145B00EE234B /* lua_TerrainPatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DCA1828145B00EE234B /* lua_TerrainPatch.cpp */; }; - 42252DD11828145B00EE234B /* lua_TerrainPatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DCA1828145B00EE234B /* lua_TerrainPatch.cpp */; }; 4234D99E14686C52003031B3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4234D99D14686C52003031B3 /* Cocoa.framework */; }; + 424F33001A60C28600395438 /* lua_AbsoluteLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31F41A60C28600395438 /* lua_AbsoluteLayout.cpp */; }; + 424F33011A60C28600395438 /* lua_AbsoluteLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31F41A60C28600395438 /* lua_AbsoluteLayout.cpp */; }; + 424F33021A60C28600395438 /* lua_AIAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31F61A60C28600395438 /* lua_AIAgent.cpp */; }; + 424F33031A60C28600395438 /* lua_AIAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31F61A60C28600395438 /* lua_AIAgent.cpp */; }; + 424F33041A60C28600395438 /* lua_AIAgentListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31F81A60C28600395438 /* lua_AIAgentListener.cpp */; }; + 424F33051A60C28600395438 /* lua_AIAgentListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31F81A60C28600395438 /* lua_AIAgentListener.cpp */; }; + 424F33061A60C28600395438 /* lua_AIController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31FA1A60C28600395438 /* lua_AIController.cpp */; }; + 424F33071A60C28600395438 /* lua_AIController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31FA1A60C28600395438 /* lua_AIController.cpp */; }; + 424F33081A60C28600395438 /* lua_AIMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31FC1A60C28600395438 /* lua_AIMessage.cpp */; }; + 424F33091A60C28600395438 /* lua_AIMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31FC1A60C28600395438 /* lua_AIMessage.cpp */; }; + 424F330A1A60C28600395438 /* lua_AIState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31FE1A60C28600395438 /* lua_AIState.cpp */; }; + 424F330B1A60C28600395438 /* lua_AIState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F31FE1A60C28600395438 /* lua_AIState.cpp */; }; + 424F330C1A60C28600395438 /* lua_AIStateListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32001A60C28600395438 /* lua_AIStateListener.cpp */; }; + 424F330D1A60C28600395438 /* lua_AIStateListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32001A60C28600395438 /* lua_AIStateListener.cpp */; }; + 424F330E1A60C28600395438 /* lua_AIStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32021A60C28600395438 /* lua_AIStateMachine.cpp */; }; + 424F330F1A60C28600395438 /* lua_AIStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32021A60C28600395438 /* lua_AIStateMachine.cpp */; }; + 424F33101A60C28600395438 /* lua_all_bindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32041A60C28600395438 /* lua_all_bindings.cpp */; }; + 424F33111A60C28600395438 /* lua_all_bindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32041A60C28600395438 /* lua_all_bindings.cpp */; }; + 424F33121A60C28600395438 /* lua_Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32061A60C28600395438 /* lua_Animation.cpp */; }; + 424F33131A60C28600395438 /* lua_Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32061A60C28600395438 /* lua_Animation.cpp */; }; + 424F33141A60C28600395438 /* lua_AnimationClip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32081A60C28600395438 /* lua_AnimationClip.cpp */; }; + 424F33151A60C28600395438 /* lua_AnimationClip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32081A60C28600395438 /* lua_AnimationClip.cpp */; }; + 424F33161A60C28600395438 /* lua_AnimationClipListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F320A1A60C28600395438 /* lua_AnimationClipListener.cpp */; }; + 424F33171A60C28600395438 /* lua_AnimationClipListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F320A1A60C28600395438 /* lua_AnimationClipListener.cpp */; }; + 424F33181A60C28600395438 /* lua_AnimationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F320C1A60C28600395438 /* lua_AnimationController.cpp */; }; + 424F33191A60C28600395438 /* lua_AnimationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F320C1A60C28600395438 /* lua_AnimationController.cpp */; }; + 424F331A1A60C28600395438 /* lua_AnimationTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F320E1A60C28600395438 /* lua_AnimationTarget.cpp */; }; + 424F331B1A60C28600395438 /* lua_AnimationTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F320E1A60C28600395438 /* lua_AnimationTarget.cpp */; }; + 424F331C1A60C28600395438 /* lua_AnimationValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32101A60C28600395438 /* lua_AnimationValue.cpp */; }; + 424F331D1A60C28600395438 /* lua_AnimationValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32101A60C28600395438 /* lua_AnimationValue.cpp */; }; + 424F331E1A60C28600395438 /* lua_AudioBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32121A60C28600395438 /* lua_AudioBuffer.cpp */; }; + 424F331F1A60C28600395438 /* lua_AudioBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32121A60C28600395438 /* lua_AudioBuffer.cpp */; }; + 424F33201A60C28600395438 /* lua_AudioController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32141A60C28600395438 /* lua_AudioController.cpp */; }; + 424F33211A60C28600395438 /* lua_AudioController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32141A60C28600395438 /* lua_AudioController.cpp */; }; + 424F33221A60C28600395438 /* lua_AudioListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32161A60C28600395438 /* lua_AudioListener.cpp */; }; + 424F33231A60C28600395438 /* lua_AudioListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32161A60C28600395438 /* lua_AudioListener.cpp */; }; + 424F33241A60C28600395438 /* lua_AudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32181A60C28600395438 /* lua_AudioSource.cpp */; }; + 424F33251A60C28600395438 /* lua_AudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32181A60C28600395438 /* lua_AudioSource.cpp */; }; + 424F33261A60C28600395438 /* lua_BoundingBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F321A1A60C28600395438 /* lua_BoundingBox.cpp */; }; + 424F33271A60C28600395438 /* lua_BoundingBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F321A1A60C28600395438 /* lua_BoundingBox.cpp */; }; + 424F33281A60C28600395438 /* lua_BoundingSphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F321C1A60C28600395438 /* lua_BoundingSphere.cpp */; }; + 424F33291A60C28600395438 /* lua_BoundingSphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F321C1A60C28600395438 /* lua_BoundingSphere.cpp */; }; + 424F332A1A60C28600395438 /* lua_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F321E1A60C28600395438 /* lua_Bundle.cpp */; }; + 424F332B1A60C28600395438 /* lua_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F321E1A60C28600395438 /* lua_Bundle.cpp */; }; + 424F332C1A60C28600395438 /* lua_Button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32201A60C28600395438 /* lua_Button.cpp */; }; + 424F332D1A60C28600395438 /* lua_Button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32201A60C28600395438 /* lua_Button.cpp */; }; + 424F332E1A60C28600395438 /* lua_Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32221A60C28600395438 /* lua_Camera.cpp */; }; + 424F332F1A60C28600395438 /* lua_Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32221A60C28600395438 /* lua_Camera.cpp */; }; + 424F33301A60C28600395438 /* lua_CameraListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32241A60C28600395438 /* lua_CameraListener.cpp */; }; + 424F33311A60C28600395438 /* lua_CameraListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32241A60C28600395438 /* lua_CameraListener.cpp */; }; + 424F33321A60C28600395438 /* lua_CheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32261A60C28600395438 /* lua_CheckBox.cpp */; }; + 424F33331A60C28600395438 /* lua_CheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32261A60C28600395438 /* lua_CheckBox.cpp */; }; + 424F33341A60C28600395438 /* lua_Container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32281A60C28600395438 /* lua_Container.cpp */; }; + 424F33351A60C28600395438 /* lua_Container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32281A60C28600395438 /* lua_Container.cpp */; }; + 424F33361A60C28600395438 /* lua_Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F322A1A60C28600395438 /* lua_Control.cpp */; }; + 424F33371A60C28600395438 /* lua_Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F322A1A60C28600395438 /* lua_Control.cpp */; }; + 424F33381A60C28600395438 /* lua_ControlListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F322C1A60C28600395438 /* lua_ControlListener.cpp */; }; + 424F33391A60C28600395438 /* lua_ControlListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F322C1A60C28600395438 /* lua_ControlListener.cpp */; }; + 424F333A1A60C28600395438 /* lua_Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F322E1A60C28600395438 /* lua_Curve.cpp */; }; + 424F333B1A60C28600395438 /* lua_Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F322E1A60C28600395438 /* lua_Curve.cpp */; }; + 424F333C1A60C28600395438 /* lua_DepthStencilTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32301A60C28600395438 /* lua_DepthStencilTarget.cpp */; }; + 424F333D1A60C28600395438 /* lua_DepthStencilTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32301A60C28600395438 /* lua_DepthStencilTarget.cpp */; }; + 424F333E1A60C28600395438 /* lua_Drawable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32321A60C28600395438 /* lua_Drawable.cpp */; }; + 424F333F1A60C28600395438 /* lua_Drawable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32321A60C28600395438 /* lua_Drawable.cpp */; }; + 424F33401A60C28600395438 /* lua_Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32341A60C28600395438 /* lua_Effect.cpp */; }; + 424F33411A60C28600395438 /* lua_Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32341A60C28600395438 /* lua_Effect.cpp */; }; + 424F33421A60C28600395438 /* lua_FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32361A60C28600395438 /* lua_FileSystem.cpp */; }; + 424F33431A60C28600395438 /* lua_FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32361A60C28600395438 /* lua_FileSystem.cpp */; }; + 424F33441A60C28600395438 /* lua_FlowLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32381A60C28600395438 /* lua_FlowLayout.cpp */; }; + 424F33451A60C28600395438 /* lua_FlowLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32381A60C28600395438 /* lua_FlowLayout.cpp */; }; + 424F33461A60C28600395438 /* lua_Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F323A1A60C28600395438 /* lua_Font.cpp */; }; + 424F33471A60C28600395438 /* lua_Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F323A1A60C28600395438 /* lua_Font.cpp */; }; + 424F33481A60C28600395438 /* lua_Form.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F323C1A60C28600395438 /* lua_Form.cpp */; }; + 424F33491A60C28600395438 /* lua_Form.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F323C1A60C28600395438 /* lua_Form.cpp */; }; + 424F334A1A60C28600395438 /* lua_FrameBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F323E1A60C28600395438 /* lua_FrameBuffer.cpp */; }; + 424F334B1A60C28600395438 /* lua_FrameBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F323E1A60C28600395438 /* lua_FrameBuffer.cpp */; }; + 424F334C1A60C28600395438 /* lua_Frustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32401A60C28600395438 /* lua_Frustum.cpp */; }; + 424F334D1A60C28600395438 /* lua_Frustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32401A60C28600395438 /* lua_Frustum.cpp */; }; + 424F334E1A60C28600395438 /* lua_Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32421A60C28600395438 /* lua_Game.cpp */; }; + 424F334F1A60C28600395438 /* lua_Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32421A60C28600395438 /* lua_Game.cpp */; }; + 424F33501A60C28600395438 /* lua_Gamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32441A60C28600395438 /* lua_Gamepad.cpp */; }; + 424F33511A60C28600395438 /* lua_Gamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32441A60C28600395438 /* lua_Gamepad.cpp */; }; + 424F33521A60C28600395438 /* lua_Gesture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32461A60C28600395438 /* lua_Gesture.cpp */; }; + 424F33531A60C28600395438 /* lua_Gesture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32461A60C28600395438 /* lua_Gesture.cpp */; }; + 424F33541A60C28600395438 /* lua_Global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32481A60C28600395438 /* lua_Global.cpp */; }; + 424F33551A60C28600395438 /* lua_Global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32481A60C28600395438 /* lua_Global.cpp */; }; + 424F33561A60C28600395438 /* lua_HeightField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F324A1A60C28600395438 /* lua_HeightField.cpp */; }; + 424F33571A60C28600395438 /* lua_HeightField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F324A1A60C28600395438 /* lua_HeightField.cpp */; }; + 424F33581A60C28600395438 /* lua_Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F324C1A60C28600395438 /* lua_Image.cpp */; }; + 424F33591A60C28600395438 /* lua_Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F324C1A60C28600395438 /* lua_Image.cpp */; }; + 424F335A1A60C28600395438 /* lua_ImageControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F324E1A60C28600395438 /* lua_ImageControl.cpp */; }; + 424F335B1A60C28600395438 /* lua_ImageControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F324E1A60C28600395438 /* lua_ImageControl.cpp */; }; + 424F335C1A60C28600395438 /* lua_Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32501A60C28600395438 /* lua_Joint.cpp */; }; + 424F335D1A60C28600395438 /* lua_Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32501A60C28600395438 /* lua_Joint.cpp */; }; + 424F335E1A60C28600395438 /* lua_JoystickControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32521A60C28600395438 /* lua_JoystickControl.cpp */; }; + 424F335F1A60C28600395438 /* lua_JoystickControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32521A60C28600395438 /* lua_JoystickControl.cpp */; }; + 424F33601A60C28600395438 /* lua_Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32541A60C28600395438 /* lua_Keyboard.cpp */; }; + 424F33611A60C28600395438 /* lua_Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32541A60C28600395438 /* lua_Keyboard.cpp */; }; + 424F33621A60C28600395438 /* lua_Label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32561A60C28600395438 /* lua_Label.cpp */; }; + 424F33631A60C28600395438 /* lua_Label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32561A60C28600395438 /* lua_Label.cpp */; }; + 424F33641A60C28600395438 /* lua_Layout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32581A60C28600395438 /* lua_Layout.cpp */; }; + 424F33651A60C28600395438 /* lua_Layout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32581A60C28600395438 /* lua_Layout.cpp */; }; + 424F33661A60C28600395438 /* lua_Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F325A1A60C28600395438 /* lua_Light.cpp */; }; + 424F33671A60C28600395438 /* lua_Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F325A1A60C28600395438 /* lua_Light.cpp */; }; + 424F33681A60C28600395438 /* lua_Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F325C1A60C28600395438 /* lua_Logger.cpp */; }; + 424F33691A60C28600395438 /* lua_Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F325C1A60C28600395438 /* lua_Logger.cpp */; }; + 424F336A1A60C28600395438 /* lua_Material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F325E1A60C28600395438 /* lua_Material.cpp */; }; + 424F336B1A60C28600395438 /* lua_Material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F325E1A60C28600395438 /* lua_Material.cpp */; }; + 424F336C1A60C28600395438 /* lua_MaterialParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32601A60C28600395438 /* lua_MaterialParameter.cpp */; }; + 424F336D1A60C28600395438 /* lua_MaterialParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32601A60C28600395438 /* lua_MaterialParameter.cpp */; }; + 424F336E1A60C28600395438 /* lua_MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32621A60C28600395438 /* lua_MathUtil.cpp */; }; + 424F336F1A60C28600395438 /* lua_MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32621A60C28600395438 /* lua_MathUtil.cpp */; }; + 424F33701A60C28600395438 /* lua_Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32641A60C28600395438 /* lua_Matrix.cpp */; }; + 424F33711A60C28600395438 /* lua_Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32641A60C28600395438 /* lua_Matrix.cpp */; }; + 424F33721A60C28600395438 /* lua_Mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32661A60C28600395438 /* lua_Mesh.cpp */; }; + 424F33731A60C28600395438 /* lua_Mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32661A60C28600395438 /* lua_Mesh.cpp */; }; + 424F33741A60C28600395438 /* lua_MeshBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32681A60C28600395438 /* lua_MeshBatch.cpp */; }; + 424F33751A60C28600395438 /* lua_MeshBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32681A60C28600395438 /* lua_MeshBatch.cpp */; }; + 424F33761A60C28600395438 /* lua_MeshPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F326A1A60C28600395438 /* lua_MeshPart.cpp */; }; + 424F33771A60C28600395438 /* lua_MeshPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F326A1A60C28600395438 /* lua_MeshPart.cpp */; }; + 424F33781A60C28600395438 /* lua_MeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F326C1A60C28600395438 /* lua_MeshSkin.cpp */; }; + 424F33791A60C28600395438 /* lua_MeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F326C1A60C28600395438 /* lua_MeshSkin.cpp */; }; + 424F337A1A60C28600395438 /* lua_Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F326E1A60C28600395438 /* lua_Model.cpp */; }; + 424F337B1A60C28600395438 /* lua_Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F326E1A60C28600395438 /* lua_Model.cpp */; }; + 424F337C1A60C28600395438 /* lua_Mouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32701A60C28600395438 /* lua_Mouse.cpp */; }; + 424F337D1A60C28600395438 /* lua_Mouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32701A60C28600395438 /* lua_Mouse.cpp */; }; + 424F337E1A60C28600395438 /* lua_Node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32721A60C28600395438 /* lua_Node.cpp */; }; + 424F337F1A60C28600395438 /* lua_Node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32721A60C28600395438 /* lua_Node.cpp */; }; + 424F33801A60C28600395438 /* lua_NodeCloneContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32741A60C28600395438 /* lua_NodeCloneContext.cpp */; }; + 424F33811A60C28600395438 /* lua_NodeCloneContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32741A60C28600395438 /* lua_NodeCloneContext.cpp */; }; + 424F33821A60C28600395438 /* lua_ParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32761A60C28600395438 /* lua_ParticleEmitter.cpp */; }; + 424F33831A60C28600395438 /* lua_ParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32761A60C28600395438 /* lua_ParticleEmitter.cpp */; }; + 424F33841A60C28600395438 /* lua_Pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32781A60C28600395438 /* lua_Pass.cpp */; }; + 424F33851A60C28600395438 /* lua_Pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32781A60C28600395438 /* lua_Pass.cpp */; }; + 424F33861A60C28600395438 /* lua_PhysicsCharacter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F327A1A60C28600395438 /* lua_PhysicsCharacter.cpp */; }; + 424F33871A60C28600395438 /* lua_PhysicsCharacter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F327A1A60C28600395438 /* lua_PhysicsCharacter.cpp */; }; + 424F33881A60C28600395438 /* lua_PhysicsCollisionObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F327C1A60C28600395438 /* lua_PhysicsCollisionObject.cpp */; }; + 424F33891A60C28600395438 /* lua_PhysicsCollisionObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F327C1A60C28600395438 /* lua_PhysicsCollisionObject.cpp */; }; + 424F338A1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F327E1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp */; }; + 424F338B1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F327E1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp */; }; + 424F338C1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32801A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp */; }; + 424F338D1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32801A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp */; }; + 424F338E1A60C28600395438 /* lua_PhysicsCollisionShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32821A60C28600395438 /* lua_PhysicsCollisionShape.cpp */; }; + 424F338F1A60C28600395438 /* lua_PhysicsCollisionShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32821A60C28600395438 /* lua_PhysicsCollisionShape.cpp */; }; + 424F33901A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32841A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp */; }; + 424F33911A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32841A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp */; }; + 424F33921A60C28600395438 /* lua_PhysicsConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32861A60C28600395438 /* lua_PhysicsConstraint.cpp */; }; + 424F33931A60C28600395438 /* lua_PhysicsConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32861A60C28600395438 /* lua_PhysicsConstraint.cpp */; }; + 424F33941A60C28600395438 /* lua_PhysicsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32881A60C28600395438 /* lua_PhysicsController.cpp */; }; + 424F33951A60C28600395438 /* lua_PhysicsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32881A60C28600395438 /* lua_PhysicsController.cpp */; }; + 424F33961A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F328A1A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp */; }; + 424F33971A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F328A1A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp */; }; + 424F33981A60C28600395438 /* lua_PhysicsControllerHitResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F328C1A60C28600395438 /* lua_PhysicsControllerHitResult.cpp */; }; + 424F33991A60C28600395438 /* lua_PhysicsControllerHitResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F328C1A60C28600395438 /* lua_PhysicsControllerHitResult.cpp */; }; + 424F339A1A60C28600395438 /* lua_PhysicsControllerListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F328E1A60C28600395438 /* lua_PhysicsControllerListener.cpp */; }; + 424F339B1A60C28600395438 /* lua_PhysicsControllerListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F328E1A60C28600395438 /* lua_PhysicsControllerListener.cpp */; }; + 424F339C1A60C28600395438 /* lua_PhysicsFixedConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32901A60C28600395438 /* lua_PhysicsFixedConstraint.cpp */; }; + 424F339D1A60C28600395438 /* lua_PhysicsFixedConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32901A60C28600395438 /* lua_PhysicsFixedConstraint.cpp */; }; + 424F339E1A60C28600395438 /* lua_PhysicsGenericConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32921A60C28600395438 /* lua_PhysicsGenericConstraint.cpp */; }; + 424F339F1A60C28600395438 /* lua_PhysicsGenericConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32921A60C28600395438 /* lua_PhysicsGenericConstraint.cpp */; }; + 424F33A01A60C28600395438 /* lua_PhysicsGhostObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32941A60C28600395438 /* lua_PhysicsGhostObject.cpp */; }; + 424F33A11A60C28600395438 /* lua_PhysicsGhostObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32941A60C28600395438 /* lua_PhysicsGhostObject.cpp */; }; + 424F33A21A60C28600395438 /* lua_PhysicsHingeConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32961A60C28600395438 /* lua_PhysicsHingeConstraint.cpp */; }; + 424F33A31A60C28600395438 /* lua_PhysicsHingeConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32961A60C28600395438 /* lua_PhysicsHingeConstraint.cpp */; }; + 424F33A41A60C28600395438 /* lua_PhysicsRigidBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32981A60C28600395438 /* lua_PhysicsRigidBody.cpp */; }; + 424F33A51A60C28600395438 /* lua_PhysicsRigidBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32981A60C28600395438 /* lua_PhysicsRigidBody.cpp */; }; + 424F33A61A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F329A1A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp */; }; + 424F33A71A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F329A1A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp */; }; + 424F33A81A60C28600395438 /* lua_PhysicsSocketConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F329C1A60C28600395438 /* lua_PhysicsSocketConstraint.cpp */; }; + 424F33A91A60C28600395438 /* lua_PhysicsSocketConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F329C1A60C28600395438 /* lua_PhysicsSocketConstraint.cpp */; }; + 424F33AA1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F329E1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp */; }; + 424F33AB1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F329E1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp */; }; + 424F33AC1A60C28600395438 /* lua_PhysicsVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A01A60C28600395438 /* lua_PhysicsVehicle.cpp */; }; + 424F33AD1A60C28600395438 /* lua_PhysicsVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A01A60C28600395438 /* lua_PhysicsVehicle.cpp */; }; + 424F33AE1A60C28600395438 /* lua_PhysicsVehicleWheel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A21A60C28600395438 /* lua_PhysicsVehicleWheel.cpp */; }; + 424F33AF1A60C28600395438 /* lua_PhysicsVehicleWheel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A21A60C28600395438 /* lua_PhysicsVehicleWheel.cpp */; }; + 424F33B01A60C28600395438 /* lua_Plane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A41A60C28600395438 /* lua_Plane.cpp */; }; + 424F33B11A60C28600395438 /* lua_Plane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A41A60C28600395438 /* lua_Plane.cpp */; }; + 424F33B21A60C28600395438 /* lua_Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A61A60C28600395438 /* lua_Platform.cpp */; }; + 424F33B31A60C28600395438 /* lua_Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A61A60C28600395438 /* lua_Platform.cpp */; }; + 424F33B41A60C28600395438 /* lua_Properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A81A60C28600395438 /* lua_Properties.cpp */; }; + 424F33B51A60C28600395438 /* lua_Properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32A81A60C28600395438 /* lua_Properties.cpp */; }; + 424F33B61A60C28600395438 /* lua_Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32AA1A60C28600395438 /* lua_Quaternion.cpp */; }; + 424F33B71A60C28600395438 /* lua_Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32AA1A60C28600395438 /* lua_Quaternion.cpp */; }; + 424F33B81A60C28600395438 /* lua_RadioButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32AC1A60C28600395438 /* lua_RadioButton.cpp */; }; + 424F33B91A60C28600395438 /* lua_RadioButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32AC1A60C28600395438 /* lua_RadioButton.cpp */; }; + 424F33BA1A60C28600395438 /* lua_Ray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32AE1A60C28600395438 /* lua_Ray.cpp */; }; + 424F33BB1A60C28600395438 /* lua_Ray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32AE1A60C28600395438 /* lua_Ray.cpp */; }; + 424F33BC1A60C28600395438 /* lua_Rectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B01A60C28600395438 /* lua_Rectangle.cpp */; }; + 424F33BD1A60C28600395438 /* lua_Rectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B01A60C28600395438 /* lua_Rectangle.cpp */; }; + 424F33BE1A60C28600395438 /* lua_Ref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B21A60C28600395438 /* lua_Ref.cpp */; }; + 424F33BF1A60C28600395438 /* lua_Ref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B21A60C28600395438 /* lua_Ref.cpp */; }; + 424F33C01A60C28600395438 /* lua_RenderState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B41A60C28600395438 /* lua_RenderState.cpp */; }; + 424F33C11A60C28600395438 /* lua_RenderState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B41A60C28600395438 /* lua_RenderState.cpp */; }; + 424F33C21A60C28600395438 /* lua_RenderStateStateBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B61A60C28600395438 /* lua_RenderStateStateBlock.cpp */; }; + 424F33C31A60C28600395438 /* lua_RenderStateStateBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B61A60C28600395438 /* lua_RenderStateStateBlock.cpp */; }; + 424F33C41A60C28600395438 /* lua_RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B81A60C28600395438 /* lua_RenderTarget.cpp */; }; + 424F33C51A60C28600395438 /* lua_RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32B81A60C28600395438 /* lua_RenderTarget.cpp */; }; + 424F33C61A60C28600395438 /* lua_Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32BA1A60C28600395438 /* lua_Scene.cpp */; }; + 424F33C71A60C28600395438 /* lua_Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32BA1A60C28600395438 /* lua_Scene.cpp */; }; + 424F33C81A60C28600395438 /* lua_ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32BC1A60C28600395438 /* lua_ScreenDisplayer.cpp */; }; + 424F33C91A60C28600395438 /* lua_ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32BC1A60C28600395438 /* lua_ScreenDisplayer.cpp */; }; + 424F33CA1A60C28600395438 /* lua_Script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32BE1A60C28600395438 /* lua_Script.cpp */; }; + 424F33CB1A60C28600395438 /* lua_Script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32BE1A60C28600395438 /* lua_Script.cpp */; }; + 424F33CC1A60C28600395438 /* lua_ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C01A60C28600395438 /* lua_ScriptController.cpp */; }; + 424F33CD1A60C28600395438 /* lua_ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C01A60C28600395438 /* lua_ScriptController.cpp */; }; + 424F33CE1A60C28600395438 /* lua_ScriptTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C21A60C28600395438 /* lua_ScriptTarget.cpp */; }; + 424F33CF1A60C28600395438 /* lua_ScriptTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C21A60C28600395438 /* lua_ScriptTarget.cpp */; }; + 424F33D01A60C28600395438 /* lua_ScriptTargetEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C41A60C28600395438 /* lua_ScriptTargetEvent.cpp */; }; + 424F33D11A60C28600395438 /* lua_ScriptTargetEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C41A60C28600395438 /* lua_ScriptTargetEvent.cpp */; }; + 424F33D21A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C61A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp */; }; + 424F33D31A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C61A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp */; }; + 424F33D41A60C28600395438 /* lua_Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C81A60C28600395438 /* lua_Slider.cpp */; }; + 424F33D51A60C28600395438 /* lua_Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32C81A60C28600395438 /* lua_Slider.cpp */; }; + 424F33D61A60C28600395438 /* lua_Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32CA1A60C28600395438 /* lua_Sprite.cpp */; }; + 424F33D71A60C28600395438 /* lua_Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32CA1A60C28600395438 /* lua_Sprite.cpp */; }; + 424F33D81A60C28600395438 /* lua_SpriteBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32CC1A60C28600395438 /* lua_SpriteBatch.cpp */; }; + 424F33D91A60C28600395438 /* lua_SpriteBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32CC1A60C28600395438 /* lua_SpriteBatch.cpp */; }; + 424F33DA1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32CE1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp */; }; + 424F33DB1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32CE1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp */; }; + 424F33DC1A60C28600395438 /* lua_Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D01A60C28600395438 /* lua_Technique.cpp */; }; + 424F33DD1A60C28600395438 /* lua_Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D01A60C28600395438 /* lua_Technique.cpp */; }; + 424F33DE1A60C28600395438 /* lua_Terrain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D21A60C28600395438 /* lua_Terrain.cpp */; }; + 424F33DF1A60C28600395438 /* lua_Terrain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D21A60C28600395438 /* lua_Terrain.cpp */; }; + 424F33E01A60C28600395438 /* lua_TerrainPatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D41A60C28600395438 /* lua_TerrainPatch.cpp */; }; + 424F33E11A60C28600395438 /* lua_TerrainPatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D41A60C28600395438 /* lua_TerrainPatch.cpp */; }; + 424F33E21A60C28600395438 /* lua_Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D61A60C28600395438 /* lua_Text.cpp */; }; + 424F33E31A60C28600395438 /* lua_Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D61A60C28600395438 /* lua_Text.cpp */; }; + 424F33E41A60C28600395438 /* lua_TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D81A60C28600395438 /* lua_TextBox.cpp */; }; + 424F33E51A60C28600395438 /* lua_TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32D81A60C28600395438 /* lua_TextBox.cpp */; }; + 424F33E61A60C28600395438 /* lua_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32DA1A60C28600395438 /* lua_Texture.cpp */; }; + 424F33E71A60C28600395438 /* lua_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32DA1A60C28600395438 /* lua_Texture.cpp */; }; + 424F33E81A60C28600395438 /* lua_TextureSampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32DC1A60C28600395438 /* lua_TextureSampler.cpp */; }; + 424F33E91A60C28600395438 /* lua_TextureSampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32DC1A60C28600395438 /* lua_TextureSampler.cpp */; }; + 424F33EA1A60C28600395438 /* lua_Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32DE1A60C28600395438 /* lua_Theme.cpp */; }; + 424F33EB1A60C28600395438 /* lua_Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32DE1A60C28600395438 /* lua_Theme.cpp */; }; + 424F33EC1A60C28600395438 /* lua_ThemeSideRegions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E01A60C28600395438 /* lua_ThemeSideRegions.cpp */; }; + 424F33ED1A60C28600395438 /* lua_ThemeSideRegions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E01A60C28600395438 /* lua_ThemeSideRegions.cpp */; }; + 424F33EE1A60C28600395438 /* lua_ThemeStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E21A60C28600395438 /* lua_ThemeStyle.cpp */; }; + 424F33EF1A60C28600395438 /* lua_ThemeStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E21A60C28600395438 /* lua_ThemeStyle.cpp */; }; + 424F33F01A60C28600395438 /* lua_ThemeThemeImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E41A60C28600395438 /* lua_ThemeThemeImage.cpp */; }; + 424F33F11A60C28600395438 /* lua_ThemeThemeImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E41A60C28600395438 /* lua_ThemeThemeImage.cpp */; }; + 424F33F21A60C28600395438 /* lua_ThemeUVs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E61A60C28600395438 /* lua_ThemeUVs.cpp */; }; + 424F33F31A60C28600395438 /* lua_ThemeUVs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E61A60C28600395438 /* lua_ThemeUVs.cpp */; }; + 424F33F41A60C28600395438 /* lua_TileSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E81A60C28600395438 /* lua_TileSet.cpp */; }; + 424F33F51A60C28600395438 /* lua_TileSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32E81A60C28600395438 /* lua_TileSet.cpp */; }; + 424F33F61A60C28600395438 /* lua_Touch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32EA1A60C28600395438 /* lua_Touch.cpp */; }; + 424F33F71A60C28600395438 /* lua_Touch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32EA1A60C28600395438 /* lua_Touch.cpp */; }; + 424F33F81A60C28600395438 /* lua_Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32EC1A60C28600395438 /* lua_Transform.cpp */; }; + 424F33F91A60C28600395438 /* lua_Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32EC1A60C28600395438 /* lua_Transform.cpp */; }; + 424F33FA1A60C28600395438 /* lua_TransformListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32EE1A60C28600395438 /* lua_TransformListener.cpp */; }; + 424F33FB1A60C28600395438 /* lua_TransformListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32EE1A60C28600395438 /* lua_TransformListener.cpp */; }; + 424F33FC1A60C28600395438 /* lua_Uniform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F01A60C28600395438 /* lua_Uniform.cpp */; }; + 424F33FD1A60C28600395438 /* lua_Uniform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F01A60C28600395438 /* lua_Uniform.cpp */; }; + 424F33FE1A60C28600395438 /* lua_Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F21A60C28600395438 /* lua_Vector2.cpp */; }; + 424F33FF1A60C28600395438 /* lua_Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F21A60C28600395438 /* lua_Vector2.cpp */; }; + 424F34001A60C28600395438 /* lua_Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F41A60C28600395438 /* lua_Vector3.cpp */; }; + 424F34011A60C28600395438 /* lua_Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F41A60C28600395438 /* lua_Vector3.cpp */; }; + 424F34021A60C28600395438 /* lua_Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F61A60C28600395438 /* lua_Vector4.cpp */; }; + 424F34031A60C28600395438 /* lua_Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F61A60C28600395438 /* lua_Vector4.cpp */; }; + 424F34041A60C28600395438 /* lua_VertexAttributeBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F81A60C28600395438 /* lua_VertexAttributeBinding.cpp */; }; + 424F34051A60C28600395438 /* lua_VertexAttributeBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32F81A60C28600395438 /* lua_VertexAttributeBinding.cpp */; }; + 424F34061A60C28600395438 /* lua_VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32FA1A60C28600395438 /* lua_VertexFormat.cpp */; }; + 424F34071A60C28600395438 /* lua_VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32FA1A60C28600395438 /* lua_VertexFormat.cpp */; }; + 424F34081A60C28600395438 /* lua_VertexFormatElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32FC1A60C28600395438 /* lua_VertexFormatElement.cpp */; }; + 424F34091A60C28600395438 /* lua_VertexFormatElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32FC1A60C28600395438 /* lua_VertexFormatElement.cpp */; }; + 424F340A1A60C28600395438 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32FE1A60C28600395438 /* lua_VerticalLayout.cpp */; }; + 424F340B1A60C28600395438 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424F32FE1A60C28600395438 /* lua_VerticalLayout.cpp */; }; 426F8317187F72A700640CBA /* JoystickControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426F8315187F72A700640CBA /* JoystickControl.cpp */; }; 426F8318187F72A700640CBA /* JoystickControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426F8315187F72A700640CBA /* JoystickControl.cpp */; }; - 426F831B187F72DF00640CBA /* lua_JoystickControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426F8319187F72DF00640CBA /* lua_JoystickControl.cpp */; }; - 426F831C187F72DF00640CBA /* lua_JoystickControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426F8319187F72DF00640CBA /* lua_JoystickControl.cpp */; }; 42CC556C1809A4EF00AAD8AD /* AbsoluteLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC52F71809A4EB00AAD8AD /* AbsoluteLayout.cpp */; }; 42CC556D1809A4EF00AAD8AD /* AbsoluteLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC52F71809A4EB00AAD8AD /* AbsoluteLayout.cpp */; }; 42CC55701809A4EF00AAD8AD /* AIAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC52F91809A4EB00AAD8AD /* AIAgent.cpp */; }; @@ -436,8 +356,6 @@ 42CC55F71809A4EF00AAD8AD /* Gamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC533F1809A4EB00AAD8AD /* Gamepad.cpp */; }; 42CC55FA1809A4EF00AAD8AD /* gameplay-main-android.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53411809A4EB00AAD8AD /* gameplay-main-android.cpp */; }; 42CC55FB1809A4EF00AAD8AD /* gameplay-main-android.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53411809A4EB00AAD8AD /* gameplay-main-android.cpp */; }; - 42CC55FC1809A4EF00AAD8AD /* gameplay-main-blackberry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53421809A4EB00AAD8AD /* gameplay-main-blackberry.cpp */; }; - 42CC55FD1809A4EF00AAD8AD /* gameplay-main-blackberry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53421809A4EB00AAD8AD /* gameplay-main-blackberry.cpp */; }; 42CC55FF1809A4EF00AAD8AD /* gameplay-main-ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53431809A4EB00AAD8AD /* gameplay-main-ios.mm */; }; 42CC56001809A4EF00AAD8AD /* gameplay-main-linux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53441809A4EB00AAD8AD /* gameplay-main-linux.cpp */; }; 42CC56011809A4EF00AAD8AD /* gameplay-main-linux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC53441809A4EB00AAD8AD /* gameplay-main-linux.cpp */; }; @@ -518,8 +436,6 @@ 42CC596F1809A4EF00AAD8AD /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55081809A4ED00AAD8AD /* Platform.cpp */; }; 42CC59721809A4EF00AAD8AD /* PlatformAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550A1809A4ED00AAD8AD /* PlatformAndroid.cpp */; }; 42CC59731809A4EF00AAD8AD /* PlatformAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550A1809A4ED00AAD8AD /* PlatformAndroid.cpp */; }; - 42CC59741809A4EF00AAD8AD /* PlatformBlackBerry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550B1809A4ED00AAD8AD /* PlatformBlackBerry.cpp */; }; - 42CC59751809A4EF00AAD8AD /* PlatformBlackBerry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550B1809A4ED00AAD8AD /* PlatformBlackBerry.cpp */; }; 42CC59771809A4EF00AAD8AD /* PlatformiOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550C1809A4ED00AAD8AD /* PlatformiOS.mm */; }; 42CC59781809A4EF00AAD8AD /* PlatformLinux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550D1809A4ED00AAD8AD /* PlatformLinux.cpp */; }; 42CC59791809A4EF00AAD8AD /* PlatformLinux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC550D1809A4ED00AAD8AD /* PlatformLinux.cpp */; }; @@ -584,11 +500,14 @@ 42CC5A1B1809A4EF00AAD8AD /* VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55651809A4EE00AAD8AD /* VertexFormat.cpp */; }; 42CC5A1E1809A4EF00AAD8AD /* VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55671809A4EE00AAD8AD /* VerticalLayout.cpp */; }; 42CC5A1F1809A4EF00AAD8AD /* VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55671809A4EE00AAD8AD /* VerticalLayout.cpp */; }; + 42D9299B1A6051EC0073258D /* Drawable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42D929991A6051EC0073258D /* Drawable.cpp */; }; + 42D9299C1A6051EC0073258D /* Drawable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42D929991A6051EC0073258D /* Drawable.cpp */; }; + 42ECC3FA1A4EF5A00036C839 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42ECC3F81A4EF5A00036C839 /* Text.cpp */; }; + 42ECC3FB1A4EF5A00036C839 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42ECC3F81A4EF5A00036C839 /* Text.cpp */; }; 5B21E99616153890006EBEAC /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B21E99516153890006EBEAC /* IOKit.framework */; }; 5B2BC75F1512514500D176CD /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC75D1512514500D176CD /* OpenAL.framework */; }; 5B2BC7601512514500D176CD /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC75E1512514500D176CD /* OpenGL.framework */; }; 5B2BC7621512514D00D176CD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC7611512514D00D176CD /* QuartzCore.framework */; }; - 5B2BC7641512516B00D176CD /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC7631512516B00D176CD /* libz.dylib */; }; 6290E04A18223DCC00A28FB9 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6290E04918223DCC00A28FB9 /* GameKit.framework */; }; 6290E04C18223DDD00A28FB9 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6290E04B18223DDD00A28FB9 /* GameKit.framework */; }; BD2636E516CF5B7400CFE15F /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD2636DF16CF5B7400CFE15F /* CoreMotion.framework */; }; @@ -597,369 +516,289 @@ BD2636E816CF5B7400CFE15F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD2636E216CF5B7400CFE15F /* OpenGLES.framework */; }; BD2636E916CF5B7400CFE15F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD2636E316CF5B7400CFE15F /* QuartzCore.framework */; }; BD2636EA16CF5B7400CFE15F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD2636E416CF5B7400CFE15F /* UIKit.framework */; }; + DD4FBEA51A0C0D240015D30C /* Script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD4FBEA31A0C0D240015D30C /* Script.cpp */; }; + DD4FBEA61A0C0D240015D30C /* Script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD4FBEA31A0C0D240015D30C /* Script.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 4204EC3F1A2EB8310074FCE9 /* TileSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TileSet.cpp; path = src/TileSet.cpp; sourceTree = SOURCE_ROOT; }; + 4204EC401A2EB8310074FCE9 /* TileSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileSet.h; path = src/TileSet.h; sourceTree = SOURCE_ROOT; }; + 4204EC431A2F70BA0074FCE9 /* Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sprite.h; path = src/Sprite.h; sourceTree = SOURCE_ROOT; }; + 4204EC441A2F878C0074FCE9 /* Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sprite.cpp; path = src/Sprite.cpp; sourceTree = SOURCE_ROOT; }; 420BBAA21817416D00C7B720 /* ControlFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ControlFactory.cpp; path = src/ControlFactory.cpp; sourceTree = SOURCE_ROOT; }; 420BBAA31817416D00C7B720 /* ControlFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ControlFactory.h; path = src/ControlFactory.h; sourceTree = SOURCE_ROOT; }; - 420BBAA61817416D00C7B720 /* lua_AbsoluteLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AbsoluteLayout.cpp; sourceTree = ""; }; - 420BBAA71817416D00C7B720 /* lua_AbsoluteLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AbsoluteLayout.h; sourceTree = ""; }; - 420BBAA81817416D00C7B720 /* lua_AIAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIAgent.cpp; sourceTree = ""; }; - 420BBAA91817416D00C7B720 /* lua_AIAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIAgent.h; sourceTree = ""; }; - 420BBAAA1817416D00C7B720 /* lua_AIAgentListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIAgentListener.cpp; sourceTree = ""; }; - 420BBAAB1817416D00C7B720 /* lua_AIAgentListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIAgentListener.h; sourceTree = ""; }; - 420BBAAC1817416D00C7B720 /* lua_AIController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIController.cpp; sourceTree = ""; }; - 420BBAAD1817416D00C7B720 /* lua_AIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIController.h; sourceTree = ""; }; - 420BBAAE1817416D00C7B720 /* lua_AIMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIMessage.cpp; sourceTree = ""; }; - 420BBAAF1817416D00C7B720 /* lua_AIMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIMessage.h; sourceTree = ""; }; - 420BBAB01817416D00C7B720 /* lua_AIMessageParameterType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIMessageParameterType.cpp; sourceTree = ""; }; - 420BBAB11817416D00C7B720 /* lua_AIMessageParameterType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIMessageParameterType.h; sourceTree = ""; }; - 420BBAB21817416D00C7B720 /* lua_AIState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIState.cpp; sourceTree = ""; }; - 420BBAB31817416D00C7B720 /* lua_AIState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIState.h; sourceTree = ""; }; - 420BBAB41817416D00C7B720 /* lua_AIStateListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIStateListener.cpp; sourceTree = ""; }; - 420BBAB51817416D00C7B720 /* lua_AIStateListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIStateListener.h; sourceTree = ""; }; - 420BBAB61817416D00C7B720 /* lua_AIStateMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIStateMachine.cpp; sourceTree = ""; }; - 420BBAB71817416D00C7B720 /* lua_AIStateMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIStateMachine.h; sourceTree = ""; }; - 420BBAB81817416D00C7B720 /* lua_all_bindings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_all_bindings.cpp; sourceTree = ""; }; - 420BBAB91817416D00C7B720 /* lua_all_bindings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_all_bindings.h; sourceTree = ""; }; - 420BBABA1817416D00C7B720 /* lua_Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Animation.cpp; sourceTree = ""; }; - 420BBABB1817416D00C7B720 /* lua_Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Animation.h; sourceTree = ""; }; - 420BBABC1817416D00C7B720 /* lua_AnimationClip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationClip.cpp; sourceTree = ""; }; - 420BBABD1817416D00C7B720 /* lua_AnimationClip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationClip.h; sourceTree = ""; }; - 420BBABE1817416D00C7B720 /* lua_AnimationClipListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationClipListener.cpp; sourceTree = ""; }; - 420BBABF1817416D00C7B720 /* lua_AnimationClipListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationClipListener.h; sourceTree = ""; }; - 420BBAC01817416D00C7B720 /* lua_AnimationClipListenerEventType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationClipListenerEventType.cpp; sourceTree = ""; }; - 420BBAC11817416D00C7B720 /* lua_AnimationClipListenerEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationClipListenerEventType.h; sourceTree = ""; }; - 420BBAC21817416D00C7B720 /* lua_AnimationController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationController.cpp; sourceTree = ""; }; - 420BBAC31817416D00C7B720 /* lua_AnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationController.h; sourceTree = ""; }; - 420BBAC41817416D00C7B720 /* lua_AnimationTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationTarget.cpp; sourceTree = ""; }; - 420BBAC51817416D00C7B720 /* lua_AnimationTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationTarget.h; sourceTree = ""; }; - 420BBAC61817416D00C7B720 /* lua_AnimationValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationValue.cpp; sourceTree = ""; }; - 420BBAC71817416D00C7B720 /* lua_AnimationValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationValue.h; sourceTree = ""; }; - 420BBAC81817416D00C7B720 /* lua_AudioBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioBuffer.cpp; sourceTree = ""; }; - 420BBAC91817416D00C7B720 /* lua_AudioBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioBuffer.h; sourceTree = ""; }; - 420BBACA1817416D00C7B720 /* lua_AudioController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioController.cpp; sourceTree = ""; }; - 420BBACB1817416D00C7B720 /* lua_AudioController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioController.h; sourceTree = ""; }; - 420BBACC1817416D00C7B720 /* lua_AudioListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioListener.cpp; sourceTree = ""; }; - 420BBACD1817416D00C7B720 /* lua_AudioListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioListener.h; sourceTree = ""; }; - 420BBACE1817416D00C7B720 /* lua_AudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioSource.cpp; sourceTree = ""; }; - 420BBACF1817416D00C7B720 /* lua_AudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioSource.h; sourceTree = ""; }; - 420BBAD01817416D00C7B720 /* lua_AudioSourceState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioSourceState.cpp; sourceTree = ""; }; - 420BBAD11817416D00C7B720 /* lua_AudioSourceState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioSourceState.h; sourceTree = ""; }; - 420BBAD21817416D00C7B720 /* lua_BoundingBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_BoundingBox.cpp; sourceTree = ""; }; - 420BBAD31817416D00C7B720 /* lua_BoundingBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_BoundingBox.h; sourceTree = ""; }; - 420BBAD41817416D00C7B720 /* lua_BoundingSphere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_BoundingSphere.cpp; sourceTree = ""; }; - 420BBAD51817416D00C7B720 /* lua_BoundingSphere.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_BoundingSphere.h; sourceTree = ""; }; - 420BBAD61817416D00C7B720 /* lua_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Bundle.cpp; sourceTree = ""; }; - 420BBAD71817416D00C7B720 /* lua_Bundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Bundle.h; sourceTree = ""; }; - 420BBAD81817416D00C7B720 /* lua_Button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Button.cpp; sourceTree = ""; }; - 420BBAD91817416D00C7B720 /* lua_Button.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Button.h; sourceTree = ""; }; - 420BBADA1817416D00C7B720 /* lua_Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Camera.cpp; sourceTree = ""; }; - 420BBADB1817416D00C7B720 /* lua_Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Camera.h; sourceTree = ""; }; - 420BBADC1817416D00C7B720 /* lua_CameraType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CameraType.cpp; sourceTree = ""; }; - 420BBADD1817416D00C7B720 /* lua_CameraType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CameraType.h; sourceTree = ""; }; - 420BBADE1817416D00C7B720 /* lua_CheckBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CheckBox.cpp; sourceTree = ""; }; - 420BBADF1817416D00C7B720 /* lua_CheckBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CheckBox.h; sourceTree = ""; }; - 420BBAE01817416D00C7B720 /* lua_Container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Container.cpp; sourceTree = ""; }; - 420BBAE11817416D00C7B720 /* lua_Container.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Container.h; sourceTree = ""; }; - 420BBAE21817416D00C7B720 /* lua_ContainerScroll.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ContainerScroll.cpp; sourceTree = ""; }; - 420BBAE31817416D00C7B720 /* lua_ContainerScroll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ContainerScroll.h; sourceTree = ""; }; - 420BBAE41817416D00C7B720 /* lua_Control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Control.cpp; sourceTree = ""; }; - 420BBAE51817416D00C7B720 /* lua_Control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Control.h; sourceTree = ""; }; - 420BBAE61817416D00C7B720 /* lua_ControlAlignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ControlAlignment.cpp; sourceTree = ""; }; - 420BBAE71817416D00C7B720 /* lua_ControlAlignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ControlAlignment.h; sourceTree = ""; }; - 420BBAE81817416D00C7B720 /* lua_ControlAutoSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ControlAutoSize.cpp; sourceTree = ""; }; - 420BBAE91817416D00C7B720 /* lua_ControlAutoSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ControlAutoSize.h; sourceTree = ""; }; - 420BBAEA1817416D00C7B720 /* lua_ControlListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ControlListener.cpp; sourceTree = ""; }; - 420BBAEB1817416D00C7B720 /* lua_ControlListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ControlListener.h; sourceTree = ""; }; - 420BBAEC1817416D00C7B720 /* lua_ControlListenerEventType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ControlListenerEventType.cpp; sourceTree = ""; }; - 420BBAED1817416D00C7B720 /* lua_ControlListenerEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ControlListenerEventType.h; sourceTree = ""; }; - 420BBAEE1817416D00C7B720 /* lua_ControlState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ControlState.cpp; sourceTree = ""; }; - 420BBAEF1817416D00C7B720 /* lua_ControlState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ControlState.h; sourceTree = ""; }; - 420BBAF01817416D00C7B720 /* lua_Curve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Curve.cpp; sourceTree = ""; }; - 420BBAF11817416D00C7B720 /* lua_Curve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Curve.h; sourceTree = ""; }; - 420BBAF21817416D00C7B720 /* lua_CurveInterpolationType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CurveInterpolationType.cpp; sourceTree = ""; }; - 420BBAF31817416E00C7B720 /* lua_CurveInterpolationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CurveInterpolationType.h; sourceTree = ""; }; - 420BBAF41817416E00C7B720 /* lua_DepthStencilTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_DepthStencilTarget.cpp; sourceTree = ""; }; - 420BBAF51817416E00C7B720 /* lua_DepthStencilTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_DepthStencilTarget.h; sourceTree = ""; }; - 420BBAF61817416E00C7B720 /* lua_DepthStencilTargetFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_DepthStencilTargetFormat.cpp; sourceTree = ""; }; - 420BBAF71817416E00C7B720 /* lua_DepthStencilTargetFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_DepthStencilTargetFormat.h; sourceTree = ""; }; - 420BBAF81817416E00C7B720 /* lua_Effect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Effect.cpp; sourceTree = ""; }; - 420BBAF91817416E00C7B720 /* lua_Effect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Effect.h; sourceTree = ""; }; - 420BBAFA1817416E00C7B720 /* lua_FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FileSystem.cpp; sourceTree = ""; }; - 420BBAFB1817416E00C7B720 /* lua_FileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FileSystem.h; sourceTree = ""; }; - 420BBAFC1817416E00C7B720 /* lua_FlowLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FlowLayout.cpp; sourceTree = ""; }; - 420BBAFD1817416E00C7B720 /* lua_FlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FlowLayout.h; sourceTree = ""; }; - 420BBAFE1817416E00C7B720 /* lua_Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Font.cpp; sourceTree = ""; }; - 420BBAFF1817416E00C7B720 /* lua_Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Font.h; sourceTree = ""; }; - 420BBB001817416E00C7B720 /* lua_FontFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FontFormat.cpp; sourceTree = ""; }; - 420BBB011817416E00C7B720 /* lua_FontFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FontFormat.h; sourceTree = ""; }; - 420BBB021817416E00C7B720 /* lua_FontJustify.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FontJustify.cpp; sourceTree = ""; }; - 420BBB031817416E00C7B720 /* lua_FontJustify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FontJustify.h; sourceTree = ""; }; - 420BBB041817416E00C7B720 /* lua_FontStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FontStyle.cpp; sourceTree = ""; }; - 420BBB051817416E00C7B720 /* lua_FontStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FontStyle.h; sourceTree = ""; }; - 420BBB061817416E00C7B720 /* lua_FontText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FontText.cpp; sourceTree = ""; }; - 420BBB071817416E00C7B720 /* lua_FontText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FontText.h; sourceTree = ""; }; - 420BBB081817416E00C7B720 /* lua_Form.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Form.cpp; sourceTree = ""; }; - 420BBB091817416E00C7B720 /* lua_Form.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Form.h; sourceTree = ""; }; - 420BBB0A1817416E00C7B720 /* lua_FrameBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FrameBuffer.cpp; sourceTree = ""; }; - 420BBB0B1817416E00C7B720 /* lua_FrameBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FrameBuffer.h; sourceTree = ""; }; - 420BBB0C1817416E00C7B720 /* lua_Frustum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Frustum.cpp; sourceTree = ""; }; - 420BBB0D1817416E00C7B720 /* lua_Frustum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Frustum.h; sourceTree = ""; }; - 420BBB0E1817416E00C7B720 /* lua_Game.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Game.cpp; sourceTree = ""; }; - 420BBB0F1817416E00C7B720 /* lua_Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Game.h; sourceTree = ""; }; - 420BBB101817416E00C7B720 /* lua_GameClearFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_GameClearFlags.cpp; sourceTree = ""; }; - 420BBB111817416E00C7B720 /* lua_GameClearFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_GameClearFlags.h; sourceTree = ""; }; - 420BBB121817416E00C7B720 /* lua_Gamepad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Gamepad.cpp; sourceTree = ""; }; - 420BBB131817416E00C7B720 /* lua_Gamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Gamepad.h; sourceTree = ""; }; - 420BBB141817416E00C7B720 /* lua_GamepadButtonMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_GamepadButtonMapping.cpp; sourceTree = ""; }; - 420BBB151817416E00C7B720 /* lua_GamepadButtonMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_GamepadButtonMapping.h; sourceTree = ""; }; - 420BBB161817416E00C7B720 /* lua_GamepadGamepadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_GamepadGamepadEvent.cpp; sourceTree = ""; }; - 420BBB171817416E00C7B720 /* lua_GamepadGamepadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_GamepadGamepadEvent.h; sourceTree = ""; }; - 420BBB181817416E00C7B720 /* lua_GameState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_GameState.cpp; sourceTree = ""; }; - 420BBB191817416E00C7B720 /* lua_GameState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_GameState.h; sourceTree = ""; }; - 420BBB1A1817416E00C7B720 /* lua_Gesture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Gesture.cpp; sourceTree = ""; }; - 420BBB1B1817416E00C7B720 /* lua_Gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Gesture.h; sourceTree = ""; }; - 420BBB1C1817416E00C7B720 /* lua_GestureGestureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_GestureGestureEvent.cpp; sourceTree = ""; }; - 420BBB1D1817416E00C7B720 /* lua_GestureGestureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_GestureGestureEvent.h; sourceTree = ""; }; - 420BBB1E1817416E00C7B720 /* lua_Global.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Global.cpp; sourceTree = ""; }; - 420BBB1F1817416E00C7B720 /* lua_Global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Global.h; sourceTree = ""; }; - 420BBB201817416E00C7B720 /* lua_HeightField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_HeightField.cpp; sourceTree = ""; }; - 420BBB211817416E00C7B720 /* lua_HeightField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_HeightField.h; sourceTree = ""; }; - 420BBB221817416E00C7B720 /* lua_Image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Image.cpp; sourceTree = ""; }; - 420BBB231817416E00C7B720 /* lua_Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Image.h; sourceTree = ""; }; - 420BBB241817416E00C7B720 /* lua_ImageControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ImageControl.cpp; sourceTree = ""; }; - 420BBB251817416E00C7B720 /* lua_ImageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ImageControl.h; sourceTree = ""; }; - 420BBB261817416E00C7B720 /* lua_ImageFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ImageFormat.cpp; sourceTree = ""; }; - 420BBB271817416E00C7B720 /* lua_ImageFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ImageFormat.h; sourceTree = ""; }; - 420BBB281817416E00C7B720 /* lua_Joint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Joint.cpp; sourceTree = ""; }; - 420BBB291817416E00C7B720 /* lua_Joint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Joint.h; sourceTree = ""; }; - 420BBB2C1817416E00C7B720 /* lua_Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Keyboard.cpp; sourceTree = ""; }; - 420BBB2D1817416E00C7B720 /* lua_Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Keyboard.h; sourceTree = ""; }; - 420BBB2E1817416E00C7B720 /* lua_KeyboardKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_KeyboardKey.cpp; sourceTree = ""; }; - 420BBB2F1817416E00C7B720 /* lua_KeyboardKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_KeyboardKey.h; sourceTree = ""; }; - 420BBB301817416E00C7B720 /* lua_KeyboardKeyEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_KeyboardKeyEvent.cpp; sourceTree = ""; }; - 420BBB311817416E00C7B720 /* lua_KeyboardKeyEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_KeyboardKeyEvent.h; sourceTree = ""; }; - 420BBB321817416E00C7B720 /* lua_Label.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Label.cpp; sourceTree = ""; }; - 420BBB331817416E00C7B720 /* lua_Label.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Label.h; sourceTree = ""; }; - 420BBB341817416E00C7B720 /* lua_Layout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Layout.cpp; sourceTree = ""; }; - 420BBB351817416E00C7B720 /* lua_Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Layout.h; sourceTree = ""; }; - 420BBB361817416E00C7B720 /* lua_LayoutType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_LayoutType.cpp; sourceTree = ""; }; - 420BBB371817416E00C7B720 /* lua_LayoutType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_LayoutType.h; sourceTree = ""; }; - 420BBB381817416E00C7B720 /* lua_Light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Light.cpp; sourceTree = ""; }; - 420BBB391817416E00C7B720 /* lua_Light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Light.h; sourceTree = ""; }; - 420BBB3A1817416E00C7B720 /* lua_LightType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_LightType.cpp; sourceTree = ""; }; - 420BBB3B1817416E00C7B720 /* lua_LightType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_LightType.h; sourceTree = ""; }; - 420BBB3C1817416E00C7B720 /* lua_Logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Logger.cpp; sourceTree = ""; }; - 420BBB3D1817416E00C7B720 /* lua_Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Logger.h; sourceTree = ""; }; - 420BBB3E1817416E00C7B720 /* lua_LoggerLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_LoggerLevel.cpp; sourceTree = ""; }; - 420BBB3F1817416E00C7B720 /* lua_LoggerLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_LoggerLevel.h; sourceTree = ""; }; - 420BBB401817416E00C7B720 /* lua_Material.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Material.cpp; sourceTree = ""; }; - 420BBB411817416E00C7B720 /* lua_Material.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Material.h; sourceTree = ""; }; - 420BBB421817416E00C7B720 /* lua_MaterialParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MaterialParameter.cpp; sourceTree = ""; }; - 420BBB431817416E00C7B720 /* lua_MaterialParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MaterialParameter.h; sourceTree = ""; }; - 420BBB441817416E00C7B720 /* lua_MathUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MathUtil.cpp; sourceTree = ""; }; - 420BBB451817416E00C7B720 /* lua_MathUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MathUtil.h; sourceTree = ""; }; - 420BBB461817416E00C7B720 /* lua_Matrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Matrix.cpp; sourceTree = ""; }; - 420BBB471817416E00C7B720 /* lua_Matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Matrix.h; sourceTree = ""; }; - 420BBB481817416E00C7B720 /* lua_Mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Mesh.cpp; sourceTree = ""; }; - 420BBB491817416E00C7B720 /* lua_Mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Mesh.h; sourceTree = ""; }; - 420BBB4A1817416E00C7B720 /* lua_MeshBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshBatch.cpp; sourceTree = ""; }; - 420BBB4B1817416E00C7B720 /* lua_MeshBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshBatch.h; sourceTree = ""; }; - 420BBB4C1817416E00C7B720 /* lua_MeshIndexFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshIndexFormat.cpp; sourceTree = ""; }; - 420BBB4D1817416E00C7B720 /* lua_MeshIndexFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshIndexFormat.h; sourceTree = ""; }; - 420BBB4E1817416E00C7B720 /* lua_MeshPart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshPart.cpp; sourceTree = ""; }; - 420BBB4F1817416E00C7B720 /* lua_MeshPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshPart.h; sourceTree = ""; }; - 420BBB501817416E00C7B720 /* lua_MeshPrimitiveType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshPrimitiveType.cpp; sourceTree = ""; }; - 420BBB511817416E00C7B720 /* lua_MeshPrimitiveType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshPrimitiveType.h; sourceTree = ""; }; - 420BBB521817416E00C7B720 /* lua_MeshSkin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshSkin.cpp; sourceTree = ""; }; - 420BBB531817416E00C7B720 /* lua_MeshSkin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshSkin.h; sourceTree = ""; }; - 420BBB541817416E00C7B720 /* lua_Model.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Model.cpp; sourceTree = ""; }; - 420BBB551817416E00C7B720 /* lua_Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Model.h; sourceTree = ""; }; - 420BBB561817416E00C7B720 /* lua_Mouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Mouse.cpp; sourceTree = ""; }; - 420BBB571817416E00C7B720 /* lua_Mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Mouse.h; sourceTree = ""; }; - 420BBB581817416E00C7B720 /* lua_MouseMouseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MouseMouseEvent.cpp; sourceTree = ""; }; - 420BBB591817416E00C7B720 /* lua_MouseMouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MouseMouseEvent.h; sourceTree = ""; }; - 420BBB5A1817416E00C7B720 /* lua_Node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Node.cpp; sourceTree = ""; }; - 420BBB5B1817416E00C7B720 /* lua_Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Node.h; sourceTree = ""; }; - 420BBB5C1817416E00C7B720 /* lua_NodeCloneContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_NodeCloneContext.cpp; sourceTree = ""; }; - 420BBB5D1817416E00C7B720 /* lua_NodeCloneContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_NodeCloneContext.h; sourceTree = ""; }; - 420BBB5E1817416E00C7B720 /* lua_NodeType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_NodeType.cpp; sourceTree = ""; }; - 420BBB5F1817416E00C7B720 /* lua_NodeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_NodeType.h; sourceTree = ""; }; - 420BBB601817416E00C7B720 /* lua_ParticleEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ParticleEmitter.cpp; sourceTree = ""; }; - 420BBB611817416E00C7B720 /* lua_ParticleEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ParticleEmitter.h; sourceTree = ""; }; - 420BBB621817416E00C7B720 /* lua_ParticleEmitterTextureBlending.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ParticleEmitterTextureBlending.cpp; sourceTree = ""; }; - 420BBB631817416E00C7B720 /* lua_ParticleEmitterTextureBlending.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ParticleEmitterTextureBlending.h; sourceTree = ""; }; - 420BBB641817416E00C7B720 /* lua_Pass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Pass.cpp; sourceTree = ""; }; - 420BBB651817416E00C7B720 /* lua_Pass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Pass.h; sourceTree = ""; }; - 420BBB661817416E00C7B720 /* lua_PhysicsCharacter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCharacter.cpp; sourceTree = ""; }; - 420BBB671817416E00C7B720 /* lua_PhysicsCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCharacter.h; sourceTree = ""; }; - 420BBB681817416E00C7B720 /* lua_PhysicsCollisionObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObject.cpp; sourceTree = ""; }; - 420BBB691817416E00C7B720 /* lua_PhysicsCollisionObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObject.h; sourceTree = ""; }; - 420BBB6A1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObjectCollisionListener.cpp; sourceTree = ""; }; - 420BBB6B1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObjectCollisionListener.h; sourceTree = ""; }; - 420BBB6C1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObjectCollisionListenerEventType.cpp; sourceTree = ""; }; - 420BBB6D1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObjectCollisionListenerEventType.h; sourceTree = ""; }; - 420BBB6E1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObjectCollisionPair.cpp; sourceTree = ""; }; - 420BBB6F1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObjectCollisionPair.h; sourceTree = ""; }; - 420BBB701817416E00C7B720 /* lua_PhysicsCollisionObjectType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObjectType.cpp; sourceTree = ""; }; - 420BBB711817416E00C7B720 /* lua_PhysicsCollisionObjectType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObjectType.h; sourceTree = ""; }; - 420BBB721817416E00C7B720 /* lua_PhysicsCollisionShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionShape.cpp; sourceTree = ""; }; - 420BBB731817416E00C7B720 /* lua_PhysicsCollisionShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionShape.h; sourceTree = ""; }; - 420BBB741817416E00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionShapeDefinition.cpp; sourceTree = ""; }; - 420BBB751817416E00C7B720 /* lua_PhysicsCollisionShapeDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionShapeDefinition.h; sourceTree = ""; }; - 420BBB761817416E00C7B720 /* lua_PhysicsCollisionShapeType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionShapeType.cpp; sourceTree = ""; }; - 420BBB771817416E00C7B720 /* lua_PhysicsCollisionShapeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionShapeType.h; sourceTree = ""; }; - 420BBB781817416E00C7B720 /* lua_PhysicsConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsConstraint.cpp; sourceTree = ""; }; - 420BBB791817416E00C7B720 /* lua_PhysicsConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsConstraint.h; sourceTree = ""; }; - 420BBB7A1817416E00C7B720 /* lua_PhysicsController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsController.cpp; sourceTree = ""; }; - 420BBB7B1817416E00C7B720 /* lua_PhysicsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsController.h; sourceTree = ""; }; - 420BBB7C1817416E00C7B720 /* lua_PhysicsControllerHitFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerHitFilter.cpp; sourceTree = ""; }; - 420BBB7D1817416E00C7B720 /* lua_PhysicsControllerHitFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerHitFilter.h; sourceTree = ""; }; - 420BBB7E1817416E00C7B720 /* lua_PhysicsControllerHitResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerHitResult.cpp; sourceTree = ""; }; - 420BBB7F1817416E00C7B720 /* lua_PhysicsControllerHitResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerHitResult.h; sourceTree = ""; }; - 420BBB801817416E00C7B720 /* lua_PhysicsControllerListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerListener.cpp; sourceTree = ""; }; - 420BBB811817416E00C7B720 /* lua_PhysicsControllerListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerListener.h; sourceTree = ""; }; - 420BBB821817416E00C7B720 /* lua_PhysicsControllerListenerEventType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerListenerEventType.cpp; sourceTree = ""; }; - 420BBB831817416E00C7B720 /* lua_PhysicsControllerListenerEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerListenerEventType.h; sourceTree = ""; }; - 420BBB841817416E00C7B720 /* lua_PhysicsFixedConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsFixedConstraint.cpp; sourceTree = ""; }; - 420BBB851817416E00C7B720 /* lua_PhysicsFixedConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsFixedConstraint.h; sourceTree = ""; }; - 420BBB861817416E00C7B720 /* lua_PhysicsGenericConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsGenericConstraint.cpp; sourceTree = ""; }; - 420BBB871817416E00C7B720 /* lua_PhysicsGenericConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsGenericConstraint.h; sourceTree = ""; }; - 420BBB881817416E00C7B720 /* lua_PhysicsGhostObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsGhostObject.cpp; sourceTree = ""; }; - 420BBB891817416E00C7B720 /* lua_PhysicsGhostObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsGhostObject.h; sourceTree = ""; }; - 420BBB8A1817416E00C7B720 /* lua_PhysicsHingeConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsHingeConstraint.cpp; sourceTree = ""; }; - 420BBB8B1817416E00C7B720 /* lua_PhysicsHingeConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsHingeConstraint.h; sourceTree = ""; }; - 420BBB8C1817416E00C7B720 /* lua_PhysicsRigidBody.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsRigidBody.cpp; sourceTree = ""; }; - 420BBB8D1817416E00C7B720 /* lua_PhysicsRigidBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsRigidBody.h; sourceTree = ""; }; - 420BBB8E1817416E00C7B720 /* lua_PhysicsRigidBodyParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsRigidBodyParameters.cpp; sourceTree = ""; }; - 420BBB8F1817416E00C7B720 /* lua_PhysicsRigidBodyParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsRigidBodyParameters.h; sourceTree = ""; }; - 420BBB901817416E00C7B720 /* lua_PhysicsSocketConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsSocketConstraint.cpp; sourceTree = ""; }; - 420BBB911817416E00C7B720 /* lua_PhysicsSocketConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsSocketConstraint.h; sourceTree = ""; }; - 420BBB921817416E00C7B720 /* lua_PhysicsSpringConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsSpringConstraint.cpp; sourceTree = ""; }; - 420BBB931817416E00C7B720 /* lua_PhysicsSpringConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsSpringConstraint.h; sourceTree = ""; }; - 420BBB941817416E00C7B720 /* lua_PhysicsVehicle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsVehicle.cpp; sourceTree = ""; }; - 420BBB951817416E00C7B720 /* lua_PhysicsVehicle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsVehicle.h; sourceTree = ""; }; - 420BBB961817416E00C7B720 /* lua_PhysicsVehicleWheel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsVehicleWheel.cpp; sourceTree = ""; }; - 420BBB971817416E00C7B720 /* lua_PhysicsVehicleWheel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsVehicleWheel.h; sourceTree = ""; }; - 420BBB981817416E00C7B720 /* lua_Plane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Plane.cpp; sourceTree = ""; }; - 420BBB991817416E00C7B720 /* lua_Plane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Plane.h; sourceTree = ""; }; - 420BBB9A1817416E00C7B720 /* lua_Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Platform.cpp; sourceTree = ""; }; - 420BBB9B1817416E00C7B720 /* lua_Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Platform.h; sourceTree = ""; }; - 420BBB9C1817416E00C7B720 /* lua_Properties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Properties.cpp; sourceTree = ""; }; - 420BBB9D1817416E00C7B720 /* lua_Properties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Properties.h; sourceTree = ""; }; - 420BBB9E1817416E00C7B720 /* lua_PropertiesType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PropertiesType.cpp; sourceTree = ""; }; - 420BBB9F1817416E00C7B720 /* lua_PropertiesType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PropertiesType.h; sourceTree = ""; }; - 420BBBA01817416E00C7B720 /* lua_Quaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Quaternion.cpp; sourceTree = ""; }; - 420BBBA11817416E00C7B720 /* lua_Quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Quaternion.h; sourceTree = ""; }; - 420BBBA21817416E00C7B720 /* lua_RadioButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RadioButton.cpp; sourceTree = ""; }; - 420BBBA31817416E00C7B720 /* lua_RadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RadioButton.h; sourceTree = ""; }; - 420BBBA41817416E00C7B720 /* lua_Ray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Ray.cpp; sourceTree = ""; }; - 420BBBA51817416E00C7B720 /* lua_Ray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Ray.h; sourceTree = ""; }; - 420BBBA61817416E00C7B720 /* lua_Rectangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Rectangle.cpp; sourceTree = ""; }; - 420BBBA71817416E00C7B720 /* lua_Rectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Rectangle.h; sourceTree = ""; }; - 420BBBA81817416E00C7B720 /* lua_Ref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Ref.cpp; sourceTree = ""; }; - 420BBBA91817416E00C7B720 /* lua_Ref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Ref.h; sourceTree = ""; }; - 420BBBAA1817416E00C7B720 /* lua_RenderState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderState.cpp; sourceTree = ""; }; - 420BBBAB1817416E00C7B720 /* lua_RenderState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderState.h; sourceTree = ""; }; - 420BBBAC1817416E00C7B720 /* lua_RenderStateAutoBinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateAutoBinding.cpp; sourceTree = ""; }; - 420BBBAD1817416E00C7B720 /* lua_RenderStateAutoBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateAutoBinding.h; sourceTree = ""; }; - 420BBBAE1817416E00C7B720 /* lua_RenderStateBlend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateBlend.cpp; sourceTree = ""; }; - 420BBBAF1817416E00C7B720 /* lua_RenderStateBlend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateBlend.h; sourceTree = ""; }; - 420BBBB01817416E00C7B720 /* lua_RenderStateCullFaceSide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateCullFaceSide.cpp; sourceTree = ""; }; - 420BBBB11817416E00C7B720 /* lua_RenderStateCullFaceSide.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateCullFaceSide.h; sourceTree = ""; }; - 420BBBB21817416E00C7B720 /* lua_RenderStateDepthFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateDepthFunction.cpp; sourceTree = ""; }; - 420BBBB31817416E00C7B720 /* lua_RenderStateDepthFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateDepthFunction.h; sourceTree = ""; }; - 420BBBB41817416E00C7B720 /* lua_RenderStateFrontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateFrontFace.cpp; sourceTree = ""; }; - 420BBBB51817416E00C7B720 /* lua_RenderStateFrontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateFrontFace.h; sourceTree = ""; }; - 420BBBB61817416E00C7B720 /* lua_RenderStateStateBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateStateBlock.cpp; sourceTree = ""; }; - 420BBBB71817416E00C7B720 /* lua_RenderStateStateBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateStateBlock.h; sourceTree = ""; }; - 420BBBB81817416E00C7B720 /* lua_RenderStateStencilFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateStencilFunction.cpp; sourceTree = ""; }; - 420BBBB91817416E00C7B720 /* lua_RenderStateStencilFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateStencilFunction.h; sourceTree = ""; }; - 420BBBBA1817416E00C7B720 /* lua_RenderStateStencilOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateStencilOperation.cpp; sourceTree = ""; }; - 420BBBBB1817416E00C7B720 /* lua_RenderStateStencilOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateStencilOperation.h; sourceTree = ""; }; - 420BBBBC1817416E00C7B720 /* lua_RenderTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderTarget.cpp; sourceTree = ""; }; - 420BBBBD1817416E00C7B720 /* lua_RenderTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderTarget.h; sourceTree = ""; }; - 420BBBBE1817416E00C7B720 /* lua_Scene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Scene.cpp; sourceTree = ""; }; - 420BBBBF1817416E00C7B720 /* lua_Scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Scene.h; sourceTree = ""; }; - 420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScreenDisplayer.cpp; sourceTree = ""; }; - 420BBBC71817416E00C7B720 /* lua_ScreenDisplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScreenDisplayer.h; sourceTree = ""; }; - 420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptController.cpp; sourceTree = ""; }; - 420BBBC91817416E00C7B720 /* lua_ScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScriptController.h; sourceTree = ""; }; - 420BBBCA1817416E00C7B720 /* lua_ScriptTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptTarget.cpp; sourceTree = ""; }; - 420BBBCB1817416E00C7B720 /* lua_ScriptTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScriptTarget.h; sourceTree = ""; }; - 420BBBCC1817416E00C7B720 /* lua_Slider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Slider.cpp; sourceTree = ""; }; - 420BBBCD1817416E00C7B720 /* lua_Slider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Slider.h; sourceTree = ""; }; - 420BBBCE1817416E00C7B720 /* lua_SpriteBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_SpriteBatch.cpp; sourceTree = ""; }; - 420BBBCF1817416E00C7B720 /* lua_SpriteBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_SpriteBatch.h; sourceTree = ""; }; - 420BBBD01817416E00C7B720 /* lua_Technique.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Technique.cpp; sourceTree = ""; }; - 420BBBD11817416E00C7B720 /* lua_Technique.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Technique.h; sourceTree = ""; }; - 420BBBD21817416E00C7B720 /* lua_Terrain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Terrain.cpp; sourceTree = ""; }; - 420BBBD31817416E00C7B720 /* lua_Terrain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Terrain.h; sourceTree = ""; }; - 420BBBD41817416E00C7B720 /* lua_TerrainFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TerrainFlags.cpp; sourceTree = ""; }; - 420BBBD51817416E00C7B720 /* lua_TerrainFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TerrainFlags.h; sourceTree = ""; }; - 420BBBD81817416E00C7B720 /* lua_TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextBox.cpp; sourceTree = ""; }; - 420BBBD91817416E00C7B720 /* lua_TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextBox.h; sourceTree = ""; }; - 420BBBDA1817416E00C7B720 /* lua_TextBoxInputMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextBoxInputMode.cpp; sourceTree = ""; }; - 420BBBDB1817416E00C7B720 /* lua_TextBoxInputMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextBoxInputMode.h; sourceTree = ""; }; - 420BBBDC1817416E00C7B720 /* lua_Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Texture.cpp; sourceTree = ""; }; - 420BBBDD1817416E00C7B720 /* lua_Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Texture.h; sourceTree = ""; }; - 420BBBDE1817416E00C7B720 /* lua_TextureFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextureFilter.cpp; sourceTree = ""; }; - 420BBBDF1817416E00C7B720 /* lua_TextureFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextureFilter.h; sourceTree = ""; }; - 420BBBE01817416E00C7B720 /* lua_TextureFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextureFormat.cpp; sourceTree = ""; }; - 420BBBE11817416E00C7B720 /* lua_TextureFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextureFormat.h; sourceTree = ""; }; - 420BBBE21817416E00C7B720 /* lua_TextureSampler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextureSampler.cpp; sourceTree = ""; }; - 420BBBE31817416E00C7B720 /* lua_TextureSampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextureSampler.h; sourceTree = ""; }; - 420BBBE41817416E00C7B720 /* lua_TextureWrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextureWrap.cpp; sourceTree = ""; }; - 420BBBE51817416F00C7B720 /* lua_TextureWrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextureWrap.h; sourceTree = ""; }; - 420BBBE61817416F00C7B720 /* lua_Theme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Theme.cpp; sourceTree = ""; }; - 420BBBE71817416F00C7B720 /* lua_Theme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Theme.h; sourceTree = ""; }; - 420BBBE81817416F00C7B720 /* lua_ThemeSideRegions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeSideRegions.cpp; sourceTree = ""; }; - 420BBBE91817416F00C7B720 /* lua_ThemeSideRegions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeSideRegions.h; sourceTree = ""; }; - 420BBBEA1817416F00C7B720 /* lua_ThemeStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeStyle.cpp; sourceTree = ""; }; - 420BBBEB1817416F00C7B720 /* lua_ThemeStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeStyle.h; sourceTree = ""; }; - 420BBBEC1817416F00C7B720 /* lua_ThemeThemeImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeThemeImage.cpp; sourceTree = ""; }; - 420BBBED1817416F00C7B720 /* lua_ThemeThemeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeThemeImage.h; sourceTree = ""; }; - 420BBBEE1817416F00C7B720 /* lua_ThemeUVs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeUVs.cpp; sourceTree = ""; }; - 420BBBEF1817416F00C7B720 /* lua_ThemeUVs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeUVs.h; sourceTree = ""; }; - 420BBBF01817416F00C7B720 /* lua_Touch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Touch.cpp; sourceTree = ""; }; - 420BBBF11817416F00C7B720 /* lua_Touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Touch.h; sourceTree = ""; }; - 420BBBF21817416F00C7B720 /* lua_TouchTouchEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TouchTouchEvent.cpp; sourceTree = ""; }; - 420BBBF31817416F00C7B720 /* lua_TouchTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TouchTouchEvent.h; sourceTree = ""; }; - 420BBBF41817416F00C7B720 /* lua_Transform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Transform.cpp; sourceTree = ""; }; - 420BBBF51817416F00C7B720 /* lua_Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Transform.h; sourceTree = ""; }; - 420BBBF61817416F00C7B720 /* lua_TransformListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TransformListener.cpp; sourceTree = ""; }; - 420BBBF71817416F00C7B720 /* lua_TransformListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TransformListener.h; sourceTree = ""; }; - 420BBBF81817416F00C7B720 /* lua_Uniform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Uniform.cpp; sourceTree = ""; }; - 420BBBF91817416F00C7B720 /* lua_Uniform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Uniform.h; sourceTree = ""; }; - 420BBBFA1817416F00C7B720 /* lua_Vector2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Vector2.cpp; sourceTree = ""; }; - 420BBBFB1817416F00C7B720 /* lua_Vector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Vector2.h; sourceTree = ""; }; - 420BBBFC1817416F00C7B720 /* lua_Vector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Vector3.cpp; sourceTree = ""; }; - 420BBBFD1817416F00C7B720 /* lua_Vector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Vector3.h; sourceTree = ""; }; - 420BBBFE1817416F00C7B720 /* lua_Vector4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Vector4.cpp; sourceTree = ""; }; - 420BBBFF1817416F00C7B720 /* lua_Vector4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Vector4.h; sourceTree = ""; }; - 420BBC001817416F00C7B720 /* lua_VertexAttributeBinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexAttributeBinding.cpp; sourceTree = ""; }; - 420BBC011817416F00C7B720 /* lua_VertexAttributeBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexAttributeBinding.h; sourceTree = ""; }; - 420BBC021817416F00C7B720 /* lua_VertexFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexFormat.cpp; sourceTree = ""; }; - 420BBC031817416F00C7B720 /* lua_VertexFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexFormat.h; sourceTree = ""; }; - 420BBC041817416F00C7B720 /* lua_VertexFormatElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexFormatElement.cpp; sourceTree = ""; }; - 420BBC051817416F00C7B720 /* lua_VertexFormatElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexFormatElement.h; sourceTree = ""; }; - 420BBC061817416F00C7B720 /* lua_VertexFormatUsage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexFormatUsage.cpp; sourceTree = ""; }; - 420BBC071817416F00C7B720 /* lua_VertexFormatUsage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexFormatUsage.h; sourceTree = ""; }; - 420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VerticalLayout.cpp; sourceTree = ""; }; - 420BBC091817416F00C7B720 /* lua_VerticalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VerticalLayout.h; sourceTree = ""; }; - 42252DC81828145B00EE234B /* lua_CameraListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CameraListener.cpp; sourceTree = ""; }; - 42252DC91828145B00EE234B /* lua_CameraListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CameraListener.h; sourceTree = ""; }; - 42252DCA1828145B00EE234B /* lua_TerrainPatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TerrainPatch.cpp; sourceTree = ""; }; - 42252DCB1828145B00EE234B /* lua_TerrainPatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TerrainPatch.h; sourceTree = ""; }; 4234D99A14686C52003031B3 /* libgameplay.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgameplay.a; sourceTree = BUILT_PRODUCTS_DIR; }; 4234D99D14686C52003031B3 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 424F31F41A60C28600395438 /* lua_AbsoluteLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AbsoluteLayout.cpp; sourceTree = ""; }; + 424F31F51A60C28600395438 /* lua_AbsoluteLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AbsoluteLayout.h; sourceTree = ""; }; + 424F31F61A60C28600395438 /* lua_AIAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIAgent.cpp; sourceTree = ""; }; + 424F31F71A60C28600395438 /* lua_AIAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIAgent.h; sourceTree = ""; }; + 424F31F81A60C28600395438 /* lua_AIAgentListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIAgentListener.cpp; sourceTree = ""; }; + 424F31F91A60C28600395438 /* lua_AIAgentListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIAgentListener.h; sourceTree = ""; }; + 424F31FA1A60C28600395438 /* lua_AIController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIController.cpp; sourceTree = ""; }; + 424F31FB1A60C28600395438 /* lua_AIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIController.h; sourceTree = ""; }; + 424F31FC1A60C28600395438 /* lua_AIMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIMessage.cpp; sourceTree = ""; }; + 424F31FD1A60C28600395438 /* lua_AIMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIMessage.h; sourceTree = ""; }; + 424F31FE1A60C28600395438 /* lua_AIState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIState.cpp; sourceTree = ""; }; + 424F31FF1A60C28600395438 /* lua_AIState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIState.h; sourceTree = ""; }; + 424F32001A60C28600395438 /* lua_AIStateListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIStateListener.cpp; sourceTree = ""; }; + 424F32011A60C28600395438 /* lua_AIStateListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIStateListener.h; sourceTree = ""; }; + 424F32021A60C28600395438 /* lua_AIStateMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AIStateMachine.cpp; sourceTree = ""; }; + 424F32031A60C28600395438 /* lua_AIStateMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AIStateMachine.h; sourceTree = ""; }; + 424F32041A60C28600395438 /* lua_all_bindings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_all_bindings.cpp; sourceTree = ""; }; + 424F32051A60C28600395438 /* lua_all_bindings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_all_bindings.h; sourceTree = ""; }; + 424F32061A60C28600395438 /* lua_Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Animation.cpp; sourceTree = ""; }; + 424F32071A60C28600395438 /* lua_Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Animation.h; sourceTree = ""; }; + 424F32081A60C28600395438 /* lua_AnimationClip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationClip.cpp; sourceTree = ""; }; + 424F32091A60C28600395438 /* lua_AnimationClip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationClip.h; sourceTree = ""; }; + 424F320A1A60C28600395438 /* lua_AnimationClipListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationClipListener.cpp; sourceTree = ""; }; + 424F320B1A60C28600395438 /* lua_AnimationClipListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationClipListener.h; sourceTree = ""; }; + 424F320C1A60C28600395438 /* lua_AnimationController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationController.cpp; sourceTree = ""; }; + 424F320D1A60C28600395438 /* lua_AnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationController.h; sourceTree = ""; }; + 424F320E1A60C28600395438 /* lua_AnimationTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationTarget.cpp; sourceTree = ""; }; + 424F320F1A60C28600395438 /* lua_AnimationTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationTarget.h; sourceTree = ""; }; + 424F32101A60C28600395438 /* lua_AnimationValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AnimationValue.cpp; sourceTree = ""; }; + 424F32111A60C28600395438 /* lua_AnimationValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AnimationValue.h; sourceTree = ""; }; + 424F32121A60C28600395438 /* lua_AudioBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioBuffer.cpp; sourceTree = ""; }; + 424F32131A60C28600395438 /* lua_AudioBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioBuffer.h; sourceTree = ""; }; + 424F32141A60C28600395438 /* lua_AudioController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioController.cpp; sourceTree = ""; }; + 424F32151A60C28600395438 /* lua_AudioController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioController.h; sourceTree = ""; }; + 424F32161A60C28600395438 /* lua_AudioListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioListener.cpp; sourceTree = ""; }; + 424F32171A60C28600395438 /* lua_AudioListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioListener.h; sourceTree = ""; }; + 424F32181A60C28600395438 /* lua_AudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_AudioSource.cpp; sourceTree = ""; }; + 424F32191A60C28600395438 /* lua_AudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_AudioSource.h; sourceTree = ""; }; + 424F321A1A60C28600395438 /* lua_BoundingBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_BoundingBox.cpp; sourceTree = ""; }; + 424F321B1A60C28600395438 /* lua_BoundingBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_BoundingBox.h; sourceTree = ""; }; + 424F321C1A60C28600395438 /* lua_BoundingSphere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_BoundingSphere.cpp; sourceTree = ""; }; + 424F321D1A60C28600395438 /* lua_BoundingSphere.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_BoundingSphere.h; sourceTree = ""; }; + 424F321E1A60C28600395438 /* lua_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Bundle.cpp; sourceTree = ""; }; + 424F321F1A60C28600395438 /* lua_Bundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Bundle.h; sourceTree = ""; }; + 424F32201A60C28600395438 /* lua_Button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Button.cpp; sourceTree = ""; }; + 424F32211A60C28600395438 /* lua_Button.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Button.h; sourceTree = ""; }; + 424F32221A60C28600395438 /* lua_Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Camera.cpp; sourceTree = ""; }; + 424F32231A60C28600395438 /* lua_Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Camera.h; sourceTree = ""; }; + 424F32241A60C28600395438 /* lua_CameraListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CameraListener.cpp; sourceTree = ""; }; + 424F32251A60C28600395438 /* lua_CameraListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CameraListener.h; sourceTree = ""; }; + 424F32261A60C28600395438 /* lua_CheckBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CheckBox.cpp; sourceTree = ""; }; + 424F32271A60C28600395438 /* lua_CheckBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CheckBox.h; sourceTree = ""; }; + 424F32281A60C28600395438 /* lua_Container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Container.cpp; sourceTree = ""; }; + 424F32291A60C28600395438 /* lua_Container.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Container.h; sourceTree = ""; }; + 424F322A1A60C28600395438 /* lua_Control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Control.cpp; sourceTree = ""; }; + 424F322B1A60C28600395438 /* lua_Control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Control.h; sourceTree = ""; }; + 424F322C1A60C28600395438 /* lua_ControlListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ControlListener.cpp; sourceTree = ""; }; + 424F322D1A60C28600395438 /* lua_ControlListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ControlListener.h; sourceTree = ""; }; + 424F322E1A60C28600395438 /* lua_Curve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Curve.cpp; sourceTree = ""; }; + 424F322F1A60C28600395438 /* lua_Curve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Curve.h; sourceTree = ""; }; + 424F32301A60C28600395438 /* lua_DepthStencilTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_DepthStencilTarget.cpp; sourceTree = ""; }; + 424F32311A60C28600395438 /* lua_DepthStencilTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_DepthStencilTarget.h; sourceTree = ""; }; + 424F32321A60C28600395438 /* lua_Drawable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Drawable.cpp; sourceTree = ""; }; + 424F32331A60C28600395438 /* lua_Drawable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Drawable.h; sourceTree = ""; }; + 424F32341A60C28600395438 /* lua_Effect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Effect.cpp; sourceTree = ""; }; + 424F32351A60C28600395438 /* lua_Effect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Effect.h; sourceTree = ""; }; + 424F32361A60C28600395438 /* lua_FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FileSystem.cpp; sourceTree = ""; }; + 424F32371A60C28600395438 /* lua_FileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FileSystem.h; sourceTree = ""; }; + 424F32381A60C28600395438 /* lua_FlowLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FlowLayout.cpp; sourceTree = ""; }; + 424F32391A60C28600395438 /* lua_FlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FlowLayout.h; sourceTree = ""; }; + 424F323A1A60C28600395438 /* lua_Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Font.cpp; sourceTree = ""; }; + 424F323B1A60C28600395438 /* lua_Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Font.h; sourceTree = ""; }; + 424F323C1A60C28600395438 /* lua_Form.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Form.cpp; sourceTree = ""; }; + 424F323D1A60C28600395438 /* lua_Form.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Form.h; sourceTree = ""; }; + 424F323E1A60C28600395438 /* lua_FrameBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_FrameBuffer.cpp; sourceTree = ""; }; + 424F323F1A60C28600395438 /* lua_FrameBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_FrameBuffer.h; sourceTree = ""; }; + 424F32401A60C28600395438 /* lua_Frustum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Frustum.cpp; sourceTree = ""; }; + 424F32411A60C28600395438 /* lua_Frustum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Frustum.h; sourceTree = ""; }; + 424F32421A60C28600395438 /* lua_Game.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Game.cpp; sourceTree = ""; }; + 424F32431A60C28600395438 /* lua_Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Game.h; sourceTree = ""; }; + 424F32441A60C28600395438 /* lua_Gamepad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Gamepad.cpp; sourceTree = ""; }; + 424F32451A60C28600395438 /* lua_Gamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Gamepad.h; sourceTree = ""; }; + 424F32461A60C28600395438 /* lua_Gesture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Gesture.cpp; sourceTree = ""; }; + 424F32471A60C28600395438 /* lua_Gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Gesture.h; sourceTree = ""; }; + 424F32481A60C28600395438 /* lua_Global.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Global.cpp; sourceTree = ""; }; + 424F32491A60C28600395438 /* lua_Global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Global.h; sourceTree = ""; }; + 424F324A1A60C28600395438 /* lua_HeightField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_HeightField.cpp; sourceTree = ""; }; + 424F324B1A60C28600395438 /* lua_HeightField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_HeightField.h; sourceTree = ""; }; + 424F324C1A60C28600395438 /* lua_Image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Image.cpp; sourceTree = ""; }; + 424F324D1A60C28600395438 /* lua_Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Image.h; sourceTree = ""; }; + 424F324E1A60C28600395438 /* lua_ImageControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ImageControl.cpp; sourceTree = ""; }; + 424F324F1A60C28600395438 /* lua_ImageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ImageControl.h; sourceTree = ""; }; + 424F32501A60C28600395438 /* lua_Joint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Joint.cpp; sourceTree = ""; }; + 424F32511A60C28600395438 /* lua_Joint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Joint.h; sourceTree = ""; }; + 424F32521A60C28600395438 /* lua_JoystickControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_JoystickControl.cpp; sourceTree = ""; }; + 424F32531A60C28600395438 /* lua_JoystickControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_JoystickControl.h; sourceTree = ""; }; + 424F32541A60C28600395438 /* lua_Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Keyboard.cpp; sourceTree = ""; }; + 424F32551A60C28600395438 /* lua_Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Keyboard.h; sourceTree = ""; }; + 424F32561A60C28600395438 /* lua_Label.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Label.cpp; sourceTree = ""; }; + 424F32571A60C28600395438 /* lua_Label.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Label.h; sourceTree = ""; }; + 424F32581A60C28600395438 /* lua_Layout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Layout.cpp; sourceTree = ""; }; + 424F32591A60C28600395438 /* lua_Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Layout.h; sourceTree = ""; }; + 424F325A1A60C28600395438 /* lua_Light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Light.cpp; sourceTree = ""; }; + 424F325B1A60C28600395438 /* lua_Light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Light.h; sourceTree = ""; }; + 424F325C1A60C28600395438 /* lua_Logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Logger.cpp; sourceTree = ""; }; + 424F325D1A60C28600395438 /* lua_Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Logger.h; sourceTree = ""; }; + 424F325E1A60C28600395438 /* lua_Material.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Material.cpp; sourceTree = ""; }; + 424F325F1A60C28600395438 /* lua_Material.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Material.h; sourceTree = ""; }; + 424F32601A60C28600395438 /* lua_MaterialParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MaterialParameter.cpp; sourceTree = ""; }; + 424F32611A60C28600395438 /* lua_MaterialParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MaterialParameter.h; sourceTree = ""; }; + 424F32621A60C28600395438 /* lua_MathUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MathUtil.cpp; sourceTree = ""; }; + 424F32631A60C28600395438 /* lua_MathUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MathUtil.h; sourceTree = ""; }; + 424F32641A60C28600395438 /* lua_Matrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Matrix.cpp; sourceTree = ""; }; + 424F32651A60C28600395438 /* lua_Matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Matrix.h; sourceTree = ""; }; + 424F32661A60C28600395438 /* lua_Mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Mesh.cpp; sourceTree = ""; }; + 424F32671A60C28600395438 /* lua_Mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Mesh.h; sourceTree = ""; }; + 424F32681A60C28600395438 /* lua_MeshBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshBatch.cpp; sourceTree = ""; }; + 424F32691A60C28600395438 /* lua_MeshBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshBatch.h; sourceTree = ""; }; + 424F326A1A60C28600395438 /* lua_MeshPart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshPart.cpp; sourceTree = ""; }; + 424F326B1A60C28600395438 /* lua_MeshPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshPart.h; sourceTree = ""; }; + 424F326C1A60C28600395438 /* lua_MeshSkin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_MeshSkin.cpp; sourceTree = ""; }; + 424F326D1A60C28600395438 /* lua_MeshSkin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_MeshSkin.h; sourceTree = ""; }; + 424F326E1A60C28600395438 /* lua_Model.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Model.cpp; sourceTree = ""; }; + 424F326F1A60C28600395438 /* lua_Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Model.h; sourceTree = ""; }; + 424F32701A60C28600395438 /* lua_Mouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Mouse.cpp; sourceTree = ""; }; + 424F32711A60C28600395438 /* lua_Mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Mouse.h; sourceTree = ""; }; + 424F32721A60C28600395438 /* lua_Node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Node.cpp; sourceTree = ""; }; + 424F32731A60C28600395438 /* lua_Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Node.h; sourceTree = ""; }; + 424F32741A60C28600395438 /* lua_NodeCloneContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_NodeCloneContext.cpp; sourceTree = ""; }; + 424F32751A60C28600395438 /* lua_NodeCloneContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_NodeCloneContext.h; sourceTree = ""; }; + 424F32761A60C28600395438 /* lua_ParticleEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ParticleEmitter.cpp; sourceTree = ""; }; + 424F32771A60C28600395438 /* lua_ParticleEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ParticleEmitter.h; sourceTree = ""; }; + 424F32781A60C28600395438 /* lua_Pass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Pass.cpp; sourceTree = ""; }; + 424F32791A60C28600395438 /* lua_Pass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Pass.h; sourceTree = ""; }; + 424F327A1A60C28600395438 /* lua_PhysicsCharacter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCharacter.cpp; sourceTree = ""; }; + 424F327B1A60C28600395438 /* lua_PhysicsCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCharacter.h; sourceTree = ""; }; + 424F327C1A60C28600395438 /* lua_PhysicsCollisionObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObject.cpp; sourceTree = ""; }; + 424F327D1A60C28600395438 /* lua_PhysicsCollisionObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObject.h; sourceTree = ""; }; + 424F327E1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObjectCollisionListener.cpp; sourceTree = ""; }; + 424F327F1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObjectCollisionListener.h; sourceTree = ""; }; + 424F32801A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionObjectCollisionPair.cpp; sourceTree = ""; }; + 424F32811A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionObjectCollisionPair.h; sourceTree = ""; }; + 424F32821A60C28600395438 /* lua_PhysicsCollisionShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionShape.cpp; sourceTree = ""; }; + 424F32831A60C28600395438 /* lua_PhysicsCollisionShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionShape.h; sourceTree = ""; }; + 424F32841A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsCollisionShapeDefinition.cpp; sourceTree = ""; }; + 424F32851A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsCollisionShapeDefinition.h; sourceTree = ""; }; + 424F32861A60C28600395438 /* lua_PhysicsConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsConstraint.cpp; sourceTree = ""; }; + 424F32871A60C28600395438 /* lua_PhysicsConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsConstraint.h; sourceTree = ""; }; + 424F32881A60C28600395438 /* lua_PhysicsController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsController.cpp; sourceTree = ""; }; + 424F32891A60C28600395438 /* lua_PhysicsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsController.h; sourceTree = ""; }; + 424F328A1A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerHitFilter.cpp; sourceTree = ""; }; + 424F328B1A60C28600395438 /* lua_PhysicsControllerHitFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerHitFilter.h; sourceTree = ""; }; + 424F328C1A60C28600395438 /* lua_PhysicsControllerHitResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerHitResult.cpp; sourceTree = ""; }; + 424F328D1A60C28600395438 /* lua_PhysicsControllerHitResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerHitResult.h; sourceTree = ""; }; + 424F328E1A60C28600395438 /* lua_PhysicsControllerListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsControllerListener.cpp; sourceTree = ""; }; + 424F328F1A60C28600395438 /* lua_PhysicsControllerListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsControllerListener.h; sourceTree = ""; }; + 424F32901A60C28600395438 /* lua_PhysicsFixedConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsFixedConstraint.cpp; sourceTree = ""; }; + 424F32911A60C28600395438 /* lua_PhysicsFixedConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsFixedConstraint.h; sourceTree = ""; }; + 424F32921A60C28600395438 /* lua_PhysicsGenericConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsGenericConstraint.cpp; sourceTree = ""; }; + 424F32931A60C28600395438 /* lua_PhysicsGenericConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsGenericConstraint.h; sourceTree = ""; }; + 424F32941A60C28600395438 /* lua_PhysicsGhostObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsGhostObject.cpp; sourceTree = ""; }; + 424F32951A60C28600395438 /* lua_PhysicsGhostObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsGhostObject.h; sourceTree = ""; }; + 424F32961A60C28600395438 /* lua_PhysicsHingeConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsHingeConstraint.cpp; sourceTree = ""; }; + 424F32971A60C28600395438 /* lua_PhysicsHingeConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsHingeConstraint.h; sourceTree = ""; }; + 424F32981A60C28600395438 /* lua_PhysicsRigidBody.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsRigidBody.cpp; sourceTree = ""; }; + 424F32991A60C28600395438 /* lua_PhysicsRigidBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsRigidBody.h; sourceTree = ""; }; + 424F329A1A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsRigidBodyParameters.cpp; sourceTree = ""; }; + 424F329B1A60C28600395438 /* lua_PhysicsRigidBodyParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsRigidBodyParameters.h; sourceTree = ""; }; + 424F329C1A60C28600395438 /* lua_PhysicsSocketConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsSocketConstraint.cpp; sourceTree = ""; }; + 424F329D1A60C28600395438 /* lua_PhysicsSocketConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsSocketConstraint.h; sourceTree = ""; }; + 424F329E1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsSpringConstraint.cpp; sourceTree = ""; }; + 424F329F1A60C28600395438 /* lua_PhysicsSpringConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsSpringConstraint.h; sourceTree = ""; }; + 424F32A01A60C28600395438 /* lua_PhysicsVehicle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsVehicle.cpp; sourceTree = ""; }; + 424F32A11A60C28600395438 /* lua_PhysicsVehicle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsVehicle.h; sourceTree = ""; }; + 424F32A21A60C28600395438 /* lua_PhysicsVehicleWheel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_PhysicsVehicleWheel.cpp; sourceTree = ""; }; + 424F32A31A60C28600395438 /* lua_PhysicsVehicleWheel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_PhysicsVehicleWheel.h; sourceTree = ""; }; + 424F32A41A60C28600395438 /* lua_Plane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Plane.cpp; sourceTree = ""; }; + 424F32A51A60C28600395438 /* lua_Plane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Plane.h; sourceTree = ""; }; + 424F32A61A60C28600395438 /* lua_Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Platform.cpp; sourceTree = ""; }; + 424F32A71A60C28600395438 /* lua_Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Platform.h; sourceTree = ""; }; + 424F32A81A60C28600395438 /* lua_Properties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Properties.cpp; sourceTree = ""; }; + 424F32A91A60C28600395438 /* lua_Properties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Properties.h; sourceTree = ""; }; + 424F32AA1A60C28600395438 /* lua_Quaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Quaternion.cpp; sourceTree = ""; }; + 424F32AB1A60C28600395438 /* lua_Quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Quaternion.h; sourceTree = ""; }; + 424F32AC1A60C28600395438 /* lua_RadioButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RadioButton.cpp; sourceTree = ""; }; + 424F32AD1A60C28600395438 /* lua_RadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RadioButton.h; sourceTree = ""; }; + 424F32AE1A60C28600395438 /* lua_Ray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Ray.cpp; sourceTree = ""; }; + 424F32AF1A60C28600395438 /* lua_Ray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Ray.h; sourceTree = ""; }; + 424F32B01A60C28600395438 /* lua_Rectangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Rectangle.cpp; sourceTree = ""; }; + 424F32B11A60C28600395438 /* lua_Rectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Rectangle.h; sourceTree = ""; }; + 424F32B21A60C28600395438 /* lua_Ref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Ref.cpp; sourceTree = ""; }; + 424F32B31A60C28600395438 /* lua_Ref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Ref.h; sourceTree = ""; }; + 424F32B41A60C28600395438 /* lua_RenderState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderState.cpp; sourceTree = ""; }; + 424F32B51A60C28600395438 /* lua_RenderState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderState.h; sourceTree = ""; }; + 424F32B61A60C28600395438 /* lua_RenderStateStateBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateStateBlock.cpp; sourceTree = ""; }; + 424F32B71A60C28600395438 /* lua_RenderStateStateBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateStateBlock.h; sourceTree = ""; }; + 424F32B81A60C28600395438 /* lua_RenderTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderTarget.cpp; sourceTree = ""; }; + 424F32B91A60C28600395438 /* lua_RenderTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderTarget.h; sourceTree = ""; }; + 424F32BA1A60C28600395438 /* lua_Scene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Scene.cpp; sourceTree = ""; }; + 424F32BB1A60C28600395438 /* lua_Scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Scene.h; sourceTree = ""; }; + 424F32BC1A60C28600395438 /* lua_ScreenDisplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScreenDisplayer.cpp; sourceTree = ""; }; + 424F32BD1A60C28600395438 /* lua_ScreenDisplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScreenDisplayer.h; sourceTree = ""; }; + 424F32BE1A60C28600395438 /* lua_Script.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Script.cpp; sourceTree = ""; }; + 424F32BF1A60C28600395438 /* lua_Script.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Script.h; sourceTree = ""; }; + 424F32C01A60C28600395438 /* lua_ScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptController.cpp; sourceTree = ""; }; + 424F32C11A60C28600395438 /* lua_ScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScriptController.h; sourceTree = ""; }; + 424F32C21A60C28600395438 /* lua_ScriptTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptTarget.cpp; sourceTree = ""; }; + 424F32C31A60C28600395438 /* lua_ScriptTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScriptTarget.h; sourceTree = ""; }; + 424F32C41A60C28600395438 /* lua_ScriptTargetEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptTargetEvent.cpp; sourceTree = ""; }; + 424F32C51A60C28600395438 /* lua_ScriptTargetEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScriptTargetEvent.h; sourceTree = ""; }; + 424F32C61A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptTargetEventRegistry.cpp; sourceTree = ""; }; + 424F32C71A60C28600395438 /* lua_ScriptTargetEventRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScriptTargetEventRegistry.h; sourceTree = ""; }; + 424F32C81A60C28600395438 /* lua_Slider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Slider.cpp; sourceTree = ""; }; + 424F32C91A60C28600395438 /* lua_Slider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Slider.h; sourceTree = ""; }; + 424F32CA1A60C28600395438 /* lua_Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Sprite.cpp; sourceTree = ""; }; + 424F32CB1A60C28600395438 /* lua_Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Sprite.h; sourceTree = ""; }; + 424F32CC1A60C28600395438 /* lua_SpriteBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_SpriteBatch.cpp; sourceTree = ""; }; + 424F32CD1A60C28600395438 /* lua_SpriteBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_SpriteBatch.h; sourceTree = ""; }; + 424F32CE1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_SpriteBatchSpriteVertex.cpp; sourceTree = ""; }; + 424F32CF1A60C28600395438 /* lua_SpriteBatchSpriteVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_SpriteBatchSpriteVertex.h; sourceTree = ""; }; + 424F32D01A60C28600395438 /* lua_Technique.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Technique.cpp; sourceTree = ""; }; + 424F32D11A60C28600395438 /* lua_Technique.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Technique.h; sourceTree = ""; }; + 424F32D21A60C28600395438 /* lua_Terrain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Terrain.cpp; sourceTree = ""; }; + 424F32D31A60C28600395438 /* lua_Terrain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Terrain.h; sourceTree = ""; }; + 424F32D41A60C28600395438 /* lua_TerrainPatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TerrainPatch.cpp; sourceTree = ""; }; + 424F32D51A60C28600395438 /* lua_TerrainPatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TerrainPatch.h; sourceTree = ""; }; + 424F32D61A60C28600395438 /* lua_Text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Text.cpp; sourceTree = ""; }; + 424F32D71A60C28600395438 /* lua_Text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Text.h; sourceTree = ""; }; + 424F32D81A60C28600395438 /* lua_TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextBox.cpp; sourceTree = ""; }; + 424F32D91A60C28600395438 /* lua_TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextBox.h; sourceTree = ""; }; + 424F32DA1A60C28600395438 /* lua_Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Texture.cpp; sourceTree = ""; }; + 424F32DB1A60C28600395438 /* lua_Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Texture.h; sourceTree = ""; }; + 424F32DC1A60C28600395438 /* lua_TextureSampler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextureSampler.cpp; sourceTree = ""; }; + 424F32DD1A60C28600395438 /* lua_TextureSampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TextureSampler.h; sourceTree = ""; }; + 424F32DE1A60C28600395438 /* lua_Theme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Theme.cpp; sourceTree = ""; }; + 424F32DF1A60C28600395438 /* lua_Theme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Theme.h; sourceTree = ""; }; + 424F32E01A60C28600395438 /* lua_ThemeSideRegions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeSideRegions.cpp; sourceTree = ""; }; + 424F32E11A60C28600395438 /* lua_ThemeSideRegions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeSideRegions.h; sourceTree = ""; }; + 424F32E21A60C28600395438 /* lua_ThemeStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeStyle.cpp; sourceTree = ""; }; + 424F32E31A60C28600395438 /* lua_ThemeStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeStyle.h; sourceTree = ""; }; + 424F32E41A60C28600395438 /* lua_ThemeThemeImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeThemeImage.cpp; sourceTree = ""; }; + 424F32E51A60C28600395438 /* lua_ThemeThemeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeThemeImage.h; sourceTree = ""; }; + 424F32E61A60C28600395438 /* lua_ThemeUVs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ThemeUVs.cpp; sourceTree = ""; }; + 424F32E71A60C28600395438 /* lua_ThemeUVs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ThemeUVs.h; sourceTree = ""; }; + 424F32E81A60C28600395438 /* lua_TileSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TileSet.cpp; sourceTree = ""; }; + 424F32E91A60C28600395438 /* lua_TileSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TileSet.h; sourceTree = ""; }; + 424F32EA1A60C28600395438 /* lua_Touch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Touch.cpp; sourceTree = ""; }; + 424F32EB1A60C28600395438 /* lua_Touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Touch.h; sourceTree = ""; }; + 424F32EC1A60C28600395438 /* lua_Transform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Transform.cpp; sourceTree = ""; }; + 424F32ED1A60C28600395438 /* lua_Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Transform.h; sourceTree = ""; }; + 424F32EE1A60C28600395438 /* lua_TransformListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TransformListener.cpp; sourceTree = ""; }; + 424F32EF1A60C28600395438 /* lua_TransformListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_TransformListener.h; sourceTree = ""; }; + 424F32F01A60C28600395438 /* lua_Uniform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Uniform.cpp; sourceTree = ""; }; + 424F32F11A60C28600395438 /* lua_Uniform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Uniform.h; sourceTree = ""; }; + 424F32F21A60C28600395438 /* lua_Vector2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Vector2.cpp; sourceTree = ""; }; + 424F32F31A60C28600395438 /* lua_Vector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Vector2.h; sourceTree = ""; }; + 424F32F41A60C28600395438 /* lua_Vector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Vector3.cpp; sourceTree = ""; }; + 424F32F51A60C28600395438 /* lua_Vector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Vector3.h; sourceTree = ""; }; + 424F32F61A60C28600395438 /* lua_Vector4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Vector4.cpp; sourceTree = ""; }; + 424F32F71A60C28600395438 /* lua_Vector4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Vector4.h; sourceTree = ""; }; + 424F32F81A60C28600395438 /* lua_VertexAttributeBinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexAttributeBinding.cpp; sourceTree = ""; }; + 424F32F91A60C28600395438 /* lua_VertexAttributeBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexAttributeBinding.h; sourceTree = ""; }; + 424F32FA1A60C28600395438 /* lua_VertexFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexFormat.cpp; sourceTree = ""; }; + 424F32FB1A60C28600395438 /* lua_VertexFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexFormat.h; sourceTree = ""; }; + 424F32FC1A60C28600395438 /* lua_VertexFormatElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VertexFormatElement.cpp; sourceTree = ""; }; + 424F32FD1A60C28600395438 /* lua_VertexFormatElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexFormatElement.h; sourceTree = ""; }; + 424F32FE1A60C28600395438 /* lua_VerticalLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VerticalLayout.cpp; sourceTree = ""; }; + 424F32FF1A60C28600395438 /* lua_VerticalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VerticalLayout.h; sourceTree = ""; }; 426F8315187F72A700640CBA /* JoystickControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JoystickControl.cpp; path = src/JoystickControl.cpp; sourceTree = SOURCE_ROOT; }; 426F8316187F72A700640CBA /* JoystickControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JoystickControl.h; path = src/JoystickControl.h; sourceTree = SOURCE_ROOT; }; - 426F8319187F72DF00640CBA /* lua_JoystickControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_JoystickControl.cpp; sourceTree = ""; }; - 426F831A187F72DF00640CBA /* lua_JoystickControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_JoystickControl.h; sourceTree = ""; }; - 42B701F615B08177002BB8C3 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = "../external-deps/lua/lib/macosx/liblua.a"; sourceTree = ""; }; - 42B701F815B081B6002BB8C3 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = "../external-deps/lua/lib/ios/armv7s/liblua.a"; sourceTree = ""; }; 42CC52F71809A4EB00AAD8AD /* AbsoluteLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AbsoluteLayout.cpp; path = src/AbsoluteLayout.cpp; sourceTree = SOURCE_ROOT; }; 42CC52F81809A4EB00AAD8AD /* AbsoluteLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AbsoluteLayout.h; path = src/AbsoluteLayout.h; sourceTree = SOURCE_ROOT; }; 42CC52F91809A4EB00AAD8AD /* AIAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AIAgent.cpp; path = src/AIAgent.cpp; sourceTree = SOURCE_ROOT; }; @@ -1035,7 +874,6 @@ 42CC533F1809A4EB00AAD8AD /* Gamepad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Gamepad.cpp; path = src/Gamepad.cpp; sourceTree = SOURCE_ROOT; }; 42CC53401809A4EB00AAD8AD /* Gamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Gamepad.h; path = src/Gamepad.h; sourceTree = SOURCE_ROOT; }; 42CC53411809A4EB00AAD8AD /* gameplay-main-android.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gameplay-main-android.cpp"; path = "src/gameplay-main-android.cpp"; sourceTree = SOURCE_ROOT; }; - 42CC53421809A4EB00AAD8AD /* gameplay-main-blackberry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gameplay-main-blackberry.cpp"; path = "src/gameplay-main-blackberry.cpp"; sourceTree = SOURCE_ROOT; }; 42CC53431809A4EB00AAD8AD /* gameplay-main-ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "gameplay-main-ios.mm"; path = "src/gameplay-main-ios.mm"; sourceTree = SOURCE_ROOT; }; 42CC53441809A4EB00AAD8AD /* gameplay-main-linux.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gameplay-main-linux.cpp"; path = "src/gameplay-main-linux.cpp"; sourceTree = SOURCE_ROOT; }; 42CC53451809A4EB00AAD8AD /* gameplay-main-macosx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "gameplay-main-macosx.mm"; path = "src/gameplay-main-macosx.mm"; sourceTree = SOURCE_ROOT; }; @@ -1128,7 +966,6 @@ 42CC55081809A4ED00AAD8AD /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Platform.cpp; path = src/Platform.cpp; sourceTree = SOURCE_ROOT; }; 42CC55091809A4ED00AAD8AD /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = src/Platform.h; sourceTree = SOURCE_ROOT; }; 42CC550A1809A4ED00AAD8AD /* PlatformAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformAndroid.cpp; path = src/PlatformAndroid.cpp; sourceTree = SOURCE_ROOT; }; - 42CC550B1809A4ED00AAD8AD /* PlatformBlackBerry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformBlackBerry.cpp; path = src/PlatformBlackBerry.cpp; sourceTree = SOURCE_ROOT; }; 42CC550C1809A4ED00AAD8AD /* PlatformiOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformiOS.mm; path = src/PlatformiOS.mm; sourceTree = SOURCE_ROOT; }; 42CC550D1809A4ED00AAD8AD /* PlatformLinux.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformLinux.cpp; path = src/PlatformLinux.cpp; sourceTree = SOURCE_ROOT; }; 42CC550E1809A4ED00AAD8AD /* PlatformMacOSX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformMacOSX.mm; path = src/PlatformMacOSX.mm; sourceTree = SOURCE_ROOT; }; @@ -1200,30 +1037,26 @@ 42CC55661809A4EE00AAD8AD /* VertexFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VertexFormat.h; path = src/VertexFormat.h; sourceTree = SOURCE_ROOT; }; 42CC55671809A4EE00AAD8AD /* VerticalLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VerticalLayout.cpp; path = src/VerticalLayout.cpp; sourceTree = SOURCE_ROOT; }; 42CC55681809A4EE00AAD8AD /* VerticalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VerticalLayout.h; path = src/VerticalLayout.h; sourceTree = SOURCE_ROOT; }; - 42CCD555146EC1EB00353661 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../external-deps/png/lib/macosx/libpng.a"; sourceTree = ""; }; - 42CD0DA6147D8EA80000361E /* libbullet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbullet.a; path = "../external-deps/bullet/lib/macosx/libbullet.a"; sourceTree = ""; }; - 42CD0DA7147D8EA80000361E /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "../external-deps/oggvorbis/lib/macosx/libogg.a"; sourceTree = ""; }; - 42CD0DA8147D8EA80000361E /* libvorbis.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbis.a; path = "../external-deps/oggvorbis/lib/macosx/libvorbis.a"; sourceTree = ""; }; - 42DFAB4F16AD8ECD0000F342 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; }; + 42D929991A6051EC0073258D /* Drawable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Drawable.cpp; path = src/Drawable.cpp; sourceTree = SOURCE_ROOT; }; + 42D9299A1A6051EC0073258D /* Drawable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Drawable.h; path = src/Drawable.h; sourceTree = SOURCE_ROOT; }; + 42ECC3F81A4EF5A00036C839 /* Text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Text.cpp; path = src/Text.cpp; sourceTree = SOURCE_ROOT; }; + 42ECC3F91A4EF5A00036C839 /* Text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Text.h; path = src/Text.h; sourceTree = SOURCE_ROOT; }; 5B04C5CA14BFCFE100EB0071 /* libgameplay.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgameplay.a; sourceTree = BUILT_PRODUCTS_DIR; }; 5B21E99516153890006EBEAC /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 5B2BC75D1512514500D176CD /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; 5B2BC75E1512514500D176CD /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; 5B2BC7611512514D00D176CD /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 5B2BC7631512516B00D176CD /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = ""; }; - 5B5DB92D14C25B7B007755DB /* libbullet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbullet.a; path = "../external-deps/bullet/lib/ios/armv7s/libbullet.a"; sourceTree = ""; }; - 5B5DB92F14C25B94007755DB /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../external-deps/png/lib/ios/armv7s/libpng.a"; sourceTree = ""; }; - 5B5DB93114C25BA5007755DB /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "../external-deps/oggvorbis/lib/ios/armv7s/libogg.a"; sourceTree = ""; }; - 5B5DB93214C25BA5007755DB /* libvorbis.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbis.a; path = "../external-deps/oggvorbis/lib/ios/armv7s/libvorbis.a"; sourceTree = ""; }; 5BC4E7D4150F8C3C00CBE1C0 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; path = res; sourceTree = ""; }; - 6290E04918223DCC00A28FB9 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/GameKit.framework; sourceTree = DEVELOPER_DIR; }; + 6290E04918223DCC00A28FB9 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameKit.framework; sourceTree = DEVELOPER_DIR; }; 6290E04B18223DDD00A28FB9 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; - BD2636DF16CF5B7400CFE15F /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; - BD2636E016CF5B7400CFE15F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - BD2636E116CF5B7400CFE15F /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = DEVELOPER_DIR; }; - BD2636E216CF5B7400CFE15F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; }; - BD2636E316CF5B7400CFE15F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - BD2636E416CF5B7400CFE15F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + BD2636DF16CF5B7400CFE15F /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; + BD2636E016CF5B7400CFE15F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + BD2636E116CF5B7400CFE15F /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = DEVELOPER_DIR; }; + BD2636E216CF5B7400CFE15F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; }; + BD2636E316CF5B7400CFE15F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + BD2636E416CF5B7400CFE15F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + DD4FBEA31A0C0D240015D30C /* Script.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Script.cpp; path = src/Script.cpp; sourceTree = SOURCE_ROOT; }; + DD4FBEA41A0C0D240015D30C /* Script.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Script.h; path = src/Script.h; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1233,7 +1066,6 @@ files = ( 6290E04C18223DDD00A28FB9 /* GameKit.framework in Frameworks */, 5B21E99616153890006EBEAC /* IOKit.framework in Frameworks */, - 5B2BC7641512516B00D176CD /* libz.dylib in Frameworks */, 5B2BC7621512514D00D176CD /* QuartzCore.framework in Frameworks */, 5B2BC75F1512514500D176CD /* OpenAL.framework in Frameworks */, 5B2BC7601512514500D176CD /* OpenGL.framework in Frameworks */, @@ -1261,358 +1093,274 @@ 420BBAA51817416D00C7B720 /* lua */ = { isa = PBXGroup; children = ( - 420BBAA61817416D00C7B720 /* lua_AbsoluteLayout.cpp */, - 420BBAA71817416D00C7B720 /* lua_AbsoluteLayout.h */, - 420BBAA81817416D00C7B720 /* lua_AIAgent.cpp */, - 420BBAA91817416D00C7B720 /* lua_AIAgent.h */, - 420BBAAA1817416D00C7B720 /* lua_AIAgentListener.cpp */, - 420BBAAB1817416D00C7B720 /* lua_AIAgentListener.h */, - 420BBAAC1817416D00C7B720 /* lua_AIController.cpp */, - 420BBAAD1817416D00C7B720 /* lua_AIController.h */, - 420BBAAE1817416D00C7B720 /* lua_AIMessage.cpp */, - 420BBAAF1817416D00C7B720 /* lua_AIMessage.h */, - 420BBAB01817416D00C7B720 /* lua_AIMessageParameterType.cpp */, - 420BBAB11817416D00C7B720 /* lua_AIMessageParameterType.h */, - 420BBAB21817416D00C7B720 /* lua_AIState.cpp */, - 420BBAB31817416D00C7B720 /* lua_AIState.h */, - 420BBAB41817416D00C7B720 /* lua_AIStateListener.cpp */, - 420BBAB51817416D00C7B720 /* lua_AIStateListener.h */, - 420BBAB61817416D00C7B720 /* lua_AIStateMachine.cpp */, - 420BBAB71817416D00C7B720 /* lua_AIStateMachine.h */, - 420BBAB81817416D00C7B720 /* lua_all_bindings.cpp */, - 420BBAB91817416D00C7B720 /* lua_all_bindings.h */, - 420BBABA1817416D00C7B720 /* lua_Animation.cpp */, - 420BBABB1817416D00C7B720 /* lua_Animation.h */, - 420BBABC1817416D00C7B720 /* lua_AnimationClip.cpp */, - 420BBABD1817416D00C7B720 /* lua_AnimationClip.h */, - 420BBABE1817416D00C7B720 /* lua_AnimationClipListener.cpp */, - 420BBABF1817416D00C7B720 /* lua_AnimationClipListener.h */, - 420BBAC01817416D00C7B720 /* lua_AnimationClipListenerEventType.cpp */, - 420BBAC11817416D00C7B720 /* lua_AnimationClipListenerEventType.h */, - 420BBAC21817416D00C7B720 /* lua_AnimationController.cpp */, - 420BBAC31817416D00C7B720 /* lua_AnimationController.h */, - 420BBAC41817416D00C7B720 /* lua_AnimationTarget.cpp */, - 420BBAC51817416D00C7B720 /* lua_AnimationTarget.h */, - 420BBAC61817416D00C7B720 /* lua_AnimationValue.cpp */, - 420BBAC71817416D00C7B720 /* lua_AnimationValue.h */, - 420BBAC81817416D00C7B720 /* lua_AudioBuffer.cpp */, - 420BBAC91817416D00C7B720 /* lua_AudioBuffer.h */, - 420BBACA1817416D00C7B720 /* lua_AudioController.cpp */, - 420BBACB1817416D00C7B720 /* lua_AudioController.h */, - 420BBACC1817416D00C7B720 /* lua_AudioListener.cpp */, - 420BBACD1817416D00C7B720 /* lua_AudioListener.h */, - 420BBACE1817416D00C7B720 /* lua_AudioSource.cpp */, - 420BBACF1817416D00C7B720 /* lua_AudioSource.h */, - 420BBAD01817416D00C7B720 /* lua_AudioSourceState.cpp */, - 420BBAD11817416D00C7B720 /* lua_AudioSourceState.h */, - 420BBAD21817416D00C7B720 /* lua_BoundingBox.cpp */, - 420BBAD31817416D00C7B720 /* lua_BoundingBox.h */, - 420BBAD41817416D00C7B720 /* lua_BoundingSphere.cpp */, - 420BBAD51817416D00C7B720 /* lua_BoundingSphere.h */, - 420BBAD61817416D00C7B720 /* lua_Bundle.cpp */, - 420BBAD71817416D00C7B720 /* lua_Bundle.h */, - 420BBAD81817416D00C7B720 /* lua_Button.cpp */, - 420BBAD91817416D00C7B720 /* lua_Button.h */, - 420BBADA1817416D00C7B720 /* lua_Camera.cpp */, - 420BBADB1817416D00C7B720 /* lua_Camera.h */, - 42252DC81828145B00EE234B /* lua_CameraListener.cpp */, - 42252DC91828145B00EE234B /* lua_CameraListener.h */, - 420BBADC1817416D00C7B720 /* lua_CameraType.cpp */, - 420BBADD1817416D00C7B720 /* lua_CameraType.h */, - 420BBADE1817416D00C7B720 /* lua_CheckBox.cpp */, - 420BBADF1817416D00C7B720 /* lua_CheckBox.h */, - 420BBAE01817416D00C7B720 /* lua_Container.cpp */, - 420BBAE11817416D00C7B720 /* lua_Container.h */, - 420BBAE21817416D00C7B720 /* lua_ContainerScroll.cpp */, - 420BBAE31817416D00C7B720 /* lua_ContainerScroll.h */, - 420BBAE41817416D00C7B720 /* lua_Control.cpp */, - 420BBAE51817416D00C7B720 /* lua_Control.h */, - 420BBAE61817416D00C7B720 /* lua_ControlAlignment.cpp */, - 420BBAE71817416D00C7B720 /* lua_ControlAlignment.h */, - 420BBAE81817416D00C7B720 /* lua_ControlAutoSize.cpp */, - 420BBAE91817416D00C7B720 /* lua_ControlAutoSize.h */, - 420BBAEA1817416D00C7B720 /* lua_ControlListener.cpp */, - 420BBAEB1817416D00C7B720 /* lua_ControlListener.h */, - 420BBAEC1817416D00C7B720 /* lua_ControlListenerEventType.cpp */, - 420BBAED1817416D00C7B720 /* lua_ControlListenerEventType.h */, - 420BBAEE1817416D00C7B720 /* lua_ControlState.cpp */, - 420BBAEF1817416D00C7B720 /* lua_ControlState.h */, - 420BBAF01817416D00C7B720 /* lua_Curve.cpp */, - 420BBAF11817416D00C7B720 /* lua_Curve.h */, - 420BBAF21817416D00C7B720 /* lua_CurveInterpolationType.cpp */, - 420BBAF31817416E00C7B720 /* lua_CurveInterpolationType.h */, - 420BBAF41817416E00C7B720 /* lua_DepthStencilTarget.cpp */, - 420BBAF51817416E00C7B720 /* lua_DepthStencilTarget.h */, - 420BBAF61817416E00C7B720 /* lua_DepthStencilTargetFormat.cpp */, - 420BBAF71817416E00C7B720 /* lua_DepthStencilTargetFormat.h */, - 420BBAF81817416E00C7B720 /* lua_Effect.cpp */, - 420BBAF91817416E00C7B720 /* lua_Effect.h */, - 420BBAFA1817416E00C7B720 /* lua_FileSystem.cpp */, - 420BBAFB1817416E00C7B720 /* lua_FileSystem.h */, - 420BBAFC1817416E00C7B720 /* lua_FlowLayout.cpp */, - 420BBAFD1817416E00C7B720 /* lua_FlowLayout.h */, - 420BBAFE1817416E00C7B720 /* lua_Font.cpp */, - 420BBAFF1817416E00C7B720 /* lua_Font.h */, - 420BBB001817416E00C7B720 /* lua_FontFormat.cpp */, - 420BBB011817416E00C7B720 /* lua_FontFormat.h */, - 420BBB021817416E00C7B720 /* lua_FontJustify.cpp */, - 420BBB031817416E00C7B720 /* lua_FontJustify.h */, - 420BBB041817416E00C7B720 /* lua_FontStyle.cpp */, - 420BBB051817416E00C7B720 /* lua_FontStyle.h */, - 420BBB061817416E00C7B720 /* lua_FontText.cpp */, - 420BBB071817416E00C7B720 /* lua_FontText.h */, - 420BBB081817416E00C7B720 /* lua_Form.cpp */, - 420BBB091817416E00C7B720 /* lua_Form.h */, - 420BBB0A1817416E00C7B720 /* lua_FrameBuffer.cpp */, - 420BBB0B1817416E00C7B720 /* lua_FrameBuffer.h */, - 420BBB0C1817416E00C7B720 /* lua_Frustum.cpp */, - 420BBB0D1817416E00C7B720 /* lua_Frustum.h */, - 420BBB0E1817416E00C7B720 /* lua_Game.cpp */, - 420BBB0F1817416E00C7B720 /* lua_Game.h */, - 420BBB101817416E00C7B720 /* lua_GameClearFlags.cpp */, - 420BBB111817416E00C7B720 /* lua_GameClearFlags.h */, - 420BBB121817416E00C7B720 /* lua_Gamepad.cpp */, - 420BBB131817416E00C7B720 /* lua_Gamepad.h */, - 420BBB141817416E00C7B720 /* lua_GamepadButtonMapping.cpp */, - 420BBB151817416E00C7B720 /* lua_GamepadButtonMapping.h */, - 420BBB161817416E00C7B720 /* lua_GamepadGamepadEvent.cpp */, - 420BBB171817416E00C7B720 /* lua_GamepadGamepadEvent.h */, - 420BBB181817416E00C7B720 /* lua_GameState.cpp */, - 420BBB191817416E00C7B720 /* lua_GameState.h */, - 420BBB1A1817416E00C7B720 /* lua_Gesture.cpp */, - 420BBB1B1817416E00C7B720 /* lua_Gesture.h */, - 420BBB1C1817416E00C7B720 /* lua_GestureGestureEvent.cpp */, - 420BBB1D1817416E00C7B720 /* lua_GestureGestureEvent.h */, - 420BBB1E1817416E00C7B720 /* lua_Global.cpp */, - 420BBB1F1817416E00C7B720 /* lua_Global.h */, - 420BBB201817416E00C7B720 /* lua_HeightField.cpp */, - 420BBB211817416E00C7B720 /* lua_HeightField.h */, - 420BBB221817416E00C7B720 /* lua_Image.cpp */, - 420BBB231817416E00C7B720 /* lua_Image.h */, - 420BBB241817416E00C7B720 /* lua_ImageControl.cpp */, - 420BBB251817416E00C7B720 /* lua_ImageControl.h */, - 420BBB261817416E00C7B720 /* lua_ImageFormat.cpp */, - 420BBB271817416E00C7B720 /* lua_ImageFormat.h */, - 420BBB281817416E00C7B720 /* lua_Joint.cpp */, - 420BBB291817416E00C7B720 /* lua_Joint.h */, - 426F8319187F72DF00640CBA /* lua_JoystickControl.cpp */, - 426F831A187F72DF00640CBA /* lua_JoystickControl.h */, - 420BBB2C1817416E00C7B720 /* lua_Keyboard.cpp */, - 420BBB2D1817416E00C7B720 /* lua_Keyboard.h */, - 420BBB2E1817416E00C7B720 /* lua_KeyboardKey.cpp */, - 420BBB2F1817416E00C7B720 /* lua_KeyboardKey.h */, - 420BBB301817416E00C7B720 /* lua_KeyboardKeyEvent.cpp */, - 420BBB311817416E00C7B720 /* lua_KeyboardKeyEvent.h */, - 420BBB321817416E00C7B720 /* lua_Label.cpp */, - 420BBB331817416E00C7B720 /* lua_Label.h */, - 420BBB341817416E00C7B720 /* lua_Layout.cpp */, - 420BBB351817416E00C7B720 /* lua_Layout.h */, - 420BBB361817416E00C7B720 /* lua_LayoutType.cpp */, - 420BBB371817416E00C7B720 /* lua_LayoutType.h */, - 420BBB381817416E00C7B720 /* lua_Light.cpp */, - 420BBB391817416E00C7B720 /* lua_Light.h */, - 420BBB3A1817416E00C7B720 /* lua_LightType.cpp */, - 420BBB3B1817416E00C7B720 /* lua_LightType.h */, - 420BBB3C1817416E00C7B720 /* lua_Logger.cpp */, - 420BBB3D1817416E00C7B720 /* lua_Logger.h */, - 420BBB3E1817416E00C7B720 /* lua_LoggerLevel.cpp */, - 420BBB3F1817416E00C7B720 /* lua_LoggerLevel.h */, - 420BBB401817416E00C7B720 /* lua_Material.cpp */, - 420BBB411817416E00C7B720 /* lua_Material.h */, - 420BBB421817416E00C7B720 /* lua_MaterialParameter.cpp */, - 420BBB431817416E00C7B720 /* lua_MaterialParameter.h */, - 420BBB441817416E00C7B720 /* lua_MathUtil.cpp */, - 420BBB451817416E00C7B720 /* lua_MathUtil.h */, - 420BBB461817416E00C7B720 /* lua_Matrix.cpp */, - 420BBB471817416E00C7B720 /* lua_Matrix.h */, - 420BBB481817416E00C7B720 /* lua_Mesh.cpp */, - 420BBB491817416E00C7B720 /* lua_Mesh.h */, - 420BBB4A1817416E00C7B720 /* lua_MeshBatch.cpp */, - 420BBB4B1817416E00C7B720 /* lua_MeshBatch.h */, - 420BBB4C1817416E00C7B720 /* lua_MeshIndexFormat.cpp */, - 420BBB4D1817416E00C7B720 /* lua_MeshIndexFormat.h */, - 420BBB4E1817416E00C7B720 /* lua_MeshPart.cpp */, - 420BBB4F1817416E00C7B720 /* lua_MeshPart.h */, - 420BBB501817416E00C7B720 /* lua_MeshPrimitiveType.cpp */, - 420BBB511817416E00C7B720 /* lua_MeshPrimitiveType.h */, - 420BBB521817416E00C7B720 /* lua_MeshSkin.cpp */, - 420BBB531817416E00C7B720 /* lua_MeshSkin.h */, - 420BBB541817416E00C7B720 /* lua_Model.cpp */, - 420BBB551817416E00C7B720 /* lua_Model.h */, - 420BBB561817416E00C7B720 /* lua_Mouse.cpp */, - 420BBB571817416E00C7B720 /* lua_Mouse.h */, - 420BBB581817416E00C7B720 /* lua_MouseMouseEvent.cpp */, - 420BBB591817416E00C7B720 /* lua_MouseMouseEvent.h */, - 420BBB5A1817416E00C7B720 /* lua_Node.cpp */, - 420BBB5B1817416E00C7B720 /* lua_Node.h */, - 420BBB5C1817416E00C7B720 /* lua_NodeCloneContext.cpp */, - 420BBB5D1817416E00C7B720 /* lua_NodeCloneContext.h */, - 420BBB5E1817416E00C7B720 /* lua_NodeType.cpp */, - 420BBB5F1817416E00C7B720 /* lua_NodeType.h */, - 420BBB601817416E00C7B720 /* lua_ParticleEmitter.cpp */, - 420BBB611817416E00C7B720 /* lua_ParticleEmitter.h */, - 420BBB621817416E00C7B720 /* lua_ParticleEmitterTextureBlending.cpp */, - 420BBB631817416E00C7B720 /* lua_ParticleEmitterTextureBlending.h */, - 420BBB641817416E00C7B720 /* lua_Pass.cpp */, - 420BBB651817416E00C7B720 /* lua_Pass.h */, - 420BBB661817416E00C7B720 /* lua_PhysicsCharacter.cpp */, - 420BBB671817416E00C7B720 /* lua_PhysicsCharacter.h */, - 420BBB681817416E00C7B720 /* lua_PhysicsCollisionObject.cpp */, - 420BBB691817416E00C7B720 /* lua_PhysicsCollisionObject.h */, - 420BBB6A1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp */, - 420BBB6B1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.h */, - 420BBB6C1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp */, - 420BBB6D1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.h */, - 420BBB6E1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp */, - 420BBB6F1817416E00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.h */, - 420BBB701817416E00C7B720 /* lua_PhysicsCollisionObjectType.cpp */, - 420BBB711817416E00C7B720 /* lua_PhysicsCollisionObjectType.h */, - 420BBB721817416E00C7B720 /* lua_PhysicsCollisionShape.cpp */, - 420BBB731817416E00C7B720 /* lua_PhysicsCollisionShape.h */, - 420BBB741817416E00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp */, - 420BBB751817416E00C7B720 /* lua_PhysicsCollisionShapeDefinition.h */, - 420BBB761817416E00C7B720 /* lua_PhysicsCollisionShapeType.cpp */, - 420BBB771817416E00C7B720 /* lua_PhysicsCollisionShapeType.h */, - 420BBB781817416E00C7B720 /* lua_PhysicsConstraint.cpp */, - 420BBB791817416E00C7B720 /* lua_PhysicsConstraint.h */, - 420BBB7A1817416E00C7B720 /* lua_PhysicsController.cpp */, - 420BBB7B1817416E00C7B720 /* lua_PhysicsController.h */, - 420BBB7C1817416E00C7B720 /* lua_PhysicsControllerHitFilter.cpp */, - 420BBB7D1817416E00C7B720 /* lua_PhysicsControllerHitFilter.h */, - 420BBB7E1817416E00C7B720 /* lua_PhysicsControllerHitResult.cpp */, - 420BBB7F1817416E00C7B720 /* lua_PhysicsControllerHitResult.h */, - 420BBB801817416E00C7B720 /* lua_PhysicsControllerListener.cpp */, - 420BBB811817416E00C7B720 /* lua_PhysicsControllerListener.h */, - 420BBB821817416E00C7B720 /* lua_PhysicsControllerListenerEventType.cpp */, - 420BBB831817416E00C7B720 /* lua_PhysicsControllerListenerEventType.h */, - 420BBB841817416E00C7B720 /* lua_PhysicsFixedConstraint.cpp */, - 420BBB851817416E00C7B720 /* lua_PhysicsFixedConstraint.h */, - 420BBB861817416E00C7B720 /* lua_PhysicsGenericConstraint.cpp */, - 420BBB871817416E00C7B720 /* lua_PhysicsGenericConstraint.h */, - 420BBB881817416E00C7B720 /* lua_PhysicsGhostObject.cpp */, - 420BBB891817416E00C7B720 /* lua_PhysicsGhostObject.h */, - 420BBB8A1817416E00C7B720 /* lua_PhysicsHingeConstraint.cpp */, - 420BBB8B1817416E00C7B720 /* lua_PhysicsHingeConstraint.h */, - 420BBB8C1817416E00C7B720 /* lua_PhysicsRigidBody.cpp */, - 420BBB8D1817416E00C7B720 /* lua_PhysicsRigidBody.h */, - 420BBB8E1817416E00C7B720 /* lua_PhysicsRigidBodyParameters.cpp */, - 420BBB8F1817416E00C7B720 /* lua_PhysicsRigidBodyParameters.h */, - 420BBB901817416E00C7B720 /* lua_PhysicsSocketConstraint.cpp */, - 420BBB911817416E00C7B720 /* lua_PhysicsSocketConstraint.h */, - 420BBB921817416E00C7B720 /* lua_PhysicsSpringConstraint.cpp */, - 420BBB931817416E00C7B720 /* lua_PhysicsSpringConstraint.h */, - 420BBB941817416E00C7B720 /* lua_PhysicsVehicle.cpp */, - 420BBB951817416E00C7B720 /* lua_PhysicsVehicle.h */, - 420BBB961817416E00C7B720 /* lua_PhysicsVehicleWheel.cpp */, - 420BBB971817416E00C7B720 /* lua_PhysicsVehicleWheel.h */, - 420BBB981817416E00C7B720 /* lua_Plane.cpp */, - 420BBB991817416E00C7B720 /* lua_Plane.h */, - 420BBB9A1817416E00C7B720 /* lua_Platform.cpp */, - 420BBB9B1817416E00C7B720 /* lua_Platform.h */, - 420BBB9C1817416E00C7B720 /* lua_Properties.cpp */, - 420BBB9D1817416E00C7B720 /* lua_Properties.h */, - 420BBB9E1817416E00C7B720 /* lua_PropertiesType.cpp */, - 420BBB9F1817416E00C7B720 /* lua_PropertiesType.h */, - 420BBBA01817416E00C7B720 /* lua_Quaternion.cpp */, - 420BBBA11817416E00C7B720 /* lua_Quaternion.h */, - 420BBBA21817416E00C7B720 /* lua_RadioButton.cpp */, - 420BBBA31817416E00C7B720 /* lua_RadioButton.h */, - 420BBBA41817416E00C7B720 /* lua_Ray.cpp */, - 420BBBA51817416E00C7B720 /* lua_Ray.h */, - 420BBBA61817416E00C7B720 /* lua_Rectangle.cpp */, - 420BBBA71817416E00C7B720 /* lua_Rectangle.h */, - 420BBBA81817416E00C7B720 /* lua_Ref.cpp */, - 420BBBA91817416E00C7B720 /* lua_Ref.h */, - 420BBBAA1817416E00C7B720 /* lua_RenderState.cpp */, - 420BBBAB1817416E00C7B720 /* lua_RenderState.h */, - 420BBBAC1817416E00C7B720 /* lua_RenderStateAutoBinding.cpp */, - 420BBBAD1817416E00C7B720 /* lua_RenderStateAutoBinding.h */, - 420BBBAE1817416E00C7B720 /* lua_RenderStateBlend.cpp */, - 420BBBAF1817416E00C7B720 /* lua_RenderStateBlend.h */, - 420BBBB01817416E00C7B720 /* lua_RenderStateCullFaceSide.cpp */, - 420BBBB11817416E00C7B720 /* lua_RenderStateCullFaceSide.h */, - 420BBBB21817416E00C7B720 /* lua_RenderStateDepthFunction.cpp */, - 420BBBB31817416E00C7B720 /* lua_RenderStateDepthFunction.h */, - 420BBBB41817416E00C7B720 /* lua_RenderStateFrontFace.cpp */, - 420BBBB51817416E00C7B720 /* lua_RenderStateFrontFace.h */, - 420BBBB61817416E00C7B720 /* lua_RenderStateStateBlock.cpp */, - 420BBBB71817416E00C7B720 /* lua_RenderStateStateBlock.h */, - 420BBBB81817416E00C7B720 /* lua_RenderStateStencilFunction.cpp */, - 420BBBB91817416E00C7B720 /* lua_RenderStateStencilFunction.h */, - 420BBBBA1817416E00C7B720 /* lua_RenderStateStencilOperation.cpp */, - 420BBBBB1817416E00C7B720 /* lua_RenderStateStencilOperation.h */, - 420BBBBC1817416E00C7B720 /* lua_RenderTarget.cpp */, - 420BBBBD1817416E00C7B720 /* lua_RenderTarget.h */, - 420BBBBE1817416E00C7B720 /* lua_Scene.cpp */, - 420BBBBF1817416E00C7B720 /* lua_Scene.h */, - 420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */, - 420BBBC71817416E00C7B720 /* lua_ScreenDisplayer.h */, - 420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */, - 420BBBC91817416E00C7B720 /* lua_ScriptController.h */, - 420BBBCA1817416E00C7B720 /* lua_ScriptTarget.cpp */, - 420BBBCB1817416E00C7B720 /* lua_ScriptTarget.h */, - 420BBBCC1817416E00C7B720 /* lua_Slider.cpp */, - 420BBBCD1817416E00C7B720 /* lua_Slider.h */, - 420BBBCE1817416E00C7B720 /* lua_SpriteBatch.cpp */, - 420BBBCF1817416E00C7B720 /* lua_SpriteBatch.h */, - 420BBBD01817416E00C7B720 /* lua_Technique.cpp */, - 420BBBD11817416E00C7B720 /* lua_Technique.h */, - 420BBBD21817416E00C7B720 /* lua_Terrain.cpp */, - 420BBBD31817416E00C7B720 /* lua_Terrain.h */, - 420BBBD41817416E00C7B720 /* lua_TerrainFlags.cpp */, - 420BBBD51817416E00C7B720 /* lua_TerrainFlags.h */, - 42252DCA1828145B00EE234B /* lua_TerrainPatch.cpp */, - 42252DCB1828145B00EE234B /* lua_TerrainPatch.h */, - 420BBBD81817416E00C7B720 /* lua_TextBox.cpp */, - 420BBBD91817416E00C7B720 /* lua_TextBox.h */, - 420BBBDA1817416E00C7B720 /* lua_TextBoxInputMode.cpp */, - 420BBBDB1817416E00C7B720 /* lua_TextBoxInputMode.h */, - 420BBBDC1817416E00C7B720 /* lua_Texture.cpp */, - 420BBBDD1817416E00C7B720 /* lua_Texture.h */, - 420BBBDE1817416E00C7B720 /* lua_TextureFilter.cpp */, - 420BBBDF1817416E00C7B720 /* lua_TextureFilter.h */, - 420BBBE01817416E00C7B720 /* lua_TextureFormat.cpp */, - 420BBBE11817416E00C7B720 /* lua_TextureFormat.h */, - 420BBBE21817416E00C7B720 /* lua_TextureSampler.cpp */, - 420BBBE31817416E00C7B720 /* lua_TextureSampler.h */, - 420BBBE41817416E00C7B720 /* lua_TextureWrap.cpp */, - 420BBBE51817416F00C7B720 /* lua_TextureWrap.h */, - 420BBBE61817416F00C7B720 /* lua_Theme.cpp */, - 420BBBE71817416F00C7B720 /* lua_Theme.h */, - 420BBBE81817416F00C7B720 /* lua_ThemeSideRegions.cpp */, - 420BBBE91817416F00C7B720 /* lua_ThemeSideRegions.h */, - 420BBBEA1817416F00C7B720 /* lua_ThemeStyle.cpp */, - 420BBBEB1817416F00C7B720 /* lua_ThemeStyle.h */, - 420BBBEC1817416F00C7B720 /* lua_ThemeThemeImage.cpp */, - 420BBBED1817416F00C7B720 /* lua_ThemeThemeImage.h */, - 420BBBEE1817416F00C7B720 /* lua_ThemeUVs.cpp */, - 420BBBEF1817416F00C7B720 /* lua_ThemeUVs.h */, - 420BBBF01817416F00C7B720 /* lua_Touch.cpp */, - 420BBBF11817416F00C7B720 /* lua_Touch.h */, - 420BBBF21817416F00C7B720 /* lua_TouchTouchEvent.cpp */, - 420BBBF31817416F00C7B720 /* lua_TouchTouchEvent.h */, - 420BBBF41817416F00C7B720 /* lua_Transform.cpp */, - 420BBBF51817416F00C7B720 /* lua_Transform.h */, - 420BBBF61817416F00C7B720 /* lua_TransformListener.cpp */, - 420BBBF71817416F00C7B720 /* lua_TransformListener.h */, - 420BBBF81817416F00C7B720 /* lua_Uniform.cpp */, - 420BBBF91817416F00C7B720 /* lua_Uniform.h */, - 420BBBFA1817416F00C7B720 /* lua_Vector2.cpp */, - 420BBBFB1817416F00C7B720 /* lua_Vector2.h */, - 420BBBFC1817416F00C7B720 /* lua_Vector3.cpp */, - 420BBBFD1817416F00C7B720 /* lua_Vector3.h */, - 420BBBFE1817416F00C7B720 /* lua_Vector4.cpp */, - 420BBBFF1817416F00C7B720 /* lua_Vector4.h */, - 420BBC001817416F00C7B720 /* lua_VertexAttributeBinding.cpp */, - 420BBC011817416F00C7B720 /* lua_VertexAttributeBinding.h */, - 420BBC021817416F00C7B720 /* lua_VertexFormat.cpp */, - 420BBC031817416F00C7B720 /* lua_VertexFormat.h */, - 420BBC041817416F00C7B720 /* lua_VertexFormatElement.cpp */, - 420BBC051817416F00C7B720 /* lua_VertexFormatElement.h */, - 420BBC061817416F00C7B720 /* lua_VertexFormatUsage.cpp */, - 420BBC071817416F00C7B720 /* lua_VertexFormatUsage.h */, - 420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */, - 420BBC091817416F00C7B720 /* lua_VerticalLayout.h */, + 424F31F41A60C28600395438 /* lua_AbsoluteLayout.cpp */, + 424F31F51A60C28600395438 /* lua_AbsoluteLayout.h */, + 424F31F61A60C28600395438 /* lua_AIAgent.cpp */, + 424F31F71A60C28600395438 /* lua_AIAgent.h */, + 424F31F81A60C28600395438 /* lua_AIAgentListener.cpp */, + 424F31F91A60C28600395438 /* lua_AIAgentListener.h */, + 424F31FA1A60C28600395438 /* lua_AIController.cpp */, + 424F31FB1A60C28600395438 /* lua_AIController.h */, + 424F31FC1A60C28600395438 /* lua_AIMessage.cpp */, + 424F31FD1A60C28600395438 /* lua_AIMessage.h */, + 424F31FE1A60C28600395438 /* lua_AIState.cpp */, + 424F31FF1A60C28600395438 /* lua_AIState.h */, + 424F32001A60C28600395438 /* lua_AIStateListener.cpp */, + 424F32011A60C28600395438 /* lua_AIStateListener.h */, + 424F32021A60C28600395438 /* lua_AIStateMachine.cpp */, + 424F32031A60C28600395438 /* lua_AIStateMachine.h */, + 424F32041A60C28600395438 /* lua_all_bindings.cpp */, + 424F32051A60C28600395438 /* lua_all_bindings.h */, + 424F32061A60C28600395438 /* lua_Animation.cpp */, + 424F32071A60C28600395438 /* lua_Animation.h */, + 424F32081A60C28600395438 /* lua_AnimationClip.cpp */, + 424F32091A60C28600395438 /* lua_AnimationClip.h */, + 424F320A1A60C28600395438 /* lua_AnimationClipListener.cpp */, + 424F320B1A60C28600395438 /* lua_AnimationClipListener.h */, + 424F320C1A60C28600395438 /* lua_AnimationController.cpp */, + 424F320D1A60C28600395438 /* lua_AnimationController.h */, + 424F320E1A60C28600395438 /* lua_AnimationTarget.cpp */, + 424F320F1A60C28600395438 /* lua_AnimationTarget.h */, + 424F32101A60C28600395438 /* lua_AnimationValue.cpp */, + 424F32111A60C28600395438 /* lua_AnimationValue.h */, + 424F32121A60C28600395438 /* lua_AudioBuffer.cpp */, + 424F32131A60C28600395438 /* lua_AudioBuffer.h */, + 424F32141A60C28600395438 /* lua_AudioController.cpp */, + 424F32151A60C28600395438 /* lua_AudioController.h */, + 424F32161A60C28600395438 /* lua_AudioListener.cpp */, + 424F32171A60C28600395438 /* lua_AudioListener.h */, + 424F32181A60C28600395438 /* lua_AudioSource.cpp */, + 424F32191A60C28600395438 /* lua_AudioSource.h */, + 424F321A1A60C28600395438 /* lua_BoundingBox.cpp */, + 424F321B1A60C28600395438 /* lua_BoundingBox.h */, + 424F321C1A60C28600395438 /* lua_BoundingSphere.cpp */, + 424F321D1A60C28600395438 /* lua_BoundingSphere.h */, + 424F321E1A60C28600395438 /* lua_Bundle.cpp */, + 424F321F1A60C28600395438 /* lua_Bundle.h */, + 424F32201A60C28600395438 /* lua_Button.cpp */, + 424F32211A60C28600395438 /* lua_Button.h */, + 424F32221A60C28600395438 /* lua_Camera.cpp */, + 424F32231A60C28600395438 /* lua_Camera.h */, + 424F32241A60C28600395438 /* lua_CameraListener.cpp */, + 424F32251A60C28600395438 /* lua_CameraListener.h */, + 424F32261A60C28600395438 /* lua_CheckBox.cpp */, + 424F32271A60C28600395438 /* lua_CheckBox.h */, + 424F32281A60C28600395438 /* lua_Container.cpp */, + 424F32291A60C28600395438 /* lua_Container.h */, + 424F322A1A60C28600395438 /* lua_Control.cpp */, + 424F322B1A60C28600395438 /* lua_Control.h */, + 424F322C1A60C28600395438 /* lua_ControlListener.cpp */, + 424F322D1A60C28600395438 /* lua_ControlListener.h */, + 424F322E1A60C28600395438 /* lua_Curve.cpp */, + 424F322F1A60C28600395438 /* lua_Curve.h */, + 424F32301A60C28600395438 /* lua_DepthStencilTarget.cpp */, + 424F32311A60C28600395438 /* lua_DepthStencilTarget.h */, + 424F32321A60C28600395438 /* lua_Drawable.cpp */, + 424F32331A60C28600395438 /* lua_Drawable.h */, + 424F32341A60C28600395438 /* lua_Effect.cpp */, + 424F32351A60C28600395438 /* lua_Effect.h */, + 424F32361A60C28600395438 /* lua_FileSystem.cpp */, + 424F32371A60C28600395438 /* lua_FileSystem.h */, + 424F32381A60C28600395438 /* lua_FlowLayout.cpp */, + 424F32391A60C28600395438 /* lua_FlowLayout.h */, + 424F323A1A60C28600395438 /* lua_Font.cpp */, + 424F323B1A60C28600395438 /* lua_Font.h */, + 424F323C1A60C28600395438 /* lua_Form.cpp */, + 424F323D1A60C28600395438 /* lua_Form.h */, + 424F323E1A60C28600395438 /* lua_FrameBuffer.cpp */, + 424F323F1A60C28600395438 /* lua_FrameBuffer.h */, + 424F32401A60C28600395438 /* lua_Frustum.cpp */, + 424F32411A60C28600395438 /* lua_Frustum.h */, + 424F32421A60C28600395438 /* lua_Game.cpp */, + 424F32431A60C28600395438 /* lua_Game.h */, + 424F32441A60C28600395438 /* lua_Gamepad.cpp */, + 424F32451A60C28600395438 /* lua_Gamepad.h */, + 424F32461A60C28600395438 /* lua_Gesture.cpp */, + 424F32471A60C28600395438 /* lua_Gesture.h */, + 424F32481A60C28600395438 /* lua_Global.cpp */, + 424F32491A60C28600395438 /* lua_Global.h */, + 424F324A1A60C28600395438 /* lua_HeightField.cpp */, + 424F324B1A60C28600395438 /* lua_HeightField.h */, + 424F324C1A60C28600395438 /* lua_Image.cpp */, + 424F324D1A60C28600395438 /* lua_Image.h */, + 424F324E1A60C28600395438 /* lua_ImageControl.cpp */, + 424F324F1A60C28600395438 /* lua_ImageControl.h */, + 424F32501A60C28600395438 /* lua_Joint.cpp */, + 424F32511A60C28600395438 /* lua_Joint.h */, + 424F32521A60C28600395438 /* lua_JoystickControl.cpp */, + 424F32531A60C28600395438 /* lua_JoystickControl.h */, + 424F32541A60C28600395438 /* lua_Keyboard.cpp */, + 424F32551A60C28600395438 /* lua_Keyboard.h */, + 424F32561A60C28600395438 /* lua_Label.cpp */, + 424F32571A60C28600395438 /* lua_Label.h */, + 424F32581A60C28600395438 /* lua_Layout.cpp */, + 424F32591A60C28600395438 /* lua_Layout.h */, + 424F325A1A60C28600395438 /* lua_Light.cpp */, + 424F325B1A60C28600395438 /* lua_Light.h */, + 424F325C1A60C28600395438 /* lua_Logger.cpp */, + 424F325D1A60C28600395438 /* lua_Logger.h */, + 424F325E1A60C28600395438 /* lua_Material.cpp */, + 424F325F1A60C28600395438 /* lua_Material.h */, + 424F32601A60C28600395438 /* lua_MaterialParameter.cpp */, + 424F32611A60C28600395438 /* lua_MaterialParameter.h */, + 424F32621A60C28600395438 /* lua_MathUtil.cpp */, + 424F32631A60C28600395438 /* lua_MathUtil.h */, + 424F32641A60C28600395438 /* lua_Matrix.cpp */, + 424F32651A60C28600395438 /* lua_Matrix.h */, + 424F32661A60C28600395438 /* lua_Mesh.cpp */, + 424F32671A60C28600395438 /* lua_Mesh.h */, + 424F32681A60C28600395438 /* lua_MeshBatch.cpp */, + 424F32691A60C28600395438 /* lua_MeshBatch.h */, + 424F326A1A60C28600395438 /* lua_MeshPart.cpp */, + 424F326B1A60C28600395438 /* lua_MeshPart.h */, + 424F326C1A60C28600395438 /* lua_MeshSkin.cpp */, + 424F326D1A60C28600395438 /* lua_MeshSkin.h */, + 424F326E1A60C28600395438 /* lua_Model.cpp */, + 424F326F1A60C28600395438 /* lua_Model.h */, + 424F32701A60C28600395438 /* lua_Mouse.cpp */, + 424F32711A60C28600395438 /* lua_Mouse.h */, + 424F32721A60C28600395438 /* lua_Node.cpp */, + 424F32731A60C28600395438 /* lua_Node.h */, + 424F32741A60C28600395438 /* lua_NodeCloneContext.cpp */, + 424F32751A60C28600395438 /* lua_NodeCloneContext.h */, + 424F32761A60C28600395438 /* lua_ParticleEmitter.cpp */, + 424F32771A60C28600395438 /* lua_ParticleEmitter.h */, + 424F32781A60C28600395438 /* lua_Pass.cpp */, + 424F32791A60C28600395438 /* lua_Pass.h */, + 424F327A1A60C28600395438 /* lua_PhysicsCharacter.cpp */, + 424F327B1A60C28600395438 /* lua_PhysicsCharacter.h */, + 424F327C1A60C28600395438 /* lua_PhysicsCollisionObject.cpp */, + 424F327D1A60C28600395438 /* lua_PhysicsCollisionObject.h */, + 424F327E1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp */, + 424F327F1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.h */, + 424F32801A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp */, + 424F32811A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.h */, + 424F32821A60C28600395438 /* lua_PhysicsCollisionShape.cpp */, + 424F32831A60C28600395438 /* lua_PhysicsCollisionShape.h */, + 424F32841A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp */, + 424F32851A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.h */, + 424F32861A60C28600395438 /* lua_PhysicsConstraint.cpp */, + 424F32871A60C28600395438 /* lua_PhysicsConstraint.h */, + 424F32881A60C28600395438 /* lua_PhysicsController.cpp */, + 424F32891A60C28600395438 /* lua_PhysicsController.h */, + 424F328A1A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp */, + 424F328B1A60C28600395438 /* lua_PhysicsControllerHitFilter.h */, + 424F328C1A60C28600395438 /* lua_PhysicsControllerHitResult.cpp */, + 424F328D1A60C28600395438 /* lua_PhysicsControllerHitResult.h */, + 424F328E1A60C28600395438 /* lua_PhysicsControllerListener.cpp */, + 424F328F1A60C28600395438 /* lua_PhysicsControllerListener.h */, + 424F32901A60C28600395438 /* lua_PhysicsFixedConstraint.cpp */, + 424F32911A60C28600395438 /* lua_PhysicsFixedConstraint.h */, + 424F32921A60C28600395438 /* lua_PhysicsGenericConstraint.cpp */, + 424F32931A60C28600395438 /* lua_PhysicsGenericConstraint.h */, + 424F32941A60C28600395438 /* lua_PhysicsGhostObject.cpp */, + 424F32951A60C28600395438 /* lua_PhysicsGhostObject.h */, + 424F32961A60C28600395438 /* lua_PhysicsHingeConstraint.cpp */, + 424F32971A60C28600395438 /* lua_PhysicsHingeConstraint.h */, + 424F32981A60C28600395438 /* lua_PhysicsRigidBody.cpp */, + 424F32991A60C28600395438 /* lua_PhysicsRigidBody.h */, + 424F329A1A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp */, + 424F329B1A60C28600395438 /* lua_PhysicsRigidBodyParameters.h */, + 424F329C1A60C28600395438 /* lua_PhysicsSocketConstraint.cpp */, + 424F329D1A60C28600395438 /* lua_PhysicsSocketConstraint.h */, + 424F329E1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp */, + 424F329F1A60C28600395438 /* lua_PhysicsSpringConstraint.h */, + 424F32A01A60C28600395438 /* lua_PhysicsVehicle.cpp */, + 424F32A11A60C28600395438 /* lua_PhysicsVehicle.h */, + 424F32A21A60C28600395438 /* lua_PhysicsVehicleWheel.cpp */, + 424F32A31A60C28600395438 /* lua_PhysicsVehicleWheel.h */, + 424F32A41A60C28600395438 /* lua_Plane.cpp */, + 424F32A51A60C28600395438 /* lua_Plane.h */, + 424F32A61A60C28600395438 /* lua_Platform.cpp */, + 424F32A71A60C28600395438 /* lua_Platform.h */, + 424F32A81A60C28600395438 /* lua_Properties.cpp */, + 424F32A91A60C28600395438 /* lua_Properties.h */, + 424F32AA1A60C28600395438 /* lua_Quaternion.cpp */, + 424F32AB1A60C28600395438 /* lua_Quaternion.h */, + 424F32AC1A60C28600395438 /* lua_RadioButton.cpp */, + 424F32AD1A60C28600395438 /* lua_RadioButton.h */, + 424F32AE1A60C28600395438 /* lua_Ray.cpp */, + 424F32AF1A60C28600395438 /* lua_Ray.h */, + 424F32B01A60C28600395438 /* lua_Rectangle.cpp */, + 424F32B11A60C28600395438 /* lua_Rectangle.h */, + 424F32B21A60C28600395438 /* lua_Ref.cpp */, + 424F32B31A60C28600395438 /* lua_Ref.h */, + 424F32B41A60C28600395438 /* lua_RenderState.cpp */, + 424F32B51A60C28600395438 /* lua_RenderState.h */, + 424F32B61A60C28600395438 /* lua_RenderStateStateBlock.cpp */, + 424F32B71A60C28600395438 /* lua_RenderStateStateBlock.h */, + 424F32B81A60C28600395438 /* lua_RenderTarget.cpp */, + 424F32B91A60C28600395438 /* lua_RenderTarget.h */, + 424F32BA1A60C28600395438 /* lua_Scene.cpp */, + 424F32BB1A60C28600395438 /* lua_Scene.h */, + 424F32BC1A60C28600395438 /* lua_ScreenDisplayer.cpp */, + 424F32BD1A60C28600395438 /* lua_ScreenDisplayer.h */, + 424F32BE1A60C28600395438 /* lua_Script.cpp */, + 424F32BF1A60C28600395438 /* lua_Script.h */, + 424F32C01A60C28600395438 /* lua_ScriptController.cpp */, + 424F32C11A60C28600395438 /* lua_ScriptController.h */, + 424F32C21A60C28600395438 /* lua_ScriptTarget.cpp */, + 424F32C31A60C28600395438 /* lua_ScriptTarget.h */, + 424F32C41A60C28600395438 /* lua_ScriptTargetEvent.cpp */, + 424F32C51A60C28600395438 /* lua_ScriptTargetEvent.h */, + 424F32C61A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp */, + 424F32C71A60C28600395438 /* lua_ScriptTargetEventRegistry.h */, + 424F32C81A60C28600395438 /* lua_Slider.cpp */, + 424F32C91A60C28600395438 /* lua_Slider.h */, + 424F32CA1A60C28600395438 /* lua_Sprite.cpp */, + 424F32CB1A60C28600395438 /* lua_Sprite.h */, + 424F32CC1A60C28600395438 /* lua_SpriteBatch.cpp */, + 424F32CD1A60C28600395438 /* lua_SpriteBatch.h */, + 424F32CE1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp */, + 424F32CF1A60C28600395438 /* lua_SpriteBatchSpriteVertex.h */, + 424F32D01A60C28600395438 /* lua_Technique.cpp */, + 424F32D11A60C28600395438 /* lua_Technique.h */, + 424F32D21A60C28600395438 /* lua_Terrain.cpp */, + 424F32D31A60C28600395438 /* lua_Terrain.h */, + 424F32D41A60C28600395438 /* lua_TerrainPatch.cpp */, + 424F32D51A60C28600395438 /* lua_TerrainPatch.h */, + 424F32D61A60C28600395438 /* lua_Text.cpp */, + 424F32D71A60C28600395438 /* lua_Text.h */, + 424F32D81A60C28600395438 /* lua_TextBox.cpp */, + 424F32D91A60C28600395438 /* lua_TextBox.h */, + 424F32DA1A60C28600395438 /* lua_Texture.cpp */, + 424F32DB1A60C28600395438 /* lua_Texture.h */, + 424F32DC1A60C28600395438 /* lua_TextureSampler.cpp */, + 424F32DD1A60C28600395438 /* lua_TextureSampler.h */, + 424F32DE1A60C28600395438 /* lua_Theme.cpp */, + 424F32DF1A60C28600395438 /* lua_Theme.h */, + 424F32E01A60C28600395438 /* lua_ThemeSideRegions.cpp */, + 424F32E11A60C28600395438 /* lua_ThemeSideRegions.h */, + 424F32E21A60C28600395438 /* lua_ThemeStyle.cpp */, + 424F32E31A60C28600395438 /* lua_ThemeStyle.h */, + 424F32E41A60C28600395438 /* lua_ThemeThemeImage.cpp */, + 424F32E51A60C28600395438 /* lua_ThemeThemeImage.h */, + 424F32E61A60C28600395438 /* lua_ThemeUVs.cpp */, + 424F32E71A60C28600395438 /* lua_ThemeUVs.h */, + 424F32E81A60C28600395438 /* lua_TileSet.cpp */, + 424F32E91A60C28600395438 /* lua_TileSet.h */, + 424F32EA1A60C28600395438 /* lua_Touch.cpp */, + 424F32EB1A60C28600395438 /* lua_Touch.h */, + 424F32EC1A60C28600395438 /* lua_Transform.cpp */, + 424F32ED1A60C28600395438 /* lua_Transform.h */, + 424F32EE1A60C28600395438 /* lua_TransformListener.cpp */, + 424F32EF1A60C28600395438 /* lua_TransformListener.h */, + 424F32F01A60C28600395438 /* lua_Uniform.cpp */, + 424F32F11A60C28600395438 /* lua_Uniform.h */, + 424F32F21A60C28600395438 /* lua_Vector2.cpp */, + 424F32F31A60C28600395438 /* lua_Vector2.h */, + 424F32F41A60C28600395438 /* lua_Vector3.cpp */, + 424F32F51A60C28600395438 /* lua_Vector3.h */, + 424F32F61A60C28600395438 /* lua_Vector4.cpp */, + 424F32F71A60C28600395438 /* lua_Vector4.h */, + 424F32F81A60C28600395438 /* lua_VertexAttributeBinding.cpp */, + 424F32F91A60C28600395438 /* lua_VertexAttributeBinding.h */, + 424F32FA1A60C28600395438 /* lua_VertexFormat.cpp */, + 424F32FB1A60C28600395438 /* lua_VertexFormat.h */, + 424F32FC1A60C28600395438 /* lua_VertexFormatElement.cpp */, + 424F32FD1A60C28600395438 /* lua_VertexFormatElement.h */, + 424F32FE1A60C28600395438 /* lua_VerticalLayout.cpp */, + 424F32FF1A60C28600395438 /* lua_VerticalLayout.h */, ); name = lua; path = src/lua; @@ -1623,7 +1371,6 @@ children = ( 5BC4E7D4150F8C3C00CBE1C0 /* res */, 4234D9A314686C52003031B3 /* src */, - 427D4F42147DC8DE0076760E /* Libraries */, 42CCD4AF146D811D00353661 /* Frameworks */, 4234D99B14686C52003031B3 /* Products */, ); @@ -1699,6 +1446,8 @@ 42CC532B1809A4EB00AAD8AD /* DebugNew.h */, 42CC532C1809A4EB00AAD8AD /* DepthStencilTarget.cpp */, 42CC532D1809A4EB00AAD8AD /* DepthStencilTarget.h */, + 42D929991A6051EC0073258D /* Drawable.cpp */, + 42D9299A1A6051EC0073258D /* Drawable.h */, 42CC532E1809A4EB00AAD8AD /* Effect.cpp */, 42CC532F1809A4EB00AAD8AD /* Effect.h */, 42CC53301809A4EB00AAD8AD /* FileSystem.cpp */, @@ -1719,7 +1468,6 @@ 42CC533F1809A4EB00AAD8AD /* Gamepad.cpp */, 42CC53401809A4EB00AAD8AD /* Gamepad.h */, 42CC53411809A4EB00AAD8AD /* gameplay-main-android.cpp */, - 42CC53421809A4EB00AAD8AD /* gameplay-main-blackberry.cpp */, 42CC53431809A4EB00AAD8AD /* gameplay-main-ios.mm */, 42CC53441809A4EB00AAD8AD /* gameplay-main-linux.cpp */, 42CC53451809A4EB00AAD8AD /* gameplay-main-macosx.mm */, @@ -1814,7 +1562,6 @@ 42CC55081809A4ED00AAD8AD /* Platform.cpp */, 42CC55091809A4ED00AAD8AD /* Platform.h */, 42CC550A1809A4ED00AAD8AD /* PlatformAndroid.cpp */, - 42CC550B1809A4ED00AAD8AD /* PlatformBlackBerry.cpp */, 42CC550C1809A4ED00AAD8AD /* PlatformiOS.mm */, 42CC550D1809A4ED00AAD8AD /* PlatformLinux.cpp */, 42CC550E1809A4ED00AAD8AD /* PlatformMacOSX.mm */, @@ -1843,6 +1590,8 @@ 42CC55251809A4EE00AAD8AD /* SceneLoader.h */, 42CC552A1809A4EE00AAD8AD /* ScreenDisplayer.cpp */, 42CC552B1809A4EE00AAD8AD /* ScreenDisplayer.h */, + DD4FBEA31A0C0D240015D30C /* Script.cpp */, + DD4FBEA41A0C0D240015D30C /* Script.h */, 42CC552C1809A4EE00AAD8AD /* ScriptController.cpp */, 42CC552D1809A4EE00AAD8AD /* ScriptController.h */, 42CC552E1809A4EE00AAD8AD /* ScriptController.inl */, @@ -1850,6 +1599,8 @@ 42CC55301809A4EE00AAD8AD /* ScriptTarget.h */, 42CC55311809A4EE00AAD8AD /* Slider.cpp */, 42CC55321809A4EE00AAD8AD /* Slider.h */, + 4204EC441A2F878C0074FCE9 /* Sprite.cpp */, + 4204EC431A2F70BA0074FCE9 /* Sprite.h */, 42CC55451809A4EE00AAD8AD /* SpriteBatch.cpp */, 42CC55461809A4EE00AAD8AD /* SpriteBatch.h */, 42CC55471809A4EE00AAD8AD /* Stream.h */, @@ -1859,6 +1610,8 @@ 42CC554B1809A4EE00AAD8AD /* Terrain.h */, 42CC554C1809A4EE00AAD8AD /* TerrainPatch.cpp */, 42CC554D1809A4EE00AAD8AD /* TerrainPatch.h */, + 42ECC3F81A4EF5A00036C839 /* Text.cpp */, + 42ECC3F91A4EF5A00036C839 /* Text.h */, 42CC554E1809A4EE00AAD8AD /* TextBox.cpp */, 42CC554F1809A4EE00AAD8AD /* TextBox.h */, 42CC55501809A4EE00AAD8AD /* Texture.cpp */, @@ -1867,6 +1620,8 @@ 42CC55531809A4EE00AAD8AD /* Theme.h */, 42CC55541809A4EE00AAD8AD /* ThemeStyle.cpp */, 42CC55551809A4EE00AAD8AD /* ThemeStyle.h */, + 4204EC3F1A2EB8310074FCE9 /* TileSet.cpp */, + 4204EC401A2EB8310074FCE9 /* TileSet.h */, 42CC55561809A4EE00AAD8AD /* TimeListener.h */, 42CC55571809A4EE00AAD8AD /* Touch.h */, 42CC55581809A4EE00AAD8AD /* Transform.cpp */, @@ -1891,20 +1646,11 @@ path = gameplay; sourceTree = ""; }; - 427D4F42147DC8DE0076760E /* Libraries */ = { - isa = PBXGroup; - children = ( - 5B5ADCE114C22DC700AC6109 /* MacOSX */, - 5B5ADCE014C22DBE00AC6109 /* iOS */, - ); - name = Libraries; - sourceTree = ""; - }; 42CCD4AF146D811D00353661 /* Frameworks */ = { isa = PBXGroup; children = ( - 5B04C5FE14BFE52F00EB0071 /* MacOSX */, 5B04C5FD14BFE52300EB0071 /* iOS */, + 5B04C5FE14BFE52F00EB0071 /* MacOSX */, ); name = Frameworks; sourceTree = ""; @@ -1936,32 +1682,6 @@ name = MacOSX; sourceTree = ""; }; - 5B5ADCE014C22DBE00AC6109 /* iOS */ = { - isa = PBXGroup; - children = ( - 5B5DB92D14C25B7B007755DB /* libbullet.a */, - 42B701F815B081B6002BB8C3 /* liblua.a */, - 5B5DB92F14C25B94007755DB /* libpng.a */, - 5B5DB93114C25BA5007755DB /* libogg.a */, - 5B5DB93214C25BA5007755DB /* libvorbis.a */, - 42DFAB4F16AD8ECD0000F342 /* libz.dylib */, - ); - name = iOS; - sourceTree = ""; - }; - 5B5ADCE114C22DC700AC6109 /* MacOSX */ = { - isa = PBXGroup; - children = ( - 42CD0DA6147D8EA80000361E /* libbullet.a */, - 42B701F615B08177002BB8C3 /* liblua.a */, - 42CCD555146EC1EB00353661 /* libpng.a */, - 42CD0DA7147D8EA80000361E /* libogg.a */, - 42CD0DA8147D8EA80000361E /* libvorbis.a */, - 5B2BC7631512516B00D176CD /* libz.dylib */, - ); - name = MacOSX; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -2003,7 +1723,7 @@ 4234D98C14686BB6003031B3 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0610; }; buildConfigurationList = 4234D98F14686BB6003031B3 /* Build configuration list for PBXProject "gameplay" */; compatibilityVersion = "Xcode 3.2"; @@ -2028,294 +1748,255 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 420BBCB61817416F00C7B720 /* lua_Effect.cpp in Sources */, - 420BBE3A1817416F00C7B720 /* lua_RenderStateStencilOperation.cpp in Sources */, - 420BBDDE1817416F00C7B720 /* lua_PhysicsRigidBody.cpp in Sources */, + 424F33A61A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp in Sources */, 42CC59861809A4EF00AAD8AD /* RadioButton.cpp in Sources */, - 420BBDBE1817416F00C7B720 /* lua_PhysicsControllerHitFilter.cpp in Sources */, + 424F330A1A60C28600395438 /* lua_AIState.cpp in Sources */, 42CC596E1809A4EF00AAD8AD /* Platform.cpp in Sources */, - 420BBDF61817416F00C7B720 /* lua_Plane.cpp in Sources */, + 424F331C1A60C28600395438 /* lua_AnimationValue.cpp in Sources */, + 424F338E1A60C28600395438 /* lua_PhysicsCollisionShape.cpp in Sources */, + 424F33FE1A60C28600395438 /* lua_Vector2.cpp in Sources */, 42CC56001809A4EF00AAD8AD /* gameplay-main-linux.cpp in Sources */, - 420BBC4E1817416F00C7B720 /* lua_AnimationTarget.cpp in Sources */, - 420BBC1E1817416F00C7B720 /* lua_AIController.cpp in Sources */, 42CC598A1809A4EF00AAD8AD /* Ray.cpp in Sources */, - 420BBCC21817416F00C7B720 /* lua_Font.cpp in Sources */, 42CC56041809A4EF00AAD8AD /* gameplay-main-windows.cpp in Sources */, - 420BBC861817416F00C7B720 /* lua_Container.cpp in Sources */, - 420BBC5A1817416F00C7B720 /* lua_AudioController.cpp in Sources */, - 420BBE0E1817416F00C7B720 /* lua_Ray.cpp in Sources */, - 420BBD821817416F00C7B720 /* lua_NodeType.cpp in Sources */, + 424F33EC1A60C28600395438 /* lua_ThemeSideRegions.cpp in Sources */, 42CC59AE1809A4EF00AAD8AD /* ScreenDisplayer.cpp in Sources */, + 424F332E1A60C28600395438 /* lua_Camera.cpp in Sources */, + 424F33BA1A60C28600395438 /* lua_Ray.cpp in Sources */, 42CC599A1809A4EF00AAD8AD /* RenderTarget.cpp in Sources */, - 420BBE621817416F00C7B720 /* lua_SpriteBatch.cpp in Sources */, 42CC59421809A4EF00AAD8AD /* PhysicsController.cpp in Sources */, 42CC59E61809A4EF00AAD8AD /* Technique.cpp in Sources */, - 420BBDAA1817416F00C7B720 /* lua_PhysicsCollisionShape.cpp in Sources */, + 424F33E01A60C28600395438 /* lua_TerrainPatch.cpp in Sources */, + 424F33D41A60C28600395438 /* lua_Slider.cpp in Sources */, + 424F33741A60C28600395438 /* lua_MeshBatch.cpp in Sources */, 42CC598E1809A4EF00AAD8AD /* Rectangle.cpp in Sources */, 42CC55DE1809A4EF00AAD8AD /* FlowLayout.cpp in Sources */, - 420BBE861817416F00C7B720 /* lua_TextureFormat.cpp in Sources */, - 426F831B187F72DF00640CBA /* lua_JoystickControl.cpp in Sources */, + 424F337E1A60C28600395438 /* lua_Node.cpp in Sources */, + 424F33101A60C28600395438 /* lua_all_bindings.cpp in Sources */, + 4204EC411A2EB8310074FCE9 /* TileSet.cpp in Sources */, 42CC59F61809A4EF00AAD8AD /* Texture.cpp in Sources */, 42CC55CA1809A4EF00AAD8AD /* Curve.cpp in Sources */, - 420BBDAE1817416F00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */, - 420BBD9E1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp in Sources */, - 420BBDDA1817416F00C7B720 /* lua_PhysicsHingeConstraint.cpp in Sources */, 42CC599E1809A4EF00AAD8AD /* Scene.cpp in Sources */, 42CC593E1809A4EF00AAD8AD /* PhysicsConstraint.cpp in Sources */, - 420BBDB61817416F00C7B720 /* lua_PhysicsConstraint.cpp in Sources */, + 424F33261A60C28600395438 /* lua_BoundingBox.cpp in Sources */, 42CC55981809A4EF00AAD8AD /* AudioBuffer.cpp in Sources */, - 420BBC961817416F00C7B720 /* lua_ControlAutoSize.cpp in Sources */, - 420BBD261817416F00C7B720 /* lua_KeyboardKeyEvent.cpp in Sources */, - 420BBD4A1817416F00C7B720 /* lua_MaterialParameter.cpp in Sources */, - 420BBEAA1817416F00C7B720 /* lua_TouchTouchEvent.cpp in Sources */, 42CC55A41809A4EF00AAD8AD /* AudioSource.cpp in Sources */, - 420BBC8A1817416F00C7B720 /* lua_ContainerScroll.cpp in Sources */, + 424F33DC1A60C28600395438 /* lua_Technique.cpp in Sources */, 42CC55C61809A4EF00AAD8AD /* Control.cpp in Sources */, - 420BBC821817416F00C7B720 /* lua_CheckBox.cpp in Sources */, - 420BBDBA1817416F00C7B720 /* lua_PhysicsController.cpp in Sources */, - 420BBE7E1817416F00C7B720 /* lua_Texture.cpp in Sources */, + 424F33501A60C28600395438 /* lua_Gamepad.cpp in Sources */, + 424F34001A60C28600395438 /* lua_Vector3.cpp in Sources */, 42CC56161809A4EF00AAD8AD /* Joint.cpp in Sources */, 42CC59961809A4EF00AAD8AD /* RenderState.cpp in Sources */, + 424F33841A60C28600395438 /* lua_Pass.cpp in Sources */, + 424F33481A60C28600395438 /* lua_Form.cpp in Sources */, + 424F340A1A60C28600395438 /* lua_VerticalLayout.cpp in Sources */, + 424F33641A60C28600395438 /* lua_Layout.cpp in Sources */, + 424F333E1A60C28600395438 /* lua_Drawable.cpp in Sources */, 42CC59721809A4EF00AAD8AD /* PlatformAndroid.cpp in Sources */, - 420BBD3E1817416F00C7B720 /* lua_Logger.cpp in Sources */, - 420BBC921817416F00C7B720 /* lua_ControlAlignment.cpp in Sources */, - 420BBCEE1817416F00C7B720 /* lua_GamepadButtonMapping.cpp in Sources */, - 420BBD2E1817416F00C7B720 /* lua_Layout.cpp in Sources */, - 420BBC6A1817416F00C7B720 /* lua_BoundingBox.cpp in Sources */, + 424F336C1A60C28600395438 /* lua_MaterialParameter.cpp in Sources */, 42CC55881809A4EF00AAD8AD /* AnimationClip.cpp in Sources */, - 420BBD921817416F00C7B720 /* lua_PhysicsCharacter.cpp in Sources */, - 420BBE561817416F00C7B720 /* lua_ScriptController.cpp in Sources */, - 420BBE261817416F00C7B720 /* lua_RenderStateCullFaceSide.cpp in Sources */, - 420BBDA21817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */, 42CC59921809A4EF00AAD8AD /* Ref.cpp in Sources */, - 420BBD9A1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */, + 424F33921A60C28600395438 /* lua_PhysicsConstraint.cpp in Sources */, 42CC595A1809A4EF00AAD8AD /* PhysicsSocketConstraint.cpp in Sources */, 42CC59EA1809A4EF00AAD8AD /* Terrain.cpp in Sources */, + 424F338C1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */, 42CC597E1809A4EF00AAD8AD /* Properties.cpp in Sources */, 42CC5A161809A4EF00AAD8AD /* VertexAttributeBinding.cpp in Sources */, - 420BBED21817416F00C7B720 /* lua_VertexFormatUsage.cpp in Sources */, - 420BBDFA1817416F00C7B720 /* lua_Platform.cpp in Sources */, + 424F33761A60C28600395438 /* lua_MeshPart.cpp in Sources */, 42CC59B21809A4EF00AAD8AD /* ScriptController.cpp in Sources */, - 420BBDCE1817416F00C7B720 /* lua_PhysicsFixedConstraint.cpp in Sources */, - 420BBE121817416F00C7B720 /* lua_Rectangle.cpp in Sources */, + 424F33421A60C28600395438 /* lua_FileSystem.cpp in Sources */, 42CC55AA1809A4EF00AAD8AD /* BoundingBox.cpp in Sources */, - 420BBDCA1817416F00C7B720 /* lua_PhysicsControllerListenerEventType.cpp in Sources */, 42CC55941809A4EF00AAD8AD /* AnimationValue.cpp in Sources */, + DD4FBEA51A0C0D240015D30C /* Script.cpp in Sources */, + 424F334A1A60C28600395438 /* lua_FrameBuffer.cpp in Sources */, + 424F33DE1A60C28600395438 /* lua_Terrain.cpp in Sources */, + 424F33CA1A60C28600395438 /* lua_Script.cpp in Sources */, + 424F33D61A60C28600395438 /* lua_Sprite.cpp in Sources */, 42CC5A0E1809A4EF00AAD8AD /* Vector3.cpp in Sources */, - 420BBCC61817416F00C7B720 /* lua_FontFormat.cpp in Sources */, - 42CC59741809A4EF00AAD8AD /* PlatformBlackBerry.cpp in Sources */, + 424F33281A60C28600395438 /* lua_BoundingSphere.cpp in Sources */, 42CC55BA1809A4EF00AAD8AD /* Camera.cpp in Sources */, 42CC59201809A4EF00AAD8AD /* Model.cpp in Sources */, - 420BBC161817416F00C7B720 /* lua_AIAgent.cpp in Sources */, 42CC59EE1809A4EF00AAD8AD /* TerrainPatch.cpp in Sources */, + 424F33441A60C28600395438 /* lua_FlowLayout.cpp in Sources */, + 424F33221A60C28600395438 /* lua_AudioListener.cpp in Sources */, + 424F33461A60C28600395438 /* lua_Font.cpp in Sources */, + 424F339A1A60C28600395438 /* lua_PhysicsControllerListener.cpp in Sources */, 42CC557C1809A4EF00AAD8AD /* AIState.cpp in Sources */, + 424F33141A60C28600395438 /* lua_AnimationClip.cpp in Sources */, 42CC59001809A4EF00AAD8AD /* Material.cpp in Sources */, - 420BBE921817416F00C7B720 /* lua_Theme.cpp in Sources */, - 420BBD0E1817416F00C7B720 /* lua_ImageControl.cpp in Sources */, - 420BBE9E1817416F00C7B720 /* lua_ThemeThemeImage.cpp in Sources */, - 420BBE6E1817416F00C7B720 /* lua_TerrainFlags.cpp in Sources */, + 424F33801A60C28600395438 /* lua_NodeCloneContext.cpp in Sources */, + 424F339C1A60C28600395438 /* lua_PhysicsFixedConstraint.cpp in Sources */, 426F8317187F72A700640CBA /* JoystickControl.cpp in Sources */, + 424F33F21A60C28600395438 /* lua_ThemeUVs.cpp in Sources */, 42CC5A1E1809A4EF00AAD8AD /* VerticalLayout.cpp in Sources */, - 42252DD01828145B00EE234B /* lua_TerrainPatch.cpp in Sources */, - 420BBCB21817416F00C7B720 /* lua_DepthStencilTargetFormat.cpp in Sources */, - 420BBCAE1817416F00C7B720 /* lua_DepthStencilTarget.cpp in Sources */, + 424F33FA1A60C28600395438 /* lua_TransformListener.cpp in Sources */, + 424F33561A60C28600395438 /* lua_HeightField.cpp in Sources */, 42CC59821809A4EF00AAD8AD /* Quaternion.cpp in Sources */, 42CC59E01809A4EF00AAD8AD /* SpriteBatch.cpp in Sources */, - 420BBE021817416F00C7B720 /* lua_PropertiesType.cpp in Sources */, - 420BBD221817416F00C7B720 /* lua_KeyboardKey.cpp in Sources */, - 420BBECE1817416F00C7B720 /* lua_VertexFormatElement.cpp in Sources */, 42CC59521809A4EF00AAD8AD /* PhysicsHingeConstraint.cpp in Sources */, + 424F33861A60C28600395438 /* lua_PhysicsCharacter.cpp in Sources */, + 424F335C1A60C28600395438 /* lua_Joint.cpp in Sources */, 42CC55EE1809A4EF00AAD8AD /* Frustum.cpp in Sources */, - 420BBD121817416F00C7B720 /* lua_ImageFormat.cpp in Sources */, + 424F33D21A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp in Sources */, + 424F33C61A60C28600395438 /* lua_Scene.cpp in Sources */, 42CC55901809A4EF00AAD8AD /* AnimationTarget.cpp in Sources */, + 424F33521A60C28600395438 /* lua_Gesture.cpp in Sources */, + 424F33601A60C28600395438 /* lua_Keyboard.cpp in Sources */, 42CC55D61809A4EF00AAD8AD /* Effect.cpp in Sources */, 42CC562C1809A4EF00AAD8AD /* Logger.cpp in Sources */, - 420BBD761817416F00C7B720 /* lua_MouseMouseEvent.cpp in Sources */, - 420BBE3E1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */, + 424F330C1A60C28600395438 /* lua_AIStateListener.cpp in Sources */, 42CC56281809A4EF00AAD8AD /* Light.cpp in Sources */, - 420BBD8E1817416F00C7B720 /* lua_Pass.cpp in Sources */, 42CC59041809A4EF00AAD8AD /* MaterialParameter.cpp in Sources */, 42CC55841809A4EF00AAD8AD /* Animation.cpp in Sources */, - 420BBC361817416F00C7B720 /* lua_all_bindings.cpp in Sources */, - 420BBEB21817416F00C7B720 /* lua_TransformListener.cpp in Sources */, - 420BBD7E1817416F00C7B720 /* lua_NodeCloneContext.cpp in Sources */, - 420BBE421817416F00C7B720 /* lua_Scene.cpp in Sources */, 42CC558C1809A4EF00AAD8AD /* AnimationController.cpp in Sources */, - 420BBDA61817416F00C7B720 /* lua_PhysicsCollisionObjectType.cpp in Sources */, - 420BBD3A1817416F00C7B720 /* lua_LightType.cpp in Sources */, - 420BBE961817416F00C7B720 /* lua_ThemeSideRegions.cpp in Sources */, - 420BBCD61817416F00C7B720 /* lua_Form.cpp in Sources */, - 420BBC621817416F00C7B720 /* lua_AudioSource.cpp in Sources */, 42CC59F21809A4EF00AAD8AD /* TextBox.cpp in Sources */, + 424F33B21A60C28600395438 /* lua_Platform.cpp in Sources */, + 424F33041A60C28600395438 /* lua_AIAgentListener.cpp in Sources */, 42CC5A1A1809A4EF00AAD8AD /* VertexFormat.cpp in Sources */, - 420BBD421817416F00C7B720 /* lua_LoggerLevel.cpp in Sources */, - 420BBCBE1817416F00C7B720 /* lua_FlowLayout.cpp in Sources */, - 420BBD721817416F00C7B720 /* lua_Mouse.cpp in Sources */, 42CC5A061809A4EF00AAD8AD /* Transform.cpp in Sources */, - 420BBEC21817416F00C7B720 /* lua_Vector4.cpp in Sources */, - 420BBE1E1817416F00C7B720 /* lua_RenderStateAutoBinding.cpp in Sources */, + 424F33821A60C28600395438 /* lua_ParticleEmitter.cpp in Sources */, 42CC559C1809A4EF00AAD8AD /* AudioController.cpp in Sources */, 42CC55BE1809A4EF00AAD8AD /* CheckBox.cpp in Sources */, 42CC5A0A1809A4EF00AAD8AD /* Vector2.cpp in Sources */, - 420BBE221817416F00C7B720 /* lua_RenderStateBlend.cpp in Sources */, - 420BBE361817416F00C7B720 /* lua_RenderStateStencilFunction.cpp in Sources */, + 424F33D01A60C28600395438 /* lua_ScriptTargetEvent.cpp in Sources */, 42CC55A01809A4EF00AAD8AD /* AudioListener.cpp in Sources */, + 424F33981A60C28600395438 /* lua_PhysicsControllerHitResult.cpp in Sources */, + 424F335A1A60C28600395438 /* lua_ImageControl.cpp in Sources */, + 424F33781A60C28600395438 /* lua_MeshSkin.cpp in Sources */, + 424F33401A60C28600395438 /* lua_Effect.cpp in Sources */, 42CC5A121809A4EF00AAD8AD /* Vector4.cpp in Sources */, - 420BBE661817416F00C7B720 /* lua_Technique.cpp in Sources */, - 420BBE5A1817416F00C7B720 /* lua_ScriptTarget.cpp in Sources */, - 420BBD361817416F00C7B720 /* lua_Light.cpp in Sources */, + 424F33241A60C28600395438 /* lua_AudioSource.cpp in Sources */, + 424F33C01A60C28600395438 /* lua_RenderState.cpp in Sources */, + 424F33961A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp in Sources */, 42CC59BA1809A4EF00AAD8AD /* Slider.cpp in Sources */, - 420BBC5E1817416F00C7B720 /* lua_AudioListener.cpp in Sources */, - 420BBC521817416F00C7B720 /* lua_AnimationValue.cpp in Sources */, - 420BBC9E1817416F00C7B720 /* lua_ControlListenerEventType.cpp in Sources */, - 420BBC261817416F00C7B720 /* lua_AIMessageParameterType.cpp in Sources */, 42CC59321809A4EF00AAD8AD /* PhysicsCharacter.cpp in Sources */, - 420BBD2A1817416F00C7B720 /* lua_Label.cpp in Sources */, - 420BBDE21817416F00C7B720 /* lua_PhysicsRigidBodyParameters.cpp in Sources */, - 420BBDF21817416F00C7B720 /* lua_PhysicsVehicleWheel.cpp in Sources */, + 424F33201A60C28600395438 /* lua_AudioController.cpp in Sources */, + 424F33B41A60C28600395438 /* lua_Properties.cpp in Sources */, + 424F33001A60C28600395438 /* lua_AbsoluteLayout.cpp in Sources */, + 424F33BE1A60C28600395438 /* lua_Ref.cpp in Sources */, + 424F337A1A60C28600395438 /* lua_Model.cpp in Sources */, + 424F33681A60C28600395438 /* lua_Logger.cpp in Sources */, 42CC59081809A4EF00AAD8AD /* MathUtil.cpp in Sources */, - 420BBEBE1817416F00C7B720 /* lua_Vector3.cpp in Sources */, - 420BBE761817416F00C7B720 /* lua_TextBox.cpp in Sources */, + 424F339E1A60C28600395438 /* lua_PhysicsGenericConstraint.cpp in Sources */, 42CC55EA1809A4EF00AAD8AD /* FrameBuffer.cpp in Sources */, + 424F33341A60C28600395438 /* lua_Container.cpp in Sources */, 42CC59561809A4EF00AAD8AD /* PhysicsRigidBody.cpp in Sources */, - 420BBCAA1817416F00C7B720 /* lua_CurveInterpolationType.cpp in Sources */, - 420BBD161817416F00C7B720 /* lua_Joint.cpp in Sources */, - 420BBCCE1817416F00C7B720 /* lua_FontStyle.cpp in Sources */, - 420BBE8A1817416F00C7B720 /* lua_TextureSampler.cpp in Sources */, - 420BBE5E1817416F00C7B720 /* lua_Slider.cpp in Sources */, - 420BBDD61817416F00C7B720 /* lua_PhysicsGhostObject.cpp in Sources */, - 420BBCE61817416F00C7B720 /* lua_GameClearFlags.cpp in Sources */, 42CC59261809A4EF00AAD8AD /* Node.cpp in Sources */, + 424F33BC1A60C28600395438 /* lua_Rectangle.cpp in Sources */, 42CC597A1809A4EF00AAD8AD /* PlatformMacOSX.mm in Sources */, - 420BBEAE1817416F00C7B720 /* lua_Transform.cpp in Sources */, - 420BBD961817416F00C7B720 /* lua_PhysicsCollisionObject.cpp in Sources */, - 420BBDEE1817416F00C7B720 /* lua_PhysicsVehicle.cpp in Sources */, - 420BBC2E1817416F00C7B720 /* lua_AIStateListener.cpp in Sources */, - 420BBD0A1817416F00C7B720 /* lua_Image.cpp in Sources */, - 420BBD1E1817416F00C7B720 /* lua_Keyboard.cpp in Sources */, + 424F33D81A60C28600395438 /* lua_SpriteBatch.cpp in Sources */, + 424F33A81A60C28600395438 /* lua_PhysicsSocketConstraint.cpp in Sources */, + 424F33381A60C28600395438 /* lua_ControlListener.cpp in Sources */, + 424F34041A60C28600395438 /* lua_VertexAttributeBinding.cpp in Sources */, + 4204EC451A2F878C0074FCE9 /* Sprite.cpp in Sources */, + 424F337C1A60C28600395438 /* lua_Mouse.cpp in Sources */, + 424F333C1A60C28600395438 /* lua_DepthStencilTarget.cpp in Sources */, 42CC592A1809A4EF00AAD8AD /* ParticleEmitter.cpp in Sources */, - 420BBC461817416F00C7B720 /* lua_AnimationClipListenerEventType.cpp in Sources */, - 42CC55FC1809A4EF00AAD8AD /* gameplay-main-blackberry.cpp in Sources */, 42CC560A1809A4EF00AAD8AD /* HeightField.cpp in Sources */, - 420BBE321817416F00C7B720 /* lua_RenderStateStateBlock.cpp in Sources */, - 420BBC3E1817416F00C7B720 /* lua_AnimationClip.cpp in Sources */, - 420BBE521817416F00C7B720 /* lua_ScreenDisplayer.cpp in Sources */, + 42D9299B1A6051EC0073258D /* Drawable.cpp in Sources */, + 424F33901A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */, 42CC55AE1809A4EF00AAD8AD /* BoundingSphere.cpp in Sources */, - 420BBCF21817416F00C7B720 /* lua_GamepadGamepadEvent.cpp in Sources */, - 420BBED61817416F00C7B720 /* lua_VerticalLayout.cpp in Sources */, 42CC55CE1809A4EF00AAD8AD /* DebugNew.cpp in Sources */, - 420BBE7A1817416F00C7B720 /* lua_TextBoxInputMode.cpp in Sources */, - 420BBD8A1817416F00C7B720 /* lua_ParticleEmitterTextureBlending.cpp in Sources */, - 420BBDEA1817416F00C7B720 /* lua_PhysicsSpringConstraint.cpp in Sources */, + 424F33581A60C28600395438 /* lua_Image.cpp in Sources */, + 424F332C1A60C28600395438 /* lua_Button.cpp in Sources */, + 424F33B01A60C28600395438 /* lua_Plane.cpp in Sources */, 42CC59141809A4EF00AAD8AD /* MeshBatch.cpp in Sources */, + 424F33CC1A60C28600395438 /* lua_ScriptController.cpp in Sources */, 42CC55701809A4EF00AAD8AD /* AIAgent.cpp in Sources */, + 424F330E1A60C28600395438 /* lua_AIStateMachine.cpp in Sources */, + 424F33C41A60C28600395438 /* lua_RenderTarget.cpp in Sources */, + 424F33DA1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp in Sources */, 42CC55D21809A4EF00AAD8AD /* DepthStencilTarget.cpp in Sources */, 42CC55B61809A4EF00AAD8AD /* Button.cpp in Sources */, - 420BBD461817416F00C7B720 /* lua_Material.cpp in Sources */, - 420BBEC61817416F00C7B720 /* lua_VertexAttributeBinding.cpp in Sources */, - 420BBD6E1817416F00C7B720 /* lua_Model.cpp in Sources */, - 420BBE821817416F00C7B720 /* lua_TextureFilter.cpp in Sources */, - 420BBC121817416F00C7B720 /* lua_AbsoluteLayout.cpp in Sources */, - 420BBC6E1817416F00C7B720 /* lua_BoundingSphere.cpp in Sources */, + 424F335E1A60C28600395438 /* lua_JoystickControl.cpp in Sources */, 42CC596A1809A4EF00AAD8AD /* Plane.cpp in Sources */, + 424F33A21A60C28600395438 /* lua_PhysicsHingeConstraint.cpp in Sources */, 42CC55E61809A4EF00AAD8AD /* Form.cpp in Sources */, - 420BBC4A1817416F00C7B720 /* lua_AnimationController.cpp in Sources */, - 420BBE6A1817416F00C7B720 /* lua_Terrain.cpp in Sources */, 42CC55801809A4EF00AAD8AD /* AIStateMachine.cpp in Sources */, - 42252DCC1828145B00EE234B /* lua_CameraListener.cpp in Sources */, - 420BBCDA1817416F00C7B720 /* lua_FrameBuffer.cpp in Sources */, 42CC560E1809A4EF00AAD8AD /* Image.cpp in Sources */, + 424F33881A60C28600395438 /* lua_PhysicsCollisionObject.cpp in Sources */, 42CC591C1809A4EF00AAD8AD /* MeshSkin.cpp in Sources */, 42CC56021809A4EF00AAD8AD /* gameplay-main-macosx.mm in Sources */, 420BBC0E1817416F00C7B720 /* ControlFactory.cpp in Sources */, - 420BBD021817416F00C7B720 /* lua_Global.cpp in Sources */, + 424F33941A60C28600395438 /* lua_PhysicsController.cpp in Sources */, + 424F331A1A60C28600395438 /* lua_AnimationTarget.cpp in Sources */, + 424F33F61A60C28600395438 /* lua_Touch.cpp in Sources */, + 424F34021A60C28600395438 /* lua_Vector4.cpp in Sources */, + 424F33AE1A60C28600395438 /* lua_PhysicsVehicleWheel.cpp in Sources */, + 424F33E61A60C28600395438 /* lua_Texture.cpp in Sources */, 42CC55741809A4EF00AAD8AD /* AIController.cpp in Sources */, - 420BBC9A1817416F00C7B720 /* lua_ControlListener.cpp in Sources */, 42CC59361809A4EF00AAD8AD /* PhysicsCollisionObject.cpp in Sources */, - 420BBCFA1817416F00C7B720 /* lua_Gesture.cpp in Sources */, - 420BBE1A1817416F00C7B720 /* lua_RenderState.cpp in Sources */, + 424F33A01A60C28600395438 /* lua_PhysicsGhostObject.cpp in Sources */, + 424F33661A60C28600395438 /* lua_Light.cpp in Sources */, + 424F33EA1A60C28600395438 /* lua_Theme.cpp in Sources */, + 424F33FC1A60C28600395438 /* lua_Uniform.cpp in Sources */, 42CC595E1809A4EF00AAD8AD /* PhysicsSpringConstraint.cpp in Sources */, - 420BBC8E1817416F00C7B720 /* lua_Control.cpp in Sources */, + 424F33AC1A60C28600395438 /* lua_PhysicsVehicle.cpp in Sources */, 42CC59661809A4EF00AAD8AD /* PhysicsVehicleWheel.cpp in Sources */, + 424F33541A60C28600395438 /* lua_Global.cpp in Sources */, + 424F33361A60C28600395438 /* lua_Control.cpp in Sources */, 42CC594E1809A4EF00AAD8AD /* PhysicsGhostObject.cpp in Sources */, - 420BBCA21817416F00C7B720 /* lua_ControlState.cpp in Sources */, - 420BBE0A1817416F00C7B720 /* lua_RadioButton.cpp in Sources */, - 420BBD861817416F00C7B720 /* lua_ParticleEmitter.cpp in Sources */, - 420BBD5E1817416F00C7B720 /* lua_MeshIndexFormat.cpp in Sources */, + 424F33081A60C28600395438 /* lua_AIMessage.cpp in Sources */, 42CC597C1809A4EF00AAD8AD /* PlatformWindows.cpp in Sources */, - 420BBDC21817416F00C7B720 /* lua_PhysicsControllerHitResult.cpp in Sources */, 42CC55B21809A4EF00AAD8AD /* Bundle.cpp in Sources */, - 420BBD521817416F00C7B720 /* lua_Matrix.cpp in Sources */, - 420BBD7A1817416F00C7B720 /* lua_Node.cpp in Sources */, - 420BBDD21817416F00C7B720 /* lua_PhysicsGenericConstraint.cpp in Sources */, 42CC592E1809A4EF00AAD8AD /* Pass.cpp in Sources */, - 420BBC661817416F00C7B720 /* lua_AudioSourceState.cpp in Sources */, - 420BBEB61817416F00C7B720 /* lua_Uniform.cpp in Sources */, - 420BBD5A1817416F00C7B720 /* lua_MeshBatch.cpp in Sources */, - 420BBDE61817416F00C7B720 /* lua_PhysicsSocketConstraint.cpp in Sources */, - 420BBEBA1817416F00C7B720 /* lua_Vector2.cpp in Sources */, - 420BBCE21817416F00C7B720 /* lua_Game.cpp in Sources */, + 424F33621A60C28600395438 /* lua_Label.cpp in Sources */, 42CC55F61809A4EF00AAD8AD /* Gamepad.cpp in Sources */, 42CC56201809A4EF00AAD8AD /* Label.cpp in Sources */, - 420BBC221817416F00C7B720 /* lua_AIMessage.cpp in Sources */, 42CC59B61809A4EF00AAD8AD /* ScriptTarget.cpp in Sources */, - 420BBE9A1817416F00C7B720 /* lua_ThemeStyle.cpp in Sources */, + 424F333A1A60C28600395438 /* lua_Curve.cpp in Sources */, 42CC59FE1809A4EF00AAD8AD /* ThemeStyle.cpp in Sources */, + 424F33C81A60C28600395438 /* lua_ScreenDisplayer.cpp in Sources */, 42CC59A21809A4EF00AAD8AD /* SceneLoader.cpp in Sources */, + 424F34081A60C28600395438 /* lua_VertexFormatElement.cpp in Sources */, 42CC556C1809A4EF00AAD8AD /* AbsoluteLayout.cpp in Sources */, + 424F336A1A60C28600395438 /* lua_Material.cpp in Sources */, + 424F334E1A60C28600395438 /* lua_Game.cpp in Sources */, 42CC59181809A4EF00AAD8AD /* MeshPart.cpp in Sources */, 42CC55FA1809A4EF00AAD8AD /* gameplay-main-android.cpp in Sources */, - 420BBE2E1817416F00C7B720 /* lua_RenderStateFrontFace.cpp in Sources */, - 420BBC2A1817416F00C7B720 /* lua_AIState.cpp in Sources */, - 420BBC721817416F00C7B720 /* lua_Bundle.cpp in Sources */, - 420BBD061817416F00C7B720 /* lua_HeightField.cpp in Sources */, - 420BBC3A1817416F00C7B720 /* lua_Animation.cpp in Sources */, + 424F336E1A60C28600395438 /* lua_MathUtil.cpp in Sources */, 42CC55781809A4EF00AAD8AD /* AIMessage.cpp in Sources */, - 420BBEA61817416F00C7B720 /* lua_Touch.cpp in Sources */, - 420BBD661817416F00C7B720 /* lua_MeshPrimitiveType.cpp in Sources */, - 420BBC7E1817416F00C7B720 /* lua_CameraType.cpp in Sources */, - 420BBCEA1817416F00C7B720 /* lua_Gamepad.cpp in Sources */, - 420BBC421817416F00C7B720 /* lua_AnimationClipListener.cpp in Sources */, - 420BBE161817416F00C7B720 /* lua_Ref.cpp in Sources */, - 420BBD6A1817416F00C7B720 /* lua_MeshSkin.cpp in Sources */, + 424F33B81A60C28600395438 /* lua_RadioButton.cpp in Sources */, + 424F33061A60C28600395438 /* lua_AIController.cpp in Sources */, + 424F338A1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */, + 424F33C21A60C28600395438 /* lua_RenderStateStateBlock.cpp in Sources */, 42CC594A1809A4EF00AAD8AD /* PhysicsGenericConstraint.cpp in Sources */, - 420BBC321817416F00C7B720 /* lua_AIStateMachine.cpp in Sources */, - 420BBD4E1817416F00C7B720 /* lua_MathUtil.cpp in Sources */, - 420BBEA21817416F00C7B720 /* lua_ThemeUVs.cpp in Sources */, 42CC593A1809A4EF00AAD8AD /* PhysicsCollisionShape.cpp in Sources */, + 424F33121A60C28600395438 /* lua_Animation.cpp in Sources */, 42CC59FA1809A4EF00AAD8AD /* Theme.cpp in Sources */, - 420BBD321817416F00C7B720 /* lua_LayoutType.cpp in Sources */, + 424F34061A60C28600395438 /* lua_VertexFormat.cpp in Sources */, + 424F33F81A60C28600395438 /* lua_Transform.cpp in Sources */, + 424F33181A60C28600395438 /* lua_AnimationController.cpp in Sources */, + 424F33301A60C28600395438 /* lua_CameraListener.cpp in Sources */, + 424F33E81A60C28600395438 /* lua_TextureSampler.cpp in Sources */, + 424F33701A60C28600395438 /* lua_Matrix.cpp in Sources */, 42CC55C21809A4EF00AAD8AD /* Container.cpp in Sources */, - 420BBD561817416F00C7B720 /* lua_Mesh.cpp in Sources */, + 424F33CE1A60C28600395438 /* lua_ScriptTarget.cpp in Sources */, + 424F33AA1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp in Sources */, 42CC59781809A4EF00AAD8AD /* PlatformLinux.cpp in Sources */, - 420BBCCA1817416F00C7B720 /* lua_FontJustify.cpp in Sources */, + 424F33A41A60C28600395438 /* lua_PhysicsRigidBody.cpp in Sources */, 42CC59461809A4EF00AAD8AD /* PhysicsFixedConstraint.cpp in Sources */, - 420BBC7A1817416F00C7B720 /* lua_Camera.cpp in Sources */, - 420BBCF61817416F00C7B720 /* lua_GameState.cpp in Sources */, + 424F334C1A60C28600395438 /* lua_Frustum.cpp in Sources */, + 424F33EE1A60C28600395438 /* lua_ThemeStyle.cpp in Sources */, + 424F33321A60C28600395438 /* lua_CheckBox.cpp in Sources */, + 424F331E1A60C28600395438 /* lua_AudioBuffer.cpp in Sources */, + 424F33161A60C28600395438 /* lua_AnimationClipListener.cpp in Sources */, + 424F33F41A60C28600395438 /* lua_TileSet.cpp in Sources */, + 424F33721A60C28600395438 /* lua_Mesh.cpp in Sources */, 42CC55F21809A4EF00AAD8AD /* Game.cpp in Sources */, - 420BBCA61817416F00C7B720 /* lua_Curve.cpp in Sources */, - 420BBCFE1817416F00C7B720 /* lua_GestureGestureEvent.cpp in Sources */, - 420BBC761817416F00C7B720 /* lua_Button.cpp in Sources */, - 420BBCDE1817416F00C7B720 /* lua_Frustum.cpp in Sources */, - 420BBE2A1817416F00C7B720 /* lua_RenderStateDepthFunction.cpp in Sources */, - 420BBCD21817416F00C7B720 /* lua_FontText.cpp in Sources */, - 420BBC1A1817416F00C7B720 /* lua_AIAgentListener.cpp in Sources */, 42CC59101809A4EF00AAD8AD /* Mesh.cpp in Sources */, + 424F33E21A60C28600395438 /* lua_Text.cpp in Sources */, 42CC55DA1809A4EF00AAD8AD /* FileSystem.cpp in Sources */, 42CC59621809A4EF00AAD8AD /* PhysicsVehicle.cpp in Sources */, - 420BBD621817416F00C7B720 /* lua_MeshPart.cpp in Sources */, - 420BBECA1817416F00C7B720 /* lua_VertexFormat.cpp in Sources */, - 420BBC561817416F00C7B720 /* lua_AudioBuffer.cpp in Sources */, - 420BBDFE1817416F00C7B720 /* lua_Properties.cpp in Sources */, + 42ECC3FA1A4EF5A00036C839 /* Text.cpp in Sources */, 42CC56121809A4EF00AAD8AD /* ImageControl.cpp in Sources */, 42CC55E21809A4EF00AAD8AD /* Font.cpp in Sources */, - 420BBE8E1817416F00C7B720 /* lua_TextureWrap.cpp in Sources */, + 424F332A1A60C28600395438 /* lua_Bundle.cpp in Sources */, + 424F33F01A60C28600395438 /* lua_ThemeThemeImage.cpp in Sources */, 42CC56241809A4EF00AAD8AD /* Layout.cpp in Sources */, - 420BBE061817416F00C7B720 /* lua_Quaternion.cpp in Sources */, - 420BBCBA1817416F00C7B720 /* lua_FileSystem.cpp in Sources */, - 420BBDC61817416F00C7B720 /* lua_PhysicsControllerListener.cpp in Sources */, 42CC590C1809A4EF00AAD8AD /* Matrix.cpp in Sources */, - 420BBDB21817416F00C7B720 /* lua_PhysicsCollisionShapeType.cpp in Sources */, + 424F33B61A60C28600395438 /* lua_Quaternion.cpp in Sources */, + 424F33021A60C28600395438 /* lua_AIAgent.cpp in Sources */, + 424F33E41A60C28600395438 /* lua_TextBox.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2323,294 +2004,255 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 420BBCB71817416F00C7B720 /* lua_Effect.cpp in Sources */, - 420BBE3B1817416F00C7B720 /* lua_RenderStateStencilOperation.cpp in Sources */, - 420BBDDF1817416F00C7B720 /* lua_PhysicsRigidBody.cpp in Sources */, + 424F33A71A60C28600395438 /* lua_PhysicsRigidBodyParameters.cpp in Sources */, 42CC59871809A4EF00AAD8AD /* RadioButton.cpp in Sources */, - 420BBDBF1817416F00C7B720 /* lua_PhysicsControllerHitFilter.cpp in Sources */, + 424F330B1A60C28600395438 /* lua_AIState.cpp in Sources */, 42CC596F1809A4EF00AAD8AD /* Platform.cpp in Sources */, - 420BBDF71817416F00C7B720 /* lua_Plane.cpp in Sources */, + 424F331D1A60C28600395438 /* lua_AnimationValue.cpp in Sources */, + 424F338F1A60C28600395438 /* lua_PhysicsCollisionShape.cpp in Sources */, + 424F33FF1A60C28600395438 /* lua_Vector2.cpp in Sources */, 42CC56011809A4EF00AAD8AD /* gameplay-main-linux.cpp in Sources */, - 420BBC4F1817416F00C7B720 /* lua_AnimationTarget.cpp in Sources */, - 420BBC1F1817416F00C7B720 /* lua_AIController.cpp in Sources */, 42CC598B1809A4EF00AAD8AD /* Ray.cpp in Sources */, - 420BBCC31817416F00C7B720 /* lua_Font.cpp in Sources */, 42CC56051809A4EF00AAD8AD /* gameplay-main-windows.cpp in Sources */, - 420BBC871817416F00C7B720 /* lua_Container.cpp in Sources */, - 420BBC5B1817416F00C7B720 /* lua_AudioController.cpp in Sources */, - 420BBE0F1817416F00C7B720 /* lua_Ray.cpp in Sources */, - 420BBD831817416F00C7B720 /* lua_NodeType.cpp in Sources */, + 424F33ED1A60C28600395438 /* lua_ThemeSideRegions.cpp in Sources */, 42CC59AF1809A4EF00AAD8AD /* ScreenDisplayer.cpp in Sources */, + 424F332F1A60C28600395438 /* lua_Camera.cpp in Sources */, + 424F33BB1A60C28600395438 /* lua_Ray.cpp in Sources */, 42CC599B1809A4EF00AAD8AD /* RenderTarget.cpp in Sources */, - 420BBE631817416F00C7B720 /* lua_SpriteBatch.cpp in Sources */, 42CC59431809A4EF00AAD8AD /* PhysicsController.cpp in Sources */, 42CC59E71809A4EF00AAD8AD /* Technique.cpp in Sources */, - 420BBDAB1817416F00C7B720 /* lua_PhysicsCollisionShape.cpp in Sources */, + 424F33E11A60C28600395438 /* lua_TerrainPatch.cpp in Sources */, + 424F33D51A60C28600395438 /* lua_Slider.cpp in Sources */, + 424F33751A60C28600395438 /* lua_MeshBatch.cpp in Sources */, 42CC598F1809A4EF00AAD8AD /* Rectangle.cpp in Sources */, 42CC55DF1809A4EF00AAD8AD /* FlowLayout.cpp in Sources */, - 420BBE871817416F00C7B720 /* lua_TextureFormat.cpp in Sources */, - 426F831C187F72DF00640CBA /* lua_JoystickControl.cpp in Sources */, + 424F337F1A60C28600395438 /* lua_Node.cpp in Sources */, + 424F33111A60C28600395438 /* lua_all_bindings.cpp in Sources */, + 4204EC421A2EB8310074FCE9 /* TileSet.cpp in Sources */, 42CC59F71809A4EF00AAD8AD /* Texture.cpp in Sources */, 42CC55CB1809A4EF00AAD8AD /* Curve.cpp in Sources */, - 420BBDAF1817416F00C7B720 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */, - 420BBD9F1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListenerEventType.cpp in Sources */, - 420BBDDB1817416F00C7B720 /* lua_PhysicsHingeConstraint.cpp in Sources */, 42CC599F1809A4EF00AAD8AD /* Scene.cpp in Sources */, 42CC55FF1809A4EF00AAD8AD /* gameplay-main-ios.mm in Sources */, - 420BBDB71817416F00C7B720 /* lua_PhysicsConstraint.cpp in Sources */, + 424F33271A60C28600395438 /* lua_BoundingBox.cpp in Sources */, 42CC593F1809A4EF00AAD8AD /* PhysicsConstraint.cpp in Sources */, 42CC55991809A4EF00AAD8AD /* AudioBuffer.cpp in Sources */, - 420BBC971817416F00C7B720 /* lua_ControlAutoSize.cpp in Sources */, - 420BBD271817416F00C7B720 /* lua_KeyboardKeyEvent.cpp in Sources */, - 420BBD4B1817416F00C7B720 /* lua_MaterialParameter.cpp in Sources */, - 420BBEAB1817416F00C7B720 /* lua_TouchTouchEvent.cpp in Sources */, + 424F33DD1A60C28600395438 /* lua_Technique.cpp in Sources */, 42CC55A51809A4EF00AAD8AD /* AudioSource.cpp in Sources */, - 420BBC8B1817416F00C7B720 /* lua_ContainerScroll.cpp in Sources */, - 420BBC831817416F00C7B720 /* lua_CheckBox.cpp in Sources */, + 424F33511A60C28600395438 /* lua_Gamepad.cpp in Sources */, + 424F34011A60C28600395438 /* lua_Vector3.cpp in Sources */, 42CC55C71809A4EF00AAD8AD /* Control.cpp in Sources */, - 420BBDBB1817416F00C7B720 /* lua_PhysicsController.cpp in Sources */, - 420BBE7F1817416F00C7B720 /* lua_Texture.cpp in Sources */, 42CC56171809A4EF00AAD8AD /* Joint.cpp in Sources */, + 424F33851A60C28600395438 /* lua_Pass.cpp in Sources */, + 424F33491A60C28600395438 /* lua_Form.cpp in Sources */, + 424F340B1A60C28600395438 /* lua_VerticalLayout.cpp in Sources */, + 424F33651A60C28600395438 /* lua_Layout.cpp in Sources */, + 424F333F1A60C28600395438 /* lua_Drawable.cpp in Sources */, 42CC59971809A4EF00AAD8AD /* RenderState.cpp in Sources */, - 420BBD3F1817416F00C7B720 /* lua_Logger.cpp in Sources */, - 420BBC931817416F00C7B720 /* lua_ControlAlignment.cpp in Sources */, - 420BBCEF1817416F00C7B720 /* lua_GamepadButtonMapping.cpp in Sources */, - 420BBD2F1817416F00C7B720 /* lua_Layout.cpp in Sources */, + 424F336D1A60C28600395438 /* lua_MaterialParameter.cpp in Sources */, 42CC59731809A4EF00AAD8AD /* PlatformAndroid.cpp in Sources */, - 420BBC6B1817416F00C7B720 /* lua_BoundingBox.cpp in Sources */, 42CC55891809A4EF00AAD8AD /* AnimationClip.cpp in Sources */, - 420BBD931817416F00C7B720 /* lua_PhysicsCharacter.cpp in Sources */, - 420BBE571817416F00C7B720 /* lua_ScriptController.cpp in Sources */, - 420BBE271817416F00C7B720 /* lua_RenderStateCullFaceSide.cpp in Sources */, - 420BBDA31817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */, - 420BBD9B1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */, + 424F33931A60C28600395438 /* lua_PhysicsConstraint.cpp in Sources */, 42CC59931809A4EF00AAD8AD /* Ref.cpp in Sources */, 42CC595B1809A4EF00AAD8AD /* PhysicsSocketConstraint.cpp in Sources */, + 424F338D1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */, 42CC59EB1809A4EF00AAD8AD /* Terrain.cpp in Sources */, 42CC597F1809A4EF00AAD8AD /* Properties.cpp in Sources */, - 420BBED31817416F00C7B720 /* lua_VertexFormatUsage.cpp in Sources */, + 424F33771A60C28600395438 /* lua_MeshPart.cpp in Sources */, 42CC5A171809A4EF00AAD8AD /* VertexAttributeBinding.cpp in Sources */, - 420BBDFB1817416F00C7B720 /* lua_Platform.cpp in Sources */, - 420BBDCF1817416F00C7B720 /* lua_PhysicsFixedConstraint.cpp in Sources */, + 424F33431A60C28600395438 /* lua_FileSystem.cpp in Sources */, 42CC59B31809A4EF00AAD8AD /* ScriptController.cpp in Sources */, - 420BBE131817416F00C7B720 /* lua_Rectangle.cpp in Sources */, - 420BBDCB1817416F00C7B720 /* lua_PhysicsControllerListenerEventType.cpp in Sources */, 42CC55AB1809A4EF00AAD8AD /* BoundingBox.cpp in Sources */, + DD4FBEA61A0C0D240015D30C /* Script.cpp in Sources */, + 424F334B1A60C28600395438 /* lua_FrameBuffer.cpp in Sources */, + 424F33DF1A60C28600395438 /* lua_Terrain.cpp in Sources */, + 424F33CB1A60C28600395438 /* lua_Script.cpp in Sources */, + 424F33D71A60C28600395438 /* lua_Sprite.cpp in Sources */, 42CC55951809A4EF00AAD8AD /* AnimationValue.cpp in Sources */, - 420BBCC71817416F00C7B720 /* lua_FontFormat.cpp in Sources */, + 424F33291A60C28600395438 /* lua_BoundingSphere.cpp in Sources */, 42CC5A0F1809A4EF00AAD8AD /* Vector3.cpp in Sources */, - 42CC59751809A4EF00AAD8AD /* PlatformBlackBerry.cpp in Sources */, 42CC55BB1809A4EF00AAD8AD /* Camera.cpp in Sources */, - 420BBC171817416F00C7B720 /* lua_AIAgent.cpp in Sources */, 42CC59211809A4EF00AAD8AD /* Model.cpp in Sources */, + 424F33451A60C28600395438 /* lua_FlowLayout.cpp in Sources */, + 424F33231A60C28600395438 /* lua_AudioListener.cpp in Sources */, + 424F33471A60C28600395438 /* lua_Font.cpp in Sources */, + 424F339B1A60C28600395438 /* lua_PhysicsControllerListener.cpp in Sources */, 42CC59EF1809A4EF00AAD8AD /* TerrainPatch.cpp in Sources */, + 424F33151A60C28600395438 /* lua_AnimationClip.cpp in Sources */, 42CC557D1809A4EF00AAD8AD /* AIState.cpp in Sources */, - 420BBE931817416F00C7B720 /* lua_Theme.cpp in Sources */, - 420BBD0F1817416F00C7B720 /* lua_ImageControl.cpp in Sources */, - 420BBE9F1817416F00C7B720 /* lua_ThemeThemeImage.cpp in Sources */, - 420BBE6F1817416F00C7B720 /* lua_TerrainFlags.cpp in Sources */, + 424F33811A60C28600395438 /* lua_NodeCloneContext.cpp in Sources */, + 424F339D1A60C28600395438 /* lua_PhysicsFixedConstraint.cpp in Sources */, 426F8318187F72A700640CBA /* JoystickControl.cpp in Sources */, + 424F33F31A60C28600395438 /* lua_ThemeUVs.cpp in Sources */, 42CC59011809A4EF00AAD8AD /* Material.cpp in Sources */, - 42252DD11828145B00EE234B /* lua_TerrainPatch.cpp in Sources */, - 420BBCB31817416F00C7B720 /* lua_DepthStencilTargetFormat.cpp in Sources */, - 420BBCAF1817416F00C7B720 /* lua_DepthStencilTarget.cpp in Sources */, + 424F33FB1A60C28600395438 /* lua_TransformListener.cpp in Sources */, + 424F33571A60C28600395438 /* lua_HeightField.cpp in Sources */, 42CC5A1F1809A4EF00AAD8AD /* VerticalLayout.cpp in Sources */, 42CC59831809A4EF00AAD8AD /* Quaternion.cpp in Sources */, 42CC59E11809A4EF00AAD8AD /* SpriteBatch.cpp in Sources */, - 420BBE031817416F00C7B720 /* lua_PropertiesType.cpp in Sources */, - 420BBD231817416F00C7B720 /* lua_KeyboardKey.cpp in Sources */, - 420BBECF1817416F00C7B720 /* lua_VertexFormatElement.cpp in Sources */, + 424F33871A60C28600395438 /* lua_PhysicsCharacter.cpp in Sources */, + 424F335D1A60C28600395438 /* lua_Joint.cpp in Sources */, 42CC59531809A4EF00AAD8AD /* PhysicsHingeConstraint.cpp in Sources */, - 420BBD131817416F00C7B720 /* lua_ImageFormat.cpp in Sources */, + 424F33D31A60C28600395438 /* lua_ScriptTargetEventRegistry.cpp in Sources */, + 424F33C71A60C28600395438 /* lua_Scene.cpp in Sources */, 42CC55EF1809A4EF00AAD8AD /* Frustum.cpp in Sources */, + 424F33531A60C28600395438 /* lua_Gesture.cpp in Sources */, + 424F33611A60C28600395438 /* lua_Keyboard.cpp in Sources */, 42CC55911809A4EF00AAD8AD /* AnimationTarget.cpp in Sources */, 42CC55D71809A4EF00AAD8AD /* Effect.cpp in Sources */, - 420BBD771817416F00C7B720 /* lua_MouseMouseEvent.cpp in Sources */, - 420BBE3F1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */, + 424F330D1A60C28600395438 /* lua_AIStateListener.cpp in Sources */, 42CC562D1809A4EF00AAD8AD /* Logger.cpp in Sources */, 42CC56291809A4EF00AAD8AD /* Light.cpp in Sources */, - 420BBD8F1817416F00C7B720 /* lua_Pass.cpp in Sources */, 42CC59051809A4EF00AAD8AD /* MaterialParameter.cpp in Sources */, 42CC55851809A4EF00AAD8AD /* Animation.cpp in Sources */, - 420BBC371817416F00C7B720 /* lua_all_bindings.cpp in Sources */, - 420BBEB31817416F00C7B720 /* lua_TransformListener.cpp in Sources */, - 420BBD7F1817416F00C7B720 /* lua_NodeCloneContext.cpp in Sources */, - 420BBE431817416F00C7B720 /* lua_Scene.cpp in Sources */, - 420BBDA71817416F00C7B720 /* lua_PhysicsCollisionObjectType.cpp in Sources */, - 420BBD3B1817416F00C7B720 /* lua_LightType.cpp in Sources */, - 420BBE971817416F00C7B720 /* lua_ThemeSideRegions.cpp in Sources */, 42CC558D1809A4EF00AAD8AD /* AnimationController.cpp in Sources */, - 420BBCD71817416F00C7B720 /* lua_Form.cpp in Sources */, - 420BBC631817416F00C7B720 /* lua_AudioSource.cpp in Sources */, + 424F33B31A60C28600395438 /* lua_Platform.cpp in Sources */, + 424F33051A60C28600395438 /* lua_AIAgentListener.cpp in Sources */, 42CC59771809A4EF00AAD8AD /* PlatformiOS.mm in Sources */, 42CC59F31809A4EF00AAD8AD /* TextBox.cpp in Sources */, - 420BBD431817416F00C7B720 /* lua_LoggerLevel.cpp in Sources */, - 420BBCBF1817416F00C7B720 /* lua_FlowLayout.cpp in Sources */, - 420BBD731817416F00C7B720 /* lua_Mouse.cpp in Sources */, - 420BBEC31817416F00C7B720 /* lua_Vector4.cpp in Sources */, - 420BBE1F1817416F00C7B720 /* lua_RenderStateAutoBinding.cpp in Sources */, + 424F33831A60C28600395438 /* lua_ParticleEmitter.cpp in Sources */, 42CC5A1B1809A4EF00AAD8AD /* VertexFormat.cpp in Sources */, 42CC5A071809A4EF00AAD8AD /* Transform.cpp in Sources */, 42CC559D1809A4EF00AAD8AD /* AudioController.cpp in Sources */, + 424F33D11A60C28600395438 /* lua_ScriptTargetEvent.cpp in Sources */, 42CC55BF1809A4EF00AAD8AD /* CheckBox.cpp in Sources */, - 420BBE231817416F00C7B720 /* lua_RenderStateBlend.cpp in Sources */, - 420BBE371817416F00C7B720 /* lua_RenderStateStencilFunction.cpp in Sources */, + 424F33991A60C28600395438 /* lua_PhysicsControllerHitResult.cpp in Sources */, + 424F335B1A60C28600395438 /* lua_ImageControl.cpp in Sources */, + 424F33791A60C28600395438 /* lua_MeshSkin.cpp in Sources */, + 424F33411A60C28600395438 /* lua_Effect.cpp in Sources */, 42CC5A0B1809A4EF00AAD8AD /* Vector2.cpp in Sources */, - 420BBE671817416F00C7B720 /* lua_Technique.cpp in Sources */, - 420BBE5B1817416F00C7B720 /* lua_ScriptTarget.cpp in Sources */, - 420BBD371817416F00C7B720 /* lua_Light.cpp in Sources */, + 424F33251A60C28600395438 /* lua_AudioSource.cpp in Sources */, + 424F33C11A60C28600395438 /* lua_RenderState.cpp in Sources */, + 424F33971A60C28600395438 /* lua_PhysicsControllerHitFilter.cpp in Sources */, 42CC55A11809A4EF00AAD8AD /* AudioListener.cpp in Sources */, 42CC5A131809A4EF00AAD8AD /* Vector4.cpp in Sources */, - 420BBC5F1817416F00C7B720 /* lua_AudioListener.cpp in Sources */, - 420BBC531817416F00C7B720 /* lua_AnimationValue.cpp in Sources */, - 420BBC9F1817416F00C7B720 /* lua_ControlListenerEventType.cpp in Sources */, - 420BBC271817416F00C7B720 /* lua_AIMessageParameterType.cpp in Sources */, + 424F33211A60C28600395438 /* lua_AudioController.cpp in Sources */, + 424F33B51A60C28600395438 /* lua_Properties.cpp in Sources */, + 424F33011A60C28600395438 /* lua_AbsoluteLayout.cpp in Sources */, + 424F33BF1A60C28600395438 /* lua_Ref.cpp in Sources */, + 424F337B1A60C28600395438 /* lua_Model.cpp in Sources */, + 424F33691A60C28600395438 /* lua_Logger.cpp in Sources */, 42CC59BB1809A4EF00AAD8AD /* Slider.cpp in Sources */, - 420BBD2B1817416F00C7B720 /* lua_Label.cpp in Sources */, - 420BBDE31817416F00C7B720 /* lua_PhysicsRigidBodyParameters.cpp in Sources */, - 420BBDF31817416F00C7B720 /* lua_PhysicsVehicleWheel.cpp in Sources */, + 424F339F1A60C28600395438 /* lua_PhysicsGenericConstraint.cpp in Sources */, 42CC59331809A4EF00AAD8AD /* PhysicsCharacter.cpp in Sources */, - 420BBEBF1817416F00C7B720 /* lua_Vector3.cpp in Sources */, - 420BBE771817416F00C7B720 /* lua_TextBox.cpp in Sources */, + 424F33351A60C28600395438 /* lua_Container.cpp in Sources */, 42CC59091809A4EF00AAD8AD /* MathUtil.cpp in Sources */, - 420BBCAB1817416F00C7B720 /* lua_CurveInterpolationType.cpp in Sources */, 42CC55EB1809A4EF00AAD8AD /* FrameBuffer.cpp in Sources */, - 420BBD171817416F00C7B720 /* lua_Joint.cpp in Sources */, + 424F33BD1A60C28600395438 /* lua_Rectangle.cpp in Sources */, 42CC59571809A4EF00AAD8AD /* PhysicsRigidBody.cpp in Sources */, - 420BBCCF1817416F00C7B720 /* lua_FontStyle.cpp in Sources */, - 420BBE8B1817416F00C7B720 /* lua_TextureSampler.cpp in Sources */, - 420BBE5F1817416F00C7B720 /* lua_Slider.cpp in Sources */, - 420BBDD71817416F00C7B720 /* lua_PhysicsGhostObject.cpp in Sources */, - 420BBCE71817416F00C7B720 /* lua_GameClearFlags.cpp in Sources */, + 424F33D91A60C28600395438 /* lua_SpriteBatch.cpp in Sources */, + 424F33A91A60C28600395438 /* lua_PhysicsSocketConstraint.cpp in Sources */, + 424F33391A60C28600395438 /* lua_ControlListener.cpp in Sources */, + 424F34051A60C28600395438 /* lua_VertexAttributeBinding.cpp in Sources */, + 4204EC461A2F878C0074FCE9 /* Sprite.cpp in Sources */, + 424F337D1A60C28600395438 /* lua_Mouse.cpp in Sources */, + 424F333D1A60C28600395438 /* lua_DepthStencilTarget.cpp in Sources */, 42CC59271809A4EF00AAD8AD /* Node.cpp in Sources */, - 420BBEAF1817416F00C7B720 /* lua_Transform.cpp in Sources */, - 420BBD971817416F00C7B720 /* lua_PhysicsCollisionObject.cpp in Sources */, - 420BBDEF1817416F00C7B720 /* lua_PhysicsVehicle.cpp in Sources */, - 420BBC2F1817416F00C7B720 /* lua_AIStateListener.cpp in Sources */, - 420BBD0B1817416F00C7B720 /* lua_Image.cpp in Sources */, - 420BBD1F1817416F00C7B720 /* lua_Keyboard.cpp in Sources */, - 420BBC471817416F00C7B720 /* lua_AnimationClipListenerEventType.cpp in Sources */, 42CC592B1809A4EF00AAD8AD /* ParticleEmitter.cpp in Sources */, - 42CC55FD1809A4EF00AAD8AD /* gameplay-main-blackberry.cpp in Sources */, - 420BBE331817416F00C7B720 /* lua_RenderStateStateBlock.cpp in Sources */, - 420BBC3F1817416F00C7B720 /* lua_AnimationClip.cpp in Sources */, + 42D9299C1A6051EC0073258D /* Drawable.cpp in Sources */, + 424F33911A60C28600395438 /* lua_PhysicsCollisionShapeDefinition.cpp in Sources */, 42CC560B1809A4EF00AAD8AD /* HeightField.cpp in Sources */, - 420BBE531817416F00C7B720 /* lua_ScreenDisplayer.cpp in Sources */, - 420BBCF31817416F00C7B720 /* lua_GamepadGamepadEvent.cpp in Sources */, 42CC55AF1809A4EF00AAD8AD /* BoundingSphere.cpp in Sources */, - 420BBED71817416F00C7B720 /* lua_VerticalLayout.cpp in Sources */, + 424F33591A60C28600395438 /* lua_Image.cpp in Sources */, + 424F332D1A60C28600395438 /* lua_Button.cpp in Sources */, + 424F33B11A60C28600395438 /* lua_Plane.cpp in Sources */, 42CC55CF1809A4EF00AAD8AD /* DebugNew.cpp in Sources */, - 420BBE7B1817416F00C7B720 /* lua_TextBoxInputMode.cpp in Sources */, - 420BBD8B1817416F00C7B720 /* lua_ParticleEmitterTextureBlending.cpp in Sources */, - 420BBDEB1817416F00C7B720 /* lua_PhysicsSpringConstraint.cpp in Sources */, + 424F33CD1A60C28600395438 /* lua_ScriptController.cpp in Sources */, 42CC59151809A4EF00AAD8AD /* MeshBatch.cpp in Sources */, + 424F330F1A60C28600395438 /* lua_AIStateMachine.cpp in Sources */, + 424F33C51A60C28600395438 /* lua_RenderTarget.cpp in Sources */, + 424F33DB1A60C28600395438 /* lua_SpriteBatchSpriteVertex.cpp in Sources */, 42CC55711809A4EF00AAD8AD /* AIAgent.cpp in Sources */, 42CC55D31809A4EF00AAD8AD /* DepthStencilTarget.cpp in Sources */, + 424F335F1A60C28600395438 /* lua_JoystickControl.cpp in Sources */, 42CC55B71809A4EF00AAD8AD /* Button.cpp in Sources */, - 420BBD471817416F00C7B720 /* lua_Material.cpp in Sources */, - 420BBEC71817416F00C7B720 /* lua_VertexAttributeBinding.cpp in Sources */, - 420BBD6F1817416F00C7B720 /* lua_Model.cpp in Sources */, - 420BBE831817416F00C7B720 /* lua_TextureFilter.cpp in Sources */, - 420BBC131817416F00C7B720 /* lua_AbsoluteLayout.cpp in Sources */, - 420BBC6F1817416F00C7B720 /* lua_BoundingSphere.cpp in Sources */, + 424F33A31A60C28600395438 /* lua_PhysicsHingeConstraint.cpp in Sources */, 42CC596B1809A4EF00AAD8AD /* Plane.cpp in Sources */, 42CC55E71809A4EF00AAD8AD /* Form.cpp in Sources */, - 420BBC4B1817416F00C7B720 /* lua_AnimationController.cpp in Sources */, - 420BBE6B1817416F00C7B720 /* lua_Terrain.cpp in Sources */, - 42252DCD1828145B00EE234B /* lua_CameraListener.cpp in Sources */, 42CC55811809A4EF00AAD8AD /* AIStateMachine.cpp in Sources */, - 420BBCDB1817416F00C7B720 /* lua_FrameBuffer.cpp in Sources */, + 424F33891A60C28600395438 /* lua_PhysicsCollisionObject.cpp in Sources */, 42CC560F1809A4EF00AAD8AD /* Image.cpp in Sources */, 42CC591D1809A4EF00AAD8AD /* MeshSkin.cpp in Sources */, 420BBC0F1817416F00C7B720 /* ControlFactory.cpp in Sources */, - 420BBD031817416F00C7B720 /* lua_Global.cpp in Sources */, + 424F33951A60C28600395438 /* lua_PhysicsController.cpp in Sources */, + 424F331B1A60C28600395438 /* lua_AnimationTarget.cpp in Sources */, + 424F33F71A60C28600395438 /* lua_Touch.cpp in Sources */, + 424F34031A60C28600395438 /* lua_Vector4.cpp in Sources */, + 424F33AF1A60C28600395438 /* lua_PhysicsVehicleWheel.cpp in Sources */, + 424F33E71A60C28600395438 /* lua_Texture.cpp in Sources */, 42CC55751809A4EF00AAD8AD /* AIController.cpp in Sources */, - 420BBC9B1817416F00C7B720 /* lua_ControlListener.cpp in Sources */, 42CC59371809A4EF00AAD8AD /* PhysicsCollisionObject.cpp in Sources */, - 420BBCFB1817416F00C7B720 /* lua_Gesture.cpp in Sources */, - 420BBE1B1817416F00C7B720 /* lua_RenderState.cpp in Sources */, + 424F33A11A60C28600395438 /* lua_PhysicsGhostObject.cpp in Sources */, + 424F33671A60C28600395438 /* lua_Light.cpp in Sources */, + 424F33EB1A60C28600395438 /* lua_Theme.cpp in Sources */, + 424F33FD1A60C28600395438 /* lua_Uniform.cpp in Sources */, 42CC595F1809A4EF00AAD8AD /* PhysicsSpringConstraint.cpp in Sources */, - 420BBC8F1817416F00C7B720 /* lua_Control.cpp in Sources */, + 424F33AD1A60C28600395438 /* lua_PhysicsVehicle.cpp in Sources */, 42CC59671809A4EF00AAD8AD /* PhysicsVehicleWheel.cpp in Sources */, + 424F33551A60C28600395438 /* lua_Global.cpp in Sources */, + 424F33371A60C28600395438 /* lua_Control.cpp in Sources */, 42CC594F1809A4EF00AAD8AD /* PhysicsGhostObject.cpp in Sources */, - 420BBCA31817416F00C7B720 /* lua_ControlState.cpp in Sources */, - 420BBE0B1817416F00C7B720 /* lua_RadioButton.cpp in Sources */, - 420BBD871817416F00C7B720 /* lua_ParticleEmitter.cpp in Sources */, - 420BBD5F1817416F00C7B720 /* lua_MeshIndexFormat.cpp in Sources */, + 424F33091A60C28600395438 /* lua_AIMessage.cpp in Sources */, 42CC597D1809A4EF00AAD8AD /* PlatformWindows.cpp in Sources */, - 420BBDC31817416F00C7B720 /* lua_PhysicsControllerHitResult.cpp in Sources */, 42CC55B31809A4EF00AAD8AD /* Bundle.cpp in Sources */, - 420BBD531817416F00C7B720 /* lua_Matrix.cpp in Sources */, - 420BBD7B1817416F00C7B720 /* lua_Node.cpp in Sources */, - 420BBDD31817416F00C7B720 /* lua_PhysicsGenericConstraint.cpp in Sources */, 42CC592F1809A4EF00AAD8AD /* Pass.cpp in Sources */, - 420BBC671817416F00C7B720 /* lua_AudioSourceState.cpp in Sources */, - 420BBEB71817416F00C7B720 /* lua_Uniform.cpp in Sources */, - 420BBD5B1817416F00C7B720 /* lua_MeshBatch.cpp in Sources */, - 420BBDE71817416F00C7B720 /* lua_PhysicsSocketConstraint.cpp in Sources */, - 420BBEBB1817416F00C7B720 /* lua_Vector2.cpp in Sources */, - 420BBCE31817416F00C7B720 /* lua_Game.cpp in Sources */, + 424F33631A60C28600395438 /* lua_Label.cpp in Sources */, 42CC55F71809A4EF00AAD8AD /* Gamepad.cpp in Sources */, 42CC56211809A4EF00AAD8AD /* Label.cpp in Sources */, - 420BBC231817416F00C7B720 /* lua_AIMessage.cpp in Sources */, 42CC59B71809A4EF00AAD8AD /* ScriptTarget.cpp in Sources */, - 420BBE9B1817416F00C7B720 /* lua_ThemeStyle.cpp in Sources */, + 424F333B1A60C28600395438 /* lua_Curve.cpp in Sources */, 42CC59FF1809A4EF00AAD8AD /* ThemeStyle.cpp in Sources */, + 424F33C91A60C28600395438 /* lua_ScreenDisplayer.cpp in Sources */, 42CC59A31809A4EF00AAD8AD /* SceneLoader.cpp in Sources */, + 424F34091A60C28600395438 /* lua_VertexFormatElement.cpp in Sources */, 42CC556D1809A4EF00AAD8AD /* AbsoluteLayout.cpp in Sources */, + 424F336B1A60C28600395438 /* lua_Material.cpp in Sources */, + 424F334F1A60C28600395438 /* lua_Game.cpp in Sources */, 42CC59191809A4EF00AAD8AD /* MeshPart.cpp in Sources */, 42CC55FB1809A4EF00AAD8AD /* gameplay-main-android.cpp in Sources */, - 420BBE2F1817416F00C7B720 /* lua_RenderStateFrontFace.cpp in Sources */, - 420BBC2B1817416F00C7B720 /* lua_AIState.cpp in Sources */, - 420BBC731817416F00C7B720 /* lua_Bundle.cpp in Sources */, - 420BBD071817416F00C7B720 /* lua_HeightField.cpp in Sources */, - 420BBC3B1817416F00C7B720 /* lua_Animation.cpp in Sources */, + 424F336F1A60C28600395438 /* lua_MathUtil.cpp in Sources */, 42CC55791809A4EF00AAD8AD /* AIMessage.cpp in Sources */, - 420BBEA71817416F00C7B720 /* lua_Touch.cpp in Sources */, - 420BBD671817416F00C7B720 /* lua_MeshPrimitiveType.cpp in Sources */, - 420BBC7F1817416F00C7B720 /* lua_CameraType.cpp in Sources */, - 420BBCEB1817416F00C7B720 /* lua_Gamepad.cpp in Sources */, - 420BBC431817416F00C7B720 /* lua_AnimationClipListener.cpp in Sources */, - 420BBE171817416F00C7B720 /* lua_Ref.cpp in Sources */, - 420BBD6B1817416F00C7B720 /* lua_MeshSkin.cpp in Sources */, + 424F33B91A60C28600395438 /* lua_RadioButton.cpp in Sources */, + 424F33071A60C28600395438 /* lua_AIController.cpp in Sources */, + 424F338B1A60C28600395438 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */, + 424F33C31A60C28600395438 /* lua_RenderStateStateBlock.cpp in Sources */, 42CC594B1809A4EF00AAD8AD /* PhysicsGenericConstraint.cpp in Sources */, - 420BBC331817416F00C7B720 /* lua_AIStateMachine.cpp in Sources */, - 420BBD4F1817416F00C7B720 /* lua_MathUtil.cpp in Sources */, - 420BBEA31817416F00C7B720 /* lua_ThemeUVs.cpp in Sources */, 42CC593B1809A4EF00AAD8AD /* PhysicsCollisionShape.cpp in Sources */, + 424F33131A60C28600395438 /* lua_Animation.cpp in Sources */, 42CC59FB1809A4EF00AAD8AD /* Theme.cpp in Sources */, - 420BBD331817416F00C7B720 /* lua_LayoutType.cpp in Sources */, + 424F34071A60C28600395438 /* lua_VertexFormat.cpp in Sources */, + 424F33F91A60C28600395438 /* lua_Transform.cpp in Sources */, + 424F33191A60C28600395438 /* lua_AnimationController.cpp in Sources */, + 424F33311A60C28600395438 /* lua_CameraListener.cpp in Sources */, + 424F33E91A60C28600395438 /* lua_TextureSampler.cpp in Sources */, + 424F33711A60C28600395438 /* lua_Matrix.cpp in Sources */, 42CC55C31809A4EF00AAD8AD /* Container.cpp in Sources */, - 420BBD571817416F00C7B720 /* lua_Mesh.cpp in Sources */, + 424F33CF1A60C28600395438 /* lua_ScriptTarget.cpp in Sources */, + 424F33AB1A60C28600395438 /* lua_PhysicsSpringConstraint.cpp in Sources */, 42CC59791809A4EF00AAD8AD /* PlatformLinux.cpp in Sources */, - 420BBCCB1817416F00C7B720 /* lua_FontJustify.cpp in Sources */, + 424F33A51A60C28600395438 /* lua_PhysicsRigidBody.cpp in Sources */, 42CC59471809A4EF00AAD8AD /* PhysicsFixedConstraint.cpp in Sources */, - 420BBC7B1817416F00C7B720 /* lua_Camera.cpp in Sources */, - 420BBCF71817416F00C7B720 /* lua_GameState.cpp in Sources */, + 424F334D1A60C28600395438 /* lua_Frustum.cpp in Sources */, + 424F33EF1A60C28600395438 /* lua_ThemeStyle.cpp in Sources */, + 424F33331A60C28600395438 /* lua_CheckBox.cpp in Sources */, + 424F331F1A60C28600395438 /* lua_AudioBuffer.cpp in Sources */, + 424F33171A60C28600395438 /* lua_AnimationClipListener.cpp in Sources */, + 424F33F51A60C28600395438 /* lua_TileSet.cpp in Sources */, + 424F33731A60C28600395438 /* lua_Mesh.cpp in Sources */, 42CC55F31809A4EF00AAD8AD /* Game.cpp in Sources */, - 420BBCA71817416F00C7B720 /* lua_Curve.cpp in Sources */, - 420BBCFF1817416F00C7B720 /* lua_GestureGestureEvent.cpp in Sources */, - 420BBC771817416F00C7B720 /* lua_Button.cpp in Sources */, - 420BBCDF1817416F00C7B720 /* lua_Frustum.cpp in Sources */, - 420BBE2B1817416F00C7B720 /* lua_RenderStateDepthFunction.cpp in Sources */, - 420BBCD31817416F00C7B720 /* lua_FontText.cpp in Sources */, - 420BBC1B1817416F00C7B720 /* lua_AIAgentListener.cpp in Sources */, 42CC59111809A4EF00AAD8AD /* Mesh.cpp in Sources */, + 424F33E31A60C28600395438 /* lua_Text.cpp in Sources */, 42CC55DB1809A4EF00AAD8AD /* FileSystem.cpp in Sources */, 42CC59631809A4EF00AAD8AD /* PhysicsVehicle.cpp in Sources */, - 420BBD631817416F00C7B720 /* lua_MeshPart.cpp in Sources */, - 420BBECB1817416F00C7B720 /* lua_VertexFormat.cpp in Sources */, - 420BBC571817416F00C7B720 /* lua_AudioBuffer.cpp in Sources */, - 420BBDFF1817416F00C7B720 /* lua_Properties.cpp in Sources */, + 42ECC3FB1A4EF5A00036C839 /* Text.cpp in Sources */, 42CC56131809A4EF00AAD8AD /* ImageControl.cpp in Sources */, 42CC55E31809A4EF00AAD8AD /* Font.cpp in Sources */, - 420BBE8F1817416F00C7B720 /* lua_TextureWrap.cpp in Sources */, + 424F332B1A60C28600395438 /* lua_Bundle.cpp in Sources */, + 424F33F11A60C28600395438 /* lua_ThemeThemeImage.cpp in Sources */, 42CC56251809A4EF00AAD8AD /* Layout.cpp in Sources */, - 420BBE071817416F00C7B720 /* lua_Quaternion.cpp in Sources */, - 420BBCBB1817416F00C7B720 /* lua_FileSystem.cpp in Sources */, - 420BBDC71817416F00C7B720 /* lua_PhysicsControllerListener.cpp in Sources */, 42CC590D1809A4EF00AAD8AD /* Matrix.cpp in Sources */, - 420BBDB31817416F00C7B720 /* lua_PhysicsCollisionShapeType.cpp in Sources */, + 424F33B71A60C28600395438 /* lua_Quaternion.cpp in Sources */, + 424F33031A60C28600395438 /* lua_AIAgent.cpp in Sources */, + 424F33E51A60C28600395438 /* lua_TextBox.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2640,9 +2282,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; - CLANG_CXX_LIBRARY = "libstdc++"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -2665,14 +2306,9 @@ GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "../external-deps/bullet/include", - "../external-deps/lua/include", - "../external-deps/png/include", - "../external-deps/oggvorbis/include", - ); + HEADER_SEARCH_PATHS = "../external-deps/include"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_NAME = gameplay; @@ -2680,7 +2316,7 @@ SHARED_PRECOMPS_DIR = ""; SUPPORTED_PLATFORMS = macosx; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "i386 x86_64"; + VALID_ARCHS = x86_64; }; name = Debug; }; @@ -2688,9 +2324,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; - CLANG_CXX_LIBRARY = "libstdc++"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -2707,21 +2342,16 @@ GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "../external-deps/bullet/include", - "../external-deps/lua/include", - "../external-deps/png/include", - "../external-deps/oggvorbis/include", - ); + HEADER_SEARCH_PATHS = "../external-deps/include"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.9; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_NAME = gameplay; PUBLIC_HEADERS_FOLDER_PATH = "$(PROJECT_NAME)_include"; SHARED_PRECOMPS_DIR = ""; SUPPORTED_PLATFORMS = macosx; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "i386 x86_64"; + VALID_ARCHS = x86_64; }; name = Release; }; @@ -2729,9 +2359,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; - CLANG_CXX_LIBRARY = "libstdc++"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEPLOYMENT_LOCATION = NO; @@ -2746,22 +2375,19 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "../external-deps/bullet/include", - "../external-deps/lua/include", - "../external-deps/png/include", - "../external-deps/oggvorbis/include", - ); + HEADER_SEARCH_PATHS = "../external-deps/include"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ""; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_NAME = gameplay; PROVISIONING_PROFILE = ""; @@ -2772,7 +2398,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "armv7 armv7s arm64 i386 x86_64"; + VALID_ARCHS = "armv7 armv7s arm64 i386"; }; name = Debug; }; @@ -2780,9 +2406,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++98"; - CLANG_CXX_LIBRARY = "libstdc++"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -2795,22 +2420,19 @@ GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "../external-deps/bullet/include", - "../external-deps/lua/include", - "../external-deps/png/include", - "../external-deps/oggvorbis/include", - ); + HEADER_SEARCH_PATHS = "../external-deps/include"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ""; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_NAME = gameplay; PROVISIONING_PROFILE = ""; @@ -2821,7 +2443,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "armv7 armv7s arm64 i386 x86_64"; + VALID_ARCHS = "armv7 armv7s arm64 i386"; }; name = Release; }; diff --git a/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-ios.xcscheme b/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-ios.xcscheme index 5bc7ddf383..332a0a605c 100644 --- a/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-ios.xcscheme +++ b/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-ios.xcscheme @@ -1,6 +1,6 @@ + + + + diff --git a/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-macosx.xcscheme b/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-macosx.xcscheme index e6e1e5b294..de4789c2ca 100644 --- a/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-macosx.xcscheme +++ b/gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-macosx.xcscheme @@ -1,6 +1,6 @@ + + + + diff --git a/gameplay/res/icon_tray.png b/gameplay/res/icon_tray.png new file mode 100644 index 0000000000..5cbccfbe82 Binary files /dev/null and b/gameplay/res/icon_tray.png differ diff --git a/gameplay/res/shaders/colored.frag b/gameplay/res/shaders/colored.frag index 3ce08c46b5..d07d3e3dc7 100644 --- a/gameplay/res/shaders/colored.frag +++ b/gameplay/res/shaders/colored.frag @@ -73,6 +73,10 @@ vec4 _baseColor; varying vec3 v_color; #endif +#if defined(LIGHTMAP) +varying vec2 v_texCoord1; +#endif + #if defined(LIGHTING) varying vec3 v_normalVector; @@ -93,10 +97,16 @@ varying vec3 v_cameraDirection; #endif +#if defined(CLIP_PLANE) +varying float v_clipDistance; +#endif void main() { - + #if defined(CLIP_PLANE) + if(v_clipDistance < 0.0) discard; + #endif + #if defined(LIGHTING) #if defined(VERTEX_COLOR) diff --git a/gameplay/res/shaders/colored.vert b/gameplay/res/shaders/colored.vert index ee87b55182..f334f84c4b 100644 --- a/gameplay/res/shaders/colored.vert +++ b/gameplay/res/shaders/colored.vert @@ -66,6 +66,11 @@ uniform vec3 u_cameraPosition; #endif +#if defined(CLIP_PLANE) +uniform mat4 u_worldMatrix; +uniform vec4 u_clipPlane; +#endif + /////////////////////////////////////////////////////////// // Varyings #if defined(LIGHTMAP) @@ -106,6 +111,9 @@ varying vec3 v_cameraDirection; #include "skinning-none.vert" #endif +#if defined(CLIP_PLANE) +varying float v_clipDistance; +#endif void main() { @@ -134,4 +142,8 @@ void main() #if defined(VERTEX_COLOR) v_color = a_color; #endif + + #if defined(CLIP_PLANE) + v_clipDistance = dot(u_worldMatrix * position, u_clipPlane); + #endif } diff --git a/gameplay/res/shaders/terrain.frag b/gameplay/res/shaders/terrain.frag index bddaeed72a..2540b6d31a 100644 --- a/gameplay/res/shaders/terrain.frag +++ b/gameplay/res/shaders/terrain.frag @@ -71,6 +71,19 @@ vec4 _baseColor; varying vec3 v_normalVector; #else vec3 v_normalVector; + +#if (DIRECTIONAL_LIGHT_COUNT > 0) +varying vec3 v_lightDirection[DIRECTIONAL_LIGHT_COUNT]; +#endif + +#if (POINT_LIGHT_COUNT > 0) +varying vec3 v_vertexToPointLightDirection[POINT_LIGHT_COUNT]; +#endif + +#if (SPOT_LIGHT_COUNT > 0) +varying vec3 v_vertexToSpotLightDirection[SPOT_LIGHT_COUNT]; +#endif + #endif #endif diff --git a/gameplay/res/shaders/textured.frag b/gameplay/res/shaders/textured.frag index d2f3f8990e..cd13792203 100644 --- a/gameplay/res/shaders/textured.frag +++ b/gameplay/res/shaders/textured.frag @@ -113,9 +113,17 @@ varying vec3 v_cameraDirection; #endif +#if defined(CLIP_PLANE) +varying float v_clipDistance; +#endif + void main() { + #if defined(CLIP_PLANE) + if(v_clipDistance < 0.0) discard; + #endif + _baseColor = texture2D(u_diffuseTexture, v_texCoord); gl_FragColor.a = _baseColor.a; diff --git a/gameplay/res/shaders/textured.vert b/gameplay/res/shaders/textured.vert index f8eea19d9d..00d72c9cfb 100644 --- a/gameplay/res/shaders/textured.vert +++ b/gameplay/res/shaders/textured.vert @@ -79,6 +79,11 @@ uniform vec2 u_textureRepeat; uniform vec2 u_textureOffset; #endif +#if defined(CLIP_PLANE) +uniform mat4 u_worldMatrix; +uniform vec4 u_clipPlane; +#endif + /////////////////////////////////////////////////////////// // Varyings varying vec2 v_texCoord; @@ -122,6 +127,10 @@ varying vec3 v_cameraDirection; #include "skinning-none.vert" #endif +#if defined(CLIP_PLANE) +varying float v_clipDistance; +#endif + void main() { vec4 position = getPosition(); @@ -164,4 +173,8 @@ void main() #if defined(LIGHTMAP) v_texCoord1 = a_texCoord1; #endif + + #if defined(CLIP_PLANE) + v_clipDistance = dot(u_worldMatrix * position, u_clipPlane); + #endif } diff --git a/gameplay/res/ui/arial.gpb b/gameplay/res/ui/arial.gpb index 044b1f7988..ef643e0e06 100644 Binary files a/gameplay/res/ui/arial.gpb and b/gameplay/res/ui/arial.gpb differ diff --git a/gameplay/src/AIAgent.cpp b/gameplay/src/AIAgent.cpp index dc65361325..9829d516aa 100644 --- a/gameplay/src/AIAgent.cpp +++ b/gameplay/src/AIAgent.cpp @@ -9,8 +9,6 @@ AIAgent::AIAgent() : _stateMachine(NULL), _node(NULL), _enabled(true), _listener(NULL), _next(NULL) { _stateMachine = new AIStateMachine(this); - - addScriptEvent("message", ""); } AIAgent::~AIAgent() @@ -35,6 +33,11 @@ Node* AIAgent::getNode() const { return _node; } + +void AIAgent::setNode(Node* node) +{ + _node = node; +} AIStateMachine* AIAgent::getStateMachine() { @@ -78,15 +81,17 @@ bool AIAgent::processMessage(AIMessage* message) } } break; + case AIMessage::MESSAGE_TYPE_CUSTOM: + break; } // Dispatch message to registered listener. if (_listener && _listener->messageReceived(message)) return true; - - if (fireScriptEvent("message", message)) + + if (_node && _node->fireScriptEvent(GP_GET_SCRIPT_EVENT(Node, messageReceived), dynamic_cast(_node), message)) return true; - + return false; } diff --git a/gameplay/src/AIAgent.h b/gameplay/src/AIAgent.h index 1539c0bb1d..45b84f4a65 100644 --- a/gameplay/src/AIAgent.h +++ b/gameplay/src/AIAgent.h @@ -4,7 +4,6 @@ #include "Ref.h" #include "AIStateMachine.h" #include "AIMessage.h" -#include "ScriptTarget.h" namespace gameplay { @@ -19,9 +18,10 @@ class Node; * such as state machines. By default, an AIAgent has an empty state * machine. */ -class AIAgent : public Ref, public ScriptTarget +class AIAgent : public Ref { friend class Node; + friend class AIState; friend class AIController; public: @@ -141,6 +141,11 @@ class AIAgent : public Ref, public ScriptTarget * Hidden copy assignment operator. */ AIAgent& operator=(const AIAgent&); + + /** + * Set the node this agent is attached to. + */ + void setNode(Node* node); /** * Called by the AIController to process a message for the AIAgent. diff --git a/gameplay/src/AIMessage.cpp b/gameplay/src/AIMessage.cpp index 2a90732767..8754be0062 100644 --- a/gameplay/src/AIMessage.cpp +++ b/gameplay/src/AIMessage.cpp @@ -195,12 +195,8 @@ AIMessage::Parameter::~Parameter() void AIMessage::Parameter::clear() { - switch (type) - { - case AIMessage::STRING: + if (type == AIMessage::STRING) SAFE_DELETE_ARRAY(stringValue); - break; - } type = AIMessage::UNDEFINED; } diff --git a/gameplay/src/AIState.cpp b/gameplay/src/AIState.cpp index 0e872eaf11..dc2ded3217 100644 --- a/gameplay/src/AIState.cpp +++ b/gameplay/src/AIState.cpp @@ -1,6 +1,8 @@ #include "Base.h" #include "AIState.h" +#include "AIAgent.h" #include "AIStateMachine.h" +#include "Node.h" namespace gameplay { @@ -10,9 +12,6 @@ AIState* AIState::_empty = NULL; AIState::AIState(const char* id) : _id(id), _listener(NULL) { - addScriptEvent("enter", ""); - addScriptEvent("exit", ""); - addScriptEvent("update", "f"); } AIState::~AIState() @@ -39,7 +38,9 @@ void AIState::enter(AIStateMachine* stateMachine) if (_listener) _listener->stateEnter(stateMachine->getAgent(), this); - fireScriptEvent("enter", stateMachine->getAgent(), this); + Node* node = stateMachine->_agent->_node; + if (node) + node->fireScriptEvent(GP_GET_SCRIPT_EVENT(Node, stateEnter), dynamic_cast(node), this); } void AIState::exit(AIStateMachine* stateMachine) @@ -47,7 +48,9 @@ void AIState::exit(AIStateMachine* stateMachine) if (_listener) _listener->stateExit(stateMachine->getAgent(), this); - fireScriptEvent("exit", stateMachine->getAgent(), this); + Node* node = stateMachine->_agent->_node; + if (node) + node->fireScriptEvent(GP_GET_SCRIPT_EVENT(Node, stateExit), dynamic_cast(node), this); } void AIState::update(AIStateMachine* stateMachine, float elapsedTime) @@ -55,7 +58,9 @@ void AIState::update(AIStateMachine* stateMachine, float elapsedTime) if (_listener) _listener->stateUpdate(stateMachine->getAgent(), this, elapsedTime); - fireScriptEvent("update", stateMachine->getAgent(), this, elapsedTime); + Node* node = stateMachine->_agent->_node; + if (node) + node->fireScriptEvent(GP_GET_SCRIPT_EVENT(Node, stateUpdate), dynamic_cast(node), this, elapsedTime); } AIState::Listener::~Listener() diff --git a/gameplay/src/AIState.h b/gameplay/src/AIState.h index 9f63350164..5146d4e469 100644 --- a/gameplay/src/AIState.h +++ b/gameplay/src/AIState.h @@ -2,7 +2,6 @@ #define AISTATE_H_ #include "Ref.h" -#include "ScriptTarget.h" namespace gameplay { @@ -17,7 +16,7 @@ class AIStateMachine; * state machine. Events can be programmed or scripted when the * state is entered, exited and each frame/tick in its update event. */ -class AIState : public Ref, public ScriptTarget +class AIState : public Ref { friend class AIStateMachine; diff --git a/gameplay/src/AIStateMachine.h b/gameplay/src/AIStateMachine.h index 2ba2b1a2ed..237b7ca00b 100644 --- a/gameplay/src/AIStateMachine.h +++ b/gameplay/src/AIStateMachine.h @@ -30,6 +30,7 @@ class AIAgent; class AIStateMachine { friend class AIAgent; + friend class AIState; public: diff --git a/gameplay/src/Animation.cpp b/gameplay/src/Animation.cpp index 453f9c8e6e..532e67bb2f 100644 --- a/gameplay/src/Animation.cpp +++ b/gameplay/src/Animation.cpp @@ -138,9 +138,9 @@ void Animation::createClips(const char* url) SAFE_DELETE(properties); } -AnimationClip* Animation::createClip(const char* id, unsigned long start, unsigned long end) +AnimationClip* Animation::createClip(const char* id, unsigned long begin, unsigned long end) { - AnimationClip* clip = new AnimationClip(id, this, start, end); + AnimationClip* clip = new AnimationClip(id, this, begin, end); addClip(clip); return clip; } @@ -238,6 +238,7 @@ bool Animation::targets(AnimationTarget* target) const return false; } + void Animation::createDefaultClip() { _defaultClip = new AnimationClip("default_clip", this, 0.0f, _duration); @@ -435,6 +436,7 @@ void Animation::setTransformRotationOffset(Curve* curve, unsigned int propertyId case Transform::ANIMATE_ROTATE_TRANSLATE: curve->setQuaternionOffset(ANIMATION_ROTATE_OFFSET); return; + case Transform::ANIMATE_SCALE_ROTATE: case Transform::ANIMATE_SCALE_ROTATE_TRANSLATE: curve->setQuaternionOffset(ANIMATION_SRT_OFFSET); return; diff --git a/gameplay/src/Animation.h b/gameplay/src/Animation.h index 77180e5a1f..a7eb6b011f 100644 --- a/gameplay/src/Animation.h +++ b/gameplay/src/Animation.h @@ -57,13 +57,13 @@ class Animation : public Ref * Creates an AnimationClip from the Animation. * * @param id The ID to the give the AnimationClip. - * @param start The time (in milliseconds) that the AnimationClip will begin from. - * @param end The time (in milliseconds) that the AnimationClip will end. + * @param begin The begin time (in milliseconds) or keyframe(for keyframe animations). + * @param end The end time (in milliseconds) or keyframe (for keyframe animations). * * @return The newly created AnimationClip; NULL if an AnimationClip already exists with the same ID. * @script{create} */ - AnimationClip* createClip(const char* id, unsigned long start, unsigned long end); + AnimationClip* createClip(const char* id, unsigned long begin, unsigned long end); /** * Finds the AnimationClip with the specified name. If NULL, gets the default clip. diff --git a/gameplay/src/AnimationClip.cpp b/gameplay/src/AnimationClip.cpp index 1339657198..cb0fe936f5 100644 --- a/gameplay/src/AnimationClip.cpp +++ b/gameplay/src/AnimationClip.cpp @@ -9,12 +9,16 @@ namespace gameplay { +extern void splitURL(const std::string& url, std::string* file, std::string* id); + AnimationClip::AnimationClip(const char* id, Animation* animation, unsigned long startTime, unsigned long endTime) : _id(id), _animation(animation), _startTime(startTime), _endTime(endTime), _duration(_endTime - _startTime), _stateBits(0x00), _repeatCount(1.0f), _loopBlendTime(0), _activeDuration(_duration * _repeatCount), _speed(1.0f), _timeStarted(0), _elapsedTime(0), _crossFadeToClip(NULL), _crossFadeOutElapsed(0), _crossFadeOutDuration(0), _blendWeight(1.0f), - _beginListeners(NULL), _endListeners(NULL), _listeners(NULL), _listenerItr(NULL), _scriptListeners(NULL) + _beginListeners(NULL), _endListeners(NULL), _listeners(NULL), _listenerItr(NULL) { + GP_REGISTER_SCRIPT_EVENTS(); + GP_ASSERT(_animation); GP_ASSERT(0 <= startTime && startTime <= _animation->_duration && 0 <= endTime && endTime <= _animation->_duration); @@ -40,15 +44,6 @@ AnimationClip::~AnimationClip() SAFE_DELETE(_beginListeners); SAFE_DELETE(_endListeners); - if (_scriptListeners) - { - for (size_t i = 0; i < _scriptListeners->size(); i++) - { - SAFE_DELETE((*_scriptListeners)[i]); - } - SAFE_DELETE(_scriptListeners); - } - if (_listeners) { *_listenerItr = _listeners->begin(); @@ -56,7 +51,7 @@ AnimationClip::~AnimationClip() { ListenerEvent* lEvt = **_listenerItr; SAFE_DELETE(lEvt); - ++*_listenerItr; + ++(*_listenerItr); } SAFE_DELETE(_listeners); } @@ -73,6 +68,11 @@ AnimationClip::ListenerEvent::~ListenerEvent() { } +const char* AnimationClip::getTypeName() const +{ + return "AnimationClip"; +} + const char* AnimationClip::getId() const { return _id.c_str(); @@ -172,9 +172,14 @@ float AnimationClip::getBlendWeight() const void AnimationClip::setLoopBlendTime(float loopBlendTime) { - _loopBlendTime = loopBlendTime; - if (_loopBlendTime < 0.0f) - _loopBlendTime = 0.0f; + if (loopBlendTime < 0.0f) + { + _loopBlendTime = 0; + } + else + { + _loopBlendTime = (unsigned int)loopBlendTime; + } } float AnimationClip::getLoopBlendTime() const @@ -309,9 +314,11 @@ void AnimationClip::addListener(AnimationClip::Listener* listener, unsigned long { float currentTime = fmodf(_elapsedTime, (float)_duration); GP_ASSERT(**_listenerItr || *_listenerItr == _listeners->end()); - if ((_speed >= 0.0f && currentTime < eventTime && (*_listenerItr == _listeners->end() || eventTime < (**_listenerItr)->_eventTime)) || + if ((_speed >= 0.0f && currentTime < eventTime && (*_listenerItr == _listeners->end() || eventTime < (**_listenerItr)->_eventTime)) || (_speed <= 0 && currentTime > eventTime && (*_listenerItr == _listeners->begin() || eventTime > (**_listenerItr)->_eventTime))) + { *_listenerItr = itr; + } } return; } @@ -320,6 +327,32 @@ void AnimationClip::addListener(AnimationClip::Listener* listener, unsigned long } } +void AnimationClip::removeListener(AnimationClip::Listener* listener, unsigned long eventTime) +{ + if (_listeners) + { + GP_ASSERT(listener); + std::list::iterator iter = std::find_if(_listeners->begin(), _listeners->end(), [&](ListenerEvent* lst){ return lst->_eventTime == eventTime && lst->_listener == listener; }); + if (iter != _listeners->end()) + { + if (isClipStateBitSet(CLIP_IS_PLAYING_BIT)) + { + float currentTime = fmodf(_elapsedTime, (float)_duration); + GP_ASSERT(**_listenerItr || *_listenerItr == _listeners->end()); + + // We the listener has not been triggered yet, then check if it is next to be triggered, remove it, and update the iterator + if (((_speed >= 0.0f && currentTime < eventTime) || (_speed <= 0 && currentTime > eventTime)) && + *iter == **_listenerItr) + { + *_listenerItr = _listeners->erase(iter); + return; + } + } + _listeners->erase(iter); + } + } +} + void AnimationClip::addBeginListener(AnimationClip::Listener* listener) { if (!_beginListeners) @@ -329,6 +362,19 @@ void AnimationClip::addBeginListener(AnimationClip::Listener* listener) _beginListeners->push_back(listener); } +void AnimationClip::removeBeginListener(AnimationClip::Listener* listener) +{ + if (_beginListeners) + { + GP_ASSERT(listener); + std::vector::iterator iter = std::find(_beginListeners->begin(), _beginListeners->end(), listener); + if (iter != _beginListeners->end()) + { + _beginListeners->erase(iter); + } + } +} + void AnimationClip::addEndListener(AnimationClip::Listener* listener) { if (!_endListeners) @@ -338,34 +384,17 @@ void AnimationClip::addEndListener(AnimationClip::Listener* listener) _endListeners->push_back(listener); } -void AnimationClip::addBeginListener(const char* function) +void AnimationClip::removeEndListener(AnimationClip::Listener* listener) { - if (!_scriptListeners) - _scriptListeners = new std::vector; - - ScriptListener* listener = new ScriptListener(function); - _scriptListeners->push_back(listener); - addBeginListener(listener); -} - -void AnimationClip::addEndListener(const char* function) -{ - if (!_scriptListeners) - _scriptListeners = new std::vector; - - ScriptListener* listener = new ScriptListener(function); - _scriptListeners->push_back(listener); - addEndListener(listener); -} - -void AnimationClip::addListener(const char* function, unsigned long eventTime) -{ - if (!_scriptListeners) - _scriptListeners = new std::vector; - - ScriptListener* listener = new ScriptListener(function); - _scriptListeners->push_back(listener); - addListener(listener, eventTime); + if (_endListeners) + { + GP_ASSERT(listener); + std::vector::iterator iter = std::find(_endListeners->begin(), _endListeners->end(), listener); + if (iter != _endListeners->end()) + { + _endListeners->erase(iter); + } + } } bool AnimationClip::update(float elapsedTime) @@ -443,7 +472,7 @@ bool AnimationClip::update(float elapsedTime) GP_ASSERT((**_listenerItr)->_listener); (**_listenerItr)->_listener->animationEvent(this, Listener::TIME); - ++*_listenerItr; + ++(*_listenerItr); } } else @@ -455,11 +484,14 @@ bool AnimationClip::update(float elapsedTime) GP_ASSERT((**_listenerItr)->_listener); (**_listenerItr)->_listener->animationEvent(this, Listener::TIME); - --*_listenerItr; + --(*_listenerItr); } } } + // Fire script update event + fireScriptEvent(GP_GET_SCRIPT_EVENT(AnimationClip, clipUpdate), this, _elapsedTime); + // Add back in start time, and divide by the total animation's duration to get the actual percentage complete GP_ASSERT(_animation); @@ -587,6 +619,9 @@ void AnimationClip::onBegin() } } + // Fire script begin event + fireScriptEvent(GP_GET_SCRIPT_EVENT(AnimationClip, clipBegin), this); + release(); } @@ -609,6 +644,9 @@ void AnimationClip::onEnd() } } + // Fire script end event + fireScriptEvent(GP_GET_SCRIPT_EVENT(AnimationClip, clipEnd), this); + release(); } @@ -651,16 +689,4 @@ AnimationClip* AnimationClip::clone(Animation* animation) const return newClip; } -AnimationClip::ScriptListener::ScriptListener(const std::string& function) -{ - // Store the function name. - this->function = Game::getInstance()->getScriptController()->loadUrl(function.c_str()); -} - -void AnimationClip::ScriptListener::animationEvent(AnimationClip* clip, EventType type) -{ - Game::getInstance()->getScriptController()->executeFunction(function.c_str(), "[AnimationClip::Listener::EventType]", clip, type); -} - - } diff --git a/gameplay/src/AnimationClip.h b/gameplay/src/AnimationClip.h index 33731cff65..03b7794e37 100644 --- a/gameplay/src/AnimationClip.h +++ b/gameplay/src/AnimationClip.h @@ -1,26 +1,31 @@ #ifndef ANIMATIONCLIP_H_ #define ANIMATIONCLIP_H_ -#include "Base.h" #include "AnimationValue.h" #include "Curve.h" #include "Animation.h" +#include "ScriptTarget.h" namespace gameplay { class Animation; class AnimationValue; -class ScriptListener; /** * Defines the runtime session of an Animation to be played. */ -class AnimationClip : public Ref +class AnimationClip : public Ref, public ScriptTarget { friend class AnimationController; friend class Animation; + GP_SCRIPT_EVENTS_START(); + GP_SCRIPT_EVENT(clipBegin, ""); + GP_SCRIPT_EVENT(clipEnd, ""); + GP_SCRIPT_EVENT(clipUpdate, "f"); + GP_SCRIPT_EVENTS_END(); + public: /** @@ -37,7 +42,7 @@ class AnimationClip : public Ref public: - /* + /** * Constructor. */ Listener() @@ -76,6 +81,14 @@ class AnimationClip : public Ref virtual void animationEvent(AnimationClip* clip, EventType type) = 0; }; + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * @return The type name of this class: "AnimationClip" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Gets the AnimationClip's ID. * @@ -231,6 +244,13 @@ class AnimationClip : public Ref */ void addBeginListener(AnimationClip::Listener* listener); + /** + * Removes an animation begin listener. + * + * @param listener The listener to be removed. + */ + void removeBeginListener(AnimationClip::Listener* listener); + /** * Adds an animation end listener. * @@ -238,6 +258,13 @@ class AnimationClip : public Ref */ void addEndListener(AnimationClip::Listener* listener); + /** + * Removes an animation end listener. + * + * @param listener The listener to be removed. + */ + void removeEndListener(AnimationClip::Listener* listener); + /** * Adds an animation listener to be called back at the specified eventTime during the playback * of the AnimationClip. @@ -250,35 +277,12 @@ class AnimationClip : public Ref void addListener(AnimationClip::Listener* listener, unsigned long eventTime); /** - * Adds an animation begin listener. - * - * Note: the given Lua function must have the same function signature as AnimationClip::Listener::animationEvent. - * - * @param function The Lua script function to be called when an AnimationClip begins. - */ - void addBeginListener(const char* function); - - /** - * Adds an animation end listener. - * - * Note: the given Lua function must have the same function signature as AnimationClip::Listener::animationEvent. + * Removes an animation listener assigned to the specified eventTime. * - * @param function The Lua script function to be called when an AnimationClip ends. + * @param listener The listener to be removed with the specified time. + * @param eventTime The time of the listener to be removed. */ - void addEndListener(const char* function); - - /** - * Adds an animation listener to be called back at the specified eventTime during the playback - * of the AnimationClip. - * - * Note: the given Lua function must have the same function signature as AnimationClip::Listener::animationEvent. - * - * @param function The Lua script function to be called when an AnimationClip reaches the - * specified time in its playback. - * @param eventTime The time the listener will be called during the playback of the AnimationClip. - * Must be between 0 and the duration of the AnimationClip. - */ - void addListener(const char* function, unsigned long eventTime); + void removeListener(AnimationClip::Listener* listener, unsigned long eventTime); private: @@ -318,25 +322,6 @@ class AnimationClip : public Ref unsigned long _eventTime; // The time at which the listener will be called back at during the playback of the AnimationClip. }; - /** - * Listener implementation for script callbacks. - */ - struct ScriptListener : public AnimationClip::Listener - { - /** - * Constructor. - */ - ScriptListener(const std::string& function); - - /** - * @see AnimationClip::Listener::animationEvent - */ - void animationEvent(AnimationClip* clip, EventType type); - - /** The function to call back when an animation event occurs. */ - std::string function; - }; - /** * Constructor. */ @@ -422,7 +407,6 @@ class AnimationClip : public Ref std::vector* _endListeners; // Collection of end listeners on the clip. std::list* _listeners; // Ordered collection of listeners on the clip. std::list::iterator* _listenerItr; // Iterator that points to the next listener event to be triggered. - std::vector* _scriptListeners; // Collection of listeners that are bound to Lua script functions. }; } diff --git a/gameplay/src/AnimationTarget.cpp b/gameplay/src/AnimationTarget.cpp index 869e3c86cd..8f6830461b 100644 --- a/gameplay/src/AnimationTarget.cpp +++ b/gameplay/src/AnimationTarget.cpp @@ -3,6 +3,7 @@ #include "Animation.h" #include "Game.h" #include "Node.h" +#include "MaterialParameter.h" #define ANIMATION_TARGET_INDEFINITE_STR "INDEFINITE" diff --git a/gameplay/src/AudioBuffer.cpp b/gameplay/src/AudioBuffer.cpp index 96dfa40f74..af1d8fd44a 100644 --- a/gameplay/src/AudioBuffer.cpp +++ b/gameplay/src/AudioBuffer.cpp @@ -9,7 +9,7 @@ namespace gameplay static std::vector __buffers; // Callbacks for loading an ogg file using Stream -static size_t readStream(void *ptr, size_t size, size_t nmemb, void *datasource) +static size_t readStream(void* ptr, size_t size, size_t nmemb, void* datasource) { GP_ASSERT(datasource); Stream* stream = reinterpret_cast(datasource); @@ -31,69 +31,92 @@ static int closeStream(void *datasource) return 0; } -static long tellStream(void *datasource) +static long tellStream(void* datasource) { GP_ASSERT(datasource); Stream* stream = reinterpret_cast(datasource); return stream->position(); } -AudioBuffer::AudioBuffer(const char* path, ALuint buffer) - : _filePath(path), _alBuffer(buffer) +AudioBuffer::AudioBuffer(const char* path, ALuint* buffer, bool streamed) +: _filePath(path), _streamed(streamed), _buffersNeededCount(0) { + memcpy(_alBufferQueue, buffer, sizeof(_alBufferQueue)); } AudioBuffer::~AudioBuffer() { // Remove the buffer from the cache. unsigned int bufferCount = (unsigned int)__buffers.size(); - for (unsigned int i = 0; i < bufferCount; i++) + + if (!_streamed) { - if (this == __buffers[i]) + unsigned int bufferCount = (unsigned int)__buffers.size(); + for (unsigned int i = 0; i < bufferCount; i++) { - __buffers.erase(__buffers.begin() + i); - break; + if (this == __buffers[i]) + { + __buffers.erase(__buffers.begin() + i); + break; + } } } + else if (_streamStateOgg.get()) + { + ov_clear(&_streamStateOgg->oggFile); + } - if (_alBuffer) + for (int i = 0; i < STREAMING_BUFFER_QUEUE_SIZE; i++) { - AL_CHECK( alDeleteBuffers(1, &_alBuffer) ); - _alBuffer = 0; + if (_alBufferQueue[i]) + { + AL_CHECK(alDeleteBuffers(1, &_alBufferQueue[i])); + _alBufferQueue[i] = 0; + } } } -AudioBuffer* AudioBuffer::create(const char* path) +AudioBuffer* AudioBuffer::create(const char* path, bool streamed) { GP_ASSERT(path); - // Search the cache for a stream from this file. - unsigned int bufferCount = (unsigned int)__buffers.size(); AudioBuffer* buffer = NULL; - for (unsigned int i = 0; i < bufferCount; i++) + if (!streamed) { - buffer = __buffers[i]; - GP_ASSERT(buffer); - if (buffer->_filePath.compare(path) == 0) + unsigned int bufferCount = (unsigned int)__buffers.size(); + for (unsigned int i = 0; i < bufferCount; i++) { - buffer->addRef(); - return buffer; + buffer = __buffers[i]; + GP_ASSERT(buffer); + if (buffer->_filePath.compare(path) == 0) + { + buffer->addRef(); + return buffer; + } } } + ALuint alBuffer[STREAMING_BUFFER_QUEUE_SIZE]; + memset(alBuffer, 0, sizeof(alBuffer)); - ALuint alBuffer; - - // Load audio data into a buffer. - AL_CHECK( alGenBuffers(1, &alBuffer) ); - if (AL_LAST_ERROR()) + // Create 1 buffer for non-streamed sounds or full queue for streamed ones. + unsigned int queueSize = streamed ? STREAMING_BUFFER_QUEUE_SIZE : 1; + for (unsigned int i = 0; i < queueSize; i++) { - GP_ERROR("Failed to create OpenAL buffer; alGenBuffers error: %d", AL_LAST_ERROR()); - AL_CHECK( alDeleteBuffers(1, &alBuffer) ); - return NULL; + // Load audio data into a buffer. + AL_CHECK(alGenBuffers(1, &alBuffer[i])); + if (AL_LAST_ERROR()) + { + GP_ERROR("Failed to create OpenAL buffer; alGenBuffers error: %d", AL_LAST_ERROR()); + AL_CHECK(alDeleteBuffers(1, &alBuffer[i])); + return NULL; + } } + std::unique_ptr streamStateWav; + std::unique_ptr streamStateOgg; + // Load sound file. - std::auto_ptr stream(FileSystem::open(path)); + std::unique_ptr stream(FileSystem::open(path)); if (stream.get() == NULL || !stream->canRead()) { GP_ERROR("Failed to load audio file %s.", path); @@ -111,7 +134,9 @@ AudioBuffer* AudioBuffer::create(const char* path) // Check the file format if (memcmp(header, "RIFF", 4) == 0) { - if (!AudioBuffer::loadWav(stream.get(), alBuffer)) + // Fill at least one buffer with sound data. + streamStateWav.reset(new AudioStreamStateWav()); + if (!AudioBuffer::loadWav(stream.get(), alBuffer[0], streamed, streamStateWav.get())) { GP_ERROR("Invalid wave file: %s", path); goto cleanup; @@ -119,7 +144,9 @@ AudioBuffer* AudioBuffer::create(const char* path) } else if (memcmp(header, "OggS", 4) == 0) { - if (!AudioBuffer::loadOgg(stream.get(), alBuffer)) + // Fill at least one buffer with sound data. + streamStateOgg.reset(new AudioStreamStateOgg()); + if (!AudioBuffer::loadOgg(stream.get(), alBuffer[0], streamed, streamStateOgg.get())) { GP_ERROR("Invalid ogg file: %s", path); goto cleanup; @@ -131,20 +158,31 @@ AudioBuffer* AudioBuffer::create(const char* path) goto cleanup; } - buffer = new AudioBuffer(path, alBuffer); + buffer = new AudioBuffer(path, alBuffer, streamed); - // Add the buffer to the cache. - __buffers.push_back(buffer); + buffer->_fileStream.reset(stream.release()); + buffer->_streamStateWav.reset(streamStateWav.release()); + buffer->_streamStateOgg.reset(streamStateOgg.release()); + if (buffer->_streamStateWav.get()) + buffer->_buffersNeededCount = (buffer->_streamStateWav->dataSize + STREAMING_BUFFER_SIZE - 1) / STREAMING_BUFFER_SIZE; + else if (buffer->_streamStateOgg.get()) + buffer->_buffersNeededCount = (buffer->_streamStateOgg->dataSize + STREAMING_BUFFER_SIZE - 1) / STREAMING_BUFFER_SIZE; + + if (!streamed) + __buffers.push_back(buffer); return buffer; cleanup: - if (alBuffer) - AL_CHECK( alDeleteBuffers(1, &alBuffer) ); + for (unsigned int i = 0; i < STREAMING_BUFFER_QUEUE_SIZE; i++) + { + if (alBuffer[i]) + AL_CHECK(alDeleteBuffers(1, &alBuffer[i])); + } return NULL; } -bool AudioBuffer::loadWav(Stream* stream, ALuint buffer) +bool AudioBuffer::loadWav(Stream* stream, ALuint buffer, bool streamed, AudioStreamStateWav* streamState) { GP_ASSERT(stream); @@ -275,6 +313,19 @@ bool AudioBuffer::loadWav(Stream* stream, ALuint buffer) return false; } + if (streamed) + { + // Save streaming state for later use. + streamState->dataStart = stream->position(); + streamState->dataSize = dataSize; + streamState->format = format; + streamState->frequency = frequency; + + // Limit data size to STREAMING_BUFFER_SIZE. + if (dataSize > STREAMING_BUFFER_SIZE) + dataSize = STREAMING_BUFFER_SIZE; + } + char* data = new char[dataSize]; if (stream->read(data, sizeof(char), dataSize) != dataSize) { @@ -330,11 +381,10 @@ bool AudioBuffer::loadWav(Stream* stream, ALuint buffer) return false; } -bool AudioBuffer::loadOgg(Stream* stream, ALuint buffer) +bool AudioBuffer::loadOgg(Stream* stream, ALuint buffer, bool streamed, AudioStreamStateOgg* streamState) { GP_ASSERT(stream); - OggVorbis_File ogg_file; vorbis_info* info; ALenum format; long result; @@ -349,13 +399,13 @@ bool AudioBuffer::loadOgg(Stream* stream, ALuint buffer) callbacks.close_func = closeStream; callbacks.tell_func = tellStream; - if ((result = ov_open_callbacks(stream, &ogg_file, NULL, 0, callbacks)) < 0) + if ((result = ov_open_callbacks(stream, &streamState->oggFile, NULL, 0, callbacks)) < 0) { GP_ERROR("Failed to open ogg file."); return false; } - info = ov_info(&ogg_file, -1); + info = ov_info(&streamState->oggFile, -1); GP_ASSERT(info); if (info->channels == 1) format = AL_FORMAT_MONO16; @@ -363,12 +413,26 @@ bool AudioBuffer::loadOgg(Stream* stream, ALuint buffer) format = AL_FORMAT_STEREO16; // size = #samples * #channels * 2 (for 16 bit). - long data_size = ov_pcm_total(&ogg_file, -1) * info->channels * 2; + long data_size = ov_pcm_total(&streamState->oggFile, -1) * info->channels * 2; + + if (streamed) + { + // Save streaming state for later use. + streamState->dataStart = ov_pcm_tell(&streamState->oggFile); + streamState->dataSize = data_size; + streamState->format = format; + streamState->frequency = info->rate; + + // Limit data size to STREAMING_BUFFER_SIZE. + if (data_size > STREAMING_BUFFER_SIZE) + data_size = STREAMING_BUFFER_SIZE; + } + char* data = new char[data_size]; while (size < data_size) { - result = ov_read(&ogg_file, data + size, data_size - size, 0, 2, 1, §ion); + result = ov_read(&streamState->oggFile, data + size, data_size - size, 0, 2, 1, §ion); if (result > 0) { size += result; @@ -392,12 +456,61 @@ bool AudioBuffer::loadOgg(Stream* stream, ALuint buffer) return false; } - AL_CHECK( alBufferData(buffer, format, data, data_size, info->rate) ); + AL_CHECK(alBufferData(buffer, format, data, size, info->rate)); SAFE_DELETE_ARRAY(data); - ov_clear(&ogg_file); + + if (!streamed) + ov_clear(&streamState->oggFile); return true; } +bool AudioBuffer::streamData(ALuint buffer, bool looped) +{ + static char buffers[STREAMING_BUFFER_SIZE]; + + if (_streamStateWav.get()) + { + ALsizei bytesRead = _fileStream->read(buffers, sizeof(char), STREAMING_BUFFER_SIZE); + if (bytesRead != STREAMING_BUFFER_SIZE) + { + if (looped) + _fileStream->seek(_streamStateWav->dataStart, SEEK_SET); + } + if (bytesRead > 0) + AL_CHECK(alBufferData(buffer, _streamStateWav->format, buffers, bytesRead, _streamStateWav->frequency)); + + return bytesRead > 0 || looped; + } + else if (_streamStateOgg.get()) + { + int section; + int result = 0; + ALsizei bytesRead = 0; + + while (bytesRead < STREAMING_BUFFER_SIZE) + { + result = ov_read(&_streamStateOgg->oggFile, buffers + bytesRead, STREAMING_BUFFER_SIZE - bytesRead, 0, 2, 1, §ion); + if (result > 0) + { + bytesRead += result; + } + else + { + if (looped) + ov_pcm_seek(&_streamStateOgg->oggFile, _streamStateOgg->dataStart); + break; + } + } + + if (bytesRead > 0) + AL_CHECK(alBufferData(buffer, _streamStateOgg->format, buffers, bytesRead, _streamStateOgg->frequency)); + + return (bytesRead > 0) || looped; + } + + return false; +} + } diff --git a/gameplay/src/AudioBuffer.h b/gameplay/src/AudioBuffer.h index df2d0972d6..521cb8b954 100644 --- a/gameplay/src/AudioBuffer.h +++ b/gameplay/src/AudioBuffer.h @@ -23,7 +23,7 @@ class AudioBuffer : public Ref /** * Constructor. */ - AudioBuffer(const char* path, ALuint buffer); + AudioBuffer(const char* path, ALuint* buffers, bool streamed); /** * Destructor. @@ -42,14 +42,41 @@ class AudioBuffer : public Ref * * @return The buffer from a file. */ - static AudioBuffer* create(const char* path); - - static bool loadWav(Stream* stream, ALuint buffer); + static AudioBuffer* create(const char* path, bool streamed); + + struct AudioStreamStateWav + { + long dataStart; + unsigned int dataSize; + ALuint format; + ALuint frequency; + }; + + struct AudioStreamStateOgg + { + long dataStart; + unsigned int dataSize; + ALuint format; + ALuint frequency; + OggVorbis_File oggFile; + }; + + enum { STREAMING_BUFFER_QUEUE_SIZE = 3 }; + enum { STREAMING_BUFFER_SIZE = 48000 }; + + static bool loadWav(Stream* stream, ALuint buffer, bool streamed, AudioStreamStateWav* streamState); - static bool loadOgg(Stream* stream, ALuint buffer); + static bool loadOgg(Stream* stream, ALuint buffer, bool streamed, AudioStreamStateOgg* streamState); + + bool streamData(ALuint buffer, bool looped); + ALuint _alBufferQueue[STREAMING_BUFFER_QUEUE_SIZE]; std::string _filePath; - ALuint _alBuffer; + bool _streamed; + std::unique_ptr _fileStream; + std::unique_ptr _streamStateWav; + std::unique_ptr _streamStateOgg; + int _buffersNeededCount; }; } diff --git a/gameplay/src/AudioController.cpp b/gameplay/src/AudioController.cpp index 5e8fb13496..ba42632ecc 100644 --- a/gameplay/src/AudioController.cpp +++ b/gameplay/src/AudioController.cpp @@ -8,7 +8,7 @@ namespace gameplay { AudioController::AudioController() - : _alcDevice(NULL), _alcContext(NULL), _pausingSource(NULL) +: _alcDevice(NULL), _alcContext(NULL), _pausingSource(NULL), _streamingThreadActive(true) { } @@ -40,10 +40,19 @@ void AudioController::initialize() { GP_ERROR("Unable to make OpenAL context current. Error: %d\n", alcErr); } + _streamingMutex.reset(new std::mutex()); } void AudioController::finalize() { + GP_ASSERT(_streamingSources.empty()); + if (_streamingThread.get()) + { + _streamingThreadActive = false; + _streamingThread->join(); + _streamingThread.reset(NULL); + } + alcMakeContextCurrent(NULL); if (_alcContext) { @@ -103,4 +112,60 @@ void AudioController::update(float elapsedTime) } } +void AudioController::addPlayingSource(AudioSource* source) +{ + if (_playingSources.find(source) == _playingSources.end()) + { + _playingSources.insert(source); + + if (source->isStreamed()) + { + GP_ASSERT(_streamingSources.find(source) == _streamingSources.end()); + bool startThread = _streamingSources.empty() && _streamingThread.get() == NULL; + _streamingMutex->lock(); + _streamingSources.insert(source); + _streamingMutex->unlock(); + + if (startThread) + _streamingThread.reset(new std::thread(&streamingThreadProc, this)); + } + } +} + +void AudioController::removePlayingSource(AudioSource* source) +{ + if (_pausingSource != source) + { + std::set::iterator iter = _playingSources.find(source); + if (iter != _playingSources.end()) + { + _playingSources.erase(iter); + + if (source->isStreamed()) + { + GP_ASSERT(_streamingSources.find(source) != _streamingSources.end()); + _streamingMutex->lock(); + _streamingSources.erase(source); + _streamingMutex->unlock(); + } + } + } +} + +void AudioController::streamingThreadProc(void* arg) +{ + AudioController* controller = (AudioController*)arg; + + while (controller->_streamingThreadActive) + { + controller->_streamingMutex->lock(); + + std::for_each(controller->_streamingSources.begin(), controller->_streamingSources.end(), std::mem_fn(&AudioSource::streamDataIfNeeded)); + + controller->_streamingMutex->unlock(); + + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + } +} + } diff --git a/gameplay/src/AudioController.h b/gameplay/src/AudioController.h index 5250bd5c2c..12f98ec1e5 100644 --- a/gameplay/src/AudioController.h +++ b/gameplay/src/AudioController.h @@ -54,11 +54,21 @@ class AudioController */ void update(float elapsedTime); + void addPlayingSource(AudioSource* source); + + void removePlayingSource(AudioSource* source); + + static void streamingThreadProc(void* arg); ALCdevice* _alcDevice; ALCcontext* _alcContext; std::set _playingSources; + std::set _streamingSources; AudioSource* _pausingSource; + + bool _streamingThreadActive; + std::unique_ptr _streamingThread; + std::unique_ptr _streamingMutex; }; } diff --git a/gameplay/src/AudioSource.cpp b/gameplay/src/AudioSource.cpp index 598d5d2c1d..6dce736dc3 100644 --- a/gameplay/src/AudioSource.cpp +++ b/gameplay/src/AudioSource.cpp @@ -13,8 +13,14 @@ AudioSource::AudioSource(AudioBuffer* buffer, ALuint source) : _alSource(source), _buffer(buffer), _looped(false), _gain(1.0f), _pitch(1.0f), _node(NULL) { GP_ASSERT(buffer); - AL_CHECK( alSourcei(_alSource, AL_BUFFER, buffer->_alBuffer) ); - AL_CHECK( alSourcei(_alSource, AL_LOOPING, _looped) ); + + if (isStreamed()) + AL_CHECK(alSourceQueueBuffers(_alSource, 1, &buffer->_alBufferQueue[0])); + else + AL_CHECK(alSourcei(_alSource, AL_BUFFER, buffer->_alBufferQueue[0])); + + AL_CHECK(alSourcei(_alSource, AL_LOOPING, _looped && !isStreamed())); + AL_CHECK( alSourcef(_alSource, AL_PITCH, _pitch) ); AL_CHECK( alSourcef(_alSource, AL_GAIN, _gain) ); AL_CHECK( alSourcefv(_alSource, AL_VELOCITY, (const ALfloat*)&_velocity) ); @@ -24,13 +30,22 @@ AudioSource::~AudioSource() { if (_alSource) { - AL_CHECK( alDeleteSources(1, &_alSource) ); + // Remove the source from the controller's set of currently playing sources + // regardless of the source's state. E.g. when the AudioController::pause is called + // all sources are paused but still remain in controller's set of currently + // playing sources. When the source is deleted afterwards, it should be removed + // from controller's set regardless of its playing state. + AudioController* audioController = Game::getInstance()->getAudioController(); + GP_ASSERT(audioController); + audioController->removePlayingSource(this); + + AL_CHECK(alDeleteSources(1, &_alSource)); _alSource = 0; } SAFE_RELEASE(_buffer); } -AudioSource* AudioSource::create(const char* url) +AudioSource* AudioSource::create(const char* url, bool streamed) { // Load from a .audio file. std::string pathStr = url; @@ -49,7 +64,7 @@ AudioSource* AudioSource::create(const char* url) } // Create an audio buffer from this URL. - AudioBuffer* buffer = AudioBuffer::create(url); + AudioBuffer* buffer = AudioBuffer::create(url, streamed); if (buffer == NULL) return NULL; @@ -84,8 +99,14 @@ AudioSource* AudioSource::create(Properties* properties) return NULL; } + bool streamed = false; + if (properties->exists("streamed")) + { + streamed = properties->getBool("streamed"); + } + // Create the audio source. - AudioSource* audio = AudioSource::create(path.c_str()); + AudioSource* audio = AudioSource::create(path.c_str(), streamed); if (audio == NULL) { GP_ERROR("Audio file '%s' failed to load properly.", path.c_str()); @@ -133,6 +154,12 @@ AudioSource::State AudioSource::getState() const return INITIAL; } +bool AudioSource::isStreamed() const +{ + GP_ASSERT(_buffer); + return _buffer->_streamed; +} + void AudioSource::play() { AL_CHECK( alSourcePlay(_alSource) ); @@ -140,8 +167,7 @@ void AudioSource::play() // Add the source to the controller's list of currently playing sources. AudioController* audioController = Game::getInstance()->getAudioController(); GP_ASSERT(audioController); - if (audioController->_playingSources.find(this) == audioController->_playingSources.end()) - audioController->_playingSources.insert(this); + audioController->addPlayingSource(this); } void AudioSource::pause() @@ -152,12 +178,7 @@ void AudioSource::pause() // if the source is being paused by the user and not the controller itself. AudioController* audioController = Game::getInstance()->getAudioController(); GP_ASSERT(audioController); - if (audioController->_pausingSource != this) - { - std::set::iterator iter = audioController->_playingSources.find(this); - if (iter != audioController->_playingSources.end()) - audioController->_playingSources.erase(iter); - } + audioController->removePlayingSource(this); } void AudioSource::resume() @@ -175,9 +196,7 @@ void AudioSource::stop() // Remove the source from the controller's set of currently playing sources. AudioController* audioController = Game::getInstance()->getAudioController(); GP_ASSERT(audioController); - std::set::iterator iter = audioController->_playingSources.find(this); - if (iter != audioController->_playingSources.end()) - audioController->_playingSources.erase(iter); + audioController->removePlayingSource(this); } void AudioSource::rewind() @@ -192,7 +211,7 @@ bool AudioSource::isLooped() const void AudioSource::setLooped(bool looped) { - AL_CHECK( alSourcei(_alSource, AL_LOOPING, (looped) ? AL_TRUE : AL_FALSE) ); + AL_CHECK(alSourcei(_alSource, AL_LOOPING, (looped && !isStreamed()) ? AL_TRUE : AL_FALSE)); if (AL_LAST_ERROR()) { GP_ERROR("Failed to set audio source's looped attribute with error: %d", AL_LAST_ERROR()); @@ -274,7 +293,7 @@ void AudioSource::transformChanged(Transform* transform, long cookie) } } -AudioSource* AudioSource::clone(NodeCloneContext &context) const +AudioSource* AudioSource::clone(NodeCloneContext& context) { GP_ASSERT(_buffer); @@ -282,7 +301,7 @@ AudioSource* AudioSource::clone(NodeCloneContext &context) const AL_CHECK( alGenSources(1, &alSource) ); if (AL_LAST_ERROR()) { - GP_ERROR("Error generating audio source."); + GP_ERROR("Unable to cloning audio."); return NULL; } AudioSource* audioClone = new AudioSource(_buffer, alSource); @@ -303,4 +322,43 @@ AudioSource* AudioSource::clone(NodeCloneContext &context) const return audioClone; } +bool AudioSource::streamDataIfNeeded() +{ + GP_ASSERT( isStreamed() ); + if( getState() != PLAYING ) + return false; + + int queuedBuffers; + alGetSourcei(_alSource, AL_BUFFERS_QUEUED, &queuedBuffers); + + int buffersNeeded = std::min(_buffer->_buffersNeededCount, AudioBuffer::STREAMING_BUFFER_QUEUE_SIZE); + if (queuedBuffers < buffersNeeded) + { + while (queuedBuffers < buffersNeeded) + { + if (!_buffer->streamData(_buffer->_alBufferQueue[queuedBuffers], _looped)) + return false; + + AL_CHECK( alSourceQueueBuffers(_alSource, 1, &_buffer->_alBufferQueue[queuedBuffers]) ); + queuedBuffers++; + } + } + else + { + int processedBuffers; + alGetSourcei(_alSource, AL_BUFFERS_PROCESSED, &processedBuffers); + + while (processedBuffers-- > 0) + { + ALuint bufferID; + AL_CHECK( alSourceUnqueueBuffers(_alSource, 1, &bufferID) ); + if (!_buffer->streamData(bufferID, _looped)) + return false; + + AL_CHECK( alSourceQueueBuffers(_alSource, 1, &bufferID) ); + } + } + return true; +} + } diff --git a/gameplay/src/AudioSource.h b/gameplay/src/AudioSource.h index c103d49d9a..6c3b585638 100644 --- a/gameplay/src/AudioSource.h +++ b/gameplay/src/AudioSource.h @@ -3,7 +3,7 @@ #include "Vector3.h" #include "Ref.h" -#include "Node.h" +#include "Transform.h" namespace gameplay { @@ -43,10 +43,11 @@ class AudioSource : public Ref, public Transform::Listener * ".#//.../" and "#//.../" is optional). * * @param url The relative location on disk of the sound file or a URL specifying a Properties object defining an audio source. + * @param streamed Don't read the entire audio buffer first before playing, instead play immediately from a stream that is read on demand. * @return The newly created audio source, or NULL if an audio source cannot be created. * @script{create} */ - static AudioSource* create(const char* url); + static AudioSource* create(const char* url, bool streamed = false); /** * Create an audio source from the given properties object. @@ -89,6 +90,13 @@ class AudioSource : public Ref, public Transform::Listener */ AudioSource::State getState() const; + /** + * Determines whether the audio source is streaming or not. + * + * @return true if the audio source is streaming, false if not. + */ + bool isStreamed() const; + /** * Determines whether the audio source is looped or not. * @@ -192,10 +200,11 @@ class AudioSource : public Ref, public Transform::Listener * Clones the audio source and returns a new audio source. * * @param context The clone context. - * * @return The newly created audio source. */ - AudioSource* clone(NodeCloneContext &context) const; + AudioSource* clone(NodeCloneContext& context); + + bool streamDataIfNeeded(); ALuint _alSource; AudioBuffer* _buffer; diff --git a/gameplay/src/Base.h b/gameplay/src/Base.h index cbf002572a..e2d0aab288 100644 --- a/gameplay/src/Base.h +++ b/gameplay/src/Base.h @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include #include "Logger.h" // Bring common functions from C into global namespace @@ -175,23 +178,23 @@ extern int strcmpnocase(const char* s1, const char* s2); #define NOMINMAX #endif -// Audio (OpenAL/Vorbis) -#ifdef __QNX__ -#include -#include -#elif __ANDROID__ -#include -#include -#elif __linux__ -#include -#include +// Audio (OpenAL) +#ifdef __ANDROID__ + #include + #include #elif WIN32 -#include -#include + #define AL_LIBTYPE_STATIC + #include + #include +#elif __linux__ + #include + #include #elif __APPLE__ -#include -#include + #include + #include #endif + +// Compressed Media #include // Image @@ -199,28 +202,12 @@ extern int strcmpnocase(const char* s1, const char* s2); // Scripting using std::va_list; -#include +#include #define WINDOW_VSYNC 1 // Graphics (OpenGL) -#ifdef __QNX__ - #include - #include - #include - #include - extern PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray; - extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; - extern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays; - extern PFNGLISVERTEXARRAYOESPROC glIsVertexArray; - #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES - #define glClearDepth glClearDepthf - #define OPENGL_ES - #define USE_PVRTC - #ifdef __arm__ - #define USE_NEON - #endif -#elif __ANDROID__ +#ifdef __ANDROID__ #include #include #include @@ -232,14 +219,14 @@ using std::va_list; #define glClearDepth glClearDepthf #define OPENGL_ES #elif WIN32 - #define WIN32_LEAN_AND_MEAN - #define GLEW_STATIC - #include - #define USE_VAO + #define WIN32_LEAN_AND_MEAN + #define GLEW_STATIC + #include + #define GP_USE_VAO #elif __linux__ #define GLEW_STATIC #include - #define USE_VAO + #define GP_USE_VAO #elif __APPLE__ #include "TargetConditionals.h" #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR @@ -252,10 +239,7 @@ using std::va_list; #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES #define glClearDepth glClearDepthf #define OPENGL_ES - #define USE_VAO - #ifdef __arm__ - #define USE_NEON - #endif + #define GP_USE_VAO #elif TARGET_OS_MAC #include #include @@ -263,7 +247,7 @@ using std::va_list; #define glDeleteVertexArrays glDeleteVertexArraysAPPLE #define glGenVertexArrays glGenVertexArraysAPPLE #define glIsVertexArray glIsVertexArrayAPPLE - #define USE_VAO + #define GP_USE_VAO #else #error "Unsupported Apple Device" #endif @@ -295,13 +279,11 @@ typedef GLuint FrameBufferHandle; /** Render buffer handle. */ typedef GLuint RenderBufferHandle; -/** Gamepad handle definitions vary by platform. */ -#if defined(__QNX__) && defined(GP_USE_GAMEPAD) - typedef screen_device_t GamepadHandle; -#elif defined(WIN32) - typedef unsigned long GamepadHandle; +/** Gamepad handle */ +#ifdef __ANDROID__ +typedef unsigned int GamepadHandle; #else - typedef unsigned int GamepadHandle; +typedef unsigned long GamepadHandle; #endif } @@ -313,7 +295,7 @@ typedef GLuint RenderBufferHandle; * mode and is therefore safe to use for realtime/per-frame GL * function calls. */ -#ifdef NDEBUG +#if defined(NDEBUG) || (defined(__APPLE__) && !defined(DEBUG)) #define GL_ASSERT( gl_code ) gl_code #else #define GL_ASSERT( gl_code ) do \ diff --git a/gameplay/src/Bundle.cpp b/gameplay/src/Bundle.cpp index 9dbbf81e1b..adda56da86 100644 --- a/gameplay/src/Bundle.cpp +++ b/gameplay/src/Bundle.cpp @@ -28,7 +28,7 @@ #define BUNDLE_MAX_STRING_LENGTH 5000 #define BUNDLE_VERSION_MAJOR_FONT_FORMAT 1 -#define BUNDLE_VERSION_MINOR_FONT_FORMAT 4 +#define BUNDLE_VERSION_MINOR_FONT_FORMAT 5 namespace gameplay { @@ -680,9 +680,12 @@ bool Bundle::skipNode() } // Skip over the node's camera, light, and model attachments. - Camera* camera = readCamera(); SAFE_RELEASE(camera); - Light* light = readLight(); SAFE_RELEASE(light); - Model* model = readModel(id); SAFE_RELEASE(model); + Camera* camera = readCamera(); + SAFE_RELEASE(camera); + Light* light = readLight(); + SAFE_RELEASE(light); + Model* model = readModel(id); + SAFE_RELEASE(model); return true; } @@ -820,10 +823,9 @@ Node* Bundle::readNode(Scene* sceneContext, Node* nodeContext) Model* model = readModel(node->getId()); if (model) { - node->setModel(model); + node->setDrawable(model); SAFE_RELEASE(model); } - return node; } @@ -1698,11 +1700,47 @@ Font* Bundle::loadFont(const char* id) } Font::Glyph* glyphs = new Font::Glyph[glyphCount]; - if (_stream->read(glyphs, sizeof(Font::Glyph), glyphCount) != glyphCount) + for (unsigned j = 0; j < glyphCount; j++) { - GP_ERROR("Failed to read glyphs for font '%s'.", id); - SAFE_DELETE_ARRAY(glyphs); - return NULL; + if (_stream->read(&glyphs[j].code, 4, 1) != 1) + { + GP_ERROR("Failed to read glyph #%d code for font '%s'.", j, id); + SAFE_DELETE_ARRAY(glyphs); + return NULL; + } + if (_stream->read(&glyphs[j].width, 4, 1) != 1) + { + GP_ERROR("Failed to read glyph #%d width for font '%s'.", j, id); + SAFE_DELETE_ARRAY(glyphs); + return NULL; + } + if (getVersionMajor() >= 1 && getVersionMinor() >= 5) + { + if (_stream->read(&glyphs[j].bearingX, 4, 1) != 1) + { + GP_ERROR("Failed to read glyph #%d bearingX for font '%s'.", j, id); + SAFE_DELETE_ARRAY(glyphs); + return NULL; + } + if (_stream->read(&glyphs[j].advance, 4, 1) != 1) + { + GP_ERROR("Failed to read glyph #%d advance for font '%s'.", j, id); + SAFE_DELETE_ARRAY(glyphs); + return NULL; + } + } + else + { + // Fallback values for older GBP format. + glyphs[j].bearingX = 0; + glyphs[j].advance = glyphs[j].width; + } + if (_stream->read(&glyphs[j].uvs, 4, 4) != 4) + { + GP_ERROR("Failed to read glyph #%d uvs for font '%s'.", j, id); + SAFE_DELETE_ARRAY(glyphs); + return NULL; + } } // Read texture attributes. @@ -1833,7 +1871,7 @@ Bundle::Reference::~Reference() } Bundle::MeshPartData::MeshPartData() : - indexCount(0), indexData(NULL) + primitiveType(Mesh::TRIANGLES), indexFormat(Mesh::INDEX32), indexCount(0), indexData(NULL) { } @@ -1843,7 +1881,7 @@ Bundle::MeshPartData::~MeshPartData() } Bundle::MeshData::MeshData(const VertexFormat& vertexFormat) - : vertexFormat(vertexFormat), vertexCount(0), vertexData(NULL) + : vertexFormat(vertexFormat), vertexCount(0), vertexData(NULL), primitiveType(Mesh::TRIANGLES) { } diff --git a/gameplay/src/Bundle.h b/gameplay/src/Bundle.h index deecf9c860..5a2aadc736 100644 --- a/gameplay/src/Bundle.h +++ b/gameplay/src/Bundle.h @@ -5,6 +5,7 @@ #include "Font.h" #include "Node.h" #include "Game.h" +#include "MeshSkin.h" namespace gameplay { diff --git a/gameplay/src/Button.cpp b/gameplay/src/Button.cpp index 480ec15069..f92caf8b9b 100644 --- a/gameplay/src/Button.cpp +++ b/gameplay/src/Button.cpp @@ -45,9 +45,9 @@ void Button::initialize(const char* typeName, Theme::Style* style, Properties* p } } -const char* Button::getType() const +const char* Button::getTypeName() const { - return "button"; + return "Button"; } const unsigned int Button::getDataBinding() const diff --git a/gameplay/src/Button.h b/gameplay/src/Button.h index 914abeb1dc..d9a00e99a2 100644 --- a/gameplay/src/Button.h +++ b/gameplay/src/Button.h @@ -62,9 +62,14 @@ class Button : public Label void initialize(const char* typeName, Theme::Style* style, Properties* properties); /** - * @see Control::getType + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "Button" + * @see ScriptTarget::getTypeName() */ - const char* getType() const; + const char* getTypeName() const; /** * Gets the data binding index for this control. diff --git a/gameplay/src/Camera.cpp b/gameplay/src/Camera.cpp index f0c4767594..36b41c4d1d 100644 --- a/gameplay/src/Camera.cpp +++ b/gameplay/src/Camera.cpp @@ -430,7 +430,7 @@ void Camera::pickRay(const Rectangle& viewport, float x, float y, Ray* dst) cons dst->set(nearPoint, direction); } -Camera* Camera::clone(NodeCloneContext &context) const +Camera* Camera::clone(NodeCloneContext& context) { Camera* cameraClone = NULL; if (getCameraType() == PERSPECTIVE) diff --git a/gameplay/src/Camera.h b/gameplay/src/Camera.h index 336407c7be..8673171e9f 100644 --- a/gameplay/src/Camera.h +++ b/gameplay/src/Camera.h @@ -51,7 +51,7 @@ class Camera : public Ref, public Transform::Listener /** * Creates a perspective camera. * - * @param fieldOfView The field of view for the perspective camera (normally in the range of 40-60 degrees). + * @param fieldOfView The field of view in degrees for the perspective camera (normally in the range of 40-60 degrees). * @param aspectRatio The aspect ratio of the camera (normally the width of the viewport divided by the height of the viewport). * @param nearPlane The near plane distance. * @param farPlane The far plane distance. @@ -346,7 +346,7 @@ class Camera : public Ref, public Transform::Listener * @param context The clone context. * @return The newly created camera. */ - Camera* clone(NodeCloneContext &context) const; + Camera* clone(NodeCloneContext& context); /** * Sets the node associated with this camera. @@ -358,9 +358,6 @@ class Camera : public Ref, public Transform::Listener */ void transformChanged(Transform* transform, long cookie); - /** - * - */ void cameraChanged(); Camera::Type _type; diff --git a/gameplay/src/CheckBox.cpp b/gameplay/src/CheckBox.cpp index dd6d51996a..bad4c0fb13 100644 --- a/gameplay/src/CheckBox.cpp +++ b/gameplay/src/CheckBox.cpp @@ -39,6 +39,11 @@ void CheckBox::initialize(const char* typeName, Theme::Style* style, Properties* } } +const char* CheckBox::getTypeName() const +{ + return "CheckBox"; +} + bool CheckBox::isChecked() { return _checked; @@ -155,9 +160,4 @@ unsigned int CheckBox::drawImages(Form* form, const Rectangle& clip) return 1; } -const char* CheckBox::getType() const -{ - return "checkBox"; -} - } diff --git a/gameplay/src/CheckBox.h b/gameplay/src/CheckBox.h index f324129219..d2b0d8ea4e 100644 --- a/gameplay/src/CheckBox.h +++ b/gameplay/src/CheckBox.h @@ -34,6 +34,16 @@ class CheckBox : public Button */ static CheckBox* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "CheckBox" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Gets whether this checkbox is checked. * @@ -48,11 +58,6 @@ class CheckBox : public Button */ void setChecked(bool checked); - /** - * @see Control::getType - */ - const char* getType() const; - /** * Add a listener to be notified of specific events affecting * this control. Event types can be OR'ed together. diff --git a/gameplay/src/Container.cpp b/gameplay/src/Container.cpp index a6400dc87f..ae4877bf70 100644 --- a/gameplay/src/Container.cpp +++ b/gameplay/src/Container.cpp @@ -177,6 +177,11 @@ void Container::addControls(Properties* properties) sortControls(); } +const char* Container::getTypeName() const +{ + return "Container"; +} + Layout* Container::getLayout() { return _layout; @@ -240,6 +245,7 @@ unsigned int Container::addControl(Control* control) control->_parent = this; sortControls(); + setDirty(Control::DIRTY_BOUNDS); return (unsigned int)( _controls.size() - 1 ); } @@ -259,6 +265,7 @@ void Container::insertControl(Control* control, unsigned int index) _controls.insert(it, control); control->addRef(); control->_parent = this; + setDirty(Control::DIRTY_BOUNDS); } } @@ -270,6 +277,7 @@ void Container::removeControl(unsigned int index) Control* control = *it; _controls.erase(it); control->_parent = NULL; + setDirty(Control::DIRTY_BOUNDS); if (_activeControl == control) _activeControl = NULL; @@ -441,11 +449,6 @@ Animation* Container::getAnimation(const char* id) const return NULL; } -const char* Container::getType() const -{ - return "container"; -} - bool Container::getScrollWheelRequiresFocus() const { return _scrollWheelRequiresFocus; @@ -551,7 +554,7 @@ void Container::updateBounds() for (size_t i = 0, count = _controls.size(); i < count; ++i) { Control* ctrl = _controls[i]; - if (!ctrl->isXPercentage() && !ctrl->isWidthPercentage()) + if (ctrl->isVisible() && !ctrl->isXPercentage() && !ctrl->isWidthPercentage()) { float w = ctrl->getX() + ctrl->getWidth(); if (width < w) @@ -569,7 +572,7 @@ void Container::updateBounds() for (size_t i = 0, count = _controls.size(); i < count; ++i) { Control* ctrl = _controls[i]; - if (!ctrl->isYPercentage() && !ctrl->isHeightPercentage()) + if (ctrl->isVisible() && !ctrl->isYPercentage() && !ctrl->isHeightPercentage()) { float h = ctrl->getY() + ctrl->getHeight(); if (height < h) diff --git a/gameplay/src/Container.h b/gameplay/src/Container.h index 74f322f406..0dde8a4c8d 100644 --- a/gameplay/src/Container.h +++ b/gameplay/src/Container.h @@ -37,6 +37,19 @@ class Container : public Control SCROLL_BOTH = SCROLL_HORIZONTAL | SCROLL_VERTICAL }; + /** + * Defines supported focus chagne directions. + */ + enum Direction + { + UP = 0x01, + DOWN = 0x02, + LEFT = 0x04, + RIGHT = 0x08, + NEXT = 0x10, + PREVIOUS = 0x20 + }; + /** * Creates a new container. * @@ -49,6 +62,16 @@ class Container : public Control */ static Container* create(const char* id, Theme::Style* style = NULL, Layout::Type layout = Layout::LAYOUT_ABSOLUTE); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "Container" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Get this container's layout. * @@ -220,11 +243,6 @@ class Container : public Control */ bool isContainer() const; - /** - * @see Control::getType - */ - const char* getType() const; - /** * Get whether this container requires focus in order to handle scroll-wheel events. */ @@ -245,6 +263,15 @@ class Container : public Control */ bool setFocus(); + /** + * Attempts to switch focus to a child of this container in the specified direction. + * + * @param direction The direction for focus change. + * + * @return True on success, false if there are no controls to focus on. + */ + bool moveFocus(Direction direction); + /** * Returns the currently active control for this container. * @@ -546,22 +573,8 @@ class Container : public Control */ Container(const Container& copy); - enum Direction - { - UP = 0x01, - DOWN = 0x02, - LEFT = 0x04, - RIGHT = 0x08, - NEXT = 0x10, - PREVIOUS = 0x20 - }; - static const int MAX_CONTACT_INDICES = 10; - // Returns true on success; false if there are no controls to focus on, - // in which case scrolling can be initiated. - bool moveFocus(Direction direction); - bool moveFocusNextPrevious(Direction direction); bool moveFocusDirectional(Direction direction); diff --git a/gameplay/src/Control.cpp b/gameplay/src/Control.cpp index 4c2008ad23..96bb802ec2 100644 --- a/gameplay/src/Control.cpp +++ b/gameplay/src/Control.cpp @@ -4,53 +4,15 @@ #include "Form.h" #include "Theme.h" -#define BOUNDS_X_PERCENTAGE_BIT 1 -#define BOUNDS_Y_PERCENTAGE_BIT 2 -#define BOUNDS_WIDTH_PERCENTAGE_BIT 4 -#define BOUNDS_HEIGHT_PERCENTAGE_BIT 8 - namespace gameplay { -static std::string toString(float v) -{ - std::ostringstream s; - s << v; - return s.str(); -} - -static float parseCoord(const char* s, bool* isPercentage) -{ - const char* p; - if ((p = strchr(s, '%')) != NULL) - { - std::string value(s, (std::string::size_type)(p - s)); - *isPercentage = true; - return (float)(atof(value.c_str()) * 0.01); - } - *isPercentage = false; - return (float)atof(s); -} - -static bool parseCoordPair(const char* s, float* v1, float* v2, bool* v1Percentage, bool* v2Percentage) -{ - size_t len = strlen(s); - const char* s2 = strchr(s, ','); - if (s2 == NULL) - return false; - std::string v1Str(s, (std::string::size_type)(s2 - s)); - std::string v2Str(s2 + 1); - *v1 = parseCoord(v1Str.c_str(), v1Percentage); - *v2 = parseCoord(v2Str.c_str(), v2Percentage); - return true; -} - Control::Control() : _id(""), _boundsBits(0), _dirtyBits(DIRTY_BOUNDS | DIRTY_STATE), _consumeInputEvents(true), _alignment(ALIGN_TOP_LEFT), - _autoSize(AUTO_SIZE_BOTH), _style(NULL), _listeners(NULL), _visible(true), _zIndex(-1), + _autoSize(AUTO_SIZE_BOTH), _listeners(NULL), _style(NULL), _visible(true), _opacity(0.0f), _zIndex(-1), _contactIndex(INVALID_CONTACT_INDEX), _focusIndex(-1), _canFocus(false), _state(NORMAL), _parent(NULL), _styleOverridden(false), _skin(NULL) { - addScriptEvent("controlEvent", "[Control::Listener::EventType]"); + GP_REGISTER_SCRIPT_EVENTS(); } Control::~Control() @@ -83,14 +45,12 @@ Control::AutoSize Control::parseAutoSize(const char* str) { if (str == NULL) return _autoSize; - if (strcmpnocase(str, "AUTO_SIZE_WIDTH") == 0 ) return AUTO_SIZE_WIDTH; if (strcmpnocase(str, "AUTO_SIZE_HEIGHT") == 0) return AUTO_SIZE_HEIGHT; if (strcmpnocase(str, "AUTO_SIZE_BOTH") == 0) return AUTO_SIZE_BOTH; - return _autoSize; } @@ -107,7 +67,6 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* // The passed in style is our parent control's style : attempt to load our style from it. _style = style->getTheme()->getStyle(styleName); } - if (!_style) { // Use an empty style from our parent's theme @@ -124,17 +83,14 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* { // Search for a style from the default theme that matches this control's name _style = Theme::getDefault()->getStyle(typeName); - if (!_style) { // No style was found, use an empty style _style = style ? style->getTheme()->getEmptyStyle() : Theme::getDefault()->getEmptyStyle(); } } - // Increase the reference count of the style's theme while we hold the style _style->getTheme()->addRef(); - if (properties) { const char* id = properties->getId(); @@ -143,11 +99,8 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* // Properties not defined by the style. const char* alignmentString = properties->getString("alignment"); - _alignment = getAlignment(alignmentString); - _consumeInputEvents = properties->getBool("consumeInputEvents", true); - _visible = properties->getBool("visible", true); if (properties->exists("zIndex")) @@ -158,10 +111,8 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* { _zIndex = -1; } - if (properties->exists("canFocus")) _canFocus = properties->getBool("canFocus", false); - if (properties->exists("focusIndex")) { _focusIndex = properties->getInt("focusIndex"); @@ -170,7 +121,6 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* { _focusIndex = -1; } - float bounds[2]; bool boundsBits[2]; const char* position = properties->getString("position"); @@ -192,7 +142,6 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* setY(bounds[1], boundsBits[1]); } } - // If there is an explicitly specified size, width or height, unset the corresponding autoSize bit const char* size = properties->getString("size"); if (size && parseCoordPair(size, &bounds[0], &bounds[1], &boundsBits[0], &boundsBits[1])) @@ -215,7 +164,6 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* setHeight(bounds[1], boundsBits[1]); } } - // Backwards Compatibility: Support deprecated autoWidth and autoHeight properties, // which resolve to width=100% and height=100%. if (properties->getBool("autoWidth")) @@ -226,14 +174,26 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* // Parse the auto-size mode for the control (this overrides explicit sizes and legacy autoWidth/autoHeight) _autoSize = parseAutoSize(properties->getString("autoSize")); + // If there is are simple padding or margin variables, parse them + if (properties->exists("padding")) + { + float pad = properties->getFloat("padding"); + setPadding(pad, pad, pad, pad); + } + if (properties->exists("margin")) + { + float margin = properties->getFloat("margin"); + setPadding(margin, margin, margin, margin); + } + if (properties->exists("enabled")) { setEnabled(properties->getBool("enabled")); } // Register script listeners for control events - if (properties->exists("listener")) - addScriptCallback("controlEvent", properties->getString("listener")); + if (properties->exists("script")) + addScript(properties->getString("script")); // Potentially override themed properties for all states. overrideThemedProperties(properties, STATE_ALL); @@ -274,12 +234,16 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties* setPadding(innerSpace->getFloat("top"), innerSpace->getFloat("bottom"), innerSpace->getFloat("left"), innerSpace->getFloat("right")); } - innerSpace = properties->getNextNamespace(); } } } +const char* Control::getTypeName() const +{ + return "Control"; +} + const char* Control::getId() const { return _id.c_str(); @@ -504,6 +468,14 @@ void Control::setVisible(bool visible) Form::controlDisabled(this); setDirty(DIRTY_BOUNDS); + + // force to update parent boundaries when child is hidden + Control* parent = _parent; + while (parent && (parent->_autoSize != AUTO_SIZE_NONE || static_cast(parent)->getLayout()->getType() != Layout::LAYOUT_ABSOLUTE)) + { + parent->setDirty(DIRTY_BOUNDS); + parent = parent->_parent; + } } } @@ -574,10 +546,10 @@ void Control::setEnabled(bool enabled) if (enabled != isEnabled()) { if (!enabled) + { Form::controlDisabled(this); - + } _state = enabled ? NORMAL : DISABLED; - setDirty(DIRTY_STATE); } } @@ -591,7 +563,6 @@ bool Control::isEnabledInHierarchy() const { if (!isEnabled()) return false; - if (_parent) return _parent->isEnabledInHierarchy(); @@ -609,7 +580,6 @@ void Control::setBorder(float top, float bottom, float left, float right, unsign if (overlays[i]) overlays[i]->setBorder(top, bottom, left, right); } - setDirty(DIRTY_BOUNDS); } @@ -681,7 +651,7 @@ void Control::setPadding(float top, float bottom, float left, float right) _style->setPadding(top, bottom, left, right); setDirty(DIRTY_BOUNDS); } - + const Theme::Padding& Control::getPadding() const { GP_ASSERT(_style); @@ -774,7 +744,7 @@ const Vector4& Control::getCursorColor(State state) GP_ASSERT(overlay); return overlay->getCursorColor(); } - + const Theme::UVs& Control::getCursorUVs(State state) { Theme::Style::Overlay* overlay = getOverlay(state); @@ -909,10 +879,10 @@ Theme* Control::getTheme() const Control::State Control::getState() const { - if (_state == HOVER) + if (Form::getFocusControl() == this) { - // Focus state takes priority over hover - return (Form::getFocusControl() == this ? FOCUS : HOVER); + // Active is the only state that overrides focus state + return _state == ACTIVE ? ACTIVE : FOCUS; } return _state; @@ -941,7 +911,7 @@ void Control::setConsumeInputEvents(bool consume) { _consumeInputEvents = consume; } - + bool Control::getConsumeInputEvents() { return _consumeInputEvents; @@ -1060,12 +1030,22 @@ bool Control::keyEvent(Keyboard::KeyEvent evt, int key) bool Control::mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta) { - // Return false instead of _consumeInputEvents to allow handling to be + // Return false instead of _consumeInputEvents to allow handling to be // routed to touchEvent before consuming. return false; } -bool Control::gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex) +bool Control::gamepadButtonEvent(Gamepad* gamepad) +{ + return false; +} + +bool Control::gamepadTriggerEvent(Gamepad* gamepad, unsigned int index) +{ + return false; +} + +bool Control::gamepadJoystickEvent(Gamepad* gamepad, unsigned int index) { return false; } @@ -1093,7 +1073,7 @@ void Control::notifyListeners(Control::Listener::EventType eventType) } } - fireScriptEvent("controlEvent", this, eventType); + fireScriptEvent(GP_GET_SCRIPT_EVENT(Control, controlEvent), dynamic_cast(this), eventType); release(); } @@ -1474,11 +1454,6 @@ Theme::ThemeImage* Control::getImage(const char* id, State state) return image ? image : _style->getTheme()->_emptyImage; } -const char* Control::getType() const -{ - return "control"; -} - Control* Control::getParent() const { return _parent; @@ -1742,7 +1717,6 @@ void Control::overrideThemedProperties(Properties* properties, unsigned char sta { setTextRightToLeft(properties->getBool("rightToLeft"), states); } - if (properties->exists("opacity")) { setOpacity(properties->getFloat("opacity"), states); @@ -1760,7 +1734,6 @@ void Control::setImageList(Theme::ImageList* imageList, unsigned char states) if( overlays[i] ) overlays[i]->setImageList(imageList); } - if (_autoSize != AUTO_SIZE_NONE) setDirty(DIRTY_BOUNDS); } @@ -1789,7 +1762,6 @@ void Control::setSkin(Theme::Skin* skin, unsigned char states) if( overlays[i] ) overlays[i]->setSkin(skin); } - if (_autoSize != AUTO_SIZE_NONE) setDirty(DIRTY_BOUNDS); } @@ -1872,9 +1844,33 @@ Control::Alignment Control::getAlignment(const char* alignment) { GP_ERROR("Failed to get corresponding control alignment for unsupported value '%s'.", alignment); } - - // Default. return Control::ALIGN_TOP_LEFT; } +float Control::parseCoord(const char* s, bool* isPercentage) +{ + const char* p; + if ((p = strchr(s, '%')) != NULL) + { + std::string value(s, (std::string::size_type)(p - s)); + *isPercentage = true; + return (float)(atof(value.c_str()) * 0.01); + } + *isPercentage = false; + return (float)atof(s); +} + +bool Control::parseCoordPair(const char* s, float* v1, float* v2, bool* v1Percentage, bool* v2Percentage) +{ + size_t len = strlen(s); + const char* s2 = strchr(s, ','); + if (s2 == NULL) + return false; + std::string v1Str(s, (std::string::size_type)(s2 - s)); + std::string v2Str(s2 + 1); + *v1 = parseCoord(v1Str.c_str(), v1Percentage); + *v2 = parseCoord(v2Str.c_str(), v2Percentage); + return true; +} + } diff --git a/gameplay/src/Control.h b/gameplay/src/Control.h index 8f267d0dca..73ed2eda39 100644 --- a/gameplay/src/Control.h +++ b/gameplay/src/Control.h @@ -28,6 +28,10 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget friend class Form; friend class Container; + GP_SCRIPT_EVENTS_START(); + GP_SCRIPT_EVENT(controlEvent, "[Control::Listener::EventType]"); + GP_SCRIPT_EVENTS_END(); + public: /** @@ -231,6 +235,16 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget */ static const int ANIMATE_OPACITY = 7; + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "Control" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Get this control's ID string. * @@ -904,13 +918,6 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget */ virtual bool isContainer() const; - /** - * Gets the type of the Control and returns it as a string. - * - * @return The string of the Control type, all in lower-case. - */ - virtual const char* getType() const; - /** * Returns this control's parent, or NULL if this control does not have a parent. * @@ -985,6 +992,31 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget */ static const int DIRTY_STATE = 2; + /** + * Indicates that the x position of the control is a percentage. + */ + static const int BOUNDS_X_PERCENTAGE_BIT = 1; + + /** + * Indicates that the y position of the control is a percentage. + */ + static const int BOUNDS_Y_PERCENTAGE_BIT = 2; + + /** + * Indicates that the width of the control is a percentage. + */ + static const int BOUNDS_WIDTH_PERCENTAGE_BIT = 4; + + /** + * Indicates that the height of the control is a percentage. + */ + static const int BOUNDS_HEIGHT_PERCENTAGE_BIT = 8; + + /** + * Indicates that the radius of the control is a percentage. + */ + static const int BOUNDS_RADIUS_PERCENTAGE_BIT = 16; + /** * Constructor. */ @@ -1096,13 +1128,27 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget virtual bool mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta); /** - * Gamepad callback on gamepad events. + * Gamepad callback on gamepad button changes. + * + * @param gamepad The gamepad whose one or more buttons have changed. + */ + virtual bool gamepadButtonEvent(Gamepad* gamepad); + + /** + * Gamepad callback on gamepad trigger changes. + * + * @param gamepad The gamepad whose one or more buttons have changed. + * @param index The index of the trigger that changed. + */ + virtual bool gamepadTriggerEvent(Gamepad* gamepad, unsigned int index); + + /** + * Gamepad callback on gamepad analog joystick changes. * - * @param gamepad The gamepad whose state changed. - * @param evt The gamepad event that occurred. - * @param analogIndex If evt is JOYSTICK_EVENT or TRIGGER_EVENT, this will be the index of the corresponding control. + * @param gamepad The gamepad whose one or more buttons have changed. + * @param index The index of the joystick that changed. */ - virtual bool gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex); + virtual bool gamepadJoystickEvent(Gamepad* gamepad, unsigned int index); /** * Called each frame to update this control and its children. @@ -1243,7 +1289,7 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget * @param id The ID of the image to retrieve. * @param state The state to get this image from. * - * @return The requested Theme::ThemeImage, or NULL if none was found. + * @return The requested Theme::ThemeImage, or an empty image from the controls theme if none was found. */ Theme::ThemeImage* getImage(const char* id, State state); @@ -1286,6 +1332,29 @@ class Control : public Ref, public AnimationTarget, public ScriptTarget */ static Alignment getAlignment(const char* alignment); + /** + * Converts a string in the format of either 'N' or 'N%' (where N is a number) + * into its value and sets a flag to indicate if it should be treated as a percentage. + * + * @param s A string in the format of either 'N' or 'N%' (where N is a number) + * @param isPercentage Set to true if the returned value should be treated as a percentage + * @return The number contained within the string + */ + static float parseCoord(const char* s, bool* isPercentage); + + /** + * Converts a string in the format of either 'N, N' or 'N%, N%' (where N is a number) + * into its values and sets flags to indicate which numbers should be treated as percentages + * + * @param s A string in the format of either 'N, N' or 'N%, N%' (where N is a number) + * @param v1 Set to the value of the first number in the string + * @param v1 Set to the value of the second number in the string + * @param v1Percentage Set to true if the first number should be treated as a percentage + * @param v2Percentage Set to true if the second number should be treated as a percentage + * @return True if the string was parsed + */ + static bool parseCoordPair(const char* s, float* v1, float* v2, bool* v1Percentage, bool* v2Percentage); + /** * The Control's ID. */ diff --git a/gameplay/src/ControlFactory.cpp b/gameplay/src/ControlFactory.cpp index a8bfaf602d..f16d8afca8 100644 --- a/gameplay/src/ControlFactory.cpp +++ b/gameplay/src/ControlFactory.cpp @@ -85,8 +85,10 @@ void ControlFactory::registerStandardControls() registerCustomControl("CONTAINER", &Container::create); registerCustomControl("SLIDER", &Slider::create); registerCustomControl("TEXTBOX", &TextBox::create); - registerCustomControl("JOYSTICK", &JoystickControl::create); - registerCustomControl("IMAGE", &ImageControl::create); + registerCustomControl("JOYSTICK", &JoystickControl::create); // convenience alias + registerCustomControl("JOYSTICKCONTROL", &JoystickControl::create); + registerCustomControl("IMAGE", &ImageControl::create); // convenience alias + registerCustomControl("IMAGECONTROL", &ImageControl::create); } } diff --git a/gameplay/src/Curve.cpp b/gameplay/src/Curve.cpp index 0aa27ece7e..2ef0572409 100644 --- a/gameplay/src/Curve.cpp +++ b/gameplay/src/Curve.cpp @@ -141,6 +141,33 @@ float Curve::getEndTime() const return _points[_pointCount-1].time; } +float Curve::getPointTime(unsigned int index) const +{ + assert(index < _pointCount); + return _points[index].time; +} + + +Curve::InterpolationType Curve::getPointInterpolation(unsigned int index) const +{ + assert(index < _pointCount); + return _points[index].type;; +} + +void Curve::getPointValues(unsigned int index, float* value, float* inValue, float* outValue) const +{ + assert(index < _pointCount); + + if (value) + memcpy(value, _points[index].value, _componentSize); + + if (inValue) + memcpy(inValue, _points[index].inValue, _componentSize); + + if (outValue) + memcpy(outValue, _points[index].outValue, _componentSize); +} + void Curve::setPoint(unsigned int index, float time, float* value, InterpolationType type) { setPoint(index, time, value, type, NULL, NULL); diff --git a/gameplay/src/Curve.h b/gameplay/src/Curve.h index 3a5360986b..7fe3c5716a 100644 --- a/gameplay/src/Curve.h +++ b/gameplay/src/Curve.h @@ -313,7 +313,7 @@ class Curve : public Ref float getEndTime() const; /** - * Sets the given point values on the curve the curve. + * Sets the given point values on the curve. * * @param index The index of the point. * @param time The time for the key. @@ -332,17 +332,45 @@ class Curve : public Ref * @param inValue The tangent approaching the point. * @param outValue The tangent leaving the point. */ - void setPoint(unsigned int index, float time, float* value, InterpolationType type, float* inValue, float* outValue); + void setPoint(unsigned int index, float time, float* value, InterpolationType type, + float* inValue, float* outValue); /** * Sets the tangents for a point on the curve specified by the index. * * @param index The index of the point. - * @param type The curve interpolation type. - * @param inValue The tangent approaching the point. - * @param outValue The tangent leaving the point. + * + * */ void setTangent(unsigned int index, InterpolationType type, float* inValue, float* outValue); + + /** + * Gets the time at a specified point. + * + * @param index The index of the point. + * + * @return The time for a key point. + */ + float getPointTime(unsigned int index) const; + + /** + * Gets the interpolation type at the specified point + * + * @param index The index of the point. + * + * @return The interpolation type at the specified index. + */ + InterpolationType getPointInterpolation(unsigned int index) const; + + /** + * Gets the values and in/out tangent value at a spedified point. + * + * @param index The index of the point. + * @param value The value at the specified index. Ignored if NULL. + * @param inValue The tangent inValue at the specified index. Ignored if NULL. + * @param outValue The tangent outValue at the specified index. Ignored if NULL. + */ + void getPointValues(unsigned int index, float* value, float* inValue, float* outValue) const; /** * Evaluates the curve at the given position value. diff --git a/gameplay/src/DebugNew.cpp b/gameplay/src/DebugNew.cpp index 95b7e32299..9ac914e18c 100644 --- a/gameplay/src/DebugNew.cpp +++ b/gameplay/src/DebugNew.cpp @@ -114,7 +114,7 @@ void* debugAlloc(std::size_t size, const char* file, int line) // Capture the stack frame (up to MAX_STACK_FRAMES) if we // are running on Windows and the user has enabled it. -#if defined(WIN32) && defined(_M_IX86) +#if defined(WIN32) rec->trackStackTrace = __trackStackTrace; if (rec->trackStackTrace) { @@ -134,7 +134,7 @@ void* debugAlloc(std::size_t size, const char* file, int line) memset(&stackFrame, 0, sizeof(STACKFRAME64)); // Initialize the stack frame based on the machine architecture. -#ifdef _M_IX86 +#if defined(_M_IX86) static const DWORD machineType = IMAGE_FILE_MACHINE_I386; stackFrame.AddrPC.Offset = context.Eip; stackFrame.AddrPC.Mode = AddrModeFlat; @@ -142,6 +142,14 @@ void* debugAlloc(std::size_t size, const char* file, int line) stackFrame.AddrFrame.Mode = AddrModeFlat; stackFrame.AddrStack.Offset = context.Esp; stackFrame.AddrStack.Mode = AddrModeFlat; +#elif defined (_M_X64) + static const DWORD machineType = IMAGE_FILE_MACHINE_AMD64; + stackFrame.AddrPC.Offset = context.Rip; + stackFrame.AddrPC.Mode = AddrModeFlat; + stackFrame.AddrFrame.Offset = context.Rdi; + stackFrame.AddrFrame.Mode = AddrModeFlat; + stackFrame.AddrStack.Offset = context.Rsp; + stackFrame.AddrStack.Mode = AddrModeFlat; #else #error "Machine architecture not supported!" #endif diff --git a/gameplay/src/Drawable.cpp b/gameplay/src/Drawable.cpp new file mode 100644 index 0000000000..c41c41e656 --- /dev/null +++ b/gameplay/src/Drawable.cpp @@ -0,0 +1,28 @@ +#include "Base.h" +#include "Drawable.h" +#include "Node.h" + + +namespace gameplay +{ + +Drawable::Drawable() + : _node(NULL) +{ +} + +Drawable::~Drawable() +{ +} + +Node* Drawable::getNode() const +{ + return _node; +} + +void Drawable::setNode(Node* node) +{ + _node = node; +} + +} diff --git a/gameplay/src/Drawable.h b/gameplay/src/Drawable.h new file mode 100644 index 0000000000..7bbab3bf86 --- /dev/null +++ b/gameplay/src/Drawable.h @@ -0,0 +1,67 @@ +#ifndef DRAWABLE_H_ +#define DRAWABLE_H_ + +namespace gameplay +{ + +class Node; +class NodeCloneContext; + +/** + * Defines a drawable object that can be attached to a Node. + */ +class Drawable +{ +public: + + friend class Node; + + /** + * Constructor. + */ + Drawable(); + + /** + * Destructor. + */ + virtual ~Drawable(); + + /** + * Draws the object. + * + * @param wireframe true if you want to request to draw the wireframe only. + * @return The number of graphics draw calls required to draw the object. + */ + + virtual unsigned int draw(bool wireframe = false) = 0; + + /** + * Gets the node this drawable is attached to. + * + * @return The node this drawable is attached to. + */ + Node* getNode() const; + +protected: + + /** + * Clones the drawable and returns a new drawable. + * + * @param context The clone context. + * @return The newly created drawable. + */ + virtual Drawable* clone(NodeCloneContext& context) = 0; + + /** + * Sets the node this drawable is attached to. + * + * @param node The node this drawable is attached to. + */ + virtual void setNode(Node* node); + + Node* _node; +}; + +} + +#endif diff --git a/gameplay/src/Effect.cpp b/gameplay/src/Effect.cpp index 9478f06f3c..3ee2388693 100644 --- a/gameplay/src/Effect.cpp +++ b/gameplay/src/Effect.cpp @@ -219,7 +219,7 @@ static void writeShaderToErrorFile(const char* filePath, const char* source) { std::string path = filePath; path += ".err"; - std::auto_ptr stream(FileSystem::open(path.c_str(), FileSystem::WRITE)); + std::unique_ptr stream(FileSystem::open(path.c_str(), FileSystem::WRITE)); if (stream.get() != NULL && stream->canWrite()) { stream->write(source, 1, strlen(source)); @@ -439,7 +439,7 @@ Effect* Effect::createFromSource(const char* vshPath, const char* vshSource, con uniform->_name = uniformName; uniform->_location = uniformLocation; uniform->_type = uniformType; - if (uniformType == GL_SAMPLER_2D) + if (uniformType == GL_SAMPLER_2D || uniformType == GL_SAMPLER_CUBE) { uniform->_index = samplerIndex; samplerIndex += uniformSize; @@ -608,8 +608,10 @@ void Effect::setValue(Uniform* uniform, const Vector4* values, unsigned int coun void Effect::setValue(Uniform* uniform, const Texture::Sampler* sampler) { GP_ASSERT(uniform); - GP_ASSERT(uniform->_type == GL_SAMPLER_2D); + GP_ASSERT(uniform->_type == GL_SAMPLER_2D || uniform->_type == GL_SAMPLER_CUBE); GP_ASSERT(sampler); + GP_ASSERT((sampler->getTexture()->getType() == Texture::TEXTURE_2D && uniform->_type == GL_SAMPLER_2D) || + (sampler->getTexture()->getType() == Texture::TEXTURE_CUBE && uniform->_type == GL_SAMPLER_CUBE)); GL_ASSERT( glActiveTexture(GL_TEXTURE0 + uniform->_index) ); @@ -622,13 +624,15 @@ void Effect::setValue(Uniform* uniform, const Texture::Sampler* sampler) void Effect::setValue(Uniform* uniform, const Texture::Sampler** values, unsigned int count) { GP_ASSERT(uniform); - GP_ASSERT(uniform->_type == GL_SAMPLER_2D); + GP_ASSERT(uniform->_type == GL_SAMPLER_2D || uniform->_type == GL_SAMPLER_CUBE); GP_ASSERT(values); // Set samplers as active and load texture unit array GLint units[32]; for (unsigned int i = 0; i < count; ++i) { + GP_ASSERT((const_cast(values[i])->getTexture()->getType() == Texture::TEXTURE_2D && uniform->_type == GL_SAMPLER_2D) || + (const_cast(values[i])->getTexture()->getType() == Texture::TEXTURE_CUBE && uniform->_type == GL_SAMPLER_CUBE)); GL_ASSERT( glActiveTexture(GL_TEXTURE0 + uniform->_index + i) ); // Bind the sampler - this binds the texture and applies sampler state @@ -654,7 +658,7 @@ Effect* Effect::getCurrentEffect() } Uniform::Uniform() : - _location(-1), _type(0), _index(0) + _location(-1), _type(0), _index(0), _effect(NULL) { } diff --git a/gameplay/src/FileSystem.cpp b/gameplay/src/FileSystem.cpp index 27d217e521..3a3ac419e6 100644 --- a/gameplay/src/FileSystem.cpp +++ b/gameplay/src/FileSystem.cpp @@ -87,6 +87,7 @@ static bool androidFileExists(const char* filePath) /** @script{ignore} */ static std::string __resourcePath("./"); +static std::string __assetPath(""); static std::map __aliases; /** @@ -343,14 +344,18 @@ bool FileSystem::fileExists(const char* filePath) { GP_ASSERT(filePath); + std::string fullPath; + #ifdef __ANDROID__ - if (androidFileExists(resolvePath(filePath))) + fullPath = __assetPath; + fullPath += resolvePath(filePath); + + if (androidFileExists(fullPath.c_str())) { return true; } #endif - std::string fullPath; getFullPath(filePath, fullPath); gp_stat_struct s; @@ -364,17 +369,17 @@ Stream* FileSystem::open(const char* path, size_t streamMode) if ((streamMode & WRITE) != 0) modeStr[0] = 'w'; #ifdef __ANDROID__ + std::string fullPath(__resourcePath); + fullPath += resolvePath(path); + if ((streamMode & WRITE) != 0) { // Open a file on the SD card - std::string fullPath(__resourcePath); - fullPath += resolvePath(path); - size_t index = fullPath.rfind('/'); if (index != std::string::npos) { std::string directoryPath = fullPath.substr(0, index); - struct stat s; + gp_stat_struct s; if (stat(directoryPath.c_str(), &s) != 0) makepath(directoryPath, 0777); } @@ -382,8 +387,19 @@ Stream* FileSystem::open(const char* path, size_t streamMode) } else { - // Open a file in the read-only asset directory - return FileStreamAndroid::create(resolvePath(path), modeStr); + // First try the SD card + Stream* stream = FileStream::create(fullPath.c_str(), modeStr); + + if (!stream) + { + // Otherwise fall-back to assets loaded via the AssetManager + fullPath = __assetPath; + fullPath += resolvePath(path); + + stream = FileStreamAndroid::create(fullPath.c_str(), modeStr); + } + + return stream; } #else std::string fullPath; @@ -412,7 +428,7 @@ char* FileSystem::readAll(const char* filePath, int* fileSize) GP_ASSERT(filePath); // Open file for reading. - std::auto_ptr stream(open(filePath)); + std::unique_ptr stream(open(filePath)); if (stream.get() == NULL) { GP_ERROR("Failed to load file: %s", filePath); @@ -456,6 +472,16 @@ bool FileSystem::isAbsolutePath(const char* filePath) #endif } +void FileSystem::setAssetPath(const char* path) +{ + __assetPath = path; +} + +const char* FileSystem::getAssetPath() +{ + return __assetPath.c_str(); +} + void FileSystem::createFileFromAsset(const char* path) { #ifdef __ANDROID__ diff --git a/gameplay/src/FileSystem.h b/gameplay/src/FileSystem.h index f363ad5fdd..2bfe1bb9f4 100644 --- a/gameplay/src/FileSystem.h +++ b/gameplay/src/FileSystem.h @@ -201,6 +201,23 @@ class FileSystem */ static bool isAbsolutePath(const char* filePath); + /** + * Sets the asset root path for the game on platforms that have separate assets (currently just Android). + * + * Once set, all asset paths will be loaded relative to the given path. + * The default asset path is an empty string (""). + * + * @param path The asset root path. + */ + static void setAssetPath(const char* path); + + /** + * Returns the currently set asset root path. + * + * @return The currently set asset root path. + */ + static const char* getAssetPath(); + /** * Creates a file on the file system from the specified asset (Android-specific). * diff --git a/gameplay/src/Font.cpp b/gameplay/src/Font.cpp index 7b2d6eb9b4..f4bd3fb73f 100644 --- a/gameplay/src/Font.cpp +++ b/gameplay/src/Font.cpp @@ -1,8 +1,10 @@ #include "Base.h" #include "Font.h" +#include "Text.h" #include "Game.h" #include "FileSystem.h" #include "Bundle.h" +#include "Material.h" // Default font shaders #define FONT_VSH "res/shaders/font.vert" @@ -16,7 +18,7 @@ static std::vector __fontCache; static Effect* __fontEffect = NULL; Font::Font() : - _format(BITMAP), _style(PLAIN), _size(0), _spacing(0.125f), _glyphs(NULL), _glyphCount(0), _texture(NULL), _batch(NULL), _cutoffParam(NULL) + _format(BITMAP), _style(PLAIN), _size(0), _spacing(0.0f), _glyphs(NULL), _glyphCount(0), _texture(NULL), _batch(NULL), _cutoffParam(NULL) { } @@ -123,7 +125,7 @@ Font* Font::create(const char* family, Style style, unsigned int size, Glyph* gl // Create batch for the font. SpriteBatch* batch = SpriteBatch::create(texture, __fontEffect, 128); - + // Release __fontEffect since the SpriteBatch keeps a reference to it SAFE_RELEASE(__fontEffect); @@ -219,255 +221,9 @@ void Font::finish() } } -Font::Text* Font::createText(const char* text, const Rectangle& area, const Vector4& color, unsigned int size, Justify justify, - bool wrap, bool rightToLeft, const Rectangle* clip) -{ - GP_ASSERT(text); - GP_ASSERT(_glyphs); - GP_ASSERT(_batch); - GP_ASSERT(_size); - - if (size == 0) - { - size = _size; - } - else - { - // Delegate to closest sized font - Font* f = findClosestSize(size); - if (f != this) - { - return f->createText(text, area, color, size, justify, wrap, rightToLeft, clip); - } - } - - float scale = (float)size / _size; - int spacing = (int)(size * _spacing); - int yPos = area.y; - const float areaHeight = area.height - size; - std::vector xPositions; - std::vector lineLengths; - - getMeasurementInfo(text, area, size, justify, wrap, rightToLeft, &xPositions, &yPos, &lineLengths); - - Text* batch = new Text(text); - batch->_font = this; - batch->_font->addRef(); - - GP_ASSERT(batch->_vertices); - GP_ASSERT(batch->_indices); - - int xPos = area.x; - std::vector::const_iterator xPositionsIt = xPositions.begin(); - if (xPositionsIt != xPositions.end()) - { - xPos = *xPositionsIt++; - } - - const char* token = text; - int iteration = 1; - unsigned int lineLength; - unsigned int currentLineLength = 0; - const char* lineStart; - std::vector::const_iterator lineLengthsIt; - if (rightToLeft) - { - lineStart = token; - lineLengthsIt = lineLengths.begin(); - lineLength = *lineLengthsIt++; - token += lineLength - 1; - iteration = -1; - } - - while (token[0] != 0) - { - // Handle delimiters until next token. - if (!handleDelimiters(&token, size, iteration, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) - { - break; - } - - bool truncated = false; - unsigned int tokenLength; - unsigned int tokenWidth; - unsigned int startIndex; - if (rightToLeft) - { - tokenLength = getReversedTokenLength(token, text); - currentLineLength += tokenLength; - token -= (tokenLength - 1); - tokenWidth = getTokenWidth(token, tokenLength, size, scale); - iteration = -1; - startIndex = tokenLength - 1; - } - else - { - tokenLength = (unsigned int)strcspn(token, " \r\n\t"); - tokenWidth = getTokenWidth(token, tokenLength, size, scale); - iteration = 1; - startIndex = 0; - } - - // Wrap if necessary. - if (wrap && (xPos + (int)tokenWidth > area.x + area.width || (rightToLeft && currentLineLength > lineLength))) - { - yPos += (int)size; - currentLineLength = tokenLength; - - if (xPositionsIt != xPositions.end()) - { - xPos = *xPositionsIt++; - } - else - { - xPos = area.x; - } - } - - bool draw = true; - if (yPos < static_cast(area.y)) - { - // Skip drawing until line break or wrap. - draw = false; - } - else if (yPos > area.y + areaHeight) - { - // Truncate below area's vertical limit. - break; - } - - for (int i = startIndex; i < (int)tokenLength && i >= 0; i += iteration) - { - char c = token[i]; - int glyphIndex = c - 32; // HACK for ASCII - - if (glyphIndex >= 0 && glyphIndex < (int)_glyphCount) - { - Glyph& g = _glyphs[glyphIndex]; - - if (xPos + (int)(g.width*scale) > area.x + area.width) - { - // Truncate this line and go on to the next one. - truncated = true; - break; - } - else if (xPos >= area.x) - { - // Draw this character. - if (draw) - { - if (clip) - { - _batch->addSprite(xPos, yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color, *clip, &batch->_vertices[batch->_vertexCount]); - } - else - { - _batch->addSprite(xPos, yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color, &batch->_vertices[batch->_vertexCount]); - } - - if (batch->_vertexCount == 0) - { - // Simply copy values directly into the start of the index array - batch->_indices[batch->_vertexCount] = batch->_vertexCount; - batch->_indices[batch->_vertexCount + 1] = batch->_vertexCount + 1; - batch->_indices[batch->_vertexCount + 2] = batch->_vertexCount + 2; - batch->_indices[batch->_vertexCount + 3] = batch->_vertexCount + 3; - batch->_vertexCount += 4; - batch->_indexCount += 4; - } - else - { - // Create a degenerate triangle to connect separate triangle strips - // by duplicating the previous and next vertices. - batch->_indices[batch->_indexCount] = batch->_indices[batch->_indexCount - 1]; - batch->_indices[batch->_indexCount + 1] = batch->_vertexCount; - - // Loop through all indices and insert them, their their value offset by - // 'vertexCount' so that they are relative to the first newly insertted vertex - for (unsigned int i = 0; i < 4; ++i) - { - batch->_indices[batch->_indexCount + 2 + i] = i + batch->_vertexCount; - } - - batch->_indexCount += 6; - batch->_vertexCount += 4; - } - - } - } - xPos += (int)(g.width)*scale + spacing; - } - } - - if (!truncated) - { - if (rightToLeft) - { - if (token == lineStart) - { - token += lineLength; - - // Now handle delimiters going forwards. - if (!handleDelimiters(&token, size, 1, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) - { - break; - } - - if (lineLengthsIt != lineLengths.end()) - { - lineLength = *lineLengthsIt++; - } - lineStart = token; - token += lineLength-1; - } - else - { - token--; - } - } - else - { - token += tokenLength; - } - } - else - { - if (rightToLeft) - { - token = lineStart + lineLength; - - if (!handleDelimiters(&token, size, 1, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) - { - break; - } - - if (lineLengthsIt != lineLengths.end()) - { - lineLength = *lineLengthsIt++; - } - lineStart = token; - token += lineLength-1; - } - else - { - // Skip the rest of this line. - size_t tokenLength = strcspn(token, "\n"); - - if (tokenLength > 0) - { - // Get first token of next line. - token += tokenLength; - } - } - } - } - - return batch; -} - Font* Font::findClosestSize(int size) { - if (size == _size) + if (size == (int)_size) return this; int diff = abs(size - (int)_size); @@ -486,26 +242,6 @@ Font* Font::findClosestSize(int size) return closest; } -void Font::drawText(Text* text) -{ - GP_ASSERT(text); - GP_ASSERT(text->_font); - - if (text->_font != this) - { - // Make sure we draw using the font/batch the text was created with - text->_font->drawText(text); - return; - } - - GP_ASSERT(_batch); - GP_ASSERT(text->_vertices); - GP_ASSERT(text->_indices); - - lazyStart(); - _batch->draw(text->_vertices, text->_vertexCount, text->_indices, text->_indexCount); -} - void Font::drawText(const char* text, int x, int y, const Vector4& color, unsigned int size, bool rightToLeft) { GP_ASSERT(_size); @@ -558,7 +294,7 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, unsign switch (delimiter) { case ' ': - xPos += size >> 1; + xPos += _glyphs[0].advance; break; case '\r': case '\n': @@ -566,7 +302,7 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, unsign xPos = x; break; case '\t': - xPos += (size >> 1)*4; + xPos += _glyphs[0].advance * 4; break; case 0: done = true; @@ -609,7 +345,7 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, unsign switch (c) { case ' ': - xPos += size >> 1; + xPos += _glyphs[0].advance; break; case '\r': case '\n': @@ -617,7 +353,7 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, unsign xPos = x; break; case '\t': - xPos += (size >> 1)*4; + xPos += _glyphs[0].advance * 4; break; default: int index = c - 32; // HACK for ASCII @@ -628,12 +364,12 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, unsign if (getFormat() == DISTANCE_FIELD ) { if (_cutoffParam == NULL) - _cutoffParam = _batch->getMaterial()->getParameter("u_cutoff"); + _cutoffParam = _batch->getMaterial()->getParameter("u_cutoff"); // TODO: Fix me so that smaller font are much smoother _cutoffParam->setVector2(Vector2(1.0, 1.0)); } - _batch->draw(xPos, yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color); - xPos += floor(g.width * scale + spacing); + _batch->draw(xPos + (int)(g.bearingX * scale), yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color); + xPos += floor(g.advance * scale + spacing); break; } break; @@ -642,7 +378,7 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, unsign if (rightToLeft) { - cursor += length; + cursor += length; } else { @@ -656,7 +392,7 @@ void Font::drawText(const char* text, int x, int y, float red, float green, floa drawText(text, x, y, Vector4(red, green, blue, alpha), size, rightToLeft); } -void Font::drawText(const char* text, const Rectangle& area, const Vector4& color, unsigned int size, Justify justify, bool wrap, bool rightToLeft, const Rectangle* clip) +void Font::drawText(const char* text, const Rectangle& area, const Vector4& color, unsigned int size, Justify justify, bool wrap, bool rightToLeft, const Rectangle& clip) { GP_ASSERT(text); GP_ASSERT(_size); @@ -773,18 +509,18 @@ void Font::drawText(const char* text, const Rectangle& area, const Vector4& colo { char c = token[i]; int glyphIndex = c - 32; // HACK for ASCII - + if (glyphIndex >= 0 && glyphIndex < (int)_glyphCount) { Glyph& g = _glyphs[glyphIndex]; - if (xPos + (int)(g.width*scale) > area.x + area.width) + if (xPos + (int)(g.advance*scale) > area.x + area.width) { // Truncate this line and go on to the next one. truncated = true; break; } - else if (xPos >= area.x) + else if (xPos >= (int)area.x) { // Draw this character. if (draw) @@ -796,17 +532,17 @@ void Font::drawText(const char* text, const Rectangle& area, const Vector4& colo // TODO: Fix me so that smaller font are much smoother _cutoffParam->setVector2(Vector2(1.0, 1.0)); } - if (clip) + if (clip != Rectangle(0, 0, 0, 0)) { - _batch->draw(xPos, yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color, *clip); + _batch->draw(xPos + (int)(g.bearingX * scale), yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color, clip); } else { - _batch->draw(xPos, yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color); + _batch->draw(xPos + (int)(g.bearingX * scale), yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color); } } } - xPos += (int)(g.width)*scale + spacing; + xPos += (int)(g.advance)*scale + spacing; } } @@ -817,7 +553,7 @@ void Font::drawText(const char* text, const Rectangle& area, const Vector4& colo if (token == lineStart) { token += lineLength; - + // Now handle delimiters going forwards. if (!handleDelimiters(&token, size, 1, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) { @@ -846,7 +582,7 @@ void Font::drawText(const char* text, const Rectangle& area, const Vector4& colo if (rightToLeft) { token = lineStart + lineLength; - + if (!handleDelimiters(&token, size, 1, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) { break; @@ -865,7 +601,7 @@ void Font::drawText(const char* text, const Rectangle& area, const Vector4& colo size_t tokenLength = strcspn(token, "\n"); if (tokenLength > 0) - { + { // Get first token of next line. token += tokenLength; } @@ -995,7 +731,7 @@ void Font::measureText(const char* text, const Rectangle& clip, unsigned int siz switch (delimiter) { case ' ': - delimWidth += size >> 1; + delimWidth += _glyphs[0].advance; break; case '\r': case '\n': @@ -1031,7 +767,7 @@ void Font::measureText(const char* text, const Rectangle& clip, unsigned int siz delimWidth = 0; break; case '\t': - delimWidth += (size >> 1)*4; + delimWidth += _glyphs[0].advance * 4; break; case 0: reachedEOF = true; @@ -1114,14 +850,14 @@ void Font::measureText(const char* text, const Rectangle& clip, unsigned int siz emptyLines.push_back(true); lines.push_back(Vector2(FLT_MAX, 0)); } - + token++; } // Measure the next line. unsigned int tokenLength = (unsigned int)strcspn(token, "\n"); lineWidth = getTokenWidth(token, tokenLength, size, scale); - + // Determine horizontal position and width. int xPos = clip.x; int hWhitespace = clip.width - lineWidth; @@ -1175,7 +911,7 @@ void Font::measureText(const char* text, const Rectangle& clip, unsigned int siz { y += vWhitespace; } - + int clippedTop = 0; int clippedBottom = 0; if (!ignoreClip) @@ -1331,7 +1067,7 @@ void Font::getMeasurementInfo(const char* text, const Rectangle& area, unsigned switch (delimiter) { case ' ': - delimWidth += size >> 1; + delimWidth += _glyphs[0].advance; lineLength++; break; case '\r': @@ -1348,7 +1084,7 @@ void Font::getMeasurementInfo(const char* text, const Rectangle& area, unsigned delimWidth = 0; break; case '\t': - delimWidth += (size >> 1)*4; + delimWidth += _glyphs[0].advance * 4; lineLength++; break; case 0: @@ -1526,7 +1262,7 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i } const char* token = text; - + int iteration = 1; unsigned int lineLength; unsigned int currentLineLength = 0; @@ -1622,12 +1358,12 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i { char c = token[i]; int glyphIndex = c - 32; // HACK for ASCII - + if (glyphIndex >= 0 && glyphIndex < (int)_glyphCount) { Glyph& g = _glyphs[glyphIndex]; - if (xPos + (int)(g.width*scale) > area.x + area.width) + if (xPos + (int)(g.advance*scale) > area.x + area.width) { // Truncate this line and go on to the next one. truncated = true; @@ -1645,7 +1381,7 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i return charIndex; } - xPos += floor(g.width*scale + spacing); + xPos += floor(g.advance*scale + spacing); charIndex++; } } @@ -1657,7 +1393,7 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i if (token == lineStart) { token += lineLength; - + // Now handle delimiters going forwards. if (!handleDelimiters(&token, size, 1, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) { @@ -1688,7 +1424,7 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i if (rightToLeft) { token = lineStart + lineLength; - + if (!handleDelimiters(&token, size, 1, area.x, &xPos, &yPos, ¤tLineLength, &xPositionsIt, xPositions.end())) { break; @@ -1707,7 +1443,7 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i unsigned int tokenLength = (unsigned int)strcspn(token, "\n"); if (tokenLength > 0) - { + { // Get first token of next line. token += tokenLength; charIndex += tokenLength; @@ -1726,7 +1462,7 @@ int Font::getIndexOrLocation(const char* text, const Rectangle& area, unsigned i outLocation->y = yPos; return charIndex; } - + return -1; } @@ -1748,17 +1484,17 @@ unsigned int Font::getTokenWidth(const char* token, unsigned int length, unsigne switch (c) { case ' ': - tokenWidth += size >> 1; + tokenWidth += _glyphs[0].advance; break; case '\t': - tokenWidth += (size >> 1)*4; + tokenWidth += _glyphs[0].advance * 4; break; default: int glyphIndex = c - 32; if (glyphIndex >= 0 && glyphIndex < (int)_glyphCount) { Glyph& g = _glyphs[glyphIndex]; - tokenWidth += floor(g.width * scale + spacing); + tokenWidth += floor(g.advance * scale + spacing); } break; } @@ -1822,7 +1558,7 @@ int Font::handleDelimiters(const char** token, const unsigned int size, const in switch (delimiter) { case ' ': - *xPos += size >> 1; + *xPos += _glyphs[0].advance; (*lineLength)++; if (charIndex) { @@ -1854,7 +1590,7 @@ int Font::handleDelimiters(const char** token, const unsigned int size, const in } break; case '\t': - *xPos += (size >> 1)*4; + *xPos += _glyphs[0].advance * 4; (*lineLength)++; if (charIndex) { @@ -1981,23 +1717,4 @@ Font::Justify Font::getJustify(const char* justify) return Font::ALIGN_TOP_LEFT; } -Font::Text::Text(const char* text) : _text(text ? text : ""), _vertexCount(0), _vertices(NULL), _indexCount(0), _indices(NULL), _font(NULL) -{ - const size_t length = strlen(text); - _vertices = new SpriteBatch::SpriteVertex[length * 4]; - _indices = new unsigned short[((length - 1) * 6) + 4]; -} - -Font::Text::~Text() -{ - SAFE_DELETE_ARRAY(_vertices); - SAFE_DELETE_ARRAY(_indices); - SAFE_RELEASE(_font); -} - -const char* Font::Text::getText() -{ - return _text.c_str(); -} - } diff --git a/gameplay/src/Font.h b/gameplay/src/Font.h index 77fe9493ad..c4e0d4d623 100644 --- a/gameplay/src/Font.h +++ b/gameplay/src/Font.h @@ -12,6 +12,7 @@ namespace gameplay class Font : public Ref { friend class Bundle; + friend class Text; friend class TextBox; public: @@ -58,52 +59,6 @@ class Font : public Ref DISTANCE_FIELD = 1 }; - /** - * Vertex coordinates, UVs and indices can be computed and stored in a Text object. - * For static text labels that do not change frequently, this means these computations - * need not be performed every frame. - */ - class Text - { - friend class Font; - - public: - /** - * Constructor. - */ - Text(const char* text); - - /** - * Destructor. - */ - ~Text(); - - /** - * Get the string that will be drawn from this Text object. - */ - const char* getText(); - - private: - - /** - * Hidden copy constructor. - */ - Text(const Text&); - - /** - * Hidden copy assignment operator. - */ - Text& operator=(const Text&); - - std::string _text; - unsigned int _vertexCount; - SpriteBatch::SpriteVertex* _vertices; - unsigned int _indexCount; - unsigned short* _indices; - Vector4 _color; - Font* _font; - }; - /** * Creates a font from the given bundle. * @@ -116,7 +71,7 @@ class Font : public Ref * * @param path The path to a bundle file containing a font resource. * @param id An optional ID of the font resource within the bundle (NULL for the first/only resource). - * + * * @return The specified Font or NULL if there was an error. * @script{create} */ @@ -166,11 +121,12 @@ class Font : public Ref * @param size The size to draw text (0 for default size). * @param rightToLeft Whether to draw text from right to left. */ - void drawText(const char* text, int x, int y, const Vector4& color, unsigned int size = 0, bool rightToLeft = false); + void drawText(const char* text, int x, int y, const Vector4& color, unsigned int size = 0, + bool rightToLeft = false); /** * Draws the specified text in a solid color, with a scaling factor. - * + * * @param text The text to draw. * @param x The viewport x position to draw text at. * @param y The viewport y position to draw text at. @@ -181,7 +137,8 @@ class Font : public Ref * @param size The size to draw text (0 for default size). * @param rightToLeft Whether to draw text from right to left. */ - void drawText(const char* text, int x, int y, float red, float green, float blue, float alpha, unsigned int size = 0, bool rightToLeft = false); + void drawText(const char* text, int x, int y, float red, float green, float blue, float alpha, unsigned int size = 0, + bool rightToLeft = false); /** * Draws the specified text within a rectangular area, with a specified alignment and scale. @@ -196,35 +153,9 @@ class Font : public Ref * @param rightToLeft Whether to draw text from right to left. * @param clip A region to clip text within after applying justification to the viewport area. */ - void drawText(const char* text, const Rectangle& area, const Vector4& color, unsigned int size = 0, - Justify justify = ALIGN_TOP_LEFT, bool wrap = true, bool rightToLeft = false, const Rectangle* clip = NULL); - - /** - * Draw a string from a precomputed Text object. - * - * @param text The text to draw. - */ - void drawText(Text* text); - - /** - * Create an immutable Text object from a given string. - * Vertex coordinates, UVs and indices will be computed and stored in the Text object. - * For static text labels that do not change frequently, this means these computations - * need not be performed every frame. - * - * @param text The text to draw. - * @param area The viewport area to draw within. Text will be clipped outside this rectangle. - * @param color The color of text. - * @param size The size to draw text (0 for default size). - * @param justify Justification of text within the viewport. - * @param wrap Wraps text to fit within the width of the viewport if true. - * @param rightToLeft Whether to draw text from right to left. - * @param clip A region to clip text within after applying justification to the viewport area. - * - * @return A Text object. - */ - Text* createText(const char* text, const Rectangle& area, const Vector4& color, unsigned int size = 0, - Justify justify = ALIGN_TOP_LEFT, bool wrap = true, bool rightToLeft = false, const Rectangle* clip = NULL); + void drawText(const char* text, const Rectangle& area, const Vector4& color, unsigned int size = 0, + Justify justify = ALIGN_TOP_LEFT, bool wrap = true, bool rightToLeft = false, + const Rectangle& clip = Rectangle(0, 0, 0, 0)); /** * Finishes text batching for this font and renders all drawn text. @@ -264,15 +195,14 @@ class Font : public Ref float getCharacterSpacing() const; /** - * Sets the fixed character spacing for this font. + * Sets the additional character spacing for this font. * - * Character spacing is the fixed amount of space that is inserted between characters. This is a simplified - * type of kerning and does not take adjacent characters into consideration. Character spacing is defined + * Character spacing is the additional amount of space that is inserted between characters. Character spacing is defined * as a floating point value that is interpreted as a percentage of size used to draw the font. For example, * a value of 0.1 would cause a spacing of 10% of the font size to be inserted between adjacent characters. * For a font size of 20, this would equate to 2 pixels of extra space between characters. * - * The default character spacing for fonts is 0.125. + * The default additional character spacing for fonts is 0.0. * * @param spacing New fixed character spacing, expressed as a percentage of font size. */ @@ -281,18 +211,19 @@ class Font : public Ref /** * Get an character index into a string corresponding to the character nearest the given location within the clip region. */ - int getIndexAtLocation(const char* text, const Rectangle& clip, unsigned int size, const Vector2& inLocation, Vector2* outLocation, - Justify justify = ALIGN_TOP_LEFT, bool wrap = true, bool rightToLeft = false); + int getIndexAtLocation(const char* text, const Rectangle& clip, unsigned int size, const Vector2& inLocation, + Vector2* outLocation, Justify justify = ALIGN_TOP_LEFT, bool wrap = true, bool rightToLeft = false); /** * Get the location of the character at the given index. */ - void getLocationAtIndex(const char* text, const Rectangle& clip, unsigned int size, Vector2* outLocation, const unsigned int destIndex, - Justify justify = ALIGN_TOP_LEFT, bool wrap = true, bool rightToLeft = false); + void getLocationAtIndex(const char* text, const Rectangle& clip, unsigned int size, Vector2* outLocation, + const unsigned int destIndex, Justify justify = ALIGN_TOP_LEFT, bool wrap = true, + bool rightToLeft = false); /** * Gets the sprite batch used to draw this Font. - * + * * @param size The font size to be drawn. * * @return The SpriteBatch that most closely matches the requested font size. @@ -302,9 +233,9 @@ class Font : public Ref /** * Gets the Justify value from the given string. * Returns ALIGN_TOP_LEFT if the string is unrecognized. - * + * * @param justify The string such as "ALIGN_HCENTER" or "ALIGN_VCENTER_RIGHT". - * + * * @return The Justify value. */ static Justify getJustify(const char* justify); @@ -327,6 +258,16 @@ class Font : public Ref */ unsigned int width; + /** + * Glyph left side bearing (in pixels). + */ + int bearingX; + + /** + * Glyph horizontal advance (in pixels). + */ + unsigned int advance; + /** * Glyph texture coordinates. */ @@ -366,7 +307,7 @@ class Font : public Ref * @param glyphCount The number of items in the glyph array. * @param texture A texture map containing rendered glyphs. * @param format The format of the font (bitmap or distance fields) - * + * * @return The new Font or NULL if there was an error. */ static Font* create(const char* family, Style style, unsigned int size, Glyph* glyphs, int glyphCount, Texture* texture, Font::Format format); diff --git a/gameplay/src/Form.cpp b/gameplay/src/Form.cpp index 3703a032ca..7ab797a05a 100644 --- a/gameplay/src/Form.cpp +++ b/gameplay/src/Form.cpp @@ -10,8 +10,8 @@ #include "CheckBox.h" #include "Scene.h" -// Scroll speed when using a DPad -- max scroll speed when using a joystick. -static const float GAMEPAD_SCROLL_SPEED = 500.0f; +// Scroll speed when using a joystick. +static const float GAMEPAD_SCROLL_SPEED = 600.0f; // Distance a joystick must be pushed in order to trigger focus-change and/or scrolling. static const float JOYSTICK_THRESHOLD = 0.75f; // If the DPad or joystick is held down, this is the initial delay in milliseconds between focus changes. @@ -42,7 +42,7 @@ struct FormInit }; static FormInit __init; -Form::Form() : _node(NULL), _batched(true) +Form::Form() : Drawable(), _batched(true) { } @@ -170,17 +170,14 @@ void Form::clearFocus() setFocusControl(NULL); } -bool Form::isForm() const +const char* Form::getTypeName() const { - return true; + return "Form"; } -void Form::setNode(Node* node) +bool Form::isForm() const { - if (_node != node) - { - _node = node; - } + return true; } static unsigned int nextPowerOfTwo(unsigned int v) @@ -236,7 +233,7 @@ const Matrix& Form::getProjectionMatrix() const return _projectionMatrix; } -unsigned int Form::draw() +unsigned int Form::draw(bool wireframe) { if (!_visible || _absoluteClipBounds.width == 0 || _absoluteClipBounds.height == 0) return 0; @@ -276,16 +273,15 @@ unsigned int Form::draw() _batches.clear(); drawCalls = batchCount; } - return drawCalls; } -const char* Form::getType() const +Drawable* Form::clone(NodeCloneContext& context) { - return "form"; + // TODO: + return NULL; } - bool Form::isBatchingEnabled() const { return _batched; @@ -738,8 +734,6 @@ bool Form::keyEventInternal(Keyboard::KeyEvent evt, int key) __shiftKeyDown = false; break; } - if (key == Keyboard::KEY_ESCAPE) - return false; // Handle focus changing if (__focusControl) @@ -905,7 +899,7 @@ bool Form::pollGamepad(Gamepad* gamepad) return focusPressed || scrolling; } -bool Form::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex) +bool Form::gamepadButtonEventInternal(Gamepad* gamepad) { if (!__focusControl) return false; @@ -913,56 +907,83 @@ bool Form::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, uns bool selectButtonPressed = gamepad->isButtonDown(Gamepad::BUTTON_A) || gamepad->isButtonDown(Gamepad::BUTTON_X); // Fire press, release and click events to focused controls - switch (evt) + if (selectButtonPressed && __focusControl->_state != ACTIVE) { - case Gamepad::BUTTON_EVENT: - if (selectButtonPressed && __focusControl->_state != ACTIVE) - { - if (__activeControl[0]) - __activeControl[0]->setDirty(DIRTY_STATE); + if (__activeControl[0]) + __activeControl[0]->setDirty(DIRTY_STATE); - __activeControl[0] = __focusControl; - __focusControl->_state = ACTIVE; - __focusControl->notifyListeners(Control::Listener::PRESS); - return true; - } - else if (!selectButtonPressed && __focusControl->_state == ACTIVE) - { - if (__activeControl[0]) - __activeControl[0]->setDirty(DIRTY_STATE); + __activeControl[0] = __focusControl; + __focusControl->_state = ACTIVE; + __focusControl->notifyListeners(Control::Listener::PRESS); + return true; + } + else if (!selectButtonPressed && __focusControl->_state == ACTIVE) + { + if (__activeControl[0]) + __activeControl[0]->setDirty(DIRTY_STATE); - for (unsigned int i = 0; i < Touch::MAX_TOUCH_POINTS; ++i) + for (unsigned int i = 0; i < Touch::MAX_TOUCH_POINTS; ++i) + { + if (__activeControl[i] == __focusControl) { - if (__activeControl[i] == __focusControl) - { - __activeControl[i] = NULL; - } + __activeControl[i] = NULL; } - - __focusControl->_state = NORMAL; - __focusControl->notifyListeners(Control::Listener::RELEASE); - __focusControl->notifyListeners(Control::Listener::CLICK); - return true; } - break; + + __focusControl->_state = NORMAL; + __focusControl->notifyListeners(Control::Listener::RELEASE); + __focusControl->notifyListeners(Control::Listener::CLICK); + return true; } - // Dispatch gamepad events to focused controls (or their parents) - Control * ctrl = __focusControl; + // Dispatch gamepad button events to focused controls (or their parents) + Control* ctrl = __focusControl; while (ctrl) { if (ctrl->isEnabled() && ctrl->isVisible()) { - if (ctrl->gamepadEvent(evt, gamepad, analogIndex)) + if (ctrl->gamepadButtonEvent(gamepad)) return true; } ctrl = ctrl->getParent(); } + return false; +} + +bool Form::gamepadTriggerEventInternal(Gamepad* gamepad, unsigned int index) +{ + // Dispatch gamepad trigger events to focused controls (or their parents) + Control* ctrl = __focusControl; + while (ctrl) + { + if (ctrl->isEnabled() && ctrl->isVisible()) + { + if (ctrl->gamepadTriggerEvent(gamepad, index)) + return true; + } + ctrl = ctrl->getParent(); + } return false; } +bool Form::gamepadJoystickEventInternal(Gamepad* gamepad, unsigned int index) +{ + // Dispatch gamepad joystick events to focused controls (or their parents) + Control* ctrl = __focusControl; + while (ctrl) + { + if (ctrl->isEnabled() && ctrl->isVisible()) + { + if (ctrl->gamepadJoystickEvent(gamepad, index)) + return true; + } + + ctrl = ctrl->getParent(); + } + return false; +} void Form::resizeEventInternal(unsigned int width, unsigned int height) { for (size_t i = 0, size = __forms.size(); i < size; ++i) @@ -971,7 +992,7 @@ void Form::resizeEventInternal(unsigned int width, unsigned int height) if (form) { // Dirty the form - form->setDirty(Control::DIRTY_STATE); + form->setDirty(Control::DIRTY_BOUNDS | Control::DIRTY_STATE); } } } diff --git a/gameplay/src/Form.h b/gameplay/src/Form.h index d3ada45038..b468e9122d 100644 --- a/gameplay/src/Form.h +++ b/gameplay/src/Form.h @@ -10,6 +10,7 @@ #include "Mouse.h" #include "Gamepad.h" #include "FrameBuffer.h" +#include "Drawable.h" namespace gameplay { @@ -23,7 +24,7 @@ class Theme; * * @see http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-UI_Forms */ -class Form : public Container +class Form : public Drawable, public Container { friend class Platform; friend class Game; @@ -94,18 +95,19 @@ class Form : public Container static void clearFocus(); /** - * @see Container#isForm() + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "Form" + * @see ScriptTarget::getTypeName */ - bool isForm() const; + const char* getTypeName() const; /** - * Attach this form to a node. - * - * A form can be drawn as part of the 3-dimensional world if it is attached to a node. - * - * @param node The node to attach this form to. + * @see Container#isForm() */ - void setNode(Node* node); + bool isForm() const; /** * @see Control::update @@ -117,12 +119,7 @@ class Form : public Container * * @return The nubmer of draw calls issued to draw the form. */ - unsigned int draw(); - - /** - * @see Control::getType - */ - const char* getType() const; + unsigned int draw(bool wireframe = false); /** * Determines whether batching is enabled for this form. @@ -160,6 +157,11 @@ class Form : public Container */ virtual ~Form(); + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext &context); + /** * @see Control::initialize */ @@ -201,11 +203,25 @@ class Form : public Container static bool mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta); /** - * Propagate gamepad events to enabled forms. + * Propagate gamepad button events to enabled forms. + * + * @see Control::gamepadButtonEventInternal + */ + static bool gamepadButtonEventInternal(Gamepad* gamepad); + + /** + * Propagate gamepad trigger events to enabled forms. + * + * @see Control::gamepadTriggerEventInternal + */ + static bool gamepadTriggerEventInternal(Gamepad* gamepad, unsigned int index); + + /** + * Propagate gamepad button events to enabled forms. * - * @see Control::gamepadEvent + * @see Control::gamepadJoystickEventInternal */ - static bool gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex); + static bool gamepadJoystickEventInternal(Gamepad* gamepad, unsigned int index); /** * Fired by the platform when the game window resizes. @@ -260,7 +276,6 @@ class Form : public Container static bool pollGamepad(Gamepad* gamepad); - Node* _node; // Node for transforming this Form in world-space. Matrix _projectionMatrix; // Projection matrix to be set on SpriteBatch objects when rendering the form std::vector _batches; bool _batched; diff --git a/gameplay/src/FrameBuffer.cpp b/gameplay/src/FrameBuffer.cpp index 25837d30c9..e14c78d4a4 100644 --- a/gameplay/src/FrameBuffer.cpp +++ b/gameplay/src/FrameBuffer.cpp @@ -155,13 +155,28 @@ unsigned int FrameBuffer::getMaxRenderTargets() void FrameBuffer::setRenderTarget(RenderTarget* target, unsigned int index) { - GP_ASSERT(index < _maxRenderTargets); - GP_ASSERT(_renderTargets); + GP_ASSERT(!target || (target->getTexture() && target->getTexture()->getType() == Texture::TEXTURE_2D)); // No change if (_renderTargets[index] == target) return; + setRenderTarget(target, index, GL_TEXTURE_2D); +} + +void FrameBuffer::setRenderTarget(RenderTarget* target, Texture::CubeFace face, unsigned int index) +{ + GP_ASSERT(face >= Texture::POSITIVE_X && face <= Texture::NEGATIVE_Z); + GP_ASSERT(!target || (target->getTexture() && target->getTexture()->getType() == Texture::TEXTURE_CUBE)); + + setRenderTarget(target, index, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face); +} + +void FrameBuffer::setRenderTarget(RenderTarget* target, unsigned int index, GLenum textureTarget) +{ + GP_ASSERT(index < _maxRenderTargets); + GP_ASSERT(_renderTargets); + // Release our reference to the current RenderTarget at this index. if (_renderTargets[index]) { @@ -173,8 +188,6 @@ void FrameBuffer::setRenderTarget(RenderTarget* target, unsigned int index) if (target) { - GP_ASSERT( _renderTargets[index]->getTexture() ); - ++_renderTargetCount; // This FrameBuffer now references the RenderTarget. @@ -183,7 +196,7 @@ void FrameBuffer::setRenderTarget(RenderTarget* target, unsigned int index) // Now set this target as the color attachment corresponding to index. GL_ASSERT( glBindFramebuffer(GL_FRAMEBUFFER, _handle) ); GLenum attachment = GL_COLOR_ATTACHMENT0 + index; - GL_ASSERT( glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GL_TEXTURE_2D, _renderTargets[index]->getTexture()->getHandle(), 0) ); + GL_ASSERT( glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, textureTarget, _renderTargets[index]->getTexture()->getHandle(), 0) ); GLenum fboStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (fboStatus != GL_FRAMEBUFFER_COMPLETE) { @@ -271,22 +284,23 @@ FrameBuffer* FrameBuffer::bind() void FrameBuffer::getScreenshot(Image* image) { - GP_ASSERT(image); - GP_ASSERT(image->getFormat() == Image::RGBA); + GP_ASSERT( image ); - unsigned int width = _currentFrameBuffer->getWidth(); - unsigned int height = _currentFrameBuffer->getHeight(); + unsigned int width = _currentFrameBuffer->getWidth(); + unsigned int height = _currentFrameBuffer->getHeight(); - if (image->getWidth() == width && image->getHeight() == height) - GL_ASSERT( glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, image->getData()) ); + if (image->getWidth() == width && image->getHeight() == height) { + GLenum format = image->getFormat() == Image::RGB ? GL_RGB : GL_RGBA; + GL_ASSERT( glReadPixels(0, 0, width, height, format, GL_UNSIGNED_BYTE, image->getData()) ); + } } -Image* FrameBuffer::createScreenshot() +Image* FrameBuffer::createScreenshot(Image::Format format) { - Image* screenshot = Image::create(_currentFrameBuffer->getWidth(), _currentFrameBuffer->getHeight(), Image::RGBA, NULL); - getScreenshot(screenshot); + Image* screenshot = Image::create(_currentFrameBuffer->getWidth(), _currentFrameBuffer->getHeight(), format, NULL); + getScreenshot(screenshot); - return screenshot; + return screenshot; } FrameBuffer* FrameBuffer::bindDefault() diff --git a/gameplay/src/FrameBuffer.h b/gameplay/src/FrameBuffer.h index d463ed38d2..79ff31686b 100644 --- a/gameplay/src/FrameBuffer.h +++ b/gameplay/src/FrameBuffer.h @@ -101,11 +101,20 @@ class FrameBuffer : public Ref /** * Set a RenderTarget on this FrameBuffer's color attachment at the specified index. * - * @param target The RenderTarget to set. + * @param target The 2D RenderTarget to set. * @param index The index of the color attachment to set. */ void setRenderTarget(RenderTarget* target, unsigned int index = 0); + /** + * Set a RenderTarget on this FrameBuffer's color attachment at the specified index. + * + * @param target The Cubemap RenderTarget to set. + * @param face The face of the cubemap to target. + * @param index The index of the color attachment to set. + */ + void setRenderTarget(RenderTarget* target, Texture::CubeFace face, unsigned int index = 0); + /** * Get the RenderTarget attached to the FrameBuffer's color attachment at the specified index. * @@ -152,22 +161,22 @@ class FrameBuffer : public Ref */ FrameBuffer* bind(); - /** - * Records a screenshot of what is stored on the current FrameBuffer. - * - * @return A screenshot of the current framebuffer's content. - */ - static Image* createScreenshot(); + /** + * Records a screenshot of what is stored on the current FrameBuffer. + * + * @param format The format the Image should be in. + * @return A screenshot of the current framebuffer's content. + */ + static Image* createScreenshot(Image::Format format = Image::RGBA); - /** - * Records a screenshot of what is stored on the current FrameBuffer to an Image. - * - * The Image must be the same size as the FrameBuffer, otherwise the operation will fail. - * The Image must be format RGBA. - * - * @param image The Image to write the current framebuffer's content to. - */ - static void getScreenshot(Image* image); + /** + * Records a screenshot of what is stored on the current FrameBuffer to an Image. + * + * The Image must be the same size as the FrameBuffer, otherwise the operation will fail. + * + * @param image The Image to write the current framebuffer's content to. + */ + static void getScreenshot(Image* image); /** * Binds the default FrameBuffer for rendering to the display. @@ -200,6 +209,8 @@ class FrameBuffer : public Ref */ FrameBuffer& operator=(const FrameBuffer&); + void setRenderTarget(RenderTarget* target, unsigned int index, GLenum textureTarget); + static void initialize(); static void finalize(); diff --git a/gameplay/src/Game.cpp b/gameplay/src/Game.cpp index 964bcf03e5..a7c24d6dcd 100644 --- a/gameplay/src/Game.cpp +++ b/gameplay/src/Game.cpp @@ -7,6 +7,7 @@ #include "SceneLoader.h" #include "ControlFactory.h" #include "Theme.h" +#include "Form.h" /** @script{ignore} */ GLenum __gl_error_code = GL_NO_ERROR; @@ -20,21 +21,61 @@ static Game* __gameInstance = NULL; double Game::_pausedTimeLast = 0.0; double Game::_pausedTimeTotal = 0.0; +/** +* @script{ignore} +*/ +class GameScriptTarget : public ScriptTarget +{ + friend class Game; + + GP_SCRIPT_EVENTS_START(); + GP_SCRIPT_EVENT(initialize, ""); + GP_SCRIPT_EVENT(finalize, ""); + GP_SCRIPT_EVENT(update, "f"); + GP_SCRIPT_EVENT(render, "f"); + GP_SCRIPT_EVENT(resizeEvent, "ii"); + GP_SCRIPT_EVENT(keyEvent, "[Keyboard::KeyEvent]i"); + GP_SCRIPT_EVENT(touchEvent, "[Touch::TouchEvent]iiui"); + GP_SCRIPT_EVENT(mouseEvent, "[Mouse::MouseEvent]iii"); + GP_SCRIPT_EVENT(gestureSwipeEvent, "iii"); + GP_SCRIPT_EVENT(gesturePinchEvent, "iif"); + GP_SCRIPT_EVENT(gestureTapEvent, "ii"); + GP_SCRIPT_EVENT(gestureLongTapevent, "iif"); + GP_SCRIPT_EVENT(gestureDragEvent, "ii"); + GP_SCRIPT_EVENT(gestureDropEvent, "ii"); + GP_SCRIPT_EVENT(gamepadEvent, "[Gamepad::GamepadEvent]"); + GP_SCRIPT_EVENTS_END(); + +public: + + GameScriptTarget() + { + GP_REGISTER_SCRIPT_EVENTS(); + } + + const char* getTypeName() const + { + return "GameScriptTarget"; + } +}; + Game::Game() : _initialized(false), _state(UNINITIALIZED), _pausedCount(0), _frameLastFPS(0), _frameCount(0), _frameRate(0), _width(0), _height(0), _clearDepth(1.0f), _clearStencil(0), _properties(NULL), _animationController(NULL), _audioController(NULL), _physicsController(NULL), _aiController(NULL), _audioListener(NULL), - _timeEvents(NULL), _scriptController(NULL), _scriptListeners(NULL) + _timeEvents(NULL), _scriptController(NULL), _scriptTarget(NULL) { GP_ASSERT(__gameInstance == NULL); + __gameInstance = this; _timeEvents = new std::priority_queue, std::less >(); } Game::~Game() { + SAFE_DELETE(_scriptTarget); SAFE_DELETE(_scriptController); // Do not call any virtual functions from the destructor. @@ -44,6 +85,8 @@ Game::~Game() Ref::printLeaks(); printMemoryLeaks(); #endif + + __gameInstance = NULL; } Game* Game::getInstance() @@ -52,6 +95,26 @@ Game* Game::getInstance() return __gameInstance; } +void Game::initialize() +{ + // stub +} + +void Game::finalize() +{ + // stub +} + +void Game::update(float elapsedTime) +{ + // stub +} + +void Game::render(float elapsedTime) +{ + // stub +} + double Game::getAbsoluteTime() { return Platform::getAbsoluteTime(); @@ -119,29 +182,42 @@ bool Game::startup() // Load any gamepads, ui or physical. loadGamepads(); - // Set the script callback functions. + // Set script handler if (_properties) { - Properties* scripts = _properties->getNamespace("scripts", true); - if (scripts) + const char* scriptPath = _properties->getString("script"); + if (scriptPath) { - const char* callback; - while ((callback = scripts->getNextProperty()) != NULL) + _scriptTarget = new GameScriptTarget(); + _scriptTarget->addScript(scriptPath); + } + else + { + // Use the older scripts namespace for loading individual global script callback functions. + Properties* sns = _properties->getNamespace("scripts", true); + if (sns) { - std::string url = scripts->getString(); - std::string file; - std::string id; - splitURL(url, &file, &id); - - if (file.size() <= 0 || id.size() <= 0) - { - GP_ERROR("Invalid %s script callback function '%s'.", callback, url.c_str()); - } - else - { - _scriptController->loadScript(file.c_str()); - _scriptController->registerCallback(callback, id.c_str()); - } + _scriptTarget = new GameScriptTarget(); + + // Define a macro to simplify defining the following script callback registrations + #define GP_REG_GAME_SCRIPT_CB(e) if (sns->exists(#e)) _scriptTarget->addScriptCallback(GP_GET_SCRIPT_EVENT(GameScriptTarget, e), sns->getString(#e)) + + // Register all supported script callbacks if they are defined + GP_REG_GAME_SCRIPT_CB(initialize); + GP_REG_GAME_SCRIPT_CB(finalize); + GP_REG_GAME_SCRIPT_CB(update); + GP_REG_GAME_SCRIPT_CB(render); + GP_REG_GAME_SCRIPT_CB(resizeEvent); + GP_REG_GAME_SCRIPT_CB(keyEvent); + GP_REG_GAME_SCRIPT_CB(touchEvent); + GP_REG_GAME_SCRIPT_CB(mouseEvent); + GP_REG_GAME_SCRIPT_CB(gestureSwipeEvent); + GP_REG_GAME_SCRIPT_CB(gesturePinchEvent); + GP_REG_GAME_SCRIPT_CB(gestureTapEvent); + GP_REG_GAME_SCRIPT_CB(gestureLongTapevent); + GP_REG_GAME_SCRIPT_CB(gestureDragEvent); + GP_REG_GAME_SCRIPT_CB(gestureDropEvent); + GP_REG_GAME_SCRIPT_CB(gamepadEvent); } } } @@ -166,16 +242,14 @@ void Game::shutdown() // Call user finalize finalize(); + // Call script finalize + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, finalize)); + + // Destroy script target so no more script events are fired + SAFE_DELETE(_scriptTarget); + // Shutdown scripting system first so that any objects allocated in script are released before our subsystems are released - _scriptController->finalizeGame(); - if (_scriptListeners) - { - for (size_t i = 0; i < _scriptListeners->size(); i++) - { - SAFE_DELETE((*_scriptListeners)[i]); - } - SAFE_DELETE(_scriptListeners); - } _scriptController->finalize(); unsigned int gamepadCount = Gamepad::getGamepadCount(); @@ -286,7 +360,8 @@ void Game::frame() { // Perform lazy first time initialization initialize(); - _scriptController->initializeGame(); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, initialize)); _initialized = true; // Fire first game resize event @@ -329,7 +404,8 @@ void Game::frame() Form::updateInternal(elapsedTime); // Run script update. - _scriptController->update(elapsedTime); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, update), elapsedTime); // Audio Rendering. _audioController->update(elapsedTime); @@ -338,7 +414,8 @@ void Game::frame() render(elapsedTime); // Run script render. - _scriptController->render(elapsedTime); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, render), elapsedTime); // Update FPS. ++_frameCount; @@ -361,13 +438,15 @@ void Game::frame() Form::updateInternal(0); // Script update. - _scriptController->update(0); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, update), 0); // Graphics Rendering. render(0); // Script render. - _scriptController->render(0); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, render), 0); } } @@ -395,7 +474,8 @@ void Game::updateOnce() _physicsController->update(elapsedTime); _aiController->update(elapsedTime); _audioController->update(elapsedTime); - _scriptController->update(elapsedTime); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, update), elapsedTime); } void Game::setViewport(const Rectangle& viewport) @@ -463,19 +543,23 @@ AudioListener* Game::getAudioListener() void Game::keyEvent(Keyboard::KeyEvent evt, int key) { + // stub } void Game::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) { + // stub } bool Game::mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta) { + // stub return false; } void Game::resizeEvent(unsigned int width, unsigned int height) { + // stub } bool Game::isGestureSupported(Gesture::GestureEvent evt) @@ -500,30 +584,124 @@ bool Game::isGestureRegistered(Gesture::GestureEvent evt) void Game::gestureSwipeEvent(int x, int y, int direction) { + // stub } void Game::gesturePinchEvent(int x, int y, float scale) { + // stub } void Game::gestureTapEvent(int x, int y) { + // stub } void Game::gestureLongTapEvent(int x, int y, float duration) { + // stub } void Game::gestureDragEvent(int x, int y) { + // stub } void Game::gestureDropEvent(int x, int y) { + // stub } void Game::gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad) { + // stub +} + +void Game::keyEventInternal(Keyboard::KeyEvent evt, int key) +{ + keyEvent(evt, key); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, keyEvent), evt, key); +} + +void Game::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) +{ + touchEvent(evt, x, y, contactIndex); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, touchEvent), evt, x, y, contactIndex); +} + +bool Game::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta) +{ + if (mouseEvent(evt, x, y, wheelDelta)) + return true; + + if (_scriptTarget) + return _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, mouseEvent), evt, x, y, wheelDelta); + + return false; +} + +void Game::resizeEventInternal(unsigned int width, unsigned int height) +{ + // Update the width and height of the game + if (_width != width || _height != height) + { + _width = width; + _height = height; + resizeEvent(width, height); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, resizeEvent), width, height); + } +} + +void Game::gestureSwipeEventInternal(int x, int y, int direction) +{ + gestureSwipeEvent(x, y, direction); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureSwipeEvent), x, y, direction); +} + +void Game::gesturePinchEventInternal(int x, int y, float scale) +{ + gesturePinchEvent(x, y, scale); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gesturePinchEvent), x, y, scale); +} + +void Game::gestureTapEventInternal(int x, int y) +{ + gestureTapEvent(x, y); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureTapEvent), x, y); +} + +void Game::gestureLongTapEventInternal(int x, int y, float duration) +{ + gestureLongTapEvent(x, y, duration); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureLongTapevent), x, y, duration); +} + +void Game::gestureDragEventInternal(int x, int y) +{ + gestureDragEvent(x, y); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureDragEvent), x, y); +} + +void Game::gestureDropEventInternal(int x, int y) +{ + gestureDropEvent(x, y); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureDropEvent), x, y); +} + +void Game::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad) +{ + gamepadEvent(evt, gamepad); + if (_scriptTarget) + _scriptTarget->fireScriptEvent(GP_GET_SCRIPT_EVENT(GameScriptTarget, gamepadEvent), evt, gamepad); } void Game::getArguments(int* argc, char*** argv) const @@ -540,12 +718,13 @@ void Game::schedule(float timeOffset, TimeListener* timeListener, void* cookie) void Game::schedule(float timeOffset, const char* function) { - if (!_scriptListeners) - _scriptListeners = new std::vector(); + getScriptController()->schedule(timeOffset, function); +} - ScriptListener* listener = new ScriptListener(function); - _scriptListeners->push_back(listener); - schedule(timeOffset, listener, NULL); +void Game::clearSchedule() +{ + SAFE_DELETE(_timeEvents); + _timeEvents = new std::priority_queue, std::less >(); } void Game::fireTimeEvents(double frameTime) @@ -565,16 +744,6 @@ void Game::fireTimeEvents(double frameTime) } } -Game::ScriptListener::ScriptListener(const char* url) -{ - function = Game::getInstance()->getScriptController()->loadUrl(url); -} - -void Game::ScriptListener::timeEvent(long timeDiff, void* cookie) -{ - Game::getInstance()->getScriptController()->executeFunction(function.c_str(), "l", timeDiff); -} - Game::TimeEvent::TimeEvent(double time, TimeListener* timeListener, void* cookie) : time(time), listener(timeListener), cookie(cookie) { diff --git a/gameplay/src/Game.h b/gameplay/src/Game.h index 167ffc9c06..86b754643d 100644 --- a/gameplay/src/Game.h +++ b/gameplay/src/Game.h @@ -31,6 +31,7 @@ class ScriptController; class Game { friend class Platform; + friend class Gamepad; friend class ShutdownListener; public: @@ -59,6 +60,11 @@ class Game CLEAR_COLOR_DEPTH_STENCIL = CLEAR_COLOR | CLEAR_DEPTH | CLEAR_STENCIL }; + /** + * Constructor. + */ + Game(); + /** * Destructor. */ @@ -590,14 +596,20 @@ class Game * Schedules a time event to be sent to the given TimeListener a given number of game milliseconds from now. * Game time stops while the game is paused. A time offset of zero will fire the time event in the next frame. * - * Note: the given Lua function must take a single floating point number, which is the difference between the - * current game time and the target time (see TimeListener::timeEvent). + * The given script function must take a single floating point number, which is the difference between the + * current game time and the target time (see TimeListener::timeEvent). The function will be executed + * in the context of the script envionrment that the schedule function was called from. * * @param timeOffset The number of game milliseconds in the future to schedule the event to be fired. - * @param function The Lua script function that will receive the event. + * @param function The script function that will receive the event. */ void schedule(float timeOffset, const char* function); + /** + * Clears all scheduled time events. + */ + void clearSchedule(); + /** * Opens an URL in an external browser, if available. * @@ -609,20 +621,15 @@ class Game protected: - /** - * Constructor. - */ - Game(); - /** * Initialize callback that is called just before the first frame when the game starts. */ - virtual void initialize() = 0; + virtual void initialize(); /** * Finalize callback that is called when the game on exits. */ - virtual void finalize() = 0; + virtual void finalize(); /** * Update callback for handling update routines. @@ -632,7 +639,7 @@ class Game * * @param elapsedTime The elapsed game time. */ - virtual void update(float elapsedTime) = 0; + virtual void update(float elapsedTime); /** * Render callback for handling rendering routines. @@ -642,7 +649,7 @@ class Game * * @param elapsedTime The elapsed game time. */ - virtual void render(float elapsedTime) = 0; + virtual void render(float elapsedTime); /** * Renders a single frame once and then swaps it to the display. @@ -654,7 +661,7 @@ class Game /** * 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 calls the given script function, which should take no parameters and return nothing (void). * * This is useful for rendering splash screens. */ @@ -671,25 +678,6 @@ class Game private: - /** - * Allows time listener interaction from Lua scripts. - */ - struct ScriptListener : public TimeListener - { - /** - * Constructor. - */ - ScriptListener(const char* url); - - /** - * @see TimeListener#timeEvent(long, void*) - */ - void timeEvent(long timeDiff, void* cookie); - - /** Holds the name of the Lua script function to call back. */ - std::string function; - }; - struct ShutdownListener : public TimeListener { void timeEvent(long timeDiff, void* cookie); @@ -743,6 +731,18 @@ class Game */ void loadGamepads(); + void keyEventInternal(Keyboard::KeyEvent evt, int key); + void touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex); + bool mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta); + void resizeEventInternal(unsigned int width, unsigned int height); + void gestureSwipeEventInternal(int x, int y, int direction); + void gesturePinchEventInternal(int x, int y, float scale); + void gestureTapEventInternal(int x, int y); + void gestureLongTapEventInternal(int x, int y, float duration); + void gestureDragEventInternal(int x, int y); + void gestureDropEventInternal(int x, int y); + void gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad); + bool _initialized; // If game has initialized yet. State _state; // The game state. unsigned int _pausedCount; // Number of times pause() has been called. @@ -765,7 +765,7 @@ class Game AudioListener* _audioListener; // The audio listener in 3D space. std::priority_queue, std::less >* _timeEvents; // Contains the scheduled time events. ScriptController* _scriptController; // Controls the scripting engine. - std::vector* _scriptListeners; // Lua script listeners. + ScriptTarget* _scriptTarget; // Script target for the game // Note: Do not add STL object member variables on the stack; this will cause false memory leaks to be reported. diff --git a/gameplay/src/Gamepad.cpp b/gameplay/src/Gamepad.cpp index 07d3b7cdce..e8ccd670f4 100644 --- a/gameplay/src/Gamepad.cpp +++ b/gameplay/src/Gamepad.cpp @@ -12,15 +12,13 @@ namespace gameplay static std::vector __gamepads; Gamepad::Gamepad(const char* formPath) - : _handle((GamepadHandle)INT_MAX), _buttonCount(0), _joystickCount(0), _triggerCount(0), _vendorId(0), _productId(0), - _form(NULL), _buttons(0) + : _handle((GamepadHandle)INT_MAX), _buttonCount(0), _joystickCount(0), _triggerCount(0), _form(NULL), _buttons(0) { GP_ASSERT(formPath); _form = Form::create(formPath); GP_ASSERT(_form); _form->setConsumeInputEvents(false); - _vendorString = "None"; - _productString = "Virtual"; + _name = "Virtual"; for (int i = 0; i < 2; ++i) { @@ -36,19 +34,13 @@ Gamepad::Gamepad(const char* formPath) bindGamepadControls(_form); } -Gamepad::Gamepad(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, - unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString) +Gamepad::Gamepad(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, const char* name) : _handle(handle), _buttonCount(buttonCount), _joystickCount(joystickCount), _triggerCount(triggerCount), - _vendorId(vendorId), _productId(productId), _form(NULL), _buttons(0) + _form(NULL), _buttons(0) { - if (vendorString) - { - _vendorString = vendorString; - } - - if (productString) + if (name) { - _productString = productString; + _name = name; } for (int i = 0; i < 2; ++i) @@ -59,20 +51,15 @@ Gamepad::Gamepad(GamepadHandle handle, unsigned int buttonCount, unsigned int jo Gamepad::~Gamepad() { - if (_form) - { - SAFE_RELEASE(_form); - } + SAFE_RELEASE(_form); } -Gamepad* Gamepad::add(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, - unsigned int vendorId, unsigned int productId, - const char* vendorString, const char* productString) +Gamepad* Gamepad::add(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, const char* name) { - Gamepad* gamepad = new Gamepad(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString); + Gamepad* gamepad = new Gamepad(handle, buttonCount, joystickCount, triggerCount, name); __gamepads.push_back(gamepad); - Game::getInstance()->gamepadEvent(CONNECTED_EVENT, gamepad); + Game::getInstance()->gamepadEventInternal(CONNECTED_EVENT, gamepad); return gamepad; } @@ -81,7 +68,7 @@ Gamepad* Gamepad::add(const char* formPath) Gamepad* gamepad = new Gamepad(formPath); __gamepads.push_back(gamepad); - Game::getInstance()->gamepadEvent(CONNECTED_EVENT, gamepad); + Game::getInstance()->gamepadEventInternal(CONNECTED_EVENT, gamepad); return gamepad; } @@ -94,7 +81,7 @@ void Gamepad::remove(GamepadHandle handle) if (gamepad->_handle == handle) { it = __gamepads.erase(it); - Game::getInstance()->gamepadEvent(DISCONNECTED_EVENT, gamepad); + Game::getInstance()->gamepadEventInternal(DISCONNECTED_EVENT, gamepad); SAFE_DELETE(gamepad); } else @@ -113,7 +100,7 @@ void Gamepad::remove(Gamepad* gamepad) if (g == gamepad) { it = __gamepads.erase(it); - Game::getInstance()->gamepadEvent(DISCONNECTED_EVENT, g); + Game::getInstance()->gamepadEventInternal(DISCONNECTED_EVENT, g); SAFE_DELETE(gamepad); } else @@ -137,14 +124,14 @@ void Gamepad::bindGamepadControls(Container* container) { bindGamepadControls((Container*) control); } - else if (std::strcmp("joystick", control->getType()) == 0) + else if (std::strcmp("JoystickControl", control->getTypeName()) == 0) { JoystickControl* joystick = (JoystickControl*)control; joystick->setConsumeInputEvents(true); _uiJoysticks[joystick->getIndex()] = joystick; _joystickCount++; } - else if (std::strcmp("button", control->getType()) == 0) + else if (std::strcmp("Button", control->getTypeName()) == 0) { Button* button = (Button*)control; button->setConsumeInputEvents(true); @@ -211,22 +198,10 @@ Gamepad::ButtonMapping Gamepad::getButtonMappingFromString(const char* string) return BUTTON_A; else if (strcmp(string, "B") == 0 || strcmp(string, "BUTTON_B") == 0) return BUTTON_B; - else if (strcmp(string, "C") == 0 || strcmp(string, "BUTTON_C") == 0) - return BUTTON_C; else if (strcmp(string, "X") == 0 || strcmp(string, "BUTTON_X") == 0) return BUTTON_X; else if (strcmp(string, "Y") == 0 || strcmp(string, "BUTTON_Y") == 0) return BUTTON_Y; - else if (strcmp(string, "Z") == 0 || strcmp(string, "BUTTON_Z") == 0) - return BUTTON_Z; - else if (strcmp(string, "MENU1") == 0 || strcmp(string, "BUTTON_MENU1") == 0) - return BUTTON_MENU1; - else if (strcmp(string, "MENU2") == 0 || strcmp(string, "BUTTON_MENU2") == 0) - return BUTTON_MENU2; - else if (strcmp(string, "MENU3") == 0 || strcmp(string, "BUTTON_MENU3") == 0) - return BUTTON_MENU3; - else if (strcmp(string, "MENU4") == 0 || strcmp(string, "BUTTON_MENU4") == 0) - return BUTTON_MENU4; else if (strcmp(string, "L1") == 0 || strcmp(string, "BUTTON_L1") == 0) return BUTTON_L1; else if (strcmp(string, "L2") == 0 || strcmp(string, "BUTTON_L2") == 0) @@ -247,29 +222,20 @@ Gamepad::ButtonMapping Gamepad::getButtonMappingFromString(const char* string) return BUTTON_LEFT; else if (strcmp(string, "RIGHT") == 0 || strcmp(string, "BUTTON_RIGHT") == 0) return BUTTON_RIGHT; + else if (strcmp(string, "MENU1") == 0 || strcmp(string, "BUTTON_MENU1") == 0) + return BUTTON_MENU1; + else if (strcmp(string, "MENU2") == 0 || strcmp(string, "BUTTON_MENU2") == 0) + return BUTTON_MENU2; + else if (strcmp(string, "MENU3") == 0 || strcmp(string, "BUTTON_MENU3") == 0) + return BUTTON_MENU3; - GP_WARN("Unknown GamepadButton string."); + GP_WARN("Unknown string for ButtonMapping."); return BUTTON_A; } -const unsigned int Gamepad::getVendorId() const -{ - return _vendorId; -} - -const unsigned int Gamepad::getProductId() const -{ - return _productId; -} - -const char* Gamepad::getVendorString() const -{ - return _vendorString.c_str(); -} - -const char* Gamepad::getProductString() const +const char* Gamepad::getName() const { - return _productString.c_str(); + return _name.c_str(); } void Gamepad::update(float elapsedTime) @@ -365,7 +331,7 @@ float Gamepad::getTriggerValue(unsigned int triggerId) const if (_form) { - // Triggers are currently not available for virtual gamepads. + // Triggers are not part of the virtual gamepad defintion return 0.0f; } else @@ -389,7 +355,7 @@ void Gamepad::setButtons(unsigned int buttons) if (buttons != _buttons) { _buttons = buttons; - Platform::gamepadEventInternal(BUTTON_EVENT, this); + Form::gamepadButtonEventInternal(this); } } @@ -398,7 +364,7 @@ void Gamepad::setJoystickValue(unsigned int index, float x, float y) if (_joysticks[index].x != x || _joysticks[index].y != y) { _joysticks[index].set(x, y); - Platform::gamepadEventInternal(JOYSTICK_EVENT, this, index); + Form::gamepadJoystickEventInternal(this, index); } } @@ -407,7 +373,7 @@ void Gamepad::setTriggerValue(unsigned int index, float value) if (_triggers[index] != value) { _triggers[index] = value; - Platform::gamepadEventInternal(TRIGGER_EVENT, this, index); + Form::gamepadTriggerEventInternal(this, index); } } diff --git a/gameplay/src/Gamepad.h b/gameplay/src/Gamepad.h index 4428cb5428..cf0df5870a 100644 --- a/gameplay/src/Gamepad.h +++ b/gameplay/src/Gamepad.h @@ -32,27 +32,18 @@ class Gamepad enum GamepadEvent { CONNECTED_EVENT, - DISCONNECTED_EVENT, - BUTTON_EVENT, - JOYSTICK_EVENT, - TRIGGER_EVENT + DISCONNECTED_EVENT }; /** * Gamepad buttons. */ enum ButtonMapping - { + { BUTTON_A, BUTTON_B, - BUTTON_C, BUTTON_X, BUTTON_Y, - BUTTON_Z, - BUTTON_MENU1, - BUTTON_MENU2, - BUTTON_MENU3, - BUTTON_MENU4, BUTTON_L1, BUTTON_L2, BUTTON_L3, @@ -62,7 +53,10 @@ class Gamepad BUTTON_UP, BUTTON_DOWN, BUTTON_LEFT, - BUTTON_RIGHT + BUTTON_RIGHT, + BUTTON_MENU1, + BUTTON_MENU2, + BUTTON_MENU3 }; /** @@ -113,33 +107,12 @@ class Gamepad */ float getTriggerValue(unsigned int triggerId) const; - /** - * Get this gamepad's vendor ID. - * - * @return This gamepad's vendor ID. - */ - const unsigned int getVendorId() const; - - /** - * Get this gamepad's product ID. - * - * @return This gamepad's product ID. - */ - const unsigned int getProductId() const; - - /** - * Get this gamepad's vendor name. - * - * @return This gamepad's vendor name. - */ - const char* getVendorString() const; - /** - * Get this gamepad's product name. + * Get this gamepad's device/product name. * - * @return This gamepad's product name. + * @return This gamepad's device/product name. */ - const char* getProductString() const; + const char* getName() const; /** * Returns whether the gamepad is currently represented with a UI form or not. @@ -187,14 +160,9 @@ class Gamepad * @param buttonCount the number of buttons on the gamepad. * @param joystickCount the number of joysticks on the gamepad. * @param triggerCount the number of triggers on the gamepad. - * @param vendorId The vendor id - * @param productId The product id - * @param vendorString The vendor string/name. - * @param productString The product string/name. + * @param name The product/device name. */ - Gamepad(GamepadHandle handle, - unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, - unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString); + Gamepad(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, const char* name); /** * Copy constructor. @@ -208,9 +176,7 @@ class Gamepad static void updateInternal(float elapsedTime); - static Gamepad* add(GamepadHandle handle, - unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, - unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString); + static Gamepad* add(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, const char* name); static Gamepad* add(const char* formPath); @@ -220,7 +186,7 @@ class Gamepad static unsigned int getGamepadCount(); - static Gamepad* getGamepad(unsigned int index, bool preferPhysical = true); + static Gamepad* getGamepad(unsigned int index, bool preferPhysical); static Gamepad* getGamepad(GamepadHandle handle); @@ -234,14 +200,11 @@ class Gamepad void bindGamepadControls(Container* container); - GamepadHandle _handle; // The handle of the Gamepad. - unsigned int _buttonCount; // Number of buttons. - unsigned int _joystickCount; // Number of joysticks. - unsigned int _triggerCount; // Number of triggers. - unsigned int _vendorId; - unsigned int _productId; - std::string _vendorString; - std::string _productString; + GamepadHandle _handle; + unsigned int _buttonCount; + unsigned int _joystickCount; + unsigned int _triggerCount; + std::string _name; Form* _form; JoystickControl* _uiJoysticks[2]; Button* _uiButtons[20]; diff --git a/gameplay/src/Image.cpp b/gameplay/src/Image.cpp index 3c5685fa05..5e8af96104 100644 --- a/gameplay/src/Image.cpp +++ b/gameplay/src/Image.cpp @@ -19,7 +19,7 @@ Image* Image::create(const char* path) GP_ASSERT(path); // Open the file. - std::auto_ptr stream(FileSystem::open(path)); + std::unique_ptr stream(FileSystem::open(path)); if (stream.get() == NULL || !stream->canRead()) { GP_ERROR("Failed to open image file '%s'.", path); @@ -66,7 +66,7 @@ Image* Image::create(const char* path) png_set_sig_bytes(png, 8); // Read the entire image into memory. - png_read_png(png, info, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND, NULL); + png_read_png(png, info, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_GRAY_TO_RGB, NULL); Image* image = new Image(); image->_width = png_get_image_width(png, info); @@ -109,32 +109,32 @@ Image* Image::create(const char* path) Image* Image::create(unsigned int width, unsigned int height, Image::Format format, unsigned char* data) { - GP_ASSERT(width > 0 && height > 0); - GP_ASSERT(format >= RGB && format <= RGBA); - - unsigned int pixelSize = 0; - switch(format) - { - case Image::RGB: - pixelSize = 3; - break; - case Image::RGBA: - pixelSize = 4; - break; - } - - Image* image = new Image(); - - unsigned int dataSize = width * height * pixelSize; - - image->_width = width; - image->_height = height; - image->_format = format; - image->_data = new unsigned char[dataSize]; - if (data) - memcpy(image->_data, data, dataSize); - - return image; + GP_ASSERT(width > 0 && height > 0); + GP_ASSERT(format >= RGB && format <= RGBA); + + unsigned int pixelSize = 0; + switch(format) + { + case Image::RGB: + pixelSize = 3; + break; + case Image::RGBA: + pixelSize = 4; + break; + } + + Image* image = new Image(); + + unsigned int dataSize = width * height * pixelSize; + + image->_width = width; + image->_height = height; + image->_format = format; + image->_data = new unsigned char[dataSize]; + if (data) + memcpy(image->_data, data, dataSize); + + return image; } Image::Image() : _data(NULL), _format(RGB), _width(0), _height(0) diff --git a/gameplay/src/Image.h b/gameplay/src/Image.h index dc8b7452dd..13e23c0484 100644 --- a/gameplay/src/Image.h +++ b/gameplay/src/Image.h @@ -33,17 +33,17 @@ class Image : public Ref */ static Image* create(const char* path); - /** + /** * Creates an image from the data provided * * @param width The width of the image data. - * @param height The height of the image data. - * @param format The format of the image data. - * @param data The image data. If NULL, the data will be allocated. + * @param height The height of the image data. + * @param format The format of the image data. + * @param data The image data. If NULL, the data will be allocated. * @return The newly created image. * @script{create} */ - static Image* create(unsigned int width, unsigned int height, Format format, unsigned char* data = NULL); + static Image* create(unsigned int width, unsigned int height, Format format, unsigned char* data = NULL); /** * Gets the image's raw pixel data. diff --git a/gameplay/src/ImageControl.cpp b/gameplay/src/ImageControl.cpp index 0baab98030..404baf8f5d 100644 --- a/gameplay/src/ImageControl.cpp +++ b/gameplay/src/ImageControl.cpp @@ -58,6 +58,11 @@ void ImageControl::initialize(const char* typeName, Theme::Style* style, Propert } } +const char* ImageControl::getTypeName() const +{ + return "ImageControl"; +} + void ImageControl::setImage(const char* path) { SAFE_DELETE(_batch); @@ -106,11 +111,6 @@ const Rectangle& ImageControl::getRegionDst() const return _dstRegion; } -const char* ImageControl::getType() const -{ - return "image"; -} - unsigned int ImageControl::drawImages(Form* form, const Rectangle& clip) { if (!_batch) diff --git a/gameplay/src/ImageControl.h b/gameplay/src/ImageControl.h index 343dbd00d9..81856fa599 100644 --- a/gameplay/src/ImageControl.h +++ b/gameplay/src/ImageControl.h @@ -35,6 +35,16 @@ class ImageControl : public Control */ static ImageControl* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "ImageControl" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Set the path of the image for this ImageControl to display. * @@ -94,8 +104,6 @@ class ImageControl : public Control */ const Rectangle& getRegionDst() const; - const char* getType() const; - protected: ImageControl(); diff --git a/gameplay/src/Joint.cpp b/gameplay/src/Joint.cpp index 7bbdb663ae..d8b1ed4e9f 100644 --- a/gameplay/src/Joint.cpp +++ b/gameplay/src/Joint.cpp @@ -1,6 +1,7 @@ #include "Base.h" #include "Joint.h" #include "MeshSkin.h" +#include "Model.h" namespace gameplay { diff --git a/gameplay/src/JoystickControl.cpp b/gameplay/src/JoystickControl.cpp index 6022c879e0..86602f9f62 100644 --- a/gameplay/src/JoystickControl.cpp +++ b/gameplay/src/JoystickControl.cpp @@ -4,16 +4,21 @@ namespace gameplay { -JoystickControl::JoystickControl() : _radius(1.0f), _relative(true), _innerSize(NULL), _outerSize(NULL), _index(0) +JoystickControl::JoystickControl() : _radiusPixels(1.0f), _relative(true), _innerSizePixels(NULL), _outerSizePixels(NULL), _index(0), + _innerRegionCoord(NULL), _outerRegionCoord(NULL), _innerRegionCoordBoundsBits(0), _outerRegionCoordBoundsBits(0), _radiusCoord(_radiusPixels) { } JoystickControl::~JoystickControl() { - if (_innerSize) - SAFE_DELETE(_innerSize); - if (_outerSize) - SAFE_DELETE(_outerSize); + if (_innerSizePixels) + SAFE_DELETE(_innerSizePixels); + if (_outerSizePixels) + SAFE_DELETE(_outerSizePixels); + if(_innerRegionCoord) + SAFE_DELETE_ARRAY(_innerRegionCoord); + if(_outerRegionCoord) + SAFE_DELETE_ARRAY(_outerRegionCoord); } JoystickControl* JoystickControl::create(const char* id, Theme::Style* style) @@ -31,35 +36,76 @@ Control* JoystickControl::create(Theme::Style* style, Properties* properties) return joystickControl; } +const char* JoystickControl::getTypeName() const +{ + return "JoystickControl"; +} + const Vector2& JoystickControl::getValue() const { return _value; } -void JoystickControl::setInnerRegionSize(const Vector2& size) +void JoystickControl::setInnerRegionSize(const Vector2& size, bool isWidthPercentage, bool isHeightPercentage) { - if (_innerSize) - _innerSize->set(size); + if (_innerSizePixels) + { + if(!_innerRegionCoord) + { + _innerRegionCoord = new Vector2(); + } + + setRegion(size, *_innerRegionCoord, _innerRegionCoordBoundsBits, isWidthPercentage, isHeightPercentage); + updateAbsoluteSizes(); + } } -const Vector2& JoystickControl::getInnerRegionSize() const +const Vector2& JoystickControl::getInnerRegionSize(bool* isWidthPercentage, bool* isHeightPercentage) const { - if (_innerSize) - return *_innerSize; + if(isWidthPercentage) + { + *isWidthPercentage = _innerSizePixels && (_innerRegionCoord && _innerRegionCoordBoundsBits & BOUNDS_WIDTH_PERCENTAGE_BIT || Control::isXPercentage()); + } + + if(isHeightPercentage) + { + *isHeightPercentage = _innerSizePixels && (_innerRegionCoord && _innerRegionCoordBoundsBits & BOUNDS_HEIGHT_PERCENTAGE_BIT || Control::isYPercentage()); + } + + if (_innerSizePixels) + return *_innerSizePixels; else return Vector2::zero(); } -void JoystickControl::setOuterRegionSize(const Vector2& size) +void JoystickControl::setOuterRegionSize(const Vector2& size, bool isWidthPercentage, bool isHeightPercentage) { - if (_outerSize) - _outerSize->set(size); + if (_outerSizePixels) + { + if(!_outerRegionCoord) + { + _outerRegionCoord = new Vector2(); + } + + setRegion(size, *_outerRegionCoord, _outerRegionCoordBoundsBits, isWidthPercentage, isHeightPercentage); + updateAbsoluteSizes(); + } } -const Vector2& JoystickControl::getOuterRegionSize() const +const Vector2& JoystickControl::getOuterRegionSize(bool* isWidthPercentage, bool* isHeightPercentage) const { - if (_outerSize) - return *_outerSize; + if(isWidthPercentage) + { + *isWidthPercentage = _outerSizePixels && (_outerRegionCoord && _outerRegionCoordBoundsBits & BOUNDS_WIDTH_PERCENTAGE_BIT || Control::isXPercentage()); + } + + if(isHeightPercentage) + { + *isHeightPercentage = _outerSizePixels && (_outerRegionCoord && _outerRegionCoordBoundsBits & BOUNDS_HEIGHT_PERCENTAGE_BIT || Control::isYPercentage()); + } + + if (_outerSizePixels) + return *_outerSizePixels; else return Vector2::zero(); } @@ -79,88 +125,171 @@ unsigned int JoystickControl::getIndex() const return _index; } +void JoystickControl::setBoundsBit(bool set, int& bitSetOut, int bit) +{ + if(set) + { + bitSetOut |= bit; + } + else + { + bitSetOut &= ~bit; + } +} + +void JoystickControl::setRadius(float radius, bool isPercentage) +{ + _radiusCoord = radius; + setBoundsBit(isPercentage, _boundsBits, BOUNDS_RADIUS_PERCENTAGE_BIT); + updateAbsoluteSizes(); +} + +float JoystickControl::getRadius() const +{ + return _radiusCoord; +} + +bool JoystickControl::isRadiusPercentage() const +{ + return _boundsBits & BOUNDS_RADIUS_PERCENTAGE_BIT; +} void JoystickControl::initialize(const char* typeName, Theme::Style* style, Properties* properties) { Control::initialize(typeName, style, properties); - if (!properties) - { - GP_WARN("JoystickControl creation without properties object is unsupported."); - return; - } - - Control::State state = getState(); - - if (!properties->exists("radius")) - { - GP_WARN("JoystickControl: required attribute 'radius' is missing."); - } - else - { - _radius = properties->getFloat("radius"); - if (_radius < 1.0f) - _radius = 1.0f; - } - - if (properties->exists("relative")) - { - setRelative(properties->getBool("relative")); - } - else - { - setRelative(false); - } - - Theme::ThemeImage* inner = getImage("inner", state); - if (inner) - { - _innerSize = new Vector2(); - Vector2 innerSize; - if (properties->getVector2("innerRegion", &innerSize)) - { - _innerSize->set(innerSize.x, innerSize.y); - } - else - { - const Rectangle& rect = inner->getRegion(); - _innerSize->set(rect.width, rect.height); - } - } - - Theme::ThemeImage* outer = getImage("outer", state); - if (outer) - { - _outerSize = new Vector2(); - Vector2 outerSize; - if (properties->getVector2("outerRegion", &outerSize)) - { - _outerSize->set(outerSize.x, outerSize.y); - } - else - { - const Rectangle& rect = outer->getRegion(); - _outerSize->set(rect.width, rect.height); - } - _screenRegion.width = _outerSize->x; - _screenRegion.height = _outerSize->y; - } - else - { - if (inner) - { - const Rectangle& rect = inner->getRegion(); - _screenRegion.width = rect.width; - _screenRegion.height = rect.height; - } - else - { - _screenRegion.width = _radius * 2.0f; - _screenRegion.height = _screenRegion.width; - } - } - - _index = properties->getInt("index"); + if (!properties) + { + GP_WARN("JoystickControl creation without properties object is unsupported."); + return; + } + + const char* radiusId = "radius"; + if (!properties->exists(radiusId)) + { + GP_WARN("JoystickControl: required attribute 'radius' is missing."); + } + else + { + const char* radiusStr = properties->getString(radiusId); + bool isPercentage = false; + _radiusCoord = parseCoord(radiusStr, &isPercentage); + setBoundsBit(isPercentage, _boundsBits, BOUNDS_RADIUS_PERCENTAGE_BIT); + } + + const char* relativeId = "relative"; + if (properties->exists(relativeId)) + { + setRelative(properties->getBool(relativeId)); + } + else + { + setRelative(false); + } + + const char* innerRegionId = "innerRegion"; + if(properties->exists(innerRegionId)) + { + _innerRegionCoord = new Vector2(); + getRegion(*_innerRegionCoord, _innerRegionCoordBoundsBits, properties->getString(innerRegionId)); + } + + const char* outerRegionId = "outerRegion"; + if(properties->exists(outerRegionId)) + { + _outerRegionCoord = new Vector2(); + getRegion(*_outerRegionCoord, _outerRegionCoordBoundsBits, properties->getString(outerRegionId)); + } + + _index = properties->getInt("index"); +} + +void JoystickControl::updateAbsoluteBounds(const Vector2& offset) +{ + Control::updateAbsoluteBounds(offset); + updateAbsoluteSizes(); +} + +void JoystickControl::setRegion(const Vector2& regionSizeIn, Vector2& regionSizeOut, int& regionBoundsBitsOut, bool isWidthPercentage, bool isHeightPercentage) +{ + regionSizeOut = regionSizeIn; + setBoundsBit(isWidthPercentage, regionBoundsBitsOut, BOUNDS_WIDTH_PERCENTAGE_BIT); + setBoundsBit(isHeightPercentage, regionBoundsBitsOut, BOUNDS_HEIGHT_PERCENTAGE_BIT); +} + +void JoystickControl::getRegion(Vector2& regionOut, int& regionBoundsBitsOut, const char* regionPropertyId) +{ + bool isWidthPercent = false; + bool isHeightPercent = false; + parseCoordPair(regionPropertyId, ®ionOut.x, ®ionOut.y, &isWidthPercent, &isHeightPercent); + setBoundsBit(isWidthPercent, regionBoundsBitsOut, BOUNDS_WIDTH_PERCENTAGE_BIT); + setBoundsBit(isHeightPercent, regionBoundsBitsOut, BOUNDS_HEIGHT_PERCENTAGE_BIT); +} + +Vector2 JoystickControl::getPixelSize(const Vector2& region, const int regionBoundsBits) const +{ + Vector2 size; + size.x = regionBoundsBits & BOUNDS_WIDTH_PERCENTAGE_BIT ? _absoluteBounds.width * region.x : region.x; + size.y = regionBoundsBits & BOUNDS_HEIGHT_PERCENTAGE_BIT ? _absoluteBounds.height * region.y: region.y; + return size; +} + +Vector2 JoystickControl::getPixelSize(const Theme::ThemeImage* image) const +{ + Rectangle rect = image->getRegion(); + rect.width = isWidthPercentage() ? (_absoluteBounds.width / rect.width) * rect.width : rect.width; + rect.height = isHeightPercentage() ? (_absoluteBounds.height / rect.height) * rect.height : rect.height; + return Vector2(rect.width, rect.height); +} + +Theme::ThemeImage * JoystickControl::getNonEmptyImage(const char* id, Control::State state) +{ + Theme::ThemeImage* image = getImage(id, state); + return strcmp(image->getId(), id) == 0 ? image : NULL; +} + +void JoystickControl::updateAbsoluteSizes() +{ + const Control::State state = getState(); + + Theme::ThemeImage* innerImage = getNonEmptyImage("inner", state); + const bool innerRegionDefined = _innerRegionCoord || innerImage; + + if(innerRegionDefined) + { + if(!_innerSizePixels) + { + _innerSizePixels = new Vector2(); + } + + *_innerSizePixels = _innerRegionCoord ? getPixelSize(*_innerRegionCoord, _innerRegionCoordBoundsBits) : getPixelSize(innerImage); + _screenRegionPixels.width = _innerSizePixels->x; + _screenRegionPixels.height = _innerSizePixels->y; + } + + Theme::ThemeImage* outerImage = getNonEmptyImage("outer", state); + const bool outerRegionDefined = _outerRegionCoord || outerImage; + + if (outerRegionDefined) + { + if(!_outerSizePixels) + { + _outerSizePixels = new Vector2(); + } + + *_outerSizePixels = _outerRegionCoord ? getPixelSize(*_outerRegionCoord, _outerRegionCoordBoundsBits) : getPixelSize(outerImage); + _screenRegionPixels.width = _outerSizePixels->x > _screenRegionPixels.width ? _outerSizePixels->x : _screenRegionPixels.width; + _screenRegionPixels.height = _outerSizePixels->y > _screenRegionPixels.height ? _outerSizePixels->y : _screenRegionPixels.height; + } + + _radiusPixels = std::max(1.0f, _boundsBits & BOUNDS_RADIUS_PERCENTAGE_BIT ? + std::min(_screenRegionPixels.width, _screenRegionPixels.height) * _radiusCoord : _radiusCoord); + + if (!innerRegionDefined && !outerRegionDefined) + { + _screenRegionPixels.width = _radiusPixels * 2.0f; + _screenRegionPixels.height = _screenRegionPixels.width; + } } void JoystickControl::addListener(Control::Listener* listener, int eventFlags) @@ -189,13 +318,13 @@ bool JoystickControl::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned i // Get the displacement of the touch from the centre. if (!_relative) { - dx = x - _screenRegion.width * 0.5f; - dy = _screenRegion.height * 0.5f - y; + dx = x - _screenRegionPixels.width * 0.5f; + dy = _screenRegionPixels.height * 0.5f - y; } else { - _screenRegion.x = x + _bounds.x - _screenRegion.width * 0.5f; - _screenRegion.y = y + _bounds.y - _screenRegion.height * 0.5f; + _screenRegionPixels.x = x + _bounds.x - _screenRegionPixels.width * 0.5f; + _screenRegionPixels.y = y + _bounds.y - _screenRegionPixels.height * 0.5f; } _displacement.set(dx, dy); @@ -204,17 +333,17 @@ bool JoystickControl::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned i // radius. Vector2 value; - if ((fabs(_displacement.x) > _radius) || (fabs(_displacement.y) > _radius)) + if ((fabs(_displacement.x) > _radiusPixels) || (fabs(_displacement.y) > _radiusPixels)) { _displacement.normalize(); value.set(_displacement); - _displacement.scale(_radius); + _displacement.scale(_radiusPixels); } else { value.set(_displacement); - GP_ASSERT(_radius); - value.scale(1.0f / _radius); + GP_ASSERT(_radiusPixels); + value.scale(1.0f / _radiusPixels); } // Check if the value has changed. Won't this always be the case? @@ -233,23 +362,23 @@ bool JoystickControl::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned i { if (_contactIndex == (int) contactIndex) { - float dx = x - ((_relative) ? _screenRegion.x - _bounds.x : 0.0f) - _screenRegion.width * 0.5f; - float dy = -(y - ((_relative) ? _screenRegion.y - _bounds.y : 0.0f) - _screenRegion.height * 0.5f); + float dx = x - ((_relative) ? _screenRegionPixels.x - _bounds.x : 0.0f) - _screenRegionPixels.width * 0.5f; + float dy = -(y - ((_relative) ? _screenRegionPixels.y - _bounds.y : 0.0f) - _screenRegionPixels.height * 0.5f); _displacement.set(dx, dy); Vector2 value; - if ((fabs(_displacement.x) > _radius) || (fabs(_displacement.y) > _radius)) + if ((fabs(_displacement.x) > _radiusPixels) || (fabs(_displacement.y) > _radiusPixels)) { _displacement.normalize(); value.set(_displacement); - _displacement.scale(_radius); + _displacement.scale(_radiusPixels); } else { value.set(_displacement); - GP_ASSERT(_radius); - value.scale(1.0f / _radius); + GP_ASSERT(_radiusPixels); + value.scale(1.0f / _radiusPixels); } if (_value != value) @@ -289,64 +418,74 @@ bool JoystickControl::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned i unsigned int JoystickControl::drawImages(Form* form, const Rectangle& clip) { - Control::State state = getState(); + const Control::State state = getState(); unsigned int drawCalls = 0; // If the JoystickControl is not absolute, then only draw if it is active. - if (!_relative || (_relative && state == ACTIVE)) + if ((_outerSizePixels || _innerSizePixels) && !_relative || (_relative && state == ACTIVE)) { if (!_relative) { - _screenRegion.x = _viewportClipBounds.x + (_viewportClipBounds.width - _screenRegion.width) / 2.0f; - _screenRegion.y = _viewportClipBounds.y + (_viewportClipBounds.height - _screenRegion.height) / 2.0f; + _screenRegionPixels.x = _viewportClipBounds.x + (_viewportClipBounds.width - _screenRegionPixels.width) / 2.0f; + _screenRegionPixels.y = _viewportClipBounds.y + (_viewportClipBounds.height - _screenRegionPixels.height) / 2.0f; } SpriteBatch* batch = _style->getTheme()->getSpriteBatch(); startBatch(form, batch); // Draw the outer image. - Theme::ThemeImage* outer = getImage("outer", state); - if (outer) + if (_outerSizePixels) { + Theme::ThemeImage* outer = getImage("outer", state); const Theme::UVs& uvs = outer->getUVs(); const Vector4& color = outer->getColor(); + + Vector2 position(_screenRegionPixels.x, _screenRegionPixels.y); + + if(_outerRegionCoord) + { + position.x += (_screenRegionPixels.width / 2) - (_outerSizePixels->x / 2); + position.y += (_screenRegionPixels.height / 2) - (_outerSizePixels->y / 2); + } + if (_relative) - batch->draw(_screenRegion.x, _screenRegion.y, _outerSize->x, _outerSize->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color); + batch->draw(position.x, position.y, _outerSizePixels->x, _outerSizePixels->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color); else - batch->draw(_screenRegion.x, _screenRegion.y, _outerSize->x, _outerSize->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color, _viewportClipBounds); + batch->draw(position.x, position.y, _outerSizePixels->x, _outerSizePixels->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color, _viewportClipBounds); ++drawCalls; } // Draw the inner image. - Theme::ThemeImage* inner = getImage("inner", state); - if (inner) + if (_innerSizePixels) { - Vector2 position(_screenRegion.x, _screenRegion.y); + Theme::ThemeImage* inner = getImage("inner", state); + Vector2 position(_screenRegionPixels.x, _screenRegionPixels.y); // Adjust position to reflect displacement. position.x += _displacement.x; position.y += -_displacement.y; + if(_innerRegionCoord) + { + position.x += (_screenRegionPixels.width / 2) - (_innerSizePixels->x / 2); + position.y += (_screenRegionPixels.height / 2) - (_innerSizePixels->y / 2); + } + // Get the uvs and color and draw. const Theme::UVs& uvs = inner->getUVs(); const Vector4& color = inner->getColor(); if (_relative) - batch->draw(position.x, position.y, _innerSize->x, _innerSize->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color); + batch->draw(position.x, position.y, _innerSizePixels->x, _innerSizePixels->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color); else - batch->draw(position.x, position.y, _innerSize->x, _innerSize->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color, _viewportClipBounds); + batch->draw(position.x, position.y, _innerSizePixels->x, _innerSizePixels->y, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color, _viewportClipBounds); ++drawCalls; } finishBatch(form, batch); - } - - return drawCalls; } -const char* JoystickControl::getType() const -{ - return "joystick"; + return drawCalls; } } diff --git a/gameplay/src/JoystickControl.h b/gameplay/src/JoystickControl.h index 8ed4d5f6ce..0cf96b4593 100644 --- a/gameplay/src/JoystickControl.h +++ b/gameplay/src/JoystickControl.h @@ -32,6 +32,16 @@ class JoystickControl : public Control */ static JoystickControl* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "JoystickControl" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Add a listener to be notified of specific events affecting * this control. Event types can be OR'ed together. @@ -56,32 +66,42 @@ class JoystickControl : public Control * inner image region defined. * * @param size The size of the inner region of the joystick. (x, y) == (width, height) + * @param isWidthPercentage If the width value should be computed as a percentage of the relative size of this control + * @param isHeightPercentage If the height value should be computed as a percentage of the relative size of this control */ - void setInnerRegionSize(const Vector2& size); + void setInnerRegionSize(const Vector2& size, bool isWidthPercentage = false, bool isHeightPercentage = false); /** * Gets the image size of the inner region of the joystick. Returns (0,0) if there is no inner image * region defined. * + * @param isWidthPercentage Set to true if the width value is a percentage value of the relative size of this control + * @param isHeightPercentage Set to true if the height value is a percentage value of the relative size of this control + * * @return The image size of the inner region of the joystick. (x, y) == (width, height) */ - const Vector2& getInnerRegionSize() const; + const Vector2& getInnerRegionSize(bool* isWidthPercentage = NULL, bool* isHeightPercentage = NULL) const; /** * Sets the image size of the outer region of the joystick. Does not do anything if there is no * outer image region defined. * * @param size The size of the outer region of the joystick. (x, y) == (width, height) + * @param isWidthPercentage If the width value should be computed as a percentage of the relative size of this control + * @param isHeightPercentage If the height value should be computed as a percentage of the relative size of this control */ - void setOuterRegionSize(const Vector2& size); + void setOuterRegionSize(const Vector2& size, bool isWidthPercentage = false, bool isHeightPercentage = false); /** * Gets the image size of the outer region of the joystick. Returns (0,0) if there is no outer image * region defined. + * + * @param isWidthPercentage Set to true if the width value is a percentage value of the relative size of this control + * @param isHeightPercentage Set to true if the height value is a percentage value of the relative size of this control * * @return The image size of the outer region of the joystick. (x, y) == (width, height) */ - const Vector2& getOuterRegionSize() const; + const Vector2& getOuterRegionSize(bool* isWidthPercentage = NULL, bool* isHeightPercentage = NULL) const; /** * Sets whether relative positioning is enabled or not. @@ -107,11 +127,27 @@ class JoystickControl : public Control * @return The index of this joystick on a form. */ unsigned int getIndex() const; - + /** - * @see Control::getType + * Sets the radius of joystick motion + * + * @param isPercentage If the radius value is a percentage value of the relative size of this control */ - const char* getType() const; + void setRadius(float radius, bool isPercentage = false); + + /** + * Gets the radius of joystick motion + * + * @return The radius of joystick motion + */ + float getRadius() const; + + /** + * Determines if the radius of joystick motion is a percentage value of the relative size of this control + * + * @return True if the radius of joystick motion is a percentage value of the relative size of this control + */ + bool isRadiusPercentage() const; protected: @@ -129,7 +165,7 @@ class JoystickControl : public Control * Create a joystick control with a given style and properties. * * @param style The style to apply to this joystick. - * @param properties A properties object containing a definition of the joystick (optional). + * @param properties A properties object containing a definition of the joystick. * * @return The new joystick. */ @@ -154,6 +190,11 @@ class JoystickControl : public Control */ bool touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex); + /** + * @see Control::updateAbsoluteBounds + */ + void updateAbsoluteBounds(const Vector2& offset); + /** * @see Control::drawImages */ @@ -161,18 +202,34 @@ class JoystickControl : public Control private: - /** - * Copy constructor. - */ JoystickControl(const JoystickControl& copy); - float _radius; + void setRegion(const Vector2& regionSizeIn, Vector2& regionSizeOut, int& regionBoundsBitsOut, bool isWidthPercentage, bool isHeightPercentage); + + void getRegion(Vector2& regionOut, int& regionBoundsBitsOut, const char* regionPropertyId); + + Vector2 getPixelSize(const Vector2& region, const int regionBoundsBits) const; + + Vector2 getPixelSize(const Theme::ThemeImage* image) const; + + Theme::ThemeImage * getNonEmptyImage(const char* id, Control::State state); + + void updateAbsoluteSizes(); + + void setBoundsBit(bool set, int& bitSetOut, int bit); + + float _radiusCoord; + Vector2* _innerRegionCoord; + Vector2* _outerRegionCoord; + int _innerRegionCoordBoundsBits; + int _outerRegionCoordBoundsBits; + float _radiusPixels; + Vector2* _innerSizePixels; + Vector2* _outerSizePixels; + Rectangle _screenRegionPixels; bool _relative; - Rectangle _screenRegion; Vector2 _value; Vector2 _displacement; - Vector2* _innerSize; - Vector2* _outerSize; unsigned int _index; }; diff --git a/gameplay/src/Label.cpp b/gameplay/src/Label.cpp index f506e6f21c..4dfa9e8f80 100644 --- a/gameplay/src/Label.cpp +++ b/gameplay/src/Label.cpp @@ -41,6 +41,12 @@ void Label::initialize(const char* typeName, Theme::Style* style, Properties* pr } } +const char* Label::getTypeName() const +{ + return "Label"; +} + + void Label::addListener(Control::Listener* listener, int eventFlags) { if ((eventFlags & Control::Listener::TEXT_CHANGED) == Control::Listener::TEXT_CHANGED) @@ -54,7 +60,7 @@ void Label::addListener(Control::Listener* listener, int eventFlags) Control::addListener(listener, eventFlags); } - + void Label::setText(const char* text) { if ((text == NULL && _text.length() > 0) || strcmp(text, _text.c_str()) != 0) @@ -125,7 +131,7 @@ unsigned int Label::drawText(Form* form, const Rectangle& clip) SpriteBatch* batch = _font->getSpriteBatch(fontSize); startBatch(form, batch); - _font->drawText(_text.c_str(), _textBounds, _textColor, fontSize, getTextAlignment(state), true, getTextRightToLeft(state), &_viewportClipBounds); + _font->drawText(_text.c_str(), _textBounds, _textColor, fontSize, getTextAlignment(state), true, getTextRightToLeft(state), _viewportClipBounds); finishBatch(form, batch); return 1; @@ -134,9 +140,4 @@ unsigned int Label::drawText(Form* form, const Rectangle& clip) return 0; } -const char* Label::getType() const -{ - return "label"; -} - } diff --git a/gameplay/src/Label.h b/gameplay/src/Label.h index 5b66bc1ff9..c77ad38893 100644 --- a/gameplay/src/Label.h +++ b/gameplay/src/Label.h @@ -32,6 +32,16 @@ class Label : public Control */ static Label* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "Label" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Set the text for this label to display. * @@ -46,11 +56,6 @@ class Label : public Control */ const char* getText(); - /** - * @see Control::getType - */ - const char* getType() const; - /** * Add a listener to be notified of specific events affecting * this control. Event types can be OR'ed together. diff --git a/gameplay/src/Light.cpp b/gameplay/src/Light.cpp index ae7ddf604f..a54e282981 100644 --- a/gameplay/src/Light.cpp +++ b/gameplay/src/Light.cpp @@ -322,7 +322,7 @@ float Light::getOuterAngleCos() const return _spot->outerAngleCos; } -Light* Light::clone(NodeCloneContext &context) const +Light* Light::clone(NodeCloneContext &context) { Light* lightClone = NULL; switch (_type) diff --git a/gameplay/src/Light.h b/gameplay/src/Light.h index edc450db71..fb16cca12d 100644 --- a/gameplay/src/Light.h +++ b/gameplay/src/Light.h @@ -299,10 +299,9 @@ class Light : public Ref * Clones the light and returns a new light. * * @param context The clone context. - * * @return The newly created light. */ - Light* clone(NodeCloneContext &context) const; + Light* clone(NodeCloneContext& context); Light::Type _type; diff --git a/gameplay/src/Logger.cpp b/gameplay/src/Logger.cpp index 4330dac96b..e84d76bf55 100644 --- a/gameplay/src/Logger.cpp +++ b/gameplay/src/Logger.cpp @@ -26,9 +26,6 @@ void Logger::log(Level level, const char* message, ...) if (!state.enabled) return; - va_list args; - va_start(args, message); - // Declare a moderately sized buffer on the stack that should be // large enough to accommodate most log requests. int size = 1024; @@ -37,6 +34,9 @@ void Logger::log(Level level, const char* message, ...) char* str = stackBuffer; for ( ; ; ) { + va_list args; + va_start(args, message); + // Pass one less than size to leave room for NULL terminator int needed = vsnprintf(str, size-1, message, args); @@ -46,12 +46,15 @@ void Logger::log(Level level, const char* message, ...) { // Successfully wrote buffer. Added a NULL terminator in case it wasn't written. str[needed] = '\0'; + va_end(args); break; } size = needed > 0 ? (needed + 1) : (size * 2); dynamicBuffer.resize(size); str = &dynamicBuffer[0]; + + va_end(args); } if (state.logFunctionC) @@ -69,8 +72,6 @@ void Logger::log(Level level, const char* message, ...) // Log to the default output gameplay::print("%s", str); } - - va_end(args); } bool Logger::isEnabled(Level level) diff --git a/gameplay/src/Material.cpp b/gameplay/src/Material.cpp index b3a3d7df2b..e3a9ba73c6 100644 --- a/gameplay/src/Material.cpp +++ b/gameplay/src/Material.cpp @@ -464,6 +464,11 @@ void Material::loadRenderState(RenderState* renderState, Properties* properties) bool mipmap = ns->getBool("mipmap"); Texture::Wrap wrapS = parseTextureWrapMode(ns->getString("wrapS"), Texture::REPEAT); Texture::Wrap wrapT = parseTextureWrapMode(ns->getString("wrapT"), Texture::REPEAT); + Texture::Wrap wrapR = Texture::REPEAT; + if(ns->exists("wrapR")) + { + wrapR = parseTextureWrapMode(ns->getString("wrapR"), Texture::REPEAT); + } Texture::Filter minFilter = parseTextureFilterMode(ns->getString("minFilter"), mipmap ? Texture::NEAREST_MIPMAP_LINEAR : Texture::LINEAR); Texture::Filter magFilter = parseTextureFilterMode(ns->getString("magFilter"), Texture::LINEAR); @@ -472,7 +477,7 @@ void Material::loadRenderState(RenderState* renderState, Properties* properties) Texture::Sampler* sampler = renderState->getParameter(name)->setValue(path.c_str(), mipmap); if (sampler) { - sampler->setWrapMode(wrapS, wrapT); + sampler->setWrapMode(wrapS, wrapT, wrapR); sampler->setFilterMode(minFilter, magFilter); } } diff --git a/gameplay/src/MathUtil.h b/gameplay/src/MathUtil.h index 69f1fc7e88..497559403f 100644 --- a/gameplay/src/MathUtil.h +++ b/gameplay/src/MathUtil.h @@ -73,7 +73,7 @@ class MathUtil #define MATRIX_SIZE ( sizeof(float) * 16) -#ifdef USE_NEON +#ifdef GP_USE_NEON #include "MathUtilNeon.inl" #else #include "MathUtil.inl" diff --git a/gameplay/src/MeshSkin.cpp b/gameplay/src/MeshSkin.cpp index 6bbb9f9426..9dcda5410b 100644 --- a/gameplay/src/MeshSkin.cpp +++ b/gameplay/src/MeshSkin.cpp @@ -1,6 +1,7 @@ #include "Base.h" #include "MeshSkin.h" #include "Joint.h" +#include "Model.h" // The number of rows in each palette matrix. #define PALETTE_ROWS 3 diff --git a/gameplay/src/MeshSkin.h b/gameplay/src/MeshSkin.h index 125eb694c2..38b80ca90c 100644 --- a/gameplay/src/MeshSkin.h +++ b/gameplay/src/MeshSkin.h @@ -9,8 +9,8 @@ namespace gameplay class Bundle; class Model; -class Joint; class Node; +class Joint; /** * Defines the skin for a mesh. diff --git a/gameplay/src/Model.cpp b/gameplay/src/Model.cpp index fd247644fa..dcc61d491e 100644 --- a/gameplay/src/Model.cpp +++ b/gameplay/src/Model.cpp @@ -9,8 +9,13 @@ namespace gameplay { -Model::Model(Mesh* mesh) : - _mesh(mesh), _material(NULL), _partCount(0), _partMaterials(NULL), _node(NULL), _skin(NULL) +Model::Model() : Drawable(), + _mesh(NULL), _material(NULL), _partCount(0), _partMaterials(NULL), _skin(NULL) +{ +} + +Model::Model(Mesh* mesh) : Drawable(), + _mesh(mesh), _material(NULL), _partCount(0), _partMaterials(NULL), _skin(NULL) { GP_ASSERT(mesh); _partCount = mesh->getPartCount(); @@ -19,7 +24,6 @@ Model::Model(Mesh* mesh) : Model::~Model() { SAFE_RELEASE(_material); - if (_partMaterials) { for (unsigned int i = 0; i < _partCount; ++i) @@ -28,9 +32,7 @@ Model::~Model() } SAFE_DELETE_ARRAY(_partMaterials); } - SAFE_RELEASE(_mesh); - SAFE_DELETE(_skin); } @@ -60,7 +62,6 @@ Material* Model::getMaterial(int partIndex) if (partIndex < 0) return _material; - if (partIndex >= (int)_partCount) return NULL; @@ -69,7 +70,6 @@ Material* Model::getMaterial(int partIndex) { m = _partMaterials[partIndex]; } - if (m == NULL) { // Return the shared material. @@ -156,7 +156,6 @@ void Model::setMaterial(Material* material, int partIndex) SAFE_RELEASE(b); } } - // Apply node binding for the new material. if (_node) { @@ -227,14 +226,9 @@ void Model::setSkin(MeshSkin* skin) } } -Node* Model::getNode() const -{ - return _node; -} - void Model::setNode(Node* node) { - _node = node; + Drawable::setNode(node); // Re-bind node related material parameters if (node) @@ -397,11 +391,11 @@ void Model::setMaterialNodeBinding(Material *material) if (_node) { - material->setNodeBinding(_node); + material->setNodeBinding(getNode()); } } -Model* Model::clone(NodeCloneContext &context) +Drawable* Model::clone(NodeCloneContext& context) { Model* model = Model::create(getMesh()); if (!model) diff --git a/gameplay/src/Model.h b/gameplay/src/Model.h index 7dc25851b9..bf494ada98 100644 --- a/gameplay/src/Model.h +++ b/gameplay/src/Model.h @@ -4,14 +4,14 @@ #include "Mesh.h" #include "MeshSkin.h" #include "Material.h" +#include "Drawable.h" namespace gameplay { class Bundle; class MeshSkin; -class Node; -class NodeCloneContext; + /** * Defines a Model or mesh renderer which is an instance of a Mesh. @@ -19,7 +19,7 @@ class NodeCloneContext; * A model has a mesh that can be drawn with the specified materials for * each of the mesh parts within it. */ -class Model : public Ref +class Model : public Ref, public Drawable { friend class Node; friend class Scene; @@ -131,36 +131,22 @@ class Model : public Ref MeshSkin* getSkin() const; /** - * Returns the node that is associated with this model. + * @see Drawable::draw * - * @return The node that is associated with this model. + * Binds the vertex buffer and index buffers for the Mesh and + * all of its MeshPart's and draws the mesh geometry. + * Any other state necessary to render the Mesh, such as + * rendering states, shader state, and so on, should be set + * up before calling this method. */ - Node* getNode() const; + unsigned int draw(bool wireframe = false); - /** - * Sets the node that is associated with this model. - * - * This method is automatically called when a model is attached to a node - * and therefore should not normally be called explicitly. - * - * @param node The node that is associated with this model. - */ - void setNode(Node* node); +private: /** - * Draws this mesh instance. - * - * This method binds the vertex buffer and index buffers for the Mesh and - * all of its MeshParts and draws the mesh geometry. Any other state - * necessary to render the Mesh, such as rendering states, shader state, - * and so on, should be set up before calling this method. - * - * @param wireframe If true, draw the model in wireframe mode. - * @return The number of draw calls (mesh parts). + * Constructor. */ - unsigned int draw(bool wireframe = false); - -private: + Model(); /** * Constructor. @@ -176,6 +162,16 @@ class Model : public Ref * Hidden copy assignment operator. */ Model& operator=(const Model&); + + /** + * @see Drawable::setNode + */ + void setNode(Node* node); + + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext& context); /** * Sets the MeshSkin for this model. @@ -189,21 +185,12 @@ class Model : public Ref */ void setMaterialNodeBinding(Material *m); - /** - * Clones the model and returns a new model. - * - * @param context The clone context. - * @return The new cloned model. - */ - Model* clone(NodeCloneContext &context); - void validatePartCount(); Mesh* _mesh; Material* _material; unsigned int _partCount; Material** _partMaterials; - Node* _node; MeshSkin* _skin; }; diff --git a/gameplay/src/Node.cpp b/gameplay/src/Node.cpp index 6b5218c297..a5945a7ab6 100644 --- a/gameplay/src/Node.cpp +++ b/gameplay/src/Node.cpp @@ -8,22 +8,27 @@ #include "PhysicsVehicleWheel.h" #include "PhysicsGhostObject.h" #include "PhysicsCharacter.h" -#include "Game.h" #include "Terrain.h" +#include "Game.h" +#include "Drawable.h" +#include "Form.h" +#include "Ref.h" // Node dirty flags #define NODE_DIRTY_WORLD 1 #define NODE_DIRTY_BOUNDS 2 -#define NODE_DIRTY_ALL (NODE_DIRTY_WORLD | NODE_DIRTY_BOUNDS) +#define NODE_DIRTY_HIERARCHY 4 +#define NODE_DIRTY_ALL (NODE_DIRTY_WORLD | NODE_DIRTY_BOUNDS | NODE_DIRTY_HIERARCHY) namespace gameplay { Node::Node(const char* id) - : _scene(NULL), _firstChild(NULL), _nextSibling(NULL), _prevSibling(NULL), _parent(NULL), _childCount(0), _active(true), - _tags(NULL), _camera(NULL), _light(NULL), _model(NULL), _terrain(NULL), _form(NULL), _audioSource(NULL), _particleEmitter(NULL), - _collisionObject(NULL), _agent(NULL), _dirtyBits(NODE_DIRTY_ALL), _notifyHierarchyChanged(true), _userData(NULL) + : _scene(NULL), _firstChild(NULL), _nextSibling(NULL), _prevSibling(NULL), _parent(NULL), _childCount(0), _enabled(true), _tags(NULL), + _drawable(NULL), _camera(NULL), _light(NULL), _audioSource(NULL), _collisionObject(NULL), _agent(NULL), _userObject(NULL), + _dirtyBits(NODE_DIRTY_ALL) { + GP_REGISTER_SCRIPT_EVENTS(); if (id) { _id = id; @@ -33,36 +38,19 @@ Node::Node(const char* id) Node::~Node() { removeAllChildren(); - - if (_model) - _model->setNode(NULL); + if (_drawable) + _drawable->setNode(NULL); if (_audioSource) _audioSource->setNode(NULL); - if (_particleEmitter) - _particleEmitter->setNode(NULL); - if (_form) - _form->setNode(NULL); - + Ref* ref = dynamic_cast(_drawable); + SAFE_RELEASE(ref); SAFE_RELEASE(_camera); SAFE_RELEASE(_light); - SAFE_RELEASE(_model); - SAFE_RELEASE(_terrain); SAFE_RELEASE(_audioSource); - SAFE_RELEASE(_particleEmitter); - SAFE_RELEASE(_form); SAFE_DELETE(_collisionObject); + SAFE_RELEASE(_userObject); SAFE_DELETE(_tags); - setAgent(NULL); - - // Cleanup user data - if (_userData) - { - // Call custom cleanup callback if specified - if (_userData->cleanupCallback) - _userData->cleanupCallback(_userData->pointer); - SAFE_DELETE(_userData); - } } Node* Node::create(const char* id) @@ -70,6 +58,11 @@ Node* Node::create(const char* id) return new Node(id); } +const char* Node::getTypeName() const +{ + return "Node"; +} + const char* Node::getId() const { return _id.c_str(); @@ -97,7 +90,6 @@ void Node::addChild(Node* child) // This node is already present in our hierarchy return; } - child->addRef(); // If the item belongs to another hierarchy, remove it first. @@ -109,7 +101,6 @@ void Node::addChild(Node* child) { child->_scene->removeNode(child); } - // Add child to the end of the list. // NOTE: This is different than the original behavior which inserted nodes // into the beginning of the list. Although slightly slower to add to the @@ -127,14 +118,11 @@ void Node::addChild(Node* child) { _firstChild = child; } - child->_parent = this; - ++_childCount; - setBoundsDirty(); - if (_notifyHierarchyChanged) + if (_dirtyBits & NODE_DIRTY_HIERARCHY) { hierarchyChanged(); } @@ -147,23 +135,19 @@ void Node::removeChild(Node* child) // The child is not in our hierarchy. return; } - // Call remove on the child. child->remove(); - SAFE_RELEASE(child); } void Node::removeAllChildren() { - _notifyHierarchyChanged = false; - + _dirtyBits &= ~NODE_DIRTY_HIERARCHY; while (_firstChild) { removeChild(_firstChild); } - - _notifyHierarchyChanged = true; + _dirtyBits |= NODE_DIRTY_HIERARCHY; hierarchyChanged(); } @@ -178,7 +162,6 @@ void Node::remove() { _nextSibling->_prevSibling = _prevSibling; } - // Update our parent. Node* parent = _parent; if (parent) @@ -187,15 +170,13 @@ void Node::remove() { parent->_firstChild = _nextSibling; } - --parent->_childCount; } - _nextSibling = NULL; _prevSibling = NULL; _parent = NULL; - if (parent && parent->_notifyHierarchyChanged) + if (parent && parent->_dirtyBits & NODE_DIRTY_HIERARCHY) { parent->hierarchyChanged(); } @@ -221,129 +202,42 @@ Node* Node::getParent() const return _parent; } -bool Node::hasTag(const char* name) const -{ - GP_ASSERT(name); - - return (_tags ? _tags->find(name) != _tags->end() : false); -} - -const char* Node::getTag(const char* name) const -{ - GP_ASSERT(name); - - if (!_tags) - return NULL; - - std::map::const_iterator itr = _tags->find(name); - return (itr == _tags->end() ? NULL : itr->second.c_str()); -} - -void Node::setTag(const char* name, const char* value) -{ - GP_ASSERT(name); - - if (value == NULL) - { - // Removing tag - if (_tags) - { - _tags->erase(name); - if (_tags->size() == 0) - SAFE_DELETE(_tags); - } - } - else - { - // Setting tag - if (_tags == NULL) - _tags = new std::map(); - - (*_tags)[name] = value; - } -} - -void* Node::getUserPointer() const -{ - return (_userData ? _userData->pointer : NULL); -} - -void Node::setUserPointer(void* pointer, void (*cleanupCallback)(void*)) +unsigned int Node::getChildCount() const { - // If existing user pointer is being changed, call cleanup function to free previous pointer - if (_userData && _userData->pointer && _userData->cleanupCallback && pointer != _userData->pointer) - { - _userData->cleanupCallback(_userData->pointer); - } - - if (pointer) - { - // Assign user pointer - if (_userData == NULL) - _userData = new UserData(); - - _userData->pointer = pointer; - _userData->cleanupCallback = cleanupCallback; - } - else - { - // Clear user pointer - SAFE_DELETE(_userData); - } + return _childCount; } -void Node::setActive(bool active) +Node* Node::getRootNode() const { - if (_active != active) + Node* n = const_cast(this); + while (n->getParent()) { - if (_collisionObject) - _collisionObject->setEnabled(active); - - _active = active; + n = n->getParent(); } -} - -bool Node::isActive() const -{ - return _active; -} - -bool Node::isActiveInHierarchy() const -{ - if (!_active) - return false; - Node* node = _parent; - while (node) - { - if (!node->_active) - return false; - } - return true; -} - -unsigned int Node::getChildCount() const -{ - return _childCount; + return n; } Node* Node::findNode(const char* id, bool recursive, bool exactMatch) const { GP_ASSERT(id); - // If the node has a model with a mesh skin, search the skin's hierarchy as well. + // If the drawable is a model with a mesh skin, search the skin's hierarchy as well. Node* rootNode = NULL; - if (_model != NULL && _model->getSkin() != NULL && (rootNode = _model->getSkin()->_rootNode) != NULL) + Model* model = dynamic_cast(_drawable); + if (model) { - if ((exactMatch && rootNode->_id == id) || (!exactMatch && rootNode->_id.find(id) == 0)) - return rootNode; - - Node* match = rootNode->findNode(id, true, exactMatch); - if (match) + if (model->getSkin() != NULL && (rootNode = model->getSkin()->_rootNode) != NULL) { - return match; + if ((exactMatch && rootNode->_id == id) || (!exactMatch && rootNode->_id.find(id) == 0)) + return rootNode; + + Node* match = rootNode->findNode(id, true, exactMatch); + if (match) + { + return match; + } } } - // Search immediate children first. for (Node* child = getFirstChild(); child != NULL; child = child->getNextSibling()) { @@ -353,7 +247,6 @@ Node* Node::findNode(const char* id, bool recursive, bool exactMatch) const return child; } } - // Recurse. if (recursive) { @@ -366,28 +259,29 @@ Node* Node::findNode(const char* id, bool recursive, bool exactMatch) const } } } - return NULL; -} +} unsigned int Node::findNodes(const char* id, std::vector& nodes, bool recursive, bool exactMatch) const { GP_ASSERT(id); - - unsigned int count = 0; - // If the node has a model with a mesh skin, search the skin's hierarchy as well. + // If the drawable is a model with a mesh skin, search the skin's hierarchy as well. + unsigned int count = 0; Node* rootNode = NULL; - if (_model != NULL && _model->getSkin() != NULL && (rootNode = _model->getSkin()->_rootNode) != NULL) + Model* model = dynamic_cast(_drawable); + if (model) { - if ((exactMatch && rootNode->_id == id) || (!exactMatch && rootNode->_id.find(id) == 0)) + if (model->getSkin() != NULL && (rootNode = model->getSkin()->_rootNode) != NULL) { - nodes.push_back(rootNode); - ++count; + if ((exactMatch && rootNode->_id == id) || (!exactMatch && rootNode->_id.find(id) == 0)) + { + nodes.push_back(rootNode); + ++count; + } + count += rootNode->findNodes(id, nodes, true, exactMatch); } - count += rootNode->findNodes(id, nodes, true, exactMatch); } - // Search immediate children first. for (Node* child = getFirstChild(); child != NULL; child = child->getNextSibling()) { @@ -398,7 +292,6 @@ unsigned int Node::findNodes(const char* id, std::vector& nodes, bool rec ++count; } } - // Recurse. if (recursive) { @@ -423,27 +316,97 @@ Scene* Node::getScene() const if (scene) return scene; } - return NULL; } -Node* Node::getRootNode() const +bool Node::hasTag(const char* name) const { - Node* n = const_cast(this); - while (n->getParent()) + GP_ASSERT(name); + return (_tags ? _tags->find(name) != _tags->end() : false); +} + +const char* Node::getTag(const char* name) const +{ + GP_ASSERT(name); + + if (!_tags) + return NULL; + + std::map::const_iterator itr = _tags->find(name); + return (itr == _tags->end() ? NULL : itr->second.c_str()); +} + +void Node::setTag(const char* name, const char* value) +{ + GP_ASSERT(name); + + if (value == NULL) { - n = n->getParent(); + // Removing tag + if (_tags) + { + _tags->erase(name); + if (_tags->size() == 0) + { + SAFE_DELETE(_tags); + } + } } - return n; + else + { + // Setting tag + if (_tags == NULL) + { + _tags = new std::map(); + } + (*_tags)[name] = value; + } +} + +void Node::setEnabled(bool enabled) +{ + if (_enabled != enabled) + { + if (_collisionObject) + { + _collisionObject->setEnabled(enabled); + } + _enabled = enabled; + } +} + +bool Node::isEnabled() const +{ + return _enabled; +} + +bool Node::isEnabledInHierarchy() const +{ + if (!_enabled) + return false; + + Node* node = _parent; + while (node) + { + if (!node->_enabled) + { + return false; + } + node = node->_parent; + } + return true; } void Node::update(float elapsedTime) { for (Node* node = _firstChild; node != NULL; node = node->_nextSibling) { - if (node->isActive()) + if (node->isEnabled()) + { node->update(elapsedTime); + } } + fireScriptEvent(GP_GET_SCRIPT_EVENT(Node, update), dynamic_cast(this), elapsedTime); } bool Node::isStatic() const @@ -481,16 +444,13 @@ const Matrix& Node::getWorldMatrix() const } } } - return _world; } const Matrix& Node::getWorldViewMatrix() const { static Matrix worldView; - Matrix::multiply(getViewMatrix(), getWorldMatrix(), &worldView); - return worldView; } @@ -576,18 +536,15 @@ const Matrix& Node::getInverseViewProjectionMatrix() const { return camera->getInverseViewProjectionMatrix(); } - return Matrix::identity(); } const Matrix& Node::getWorldViewProjectionMatrix() const { - static Matrix worldViewProj; - // Always re-calculate worldViewProjection matrix since it's extremely difficult // to track whether the camera has changed (it may frequently change every frame). + static Matrix worldViewProj; Matrix::multiply(getViewProjectionMatrix(), getWorldMatrix(), &worldViewProj); - return worldViewProj; } @@ -650,7 +607,6 @@ Vector3 Node::getActiveCameraTranslationWorld() const } } } - return Vector3::zero(); } @@ -669,13 +625,13 @@ Vector3 Node::getActiveCameraTranslationView() const } } } - return Vector3::zero(); } void Node::hierarchyChanged() { // When our hierarchy changes our world transform is affected, so we must dirty it. + _dirtyBits |= NODE_DIRTY_HIERARCHY; transformChanged(); } @@ -701,7 +657,6 @@ void Node::transformChanged() n->transformChanged(); } } - Transform::transformChanged(); } @@ -722,7 +677,7 @@ Animation* Node::getAnimation(const char* id) const return animation; // See if this node has a model, then drill down. - Model* model = this->getModel(); + Model* model = dynamic_cast(_drawable); if (model) { // Check to see if there's any animations with the ID on the joints. @@ -756,7 +711,7 @@ Animation* Node::getAnimation(const char* id) const } // look through form for animations. - Form* form = this->getForm(); + Form* form = dynamic_cast(_drawable); if (form) { animation = form->getAnimation(id); @@ -782,21 +737,21 @@ Camera* Node::getCamera() const void Node::setCamera(Camera* camera) { - if (_camera != camera) + if (_camera == camera) + return; + + if (_camera) { - if (_camera) - { - _camera->setNode(NULL); - SAFE_RELEASE(_camera); - } + _camera->setNode(NULL); + SAFE_RELEASE(_camera); + } - _camera = camera; + _camera = camera; - if (_camera) - { - _camera->addRef(); - _camera->setNode(this); - } + if (_camera) + { + _camera->addRef(); + _camera->setNode(this); } } @@ -807,101 +762,54 @@ Light* Node::getLight() const void Node::setLight(Light* light) { - if (_light != light) - { - if (_light) - { - _light->setNode(NULL); - SAFE_RELEASE(_light); - } - - _light = light; - - if (_light) - { - _light->addRef(); - _light->setNode(this); - } - - setBoundsDirty(); - } -} - -Model* Node::getModel() const -{ - return _model; -} + if (_light == light) + return; -void Node::setModel(Model* model) -{ - if (_model != model) + if (_light) { - if (_model) - { - _model->setNode(NULL); - SAFE_RELEASE(_model); - } - - _model = model; - - if (_model) - { - _model->addRef(); - _model->setNode(this); - } + _light->setNode(NULL); + SAFE_RELEASE(_light); } -} -Terrain* Node::getTerrain() const -{ - return _terrain; -} + _light = light; -void Node::setTerrain(Terrain* terrain) -{ - if (_terrain != terrain) + if (_light) { - if (_terrain) - { - _terrain->setNode(NULL); - SAFE_RELEASE(_terrain); - } - - _terrain = terrain; - - if (_terrain) - { - _terrain->addRef(); - _terrain->setNode(this); - } - - setBoundsDirty(); + _light->addRef(); + _light->setNode(this); } + + setBoundsDirty(); } -Form* Node::getForm() const +Drawable* Node::getDrawable() const { - return _form; + return _drawable; } -void Node::setForm(Form* form) +void Node::setDrawable(Drawable* drawable) { - if (_form != form) + if (_drawable != drawable) { - if (_form) + if (_drawable) { - _form->setNode(NULL); - SAFE_RELEASE(_form); + _drawable->setNode(NULL); + Ref* ref = dynamic_cast(_drawable); + if (ref) + ref->release(); } - _form = form; + _drawable = drawable; - if (_form) + if (_drawable) { - _form->addRef(); - _form->setNode(this); + Ref* ref = dynamic_cast(_drawable); + if (ref) + ref->addRef(); + _drawable->setNode(this); } } + setBoundsDirty(); } const BoundingSphere& Node::getBoundingSphere() const @@ -913,23 +821,25 @@ const BoundingSphere& Node::getBoundingSphere() const const Matrix& worldMatrix = getWorldMatrix(); // Start with our local bounding sphere - // TODO: Incorporate bounds from entities other than mesh (i.e. emitters, audiosource, etc) + // TODO: Incorporate bounds from entities other than mesh (i.e. particleemitters, audiosource, etc) bool empty = true; - if (_terrain) + Terrain* terrain = dynamic_cast(_drawable); + if (terrain) { - _bounds.set(_terrain->getBoundingBox()); + _bounds.set(terrain->getBoundingBox()); empty = false; } - if (_model && _model->getMesh()) + Model* model = dynamic_cast(_drawable); + if (model && model->getMesh()) { if (empty) { - _bounds.set(_model->getMesh()->getBoundingSphere()); + _bounds.set(model->getMesh()->getBoundingSphere()); empty = false; } else { - _bounds.merge(_model->getMesh()->getBoundingSphere()); + _bounds.merge(model->getMesh()->getBoundingSphere()); } } if (_light) @@ -963,7 +873,7 @@ const BoundingSphere& Node::getBoundingSphere() const if (!empty) { bool applyWorldTransform = true; - if (_model && _model->getSkin()) + if (model && model->getSkin()) { // Special case: If the root joint of our mesh skin is parented by any nodes, // multiply the world matrix of the root joint's parent by this node's @@ -973,8 +883,8 @@ const BoundingSphere& Node::getBoundingSphere() const // since joint parent nodes that are not in the matrix palette do not need to // be considered as directly transforming vertices on the GPU (they can instead // be applied directly to the bounding volume transformation below). - GP_ASSERT(_model->getSkin()->getRootJoint()); - Node* jointParent = _model->getSkin()->getRootJoint()->getParent(); + GP_ASSERT(model->getSkin()->getRootJoint()); + Node* jointParent = model->getSkin()->getRootJoint()->getParent(); if (jointParent) { // TODO: Should we protect against the case where joints are nested directly @@ -1044,53 +954,53 @@ Node* Node::cloneRecursive(NodeCloneContext &context) const return copy; } -void Node::cloneInto(Node* node, NodeCloneContext &context) const +void Node::cloneInto(Node* node, NodeCloneContext& context) const { GP_ASSERT(node); - Transform::cloneInto(node, context); - // TODO: Clone the rest of the node data. + Transform::cloneInto(node, context); + if (Drawable* drawable = getDrawable()) + { + Drawable* clone = drawable->clone(context); + node->setDrawable(clone); + Ref* ref = dynamic_cast(clone); + if (ref) + ref->release(); + } if (Camera* camera = getCamera()) { - Camera* cameraClone = camera->clone(context); - node->setCamera(cameraClone); - cameraClone->release(); + Camera* clone = camera->clone(context); + node->setCamera(clone); + Ref* ref = dynamic_cast(clone); + if (ref) + ref->release(); } if (Light* light = getLight()) { - Light* lightClone = light->clone(context); - node->setLight(lightClone); - lightClone->release(); + Light* clone = light->clone(context); + node->setLight(clone); + Ref* ref = dynamic_cast(clone); + if (ref) + ref->release(); } if (AudioSource* audio = getAudioSource()) { - AudioSource* audioClone = audio->clone(context); - node->setAudioSource(audioClone); - audioClone->release(); - } - if (Model* model = getModel()) - { - Model* modelClone = model->clone(context); - node->setModel(modelClone); - modelClone->release(); + AudioSource* clone = audio->clone(context); + node->setAudioSource(clone); + Ref* ref = dynamic_cast(clone); + if (ref) + ref->release(); } - if (ParticleEmitter* emitter = getParticleEmitter()) + if (_tags) { - ParticleEmitter* emitterClone = emitter->clone(); - node->setParticleEmitter(emitterClone); - emitterClone->release(); + node->_tags = new std::map(_tags->begin(), _tags->end()); } + node->_world = _world; node->_bounds = _bounds; - // Note: Do not clone _userData - we can't make any assumptions about its content and how it's managed, - // so it's the caller's responsibility to clone user data if needed. - - if (_tags) - { - node->_tags = new std::map(_tags->begin(), _tags->end()); - } + // TODO: Clone the rest of the node data. } AudioSource* Node::getAudioSource() const @@ -1100,46 +1010,21 @@ AudioSource* Node::getAudioSource() const void Node::setAudioSource(AudioSource* audio) { - if (_audioSource != audio) - { - if (_audioSource) - { - _audioSource->setNode(NULL); - SAFE_RELEASE(_audioSource); - } - - _audioSource = audio; - - if (_audioSource) - { - _audioSource->addRef(); - _audioSource->setNode(this); - } - } -} - -ParticleEmitter* Node::getParticleEmitter() const -{ - return _particleEmitter; -} + if (_audioSource == audio) + return; -void Node::setParticleEmitter(ParticleEmitter* emitter) -{ - if (_particleEmitter != emitter) + if (_audioSource) { - if (_particleEmitter) - { - _particleEmitter->setNode(NULL); - SAFE_RELEASE(_particleEmitter); - } + _audioSource->setNode(NULL); + SAFE_RELEASE(_audioSource); + } - _particleEmitter = emitter; + _audioSource = audio; - if (_particleEmitter) - { - _particleEmitter->addRef(); - _particleEmitter->setNode(this); - } + if (_audioSource) + { + _audioSource->addRef(); + _audioSource->setNode(this); } } @@ -1275,31 +1160,51 @@ PhysicsCollisionObject* Node::setCollisionObject(Properties* properties) AIAgent* Node::getAgent() const { + // Lazily create a new Agent for this Node if we don't have one yet. + // Basically, all Nodes by default can have an Agent, we just won't + // waste the memory unless they request one. + if (!_agent) + { + _agent = AIAgent::create(); + _agent->_node = const_cast(this); + Game::getInstance()->getAIController()->addAgent(_agent); + } + return _agent; } void Node::setAgent(AIAgent* agent) { - if (agent != _agent) + if (agent == _agent) + return; + + if (_agent) { - if (_agent) - { - Game::getInstance()->getAIController()->removeAgent(_agent); - _agent->_node = NULL; - SAFE_RELEASE(_agent); - } + Game::getInstance()->getAIController()->removeAgent(_agent); + _agent->setNode(NULL); + SAFE_RELEASE(_agent); + } - _agent = agent; + _agent = agent; - if (_agent) - { - _agent->addRef(); - _agent->_node = this; - Game::getInstance()->getAIController()->addAgent(_agent); - } + if (_agent) + { + _agent->addRef(); + _agent->setNode(this); + Game::getInstance()->getAIController()->addAgent(_agent); } } +Ref* Node::getUserObject() const +{ + return _userObject; +} + +void Node::setUserObject(Ref* obj) +{ + _userObject = obj; +} + NodeCloneContext::NodeCloneContext() { } diff --git a/gameplay/src/Node.h b/gameplay/src/Node.h index 3312d9f3bb..b258209adf 100644 --- a/gameplay/src/Node.h +++ b/gameplay/src/Node.h @@ -2,11 +2,15 @@ #define NODE_H_ #include "Transform.h" -#include "Camera.h" -#include "Light.h" +#include "ScriptTarget.h" #include "Model.h" +#include "Sprite.h" +#include "TileSet.h" +#include "Text.h" #include "Form.h" #include "ParticleEmitter.h" +#include "Camera.h" +#include "Light.h" #include "PhysicsRigidBody.h" #include "PhysicsCollisionObject.h" #include "BoundingBox.h" @@ -15,28 +19,37 @@ namespace gameplay { -class AudioSource; -class Bundle; class Scene; -class Form; -class Terrain; +class Camera; +class Light; +class AudioSource; +class AIAgent; +class Drawable; /** * Defines a hierarchical structure of objects in 3D transformation spaces. * * This object allow you to attach components to a scene such as: - * Model, Camera, Light, PhysicsCollisionObject, AudioSource, ParticleEmitter and - * Form components. + * Drawable's(Model, Camera, Light, PhysicsCollisionObject, AudioSource, etc. * * @see http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-Node */ class Node : public Transform, public Ref { friend class Scene; + friend class SceneLoader; friend class Bundle; friend class MeshSkin; friend class Light; + GP_SCRIPT_EVENTS_START(); + GP_SCRIPT_EVENT(update, "f"); + GP_SCRIPT_EVENT(messageReceived, ""); + GP_SCRIPT_EVENT(stateEnter, ""); + GP_SCRIPT_EVENT(stateExit, ""); + GP_SCRIPT_EVENT(stateUpdate, "f"); + GP_SCRIPT_EVENTS_END(); + public: /** @@ -56,6 +69,14 @@ class Node : public Transform, public Ref */ static Node* create(const char* id = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * @return The type name of this class: "Node" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Gets the identifier for the node. * @@ -123,141 +144,117 @@ class Node : public Transform, public Ref Node* getParent() const; /** - * Sets a custom tag on this Node. - * - * Custom tags can be used for a variety of purposes within a game. For example, - * a tag called "transparent" can be added to nodes, to indicate which nodes in - * a scene are transparent. This tag can then be read during rendering to sort - * transparent and opaque objects for correct drawing order. - * - * Setting a tag to NULL removes the tag from the Node. + * Returns the number of direct children of this item. * - * @param name Name of the tag to set. - * @param value Optional value of the tag (empty string by default). + * @return The number of children. */ - void setTag(const char* name, const char* value = ""); + unsigned int getChildCount() const; /** - * Returns the value of the custom tag with the given name. - * - * @param name Name of the tag to return. - * - * @return The value of the given tag, or NULL if the tag is not set. + * Gets the top level node in this node's parent hierarchy. */ - const char* getTag(const char* name) const; + Node* getRootNode() const; /** - * Determines if a custom tag with the specified name is set. + * Returns the first child node that matches the given ID. * - * @param name Name of the tag to query. + * This method checks the specified ID against its immediate child nodes + * but does not check the ID against itself. + * If recursive is true, it also traverses the Node's hierarchy with a breadth first search. * - * @return true if the tag is set, false otherwise. - */ - bool hasTag(const char* name) const; - - /** - * Returns the user pointer for this node. + * @param id The ID of the child to find. + * @param recursive True to search recursively all the node's children, false for only direct children. + * @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned, + * or false if nodes that start with the given ID are returned. * - * @return The user pointer for this node. - * @see setUserPointer(void*) - * @script{ignore} + * @return The Node found or NULL if not found. */ - void* getUserPointer() const; + Node* findNode(const char* id, bool recursive = true, bool exactMatch = true) const; /** - * Sets the user pointer for this node. - * - * The user pointer is initially NULL and can be set to anything. - * This is normally used to store game-specific data, such as - * game state for a particular node. For example, attributes - * for a game character, such as hit points, stamina, etc can - * be defined in a game structure and stored in this field. + * Returns all child nodes that match the given ID. * - * When a node is deleted, the (optional) cleanup callback - * function passed to this function is called to allow the - * user to free any memory associated with the user pointer. + * @param id The ID of the node to find. + * @param nodes A vector of nodes to be populated with matches. + * @param recursive true if a recursive search should be performed, false otherwise. + * @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned, + * or false if nodes that start with the given ID are returned. * - * @param pointer User pointer. - * @param cleanupCallback Optional callback that is called when the - * Node is being destroyed (or when the user pointer changes), - * to allow the user to cleanup any memory associated with the - * user pointer. + * @return The number of matches found. * @script{ignore} */ - void setUserPointer(void* pointer, void (*cleanupCallback)(void*) = NULL); + unsigned int findNodes(const char* id, std::vector& nodes, bool recursive = true, bool exactMatch = true) const; /** - * Sets if the node is active in the scene. + * Gets the scene this node is currenlty within. * - * @param active if the node is active in the scene. + * @return The scene. */ - void setActive(bool active); + virtual Scene* getScene() const; /** - * Gets if the node is active in the scene. + * Sets a tag on this Node. * - * @return if the node is active in the scene. - */ - bool isActive() const; - - /** - * Gets if the node either inherited active. + * tags can be used for a variety of purposes within a game. For example, + * a tag called "transparent" can be added to nodes, to indicate which nodes in + * a scene are transparent. This tag can then be read during rendering to sort + * transparent and opaque objects for correct drawing order. * - * @return if visual components attached on this node should be drawn. + * Setting a tag to NULL removes the tag from the Node. + * + * @param name Name of the tag to set. + * @param value Optional value of the tag (empty string by default). */ - bool isActiveInHierarchy() const; + void setTag(const char* name, const char* value = ""); /** - * Returns the number of direct children of this item. + * Returns the value of the custom tag with the given name. * - * @return The number of children. + * @param name Name of the tag to return. + * + * @return The value of the given tag, or NULL if the tag is not set. */ - unsigned int getChildCount() const; + const char* getTag(const char* name) const; /** - * Returns the first child node that matches the given ID. - * - * This method checks the specified ID against its immediate child nodes - * but does not check the ID against itself. - * If recursive is true, it also traverses the Node's hierarchy with a breadth first search. + * Determines if a custom tag with the specified name is set. * - * @param id The ID of the child to find. - * @param recursive True to search recursively all the node's children, false for only direct children. - * @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned, - * or false if nodes that start with the given ID are returned. + * @param name Name of the tag to query. * - * @return The Node found or NULL if not found. + * @return true if the tag is set, false otherwise. */ - Node* findNode(const char* id, bool recursive = true, bool exactMatch = true) const; + bool hasTag(const char* name) const; /** - * Returns all child nodes that match the given ID. - * - * @param id The ID of the node to find. - * @param nodes A vector of nodes to be populated with matches. - * @param recursive true if a recursive search should be performed, false otherwise. - * @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned, - * or false if nodes that start with the given ID are returned. + * Sets if the node is enabled in the scene. * - * @return The number of matches found. - * @script{ignore} + * @param enabled if the node is enabled in the scene. */ - unsigned int findNodes(const char* id, std::vector& nodes, bool recursive = true, bool exactMatch = true) const; + void setEnabled(bool enabled); /** - * Gets the scene. + * Gets if the node is enabled in the scene. * - * @return The scene. + * @return if the node is enabled in the scene. */ - virtual Scene* getScene() const; + bool isEnabled() const; /** - * Gets the top level node in this node's parent hierarchy. + * Gets if the node inherently enabled. + * + * @return if components attached on this node should be running. */ - Node* getRootNode() const; + bool isEnabledInHierarchy() const; /** - * Updates this node and any active children. + * Called to update the state of this Node. + * + * This method is called by Scene::update(float) to update the state of all active + * nodes in a scene. A Node is considered active if Node::isActive() returns true. + * + * If any scripts are attached to the node, their update event will be fired. + * + * @param elapsedTime Elapsed time in milliseconds. */ void update(float elapsedTime); @@ -417,96 +414,66 @@ class Node : public Transform, public Ref Animation* getAnimation(const char* id = NULL) const; /** - * Returns the pointer to this node's camera. + * Gets the drawable object attached to this node. * - * @return The pointer to this node's camera or NULL. - */ - Camera* getCamera() const; - - /** - * Assigns a camera to this node. * - * This will increase the reference count of the new camera and decrease - * the reference count of the old camera. - * - * @param camera A pointer to a camera. May be NULL. + * @return The model attached to this node. */ - void setCamera(Camera* camera); + Drawable* getDrawable() const; /** - * Returns the pointer to this node's light. + * Set the drawable object to be attached to this node. * - * @return The pointer to this node's light or NULL. - */ - Light* getLight() const; - - /** - * Assigns a light to this node. - * - * This will increase the reference count of the new light and decrease - * the reference count of the old light. - * - * @param light The new light. May be NULL. - */ - void setLight(Light* light); - - /** - * Returns the pointer to this node's model. - * - * @return The pointer to this node's model or NULL. - */ - Model* getModel() const; - - /** - * Assigns a model to this node. - * - * This will increase the reference count of the new model and decrease - * the reference count of the old model. + * This will increase the reference count of the new drawble and decrease + * the reference count of the old drawable. * * @param model The new model. May be NULL. */ - void setModel(Model* model); + void setDrawable(Drawable* drawable); /** - * Returns the pointer to this node's terrain. + * Gets the camera attached to this node. * - * @return The pointer to this node's terrain. + * @return Gets the camera attached to this node. */ - Terrain* getTerrain() const; + Camera* getCamera() const; /** - * Assigns a terrain to this node. + * Attaches a camera to this node. * - * This will increase the reference count of the new terrain and decrease - * the reference count of the old terrain. + * This will increase the reference count of the new camera and decrease + * the reference count of the old camera. * - * @param terrain The new terrain. May be NULL. + * @param camera The new camera. May be NULL. */ - void setTerrain(Terrain* terrain); + void setCamera(Camera* camera); /** - * Returns the pointer to this node's form. + * Get the light attached to this node. * - * @return The pointer to this node's form or NULL. + * @return The light attached to this node. */ - Form* getForm() const; + Light* getLight() const; /** - * Assigns a form to this node. + * Attaches a light to this node. * - * @param form The form pointer. May be NULL. + * This will increase the reference count of the new light and decrease + * the reference count of the old light. + * + * @param light The new light. May be NULL. */ - void setForm(Form* form); + void setLight(Light* light); /** - * Returns the pointer to this node's audio source. + * Gets the audio source attached to this node. * - * @return The pointer to this node's audio source or NULL. + * @return The audio source attached to this node. */ AudioSource* getAudioSource() const; /** - * Assigns an audio source to this node. + * Attaches an audio source to this node. * * This will increase the reference count of the new audio source and decrease * the reference count of the old audio source. @@ -515,23 +482,6 @@ class Node : public Transform, public Ref */ void setAudioSource(AudioSource* audio); - /** - * Returns the pointer to this node's particle emitter. - * - * @return The pointer to this node's particle emitter or NULL. - */ - ParticleEmitter* getParticleEmitter() const; - - /** - * Assigns a particle emitter to this node. - * - * This will increase the reference count of the new particle emitter and decrease - * the reference count of the old particle emitter. - * - * @param emitter The new particle emitter. May be NULL. - */ - void setParticleEmitter(ParticleEmitter* emitter); - /** * Returns the pointer to this node's physics collision object. * @@ -585,9 +535,11 @@ class Node : public Transform, public Ref * @param group Group identifier of the object for collision filtering. * @param mask Bitmask to filter groups of objects to collide with this one. */ - PhysicsCollisionObject* setCollisionObject(PhysicsCollisionObject::Type type, const PhysicsCollisionShape::Definition& shape = PhysicsCollisionShape::box(), - PhysicsRigidBody::Parameters* rigidBodyParameters = NULL, int group = PHYSICS_COLLISION_GROUP_DEFAULT, int mask = PHYSICS_COLLISION_MASK_DEFAULT); - + PhysicsCollisionObject* setCollisionObject(PhysicsCollisionObject::Type type, + const PhysicsCollisionShape::Definition& shape = PhysicsCollisionShape::box(), + PhysicsRigidBody::Parameters* rigidBodyParameters = NULL, + int group = PHYSICS_COLLISION_GROUP_DEFAULT, + int mask = PHYSICS_COLLISION_MASK_DEFAULT); /** * Sets the physics collision object for this node using the data from the Properties object defined at the specified URL, * where the URL is of the format ".#//.../" @@ -598,14 +550,7 @@ class Node : public Transform, public Ref PhysicsCollisionObject* setCollisionObject(const char* url); /** - * Sets the physics collision object for this node from the given properties object. - * - * @param properties The properties object defining the collision object. - */ - PhysicsCollisionObject* setCollisionObject(Properties* properties); - - /** - * Returns the AI agent assigned to this node. + * Gets the AI agent assigned to this node * * @return The AI agent for this node. */ @@ -618,6 +563,20 @@ class Node : public Transform, public Ref */ void setAgent(AIAgent* agent); + /** + * Gets the user object assigned to this node. + * + * @return The user object assigned object to this node. + */ + Ref* getUserObject() const; + + /** + * Sets a user object to be assigned object to this node. + * + * @param obj The user object assigned object to this node. + */ + void setUserObject(Ref* obj); + /** * Returns the bounding sphere for the Node, in world space. * @@ -717,148 +676,33 @@ class Node : public Transform, public Ref */ Node& operator=(const Node&); -protected: + PhysicsCollisionObject* setCollisionObject(Properties* properties); - /** - * Defines a pointer and cleanup callback to custom user data that can be store in a Node. - */ - struct UserData - { - /** - * Constructor. - */ - UserData() : pointer(NULL), cleanupCallback(NULL) {} - - /** - * A pointer to custom user data. - */ - void* pointer; - - /** - * Cleanup callback. - */ - void (*cleanupCallback)(void*); - }; +protected: - /** - * The Scene this node belongs to. - */ Scene* _scene; - - /** - * The Node's ID. - */ std::string _id; - - /** - * Pointer to the Node's first child. - */ Node* _firstChild; - - /** - * Pointer to the Node's next child. - */ Node* _nextSibling; - - /** - * Pointer to the Node's previous sibling. - */ Node* _prevSibling; - - /** - * Pointer to the Node's parent. - */ Node* _parent; - - /** - * The number of children belonging to the Node. - */ unsigned int _childCount; - - /** - * If this node is active in the scrne. This may not be active in hierarchy if its parents are not active. - */ - bool _active; - - /** - * List of custom tags for a node. - */ + bool _enabled; std::map* _tags; - - /** - * Pointer to the Camera attached to the Node. - */ + Drawable* _drawable; Camera* _camera; - - /** - * Pointer to the Light attached to the Node. - */ Light* _light; - - /** - * Pointer to the Model attached to the Node. - */ - Model* _model; - - /** - * Pointer to the Terrain attached to the Node. - */ - Terrain* _terrain; - - /** - * Pointer to the Form attached to the Node. - */ - Form* _form; - - /** - * Pointer to the AudioSource attached to the Node. - */ AudioSource* _audioSource; - - /** - * Pointer to the ParticleEmitter attached to the Node. - */ - ParticleEmitter* _particleEmitter; - - /** - * Pointer to the PhysicsCollisionObject attached to the Node. - */ PhysicsCollisionObject* _collisionObject; - - /** - * Pointer to the AI agent attached to the Node. - */ - AIAgent* _agent; - - /** - * World Matrix representation of the Node. - */ + mutable AIAgent* _agent; + Ref* _userObject; mutable Matrix _world; - - /** - * Dirty bits flag for the Node. - */ mutable int _dirtyBits; - - /** - * A flag indicating if the Node's hierarchy has changed. - */ - bool _notifyHierarchyChanged; - - /** - * The Bounding Sphere containing the Node. - */ mutable BoundingSphere _bounds; - - /** - * Pointer to custom UserData and cleanup call back that can be stored in a Node. - */ - UserData* _userData; }; /** * NodeCloneContext represents the context data that is kept when cloning a node. - * * The NodeCloneContext is used to make sure objects don't get cloned twice. */ class NodeCloneContext diff --git a/gameplay/src/ParticleEmitter.cpp b/gameplay/src/ParticleEmitter.cpp index 85f1620af1..e19d313c1c 100644 --- a/gameplay/src/ParticleEmitter.cpp +++ b/gameplay/src/ParticleEmitter.cpp @@ -14,7 +14,7 @@ namespace gameplay { -ParticleEmitter::ParticleEmitter(unsigned int particleCountMax) : +ParticleEmitter::ParticleEmitter(unsigned int particleCountMax) : Drawable(), _particleCountMax(particleCountMax), _particleCount(0), _particles(NULL), _emissionRate(PARTICLE_EMISSION_RATE), _started(false), _ellipsoid(false), _sizeStartMin(1.0f), _sizeStartMax(1.0f), _sizeEndMin(1.0f), _sizeEndMax(1.0f), @@ -26,9 +26,9 @@ ParticleEmitter::ParticleEmitter(unsigned int particleCountMax) : _rotationPerParticleSpeedMin(0.0f), _rotationPerParticleSpeedMax(0.0f), _rotationSpeedMin(0.0f), _rotationSpeedMax(0.0f), _rotationAxis(Vector3::zero()), _rotation(Matrix::identity()), - _spriteBatch(NULL), _spriteTextureBlending(BLEND_TRANSPARENT), _spriteTextureWidth(0), _spriteTextureHeight(0), _spriteTextureWidthRatio(0), _spriteTextureHeightRatio(0), _spriteTextureCoords(NULL), + _spriteBatch(NULL), _spriteBlendMode(BLEND_ALPHA), _spriteTextureWidth(0), _spriteTextureHeight(0), _spriteTextureWidthRatio(0), _spriteTextureHeightRatio(0), _spriteTextureCoords(NULL), _spriteAnimated(false), _spriteLooped(false), _spriteFrameCount(1), _spriteFrameRandomOffset(0),_spriteFrameDuration(0L), _spriteFrameDurationSecs(0.0f), _spritePercentPerFrame(0.0f), - _node(NULL), _orbitPosition(false), _orbitVelocity(false), _orbitAcceleration(false), + _orbitPosition(false), _orbitVelocity(false), _orbitAcceleration(false), _timePerEmission(PARTICLE_EMISSION_RATE_TIME_INTERVAL), _emitTime(0), _lastUpdated(0) { GP_ASSERT(particleCountMax); @@ -42,7 +42,7 @@ ParticleEmitter::~ParticleEmitter() SAFE_DELETE_ARRAY(_spriteTextureCoords); } -ParticleEmitter* ParticleEmitter::create(const char* textureFile, TextureBlending textureBlending, unsigned int particleCountMax) +ParticleEmitter* ParticleEmitter::create(const char* textureFile, BlendMode blendMode, unsigned int particleCountMax) { Texture* texture = Texture::create(textureFile, true); @@ -54,17 +54,17 @@ ParticleEmitter* ParticleEmitter::create(const char* textureFile, TextureBlendin GP_ASSERT(texture->getWidth()); GP_ASSERT(texture->getHeight()); - ParticleEmitter* emitter = ParticleEmitter::create(texture, textureBlending, particleCountMax); + ParticleEmitter* emitter = ParticleEmitter::create(texture, blendMode, particleCountMax); SAFE_RELEASE(texture); return emitter; } -ParticleEmitter* ParticleEmitter::create(Texture* texture, TextureBlending textureBlending, unsigned int particleCountMax) +ParticleEmitter* ParticleEmitter::create(Texture* texture, BlendMode blendMode, unsigned int particleCountMax) { ParticleEmitter* emitter = new ParticleEmitter(particleCountMax); GP_ASSERT(emitter); - emitter->setTexture(texture, textureBlending); + emitter->setTexture(texture, blendMode); return emitter; } @@ -108,8 +108,11 @@ ParticleEmitter* ParticleEmitter::create(Properties* properties) return NULL; } - const char* blendingString = sprite->getString("blending"); - TextureBlending textureBlending = getTextureBlendingFromString(blendingString); + const char* blendModeString = sprite->getString("blendMode"); + // Check for the old naming + if (blendModeString == NULL) + blendModeString = sprite->getString("blending"); + BlendMode blendMode = getBlendModeFromString(blendModeString); int spriteWidth = sprite->getInt("width"); int spriteHeight = sprite->getInt("height"); bool spriteAnimated = sprite->getBool("animated"); @@ -174,7 +177,7 @@ ParticleEmitter* ParticleEmitter::create(Properties* properties) bool orbitAcceleration = properties->getBool("orbitAcceleration"); // Apply all properties to a newly created ParticleEmitter. - ParticleEmitter* emitter = ParticleEmitter::create(texturePath.c_str(), textureBlending, particleCountMax); + ParticleEmitter* emitter = ParticleEmitter::create(texturePath.c_str(), blendMode, particleCountMax); if (!emitter) { GP_ERROR("Failed to create particle emitter."); @@ -190,24 +193,22 @@ ParticleEmitter* ParticleEmitter::create(Properties* properties) emitter->setAcceleration(acceleration, accelerationVar); emitter->setRotationPerParticle(rotationPerParticleSpeedMin, rotationPerParticleSpeedMax); emitter->setRotation(rotationSpeedMin, rotationSpeedMax, rotationAxis, rotationAxisVar); - emitter->setSpriteAnimated(spriteAnimated); emitter->setSpriteLooped(spriteLooped); emitter->setSpriteFrameRandomOffset(spriteFrameRandomOffset); emitter->setSpriteFrameDuration(spriteFrameDuration); emitter->setSpriteFrameCoords(spriteFrameCount, spriteWidth, spriteHeight); - emitter->setOrbit(orbitPosition, orbitVelocity, orbitAcceleration); return emitter; } -void ParticleEmitter::setTexture(const char* texturePath, TextureBlending textureBlending) +void ParticleEmitter::setTexture(const char* texturePath, BlendMode blendMode) { Texture* texture = Texture::create(texturePath, true); if (texture) { - setTexture(texture, textureBlending); + setTexture(texture, blendMode); texture->release(); } else @@ -216,7 +217,7 @@ void ParticleEmitter::setTexture(const char* texturePath, TextureBlending textur } } -void ParticleEmitter::setTexture(Texture* texture, TextureBlending textureBlending) +void ParticleEmitter::setTexture(Texture* texture, BlendMode blendMode) { // Create new batch before releasing old one, in case the same texture // is used for both (so it's not released before passing to the new batch). @@ -230,7 +231,7 @@ void ParticleEmitter::setTexture(Texture* texture, TextureBlending textureBlendi _spriteBatch->getStateBlock()->setDepthWrite(false); _spriteBatch->getStateBlock()->setDepthTest(true); - setTextureBlending(textureBlending); + setBlendMode(blendMode); _spriteTextureWidth = texture->getWidth(); _spriteTextureHeight = texture->getHeight(); _spriteTextureWidthRatio = 1.0f / (float)texture->getWidth(); @@ -558,17 +559,17 @@ const Vector3& ParticleEmitter::getRotationAxisVariance() const return _rotationAxisVar; } -void ParticleEmitter::setTextureBlending(TextureBlending textureBlending) +void ParticleEmitter::setBlendMode(BlendMode blendMode) { GP_ASSERT(_spriteBatch); GP_ASSERT(_spriteBatch->getStateBlock()); - switch (textureBlending) + switch (blendMode) { - case BLEND_OPAQUE: + case BLEND_NONE: _spriteBatch->getStateBlock()->setBlend(false); break; - case BLEND_TRANSPARENT: + case BLEND_ALPHA: _spriteBatch->getStateBlock()->setBlend(true); _spriteBatch->getStateBlock()->setBlendSrc(RenderState::BLEND_SRC_ALPHA); _spriteBatch->getStateBlock()->setBlendDst(RenderState::BLEND_ONE_MINUS_SRC_ALPHA); @@ -584,16 +585,16 @@ void ParticleEmitter::setTextureBlending(TextureBlending textureBlending) _spriteBatch->getStateBlock()->setBlendDst(RenderState::BLEND_SRC_COLOR); break; default: - GP_ERROR("Unsupported texture blending mode (%d).", textureBlending); + GP_ERROR("Unsupported blend mode (%d).", blendMode); break; } - _spriteTextureBlending = textureBlending; + _spriteBlendMode = blendMode; } -ParticleEmitter::TextureBlending ParticleEmitter::getTextureBlending() const +ParticleEmitter::BlendMode ParticleEmitter::getBlendMode() const { - return _spriteTextureBlending; + return _spriteBlendMode; } void ParticleEmitter::setSpriteAnimated(bool animated) @@ -721,17 +722,6 @@ unsigned int ParticleEmitter::getSpriteFrameCount() const return _spriteFrameCount; } -Node* ParticleEmitter::getNode() const -{ - return _node; -} - -void ParticleEmitter::setNode(Node* node) -{ - // Connect the new node. - _node = node; -} - void ParticleEmitter::setOrbit(bool orbitPosition, bool orbitVelocity, bool orbitAcceleration) { _orbitPosition = orbitPosition; @@ -832,17 +822,25 @@ void ParticleEmitter::generateColor(const Vector4& base, const Vector4& variance dst->w = base.w + variance.w * MATH_RANDOM_MINUS1_1(); } -ParticleEmitter::TextureBlending ParticleEmitter::getTextureBlendingFromString(const char* str) +ParticleEmitter::BlendMode ParticleEmitter::getBlendModeFromString(const char* str) { GP_ASSERT(str); - if (strcmp(str, "BLEND_OPAQUE") == 0 || strcmp(str, "OPAQUE") == 0) + if (strcmp(str, "BLEND_NONE") == 0 || strcmp(str, "NONE") == 0 ) + { + return BLEND_NONE; + } + else if (strcmp(str, "BLEND_OPAQUE") == 0 || strcmp(str, "OPAQUE") == 0 ) { - return BLEND_OPAQUE; + return BLEND_NONE; } - else if (strcmp(str, "BLEND_TRANSPARENT") == 0 || strcmp(str, "TRANSPARENT") == 0) + else if (strcmp(str, "BLEND_ALPHA") == 0 || strcmp(str, "ALPHA") == 0 ) { - return BLEND_TRANSPARENT; + return BLEND_ALPHA; + } + else if (strcmp(str, "BLEND_TRANSPARENT") == 0 || strcmp(str, "TRANSPARENT") == 0 ) + { + return BLEND_ALPHA; } else if (strcmp(str, "BLEND_ADDITIVE") == 0 || strcmp(str, "ADDITIVE") == 0) { @@ -854,7 +852,7 @@ ParticleEmitter::TextureBlending ParticleEmitter::getTextureBlendingFromString(c } else { - return BLEND_TRANSPARENT; + return BLEND_ALPHA; } } @@ -981,7 +979,7 @@ void ParticleEmitter::update(float elapsedTime) } } -unsigned int ParticleEmitter::draw() +unsigned int ParticleEmitter::draw(bool wireframe) { if (!isActive()) return 0; @@ -1028,46 +1026,46 @@ unsigned int ParticleEmitter::draw() return 1; } -ParticleEmitter* ParticleEmitter::clone() +Drawable* ParticleEmitter::clone(NodeCloneContext& context) { // Create a clone of this emitter - ParticleEmitter* emitter = ParticleEmitter::create(_spriteBatch->getSampler()->getTexture(), _spriteTextureBlending, _particleCountMax); - - // Copy all properties to the clone - emitter->setEmissionRate(_emissionRate); - emitter->_ellipsoid = _ellipsoid; - emitter->_sizeStartMin = _sizeStartMin; - emitter->_sizeStartMax = _sizeStartMax; - emitter->_sizeEndMin = _sizeEndMin; - emitter->_sizeEndMax = _sizeEndMax; - emitter->_energyMin = _energyMin; - emitter->_energyMax = _energyMax; - emitter->_colorStart = _colorStart; - emitter->_colorStartVar = _colorStartVar; - emitter->_colorEnd = _colorEnd; - emitter->_colorEndVar = _colorEndVar; - emitter->_position = _position; - emitter->_positionVar = _positionVar; - emitter->_velocity = _velocity; - emitter->_velocityVar = _velocityVar; - emitter->_acceleration = _acceleration; - emitter->_accelerationVar = _accelerationVar; - emitter->_rotationPerParticleSpeedMin = _rotationPerParticleSpeedMin; - emitter->_rotationPerParticleSpeedMax = _rotationPerParticleSpeedMax; - emitter->_rotationSpeedMin = _rotationSpeedMin; - emitter->_rotationSpeedMax = _rotationSpeedMax; - emitter->_rotationAxis = _rotationAxis; - emitter->_rotationAxisVar = _rotationAxisVar; - emitter->setSpriteTexCoords(_spriteFrameCount, _spriteTextureCoords); - emitter->_spriteAnimated = _spriteAnimated; - emitter->_spriteLooped = _spriteLooped; - emitter->_spriteFrameRandomOffset = _spriteFrameRandomOffset; - emitter->setSpriteFrameDuration(_spriteFrameDuration); - emitter->_orbitPosition = _orbitPosition; - emitter->_orbitVelocity = _orbitVelocity; - emitter->_orbitAcceleration = _orbitAcceleration; - - return emitter; + ParticleEmitter* clone = ParticleEmitter::create(_spriteBatch->getSampler()->getTexture(), + _spriteBlendMode, _particleCountMax); + // Clone properties + clone->setEmissionRate(_emissionRate); + clone->_ellipsoid = _ellipsoid; + clone->_sizeStartMin = _sizeStartMin; + clone->_sizeStartMax = _sizeStartMax; + clone->_sizeEndMin = _sizeEndMin; + clone->_sizeEndMax = _sizeEndMax; + clone->_energyMin = _energyMin; + clone->_energyMax = _energyMax; + clone->_colorStart = _colorStart; + clone->_colorStartVar = _colorStartVar; + clone->_colorEnd = _colorEnd; + clone->_colorEndVar = _colorEndVar; + clone->_position = _position; + clone->_positionVar = _positionVar; + clone->_velocity = _velocity; + clone->_velocityVar = _velocityVar; + clone->_acceleration = _acceleration; + clone->_accelerationVar = _accelerationVar; + clone->_rotationPerParticleSpeedMin = _rotationPerParticleSpeedMin; + clone->_rotationPerParticleSpeedMax = _rotationPerParticleSpeedMax; + clone->_rotationSpeedMin = _rotationSpeedMin; + clone->_rotationSpeedMax = _rotationSpeedMax; + clone->_rotationAxis = _rotationAxis; + clone->_rotationAxisVar = _rotationAxisVar; + clone->setSpriteTexCoords(_spriteFrameCount, _spriteTextureCoords); + clone->_spriteAnimated = _spriteAnimated; + clone->_spriteLooped = _spriteLooped; + clone->_spriteFrameRandomOffset = _spriteFrameRandomOffset; + clone->setSpriteFrameDuration(_spriteFrameDuration); + clone->_orbitPosition = _orbitPosition; + clone->_orbitVelocity = _orbitVelocity; + clone->_orbitAcceleration = _orbitAcceleration; + + return clone; } } diff --git a/gameplay/src/ParticleEmitter.h b/gameplay/src/ParticleEmitter.h index e30064509a..7f226fc813 100644 --- a/gameplay/src/ParticleEmitter.h +++ b/gameplay/src/ParticleEmitter.h @@ -9,6 +9,7 @@ #include "Rectangle.h" #include "SpriteBatch.h" #include "Properties.h" +#include "Drawable.h" namespace gameplay { @@ -138,19 +139,19 @@ class Node; * * @see http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-Particles */ -class ParticleEmitter : public Ref +class ParticleEmitter : public Ref, public Drawable { friend class Node; public: /** - * Defines the types of texture blending + * Defines the types of blend modes */ - enum TextureBlending + enum BlendMode { - BLEND_OPAQUE, - BLEND_TRANSPARENT, + BLEND_NONE, + BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED }; @@ -181,11 +182,11 @@ class ParticleEmitter : public Ref * Creates an uninitialized ParticleEmitter. * * @param texturePath A path to the image to use as this ParticleEmitter's texture. - * @param textureBlending The type of texture blending to be used for the particles emitted. + * @param blendMode The blend mode to be used for the particles emitted. * @param particleCountMax The maximum number of particles that can be alive at one time in this ParticleEmitter's system. * @script{create} */ - static ParticleEmitter* create(const char* texturePath, TextureBlending textureBlending, unsigned int particleCountMax); + static ParticleEmitter* create(const char* texturePath, BlendMode blendMode, unsigned int particleCountMax); /** * Sets a new texture for this particle emitter. @@ -193,9 +194,9 @@ class ParticleEmitter : public Ref * The current texture's reference count is decreased. * * @param texturePath Path to the new texture to set. - * @param textureBlending Blending mode for the new texture. + * @param blendMode Blend mode for the new texture. */ - void setTexture(const char* texturePath, TextureBlending textureBlending); + void setTexture(const char* texturePath, BlendMode blendMode); /** * Sets a new texture for this particle emitter. @@ -204,9 +205,9 @@ class ParticleEmitter : public Ref * current texture's reference count is decreased. * * @param texture The new texture to set. - * @param textureBlending Blending mode for the new texture. + * @param blendMode Blend mode for the new texture. */ - void setTexture(Texture* texture, TextureBlending textureBlending); + void setTexture(Texture* texture, BlendMode blendMode); /** * Returns the texture currently set for this particle emitter. @@ -654,13 +655,6 @@ class ParticleEmitter : public Ref */ unsigned int getSpriteFrameCount() const; - /** - * Gets the node that this emitter is attached to. - * - * @return The node that this emitter is attached to. - */ - Node* getNode() const; - /** * Sets whether the vector properties of newly emitted particles are rotated around the node's position * by the node's rotation matrix. @@ -693,42 +687,32 @@ class ParticleEmitter : public Ref bool getOrbitAcceleration() const; /** - * Updates the particles currently being emitted. + * Sets the texture blend mode for this particle emitter. * - * @param elapsedTime The amount of time that has passed since the last call to update(), in milliseconds. + * @param blendMode The new blend mode. */ - void update(float elapsedTime); + void setBlendMode(BlendMode blendMode); /** - * Draws the particles currently being emitted. - */ - unsigned int draw(); - - /** - * Gets a TextureBlending enum from a corresponding string. - */ - static TextureBlending getTextureBlendingFromString(const char* src); - - /** - * Sets the texture blend mode for this particle emitter. + * Gets the current texture blend mode for this particle emitter. * - * @param blending The new blend mode. + * @return The current blend mode. */ - void setTextureBlending(TextureBlending blending); + BlendMode getBlendMode() const; /** - * Gets the current texture blend mode for this particle emitter. + * Updates the particles currently being emitted. * - * @return The current blend mode. + * @param elapsedTime The amount of time that has passed since the last call to update(), in milliseconds. */ - TextureBlending getTextureBlending() const; + void update(float elapsedTime); /** - * Clones the particle emitter and returns a new emitter. - * - * @return The new cloned particle emitter. + * @see Drawable::draw + * + * Draws the particles currently being emitted. */ - ParticleEmitter* clone(); + unsigned int draw(bool wireframe = false); private: @@ -742,26 +726,26 @@ class ParticleEmitter : public Ref */ ~ParticleEmitter(); + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext& context); + /** * Creates an uninitialized ParticleEmitter. * * @param texture the texture to use. - * @param textureBlending The type of texture blending to be used for the particles emitted. + * @param blendMode The blend mode to be used for the particles emitted. * @param particleCountMax The maximum number of particles that can be alive at one time in this ParticleEmitter's system. * @script{create} */ - static ParticleEmitter* create(Texture* texture, TextureBlending textureBlending, unsigned int particleCountMax); + static ParticleEmitter* create(Texture* texture, BlendMode blendMode, unsigned int particleCountMax); /** * Hidden copy assignment operator. */ ParticleEmitter& operator=(const ParticleEmitter&); - /** - * Sets the node that this emitter is attached to. - */ - void setNode(Node* node); - // Generates a scalar within the range defined by min and max. float generateScalar(float min, float max); @@ -778,6 +762,9 @@ class ParticleEmitter : public Ref // Generates a color within the domain defined by a base vector and its variance. void generateColor(const Vector4& base, const Vector4& variance, Vector4* dst); + // Gets the blend mode from string. + static ParticleEmitter::BlendMode getBlendModeFromString(const char* src); + /** * Defines the data for a single particle in the system. */ @@ -834,7 +821,7 @@ class ParticleEmitter : public Ref Vector3 _rotationAxisVar; Matrix _rotation; SpriteBatch* _spriteBatch; - TextureBlending _spriteTextureBlending; + BlendMode _spriteBlendMode; float _spriteTextureWidth; float _spriteTextureHeight; float _spriteTextureWidthRatio; @@ -847,7 +834,6 @@ class ParticleEmitter : public Ref long _spriteFrameDuration; float _spriteFrameDurationSecs; float _spritePercentPerFrame; - Node* _node; bool _orbitPosition; bool _orbitVelocity; bool _orbitAcceleration; diff --git a/gameplay/src/PhysicsCharacter.cpp b/gameplay/src/PhysicsCharacter.cpp index b78bb45994..8999f5d6e4 100644 --- a/gameplay/src/PhysicsCharacter.cpp +++ b/gameplay/src/PhysicsCharacter.cpp @@ -191,6 +191,16 @@ void PhysicsCharacter::setVelocity(float x, float y, float z) _moveVelocity.setValue(x, y, z); } +void PhysicsCharacter::resetVelocityState() +{ + _forwardVelocity = 0.0f; + _rightVelocity = 0.0f; + _verticalVelocity.setZero(); + _currentVelocity.setZero(); + _normalizedVelocity.setZero(); + _moveVelocity.setZero(); +} + void PhysicsCharacter::rotate(const Vector3& axis, float angle) { GP_ASSERT(_node); @@ -234,10 +244,10 @@ Vector3 PhysicsCharacter::getCurrentVelocity() const return v; } -void PhysicsCharacter::jump(float height) +void PhysicsCharacter::jump(float height, bool force) { // TODO: Add support for different jump modes (i.e. double jump, changing direction in air, holding down jump button for extra height, etc) - if (!_verticalVelocity.isZero()) + if (!force && !_verticalVelocity.isZero()) return; // v = sqrt(v0^2 + 2 a s) @@ -245,11 +255,11 @@ void PhysicsCharacter::jump(float height) // a == acceleration (inverse gravity) // s == linear displacement (height) GP_ASSERT(Game::getInstance()->getPhysicsController()); - Vector3 jumpVelocity = -Game::getInstance()->getPhysicsController()->getGravity() * height * 2.0f; + Vector3 jumpVelocity = Game::getInstance()->getPhysicsController()->getGravity() * height * 2.0f; jumpVelocity.set( - jumpVelocity.x == 0 ? 0 : std::sqrt(jumpVelocity.x), - jumpVelocity.y == 0 ? 0 : std::sqrt(jumpVelocity.y), - jumpVelocity.z == 0 ? 0 : std::sqrt(jumpVelocity.z)); + jumpVelocity.x == 0 ? 0 : std::sqrt(std::fabs(jumpVelocity.x)) * (jumpVelocity.x > 0 ? 1.0f : -1.0f), + jumpVelocity.y == 0 ? 0 : std::sqrt(std::fabs(jumpVelocity.y)) * (jumpVelocity.y < 0 ? 1.0f : -1.0f), + jumpVelocity.z == 0 ? 0 : std::sqrt(std::fabs(jumpVelocity.z)) * (jumpVelocity.z > 0 ? 1.0f : -1.0f)); _verticalVelocity += BV(jumpVelocity); } @@ -650,6 +660,9 @@ void PhysicsCharacter::ActionInterface::debugDraw(btIDebugDraw* debugDrawer) void PhysicsCharacter::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) { + if (!isEnabled()) + return; + GP_ASSERT(_ghostObject); GP_ASSERT(_node); diff --git a/gameplay/src/PhysicsCharacter.h b/gameplay/src/PhysicsCharacter.h index 1014e3be6a..96e9e28c3d 100644 --- a/gameplay/src/PhysicsCharacter.h +++ b/gameplay/src/PhysicsCharacter.h @@ -113,6 +113,12 @@ class PhysicsCharacter : public PhysicsGhostObject */ void setVelocity(float x, float y, float z); + /** + * Resets the internal velocity state which brings the character to an immediate stop + * + */ + void resetVelocityState(); + /** * Rotates the character. * @@ -178,8 +184,9 @@ class PhysicsCharacter : public PhysicsGhostObject * Causes the character to jump to the specified height. * * @param height The amount to jump. + * @param force Set true to force the character to jump even if vertical velocity is non-zero */ - void jump(float height); + void jump(float height, bool force = false); protected: diff --git a/gameplay/src/PhysicsCollisionObject.cpp b/gameplay/src/PhysicsCollisionObject.cpp index 222150f9ab..b0812f6368 100644 --- a/gameplay/src/PhysicsCollisionObject.cpp +++ b/gameplay/src/PhysicsCollisionObject.cpp @@ -13,6 +13,8 @@ namespace gameplay { +extern void splitURL(const std::string& url, std::string* file, std::string* id); + /** * Internal class used to implement the collidesWith(PhysicsCollisionObject*) function. * @script{ignore} @@ -45,7 +47,7 @@ PhysicsCollisionObject::~PhysicsCollisionObject() if (_scriptListeners) { - for (unsigned int i = 0; i < _scriptListeners->size(); i++) + for (size_t i = 0, count = _scriptListeners->size(); i < count; ++i) { SAFE_DELETE((*_scriptListeners)[i]); } @@ -144,11 +146,14 @@ void PhysicsCollisionObject::removeCollisionListener(CollisionListener* listener void PhysicsCollisionObject::addCollisionListener(const char* function, PhysicsCollisionObject* object) { + ScriptListener* listener = ScriptListener::create(function); + if (!listener) + return; // falied to load + if (!_scriptListeners) _scriptListeners = new std::vector(); - - ScriptListener* listener = new ScriptListener(function); _scriptListeners->push_back(listener); + addCollisionListener(listener, object); } @@ -158,7 +163,7 @@ void PhysicsCollisionObject::removeCollisionListener(const char* function, Physi return; std::string url = function; - for (unsigned int i = 0; i < _scriptListeners->size(); i++) + for (size_t i = 0, count = _scriptListeners->size(); i < count; ++i) { if ((*_scriptListeners)[i]->url == url) { @@ -183,31 +188,6 @@ bool PhysicsCollisionObject::collidesWith(PhysicsCollisionObject* object) const return callback.result; } -PhysicsRigidBody* PhysicsCollisionObject::asRigidBody() -{ - return getType() == RIGID_BODY ? static_cast(this) : NULL; -} - -PhysicsCharacter* PhysicsCollisionObject::asCharacter() -{ - return getType() == CHARACTER ? static_cast(this) : NULL; -} - -PhysicsGhostObject* PhysicsCollisionObject::asGhostObject() -{ - return getType() == GHOST_OBJECT ? static_cast(this) : NULL; -} - -PhysicsVehicle* PhysicsCollisionObject::asVehicle() -{ - return getType() == VEHICLE ? static_cast(this) : NULL; -} - -PhysicsVehicleWheel* PhysicsCollisionObject::asVehicleWheel() -{ - return getType() == VEHICLE_WHEEL ? static_cast(this) : NULL; -} - PhysicsCollisionObject::CollisionPair::CollisionPair(PhysicsCollisionObject* objectA, PhysicsCollisionObject* objectB) : objectA(objectA), objectB(objectB) { @@ -301,10 +281,43 @@ void PhysicsCollisionObject::PhysicsMotionState::setCenterOfMassOffset(const Vec _centerOfMassOffset.setOrigin(BV(centerOfMassOffset)); } -PhysicsCollisionObject::ScriptListener::ScriptListener(const char* url) - : url(url) +PhysicsCollisionObject::ScriptListener::ScriptListener() + : script(NULL) +{ +} + +PhysicsCollisionObject::ScriptListener::~ScriptListener() +{ + SAFE_RELEASE(script); +} + +PhysicsCollisionObject::ScriptListener* PhysicsCollisionObject::ScriptListener::create(const char* url) { - function = Game::getInstance()->getScriptController()->loadUrl(url); + std::string scriptPath, func; + splitURL(url, &scriptPath, &func); + if (func.empty()) + { + // Only a function was specified + func = scriptPath; + scriptPath = ""; + } + + Script* script = NULL; + if (!scriptPath.empty()) + { + script = Game::getInstance()->getScriptController()->loadScript(scriptPath.c_str(), Script::GLOBAL); + if (!script) + { + // Failed to load script + return NULL; + } + } + + ScriptListener* listener = new ScriptListener(); + listener->url = url; + listener->script = script; + listener->function = func; + return listener; } void PhysicsCollisionObject::ScriptListener::collisionEvent(PhysicsCollisionObject::CollisionListener::EventType type, diff --git a/gameplay/src/PhysicsCollisionObject.h b/gameplay/src/PhysicsCollisionObject.h index 93e99690ad..8233e8a2ee 100644 --- a/gameplay/src/PhysicsCollisionObject.h +++ b/gameplay/src/PhysicsCollisionObject.h @@ -1,6 +1,7 @@ #ifndef PHYSICSCOLLISIONOBJECT_H_ #define PHYSICSCOLLISIONOBJECT_H_ +#include "Script.h" #include "Vector3.h" #include "PhysicsCollisionShape.h" @@ -236,9 +237,10 @@ class PhysicsCollisionObject /** * Adds a collision listener for this collision object. * - * Note: the given Lua function must match the function signature of PhysicsCollisionObject::CollisionListener::collisionEvent. + * Note: the given script function must be global and it must match the function + * signature of PhysicsCollisionObject::CollisionListener::collisionEvent. * - * @param function The Lua script function to add as a listener callback. + * @param function A valid global script function to add as a listener callback. * @param object Optional collision object used to filter the collision event. */ void addCollisionListener(const char* function, PhysicsCollisionObject* object = NULL); @@ -246,7 +248,7 @@ class PhysicsCollisionObject /** * Removes a collision listener. * - * @param function The Lua function (used as a listener callback) to remove. + * @param function The previously added script function to remove. * @param object Optional collision object used to filter the collision event. */ void removeCollisionListener(const char* function, PhysicsCollisionObject* object = NULL); @@ -260,62 +262,29 @@ class PhysicsCollisionObject */ bool collidesWith(PhysicsCollisionObject* object) const; - /** - * Returns this collision object as a physics rigid body. - * - * If this collision object is not of type RIGID_BODY, this method returns NULL. - * - * @return This collision object cast to a PhysicsRigidBody. - */ - PhysicsRigidBody* asRigidBody(); - - /** - * Returns this collision object as a physics character. - * - * If this collision object is not of type CHARACTER, this method returns NULL. - * - * @return This collision object cast to a PhysicsCharacter. - */ - PhysicsCharacter* asCharacter(); - - /** - * Returns this collision object as a physics ghost object. - * - * If this collision object is not of type GHOST_OBJECT, this method returns NULL. - * - * @return This collision object cast to a PhysicsGhostObject. - */ - PhysicsGhostObject* asGhostObject(); - - /** - * Returns this collision object as a physics vehicle. - * - * If this collision object is not of type VEHICLE, this method returns NULL. - * - * @return This collision object cast to a PhysicsVehicle. - */ - PhysicsVehicle* asVehicle(); - - /** - * Returns this collision object as a physics vehicle wheel. - * - * If this collision object is not of type VEHICLE_WHEEL, this method returns NULL. - * - * @return This collision object cast to a PhysicsVehicleWheel. - */ - PhysicsVehicleWheel* asVehicleWheel(); protected: /** * Handles collision event callbacks to Lua script functions. */ - struct ScriptListener : public CollisionListener + class ScriptListener : public CollisionListener { + public: + /** - * Constructor. + * Destructor. */ - ScriptListener(const char* url); + ~ScriptListener(); + + /** + * Creates a ScriptListener for the given script function url. + * + * @param url The global script function, or script#function. + * + * @return The ScriptListener, or NULL if the function could not be loaded. + */ + static ScriptListener* create(const char* url); /** * @see PhysicsCollisionObject::CollisionListener @@ -325,8 +294,17 @@ class PhysicsCollisionObject /** The URL to the Lua script function to use as the callback. */ std::string url; + /** The loaded script that contains the function. */ + Script* script; /** The name of the Lua script function to use as the callback. */ std::string function; + + private: + + /** + * Constructor. + */ + ScriptListener(); }; /** diff --git a/gameplay/src/PhysicsCollisionShape.cpp b/gameplay/src/PhysicsCollisionShape.cpp index f84ed0f270..f2c81371d2 100644 --- a/gameplay/src/PhysicsCollisionShape.cpp +++ b/gameplay/src/PhysicsCollisionShape.cpp @@ -5,6 +5,7 @@ #include "Properties.h" #include "FileSystem.h" #include "HeightField.h" +#include "Terrain.h" namespace gameplay { @@ -154,7 +155,7 @@ PhysicsCollisionShape::Definition PhysicsCollisionShape::Definition::create(Node // Load the defined properties. properties->rewind(); const char* name; - while (name = properties->getNextProperty()) + while ((name = properties->getNextProperty())) { if (strcmp(name, "shape") == 0) { @@ -288,7 +289,7 @@ PhysicsCollisionShape::Definition PhysicsCollisionShape::Definition::create(Node case SHAPE_MESH: { // Mesh is required on node. - Mesh* nodeMesh = node->getModel() ? node->getModel()->getMesh() : NULL; + Mesh* nodeMesh = node->getDrawable() ? dynamic_cast(node->getDrawable())->getMesh() : NULL; if (nodeMesh == NULL) { GP_ERROR("Cannot create mesh collision object for node without model/mesh."); @@ -317,7 +318,7 @@ PhysicsCollisionShape::Definition PhysicsCollisionShape::Definition::create(Node if (imagePath == NULL) { // Node requires a valid terrain - if (node->getTerrain() == NULL) + if (dynamic_cast(node->getDrawable()) == NULL) { GP_ERROR("Heightfield collision objects can only be specified on nodes that have a valid terrain, or that specify an image path."); } diff --git a/gameplay/src/PhysicsConstraint.h b/gameplay/src/PhysicsConstraint.h index 5c814e6819..f9a5417845 100644 --- a/gameplay/src/PhysicsConstraint.h +++ b/gameplay/src/PhysicsConstraint.h @@ -6,8 +6,8 @@ namespace gameplay { - class Node; class PhysicsRigidBody; + class Node; /** * Defines the base class for physics constraints. diff --git a/gameplay/src/PhysicsController.cpp b/gameplay/src/PhysicsController.cpp index b7b1efa969..6eb09a949b 100644 --- a/gameplay/src/PhysicsController.cpp +++ b/gameplay/src/PhysicsController.cpp @@ -33,10 +33,10 @@ PhysicsController::PhysicsController() _debugDrawer(NULL), _status(PhysicsController::Listener::DEACTIVATED), _listeners(NULL), _gravity(btScalar(0.0), btScalar(-9.8), btScalar(0.0)), _collisionCallback(NULL) { + GP_REGISTER_SCRIPT_EVENTS(); + // Default gravity is 9.8 along the negative Y axis. _collisionCallback = new CollisionCallback(this); - - addScriptEvent("statusEvent", "[PhysicsController::Listener::EventType]"); } PhysicsController::~PhysicsController() @@ -47,6 +47,11 @@ PhysicsController::~PhysicsController() SAFE_DELETE(_listeners); } +const char* PhysicsController::getTypeName() const +{ + return "PhysicsController"; +} + void PhysicsController::addStatusListener(Listener* listener) { GP_ASSERT(listener); @@ -484,7 +489,7 @@ void PhysicsController::update(float elapsedTime) _world->stepSimulation(elapsedTime * 0.001f, 10); // If we have status listeners, then check if our status has changed. - if (_listeners || _callbacks["statusEvent"]) + if (_listeners || hasScriptListener(GP_GET_SCRIPT_EVENT(PhysicsController, statusEvent))) { Listener::EventType oldStatus = _status; @@ -529,7 +534,7 @@ void PhysicsController::update(float elapsedTime) } } - fireScriptEvent("statusEvent", _status); + fireScriptEvent(GP_GET_SCRIPT_EVENT(PhysicsController, statusEvent), _status); } } @@ -714,15 +719,16 @@ static void getBoundingBox(Node* node, BoundingBox* out, bool merge = false) GP_ASSERT(node); GP_ASSERT(out); - if (node->getModel()) + Model* model = dynamic_cast(node->getDrawable()); + if (model != NULL) { - GP_ASSERT(node->getModel()->getMesh()); + GP_ASSERT(model->getMesh()); if (merge) - out->merge(node->getModel()->getMesh()->getBoundingBox()); + out->merge(model->getMesh()->getBoundingBox()); else { - out->set(node->getModel()->getMesh()->getBoundingBox()); + out->set(model->getMesh()->getBoundingBox()); merge = true; } } @@ -740,15 +746,16 @@ static void getBoundingSphere(Node* node, BoundingSphere* out, bool merge = fals GP_ASSERT(node); GP_ASSERT(out); - if (node->getModel()) + Model* model = dynamic_cast(node->getDrawable()); + if (model != NULL) { - GP_ASSERT(node->getModel()->getMesh()); + GP_ASSERT(model->getMesh()); if (merge) - out->merge(node->getModel()->getMesh()->getBoundingSphere()); + out->merge(model->getMesh()->getBoundingSphere()); else { - out->set(node->getModel()->getMesh()->getBoundingSphere()); + out->set(model->getMesh()->getBoundingSphere()); merge = true; } } @@ -887,10 +894,10 @@ PhysicsCollisionShape* PhysicsController::createShape(Node* node, const PhysicsC else { // Build the heightfield from an attached terrain's height array - if (node->getTerrain() == NULL) + if (dynamic_cast(node->getDrawable()) == NULL) GP_ERROR("Empty heightfield collision shapes can only be used on nodes that have an attached Terrain."); else - collisionShape = createHeightfield(node, node->getTerrain()->_heightfield, centerOfMassOffset); + collisionShape = createHeightfield(node, dynamic_cast(node->getDrawable())->_heightfield, centerOfMassOffset); } } break; @@ -1032,9 +1039,10 @@ PhysicsCollisionShape* PhysicsController::createHeightfield(Node* node, HeightFi node->getWorldMatrix().getScale(&scale); // If the node has a terrain, apply the terrain's local scale to the world scale - if (node->getTerrain()) + Terrain* terrain = dynamic_cast(node->getDrawable()); + if (terrain != NULL) { - const Vector3& tScale = node->getTerrain()->_localScale; + const Vector3& tScale = terrain->_localScale; scale.set(scale.x * tScale.x, scale.y * tScale.y, scale.z * tScale.z); } diff --git a/gameplay/src/PhysicsController.h b/gameplay/src/PhysicsController.h index 97f28501df..69db2e991a 100644 --- a/gameplay/src/PhysicsController.h +++ b/gameplay/src/PhysicsController.h @@ -32,6 +32,10 @@ class PhysicsController : public ScriptTarget friend class PhysicsCollisionObject; friend class PhysicsGhostObject; + GP_SCRIPT_EVENTS_START(); + GP_SCRIPT_EVENT(statusEvent, "[PhysicsController::Listener::EventType]"); + GP_SCRIPT_EVENTS_END(); + public: /** @@ -144,6 +148,14 @@ class PhysicsController : public ScriptTarget virtual bool hit(const HitResult& result); }; + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * @return The type name of this class: "PhysicsController" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Adds a listener to the physics controller. * @@ -464,10 +476,30 @@ class PhysicsController : public ScriptTarget { public: + /** + * Constructor. + */ + DebugDrawer(); + /** - * DebugVertex. - * @script{ignore} + * Destructor. */ + ~DebugDrawer(); + + void begin(const Matrix& viewProjection); + void end(); + + // Overridden Bullet functions from btIDebugDraw. + void drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor); + void drawLine(const btVector3& from, const btVector3& to, const btVector3& color); + void drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color); + void reportErrorWarning(const char* warningString); + void draw3dText(const btVector3& location, const char* textString); + void setDebugMode(int mode); + int getDebugMode() const; + + private: + struct DebugVertex { /** @@ -504,31 +536,7 @@ class PhysicsController : public ScriptTarget * The alpha component of the vertex. */ float a; - }; - - /** - * Constructor. - */ - DebugDrawer(); - - /** - * Destructor. - */ - ~DebugDrawer(); - - void begin(const Matrix& viewProjection); - void end(); - - // Overridden Bullet functions from btIDebugDraw. - void drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor); - void drawLine(const btVector3& from, const btVector3& to, const btVector3& color); - void drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color); - void reportErrorWarning(const char* warningString); - void draw3dText(const btVector3& location, const char* textString); - void setDebugMode(int mode); - int getDebugMode() const; - - private: + }; int _mode; MeshBatch* _meshBatch; diff --git a/gameplay/src/PhysicsRigidBody.cpp b/gameplay/src/PhysicsRigidBody.cpp index f82f2422e3..a40a4177ba 100644 --- a/gameplay/src/PhysicsRigidBody.cpp +++ b/gameplay/src/PhysicsRigidBody.cpp @@ -286,8 +286,9 @@ float PhysicsRigidBody::getHeight(float x, float z) const // If our node has a terrain, call getHeight() on it since we need to factor in local // scaling on the terrain into the height calculation. - if (_node->getTerrain()) - return _node->getTerrain()->getHeight(x, z); + Terrain* terrain = dynamic_cast(_node->getDrawable()); + if (terrain) + return terrain->getHeight(x, z); // This function is only supported for heightfield rigid bodies. if (_collisionShape->getType() != PhysicsCollisionShape::SHAPE_HEIGHTFIELD) @@ -374,9 +375,10 @@ void PhysicsRigidBody::transformChanged(Transform* transform, long cookie) _node->getWorldMatrix().getScale(&scale); // If the node has a terrain attached, factor in the terrain local scaling as well for the collision shape - if (_node->getTerrain()) + Terrain* terrain = dynamic_cast(_node->getDrawable()); + if (terrain) { - const Vector3& tScale = _node->getTerrain()->_localScale; + const Vector3& tScale = terrain->_localScale; scale.set(scale.x * tScale.x, scale.y * tScale.y, scale.z * tScale.z); } diff --git a/gameplay/src/PhysicsVehicle.cpp b/gameplay/src/PhysicsVehicle.cpp index b44485450f..fa4c8a01d8 100644 --- a/gameplay/src/PhysicsVehicle.cpp +++ b/gameplay/src/PhysicsVehicle.cpp @@ -224,14 +224,14 @@ void PhysicsVehicle::setEnabled(bool enable) getRigidBody()->setEnabled(enable); } -unsigned int PhysicsVehicle::getNumWheels() const +unsigned int PhysicsVehicle::getWheelCount() const { return (unsigned int)_wheels.size(); } -PhysicsVehicleWheel* PhysicsVehicle::getWheel(unsigned int i) +PhysicsVehicleWheel* PhysicsVehicle::getWheel(unsigned int index) { - return _wheels.at(i); + return _wheels.at(index); } void PhysicsVehicle::addWheel(PhysicsVehicleWheel* wheel) diff --git a/gameplay/src/PhysicsVehicle.h b/gameplay/src/PhysicsVehicle.h index dfe5981ed7..91f8ae7914 100644 --- a/gameplay/src/PhysicsVehicle.h +++ b/gameplay/src/PhysicsVehicle.h @@ -7,7 +7,6 @@ namespace gameplay { -class Node; class PhysicsVehicleWheel; /** @@ -45,11 +44,11 @@ class PhysicsVehicle : public PhysicsCollisionObject void setEnabled(bool enable); /** - * Returns the number of wheels on this vehicle. + * Gets the number of wheels on this vehicle. * * @return the number of wheels on this vehicle. */ - unsigned int getNumWheels() const; + unsigned int getWheelCount() const; /** * Gets the wheel at the specified index. @@ -67,12 +66,12 @@ class PhysicsVehicle : public PhysicsCollisionObject void addWheel(PhysicsVehicleWheel* wheel); /** - * Returns an indication of vehicle speed in kilometers per hour. + * Gets an indication of vehicle speed in kilometers per hour. */ float getSpeedKph() const; /** - * Returns a lagged version of vehicle speed in kilometers per hour, + * Gets a lagged version of vehicle speed in kilometers per hour, * for example that might be used to control engine sounds. */ float getSpeedSmoothKph() const; diff --git a/gameplay/src/PhysicsVehicleWheel.cpp b/gameplay/src/PhysicsVehicleWheel.cpp index e0d0b48d7f..30ddce4378 100644 --- a/gameplay/src/PhysicsVehicleWheel.cpp +++ b/gameplay/src/PhysicsVehicleWheel.cpp @@ -129,8 +129,8 @@ void PhysicsVehicleWheel::findAncestorAndBind() Node* m; for (Node* n = getNode(); n && !host; n = n->getParent()) { - // Visit siblings before n - for (m = n->getPreviousSibling(); m && !host; m = m->getPreviousSibling()) + // Visit previous siblings starting with n + for (m = n; m && !host; m = m->getPreviousSibling()) { host = findVehicle(m); } @@ -175,7 +175,7 @@ void PhysicsVehicleWheel::setHost(PhysicsVehicle* host, unsigned int indexInHost void PhysicsVehicleWheel::addToVehicle(btRaycastVehicle* vehicle) { GP_ASSERT(_host); - GP_ASSERT(_host->getNumWheels() == vehicle->getNumWheels() + 1); + GP_ASSERT(_host->getWheelCount() == vehicle->getNumWheels() + 1); // Use safe defaults for now. Properties are assigned elsewhere. btRaycastVehicle::btVehicleTuning tuning; diff --git a/gameplay/src/PhysicsVehicleWheel.h b/gameplay/src/PhysicsVehicleWheel.h index 038a98bf65..38ee328f35 100644 --- a/gameplay/src/PhysicsVehicleWheel.h +++ b/gameplay/src/PhysicsVehicleWheel.h @@ -3,11 +3,11 @@ #include "PhysicsCollisionObject.h" #include "PhysicsRigidBody.h" +#include "Node.h" namespace gameplay { -class Node; class PhysicsVehicle; /** diff --git a/gameplay/src/Platform.cpp b/gameplay/src/Platform.cpp index 45101b508a..09d6fee682 100644 --- a/gameplay/src/Platform.cpp +++ b/gameplay/src/Platform.cpp @@ -12,8 +12,7 @@ void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned { if (actuallyMouse || !Form::touchEventInternal(evt, x, y, contactIndex)) { - Game::getInstance()->touchEvent(evt, x, y, contactIndex); - Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex); + Game::getInstance()->touchEventInternal(evt, x, y, contactIndex); } } @@ -21,102 +20,92 @@ void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key) { if (!Form::keyEventInternal(evt, key)) { - Game::getInstance()->keyEvent(evt, key); - Game::getInstance()->getScriptController()->keyEvent(evt, key); + Game::getInstance()->keyEventInternal(evt, key); } } bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta) { if (Form::mouseEventInternal(evt, x, y, wheelDelta)) - { - return true; - } - else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta)) - { return true; - } - else - { - return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta); - } + + return Game::getInstance()->mouseEventInternal(evt, x, y, wheelDelta); } void Platform::gestureSwipeEventInternal(int x, int y, int direction) { - // TODO: Add support to Form for gestures - Game::getInstance()->gestureSwipeEvent(x, y, direction); - Game::getInstance()->getScriptController()->gestureSwipeEvent(x, y, direction); + Game::getInstance()->gestureSwipeEventInternal(x, y, direction); } void Platform::gesturePinchEventInternal(int x, int y, float scale) { - // TODO: Add support to Form for gestures - Game::getInstance()->gesturePinchEvent(x, y, scale); - Game::getInstance()->getScriptController()->gesturePinchEvent(x, y, scale); + Game::getInstance()->gesturePinchEventInternal(x, y, scale); } void Platform::gestureTapEventInternal(int x, int y) { - // TODO: Add support to Form for gestures - Game::getInstance()->gestureTapEvent(x, y); - Game::getInstance()->getScriptController()->gestureTapEvent(x, y); + Game::getInstance()->gestureTapEventInternal(x, y); } void Platform::gestureLongTapEventInternal(int x, int y, float duration) { - // TODO: Add support to Form for gestures - Game::getInstance()->gestureLongTapEvent(x, y, duration); - Game::getInstance()->getScriptController()->gestureLongTapEvent(x, y, duration); + Game::getInstance()->gestureLongTapEventInternal(x, y, duration); } void Platform::gestureDragEventInternal(int x, int y) { - // TODO: Add support to Form for gestures - Game::getInstance()->gestureDragEvent(x, y); - Game::getInstance()->getScriptController()->gestureDragEvent(x, y); + Game::getInstance()->gestureDragEventInternal(x, y); } void Platform::gestureDropEventInternal(int x, int y) { - // TODO: Add support to Form for gestures - Game::getInstance()->gestureDropEvent(x, y); - Game::getInstance()->getScriptController()->gestureDropEvent(x, y); + Game::getInstance()->gestureDropEventInternal(x, y); } void Platform::resizeEventInternal(unsigned int width, unsigned int height) { - // Update the width and height of the game - Game* game = Game::getInstance(); - if (game->_width != width || game->_height != height) - { - game->_width = width; - game->_height = height; - game->resizeEvent(width, height); - game->getScriptController()->resizeEvent(width, height); - } - + Game::getInstance()->resizeEventInternal(width, height); Form::resizeEventInternal(width, height); } -void Platform::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex) +void Platform::gamepadEventConnectedInternal(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, const char* name) { - if (!Form::gamepadEventInternal(evt, gamepad, analogIndex)) - { - Game::getInstance()->gamepadEvent(evt, gamepad); - Game::getInstance()->getScriptController()->gamepadEvent(evt, gamepad); - } + Gamepad::add(handle, buttonCount, joystickCount, triggerCount, name); } -void Platform::gamepadEventConnectedInternal(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, - unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString) +void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle) { - Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString); + Gamepad::remove(handle); } -void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle) +void Platform::gamepadButtonPressedEventInternal(GamepadHandle handle, Gamepad::ButtonMapping mapping) { - Gamepad::remove(handle); + Gamepad* gamepad = Gamepad::getGamepad(handle); + unsigned int newButtons = gamepad->_buttons | (1 << mapping); + gamepad->setButtons(newButtons); + Form::gamepadButtonEventInternal(gamepad); +} + +void Platform::gamepadButtonReleasedEventInternal(GamepadHandle handle, Gamepad::ButtonMapping mapping) +{ + Gamepad* gamepad = Gamepad::getGamepad(handle); + unsigned int newButtons = gamepad->_buttons & ~(1 << mapping); + gamepad->setButtons(newButtons); + Form::gamepadButtonEventInternal(gamepad); +} + +void Platform::gamepadTriggerChangedEventInternal(GamepadHandle handle, unsigned int index, float value) +{ + Gamepad* gamepad = Gamepad::getGamepad(handle); + gamepad->setTriggerValue(index, value); + Form::gamepadTriggerEventInternal(gamepad, index); +} + +void Platform::gamepadJoystickChangedEventInternal(GamepadHandle handle, unsigned int index, float x, float y) +{ + Gamepad* gamepad = Gamepad::getGamepad(handle); + gamepad->setJoystickValue(index, x, y); + Form::gamepadJoystickEventInternal(gamepad, index); } } diff --git a/gameplay/src/Platform.h b/gameplay/src/Platform.h index 71a78fdc62..364bb294e0 100644 --- a/gameplay/src/Platform.h +++ b/gameplay/src/Platform.h @@ -370,27 +370,48 @@ class Platform * * @script{ignore} */ - static void gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex = 0); + static void gamepadEventConnectedInternal(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, const char* name); /** * Internal method used only from static code in various platform implementation. * * @script{ignore} */ - static void gamepadEventConnectedInternal(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount, - unsigned int vendorId, unsigned int productId, - const char* vendorString, const char* productString); + static void gamepadEventDisconnectedInternal(GamepadHandle handle); /** * Internal method used only from static code in various platform implementation. * * @script{ignore} */ - static void gamepadEventDisconnectedInternal(GamepadHandle handle); + static void gamepadButtonPressedEventInternal(GamepadHandle handle, Gamepad::ButtonMapping mapping); /** - * Internal method used by Gamepad that polls the platform for the updated Gamepad - * states such as joysticks, buttons and trigger values. + * Internal method used only from static code in various platform implementation. + * + * @script{ignore} + */ + static void gamepadButtonReleasedEventInternal(GamepadHandle handle, Gamepad::ButtonMapping button); + + /** + * Internal method used only from static code in various platform implementation. + * + * @script{ignore} + */ + static void gamepadTriggerChangedEventInternal(GamepadHandle handle, unsigned int index, float value); + + /** + * Internal method used only from static code in various platform implementation. + * + * @script{ignore} + */ + static void gamepadJoystickChangedEventInternal(GamepadHandle handle, unsigned int index, float x, float y); + + /** + * Internal method used to poll the platform for the updated Gamepad + * states such as buttons, joytick and trigger values. + * + * Some platforms require to poll the gamepad system to get deltas. * * @param gamepad The gamepad to be returned with the latest polled values populated. * @script{ignore} diff --git a/gameplay/src/PlatformAndroid.cpp b/gameplay/src/PlatformAndroid.cpp index e2ef06400c..9deea7bf2a 100644 --- a/gameplay/src/PlatformAndroid.cpp +++ b/gameplay/src/PlatformAndroid.cpp @@ -4,6 +4,7 @@ #include "Platform.h" #include "FileSystem.h" #include "Game.h" +#include "Gamepad.h" #include "Form.h" #include "ScriptController.h" #include @@ -701,9 +702,64 @@ static int getUnicode(int keycode, int metastate) } } +Gamepad::ButtonMapping getGamepadButtonMapping(jint keycode) +{ + switch (keycode) + { + case AKEYCODE_BUTTON_X: + return Gamepad::BUTTON_X; + case AKEYCODE_BUTTON_Y: + return Gamepad::BUTTON_Y; + case AKEYCODE_BUTTON_A: + case AKEYCODE_DPAD_CENTER: + return Gamepad::BUTTON_A; + case AKEYCODE_BUTTON_B: + return Gamepad::BUTTON_B; + case AKEYCODE_BUTTON_L1: + return Gamepad::BUTTON_L1; + case AKEYCODE_BUTTON_L2: + return Gamepad::BUTTON_L2; + case AKEYCODE_BUTTON_THUMBL: + return Gamepad::BUTTON_L3; + case AKEYCODE_BUTTON_R1: + return Gamepad::BUTTON_R1; + case AKEYCODE_BUTTON_R2: + return Gamepad::BUTTON_R2; + case AKEYCODE_BUTTON_THUMBR: + return Gamepad::BUTTON_R3; + case AKEYCODE_DPAD_UP: + return Gamepad::BUTTON_UP; + case AKEYCODE_DPAD_DOWN: + return Gamepad::BUTTON_DOWN; + case AKEYCODE_DPAD_LEFT: + return Gamepad::BUTTON_LEFT; + case AKEYCODE_DPAD_RIGHT: + return Gamepad::BUTTON_RIGHT; + case AKEYCODE_BUTTON_SELECT: + case AKEYCODE_BACK: + return Gamepad::BUTTON_MENU1; + case AKEYCODE_BUTTON_START: + return Gamepad::BUTTON_MENU2; + case AKEYCODE_BUTTON_MODE: + return Gamepad::BUTTON_MENU3; + default: + return Gamepad::BUTTON_A; + } +} + +static float clampFuzz(float value, float fuzz) +{ + if (std::fabs(value) <= fuzz) + return 0.0f; + return value; +} + // Process the next input event. static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) { + int32_t deviceId = AInputEvent_getDeviceId(event); + int32_t source = AInputEvent_getSource(event); + if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) { int32_t action = AMotionEvent_getAction(event); @@ -713,305 +769,364 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) int x; int y; - switch (action & AMOTION_EVENT_ACTION_MASK) + if ((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) { - case AMOTION_EVENT_ACTION_DOWN: - { - pointerId = AMotionEvent_getPointerId(event, 0); - x = AMotionEvent_getX(event, 0); - y = AMotionEvent_getY(event, 0); - - // Gesture handling - if ( __gestureEventsProcessed.test(Gesture::GESTURE_TAP) || - __gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) || - __gestureEventsProcessed.test(Gesture::GESTURE_DRAG) || - __gestureEventsProcessed.test(Gesture::GESTURE_DROP) || - __gestureEventsProcessed.test(Gesture::GESTURE_PINCH) || - __gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP)) + // DPAD handling (axis hats) + float xaxis = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_HAT_X, 0); + float yaxis = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_HAT_Y, 0); + if (xaxis == -1.0f) + { + gameplay::Platform::gamepadButtonPressedEventInternal(deviceId, gameplay::Gamepad::BUTTON_LEFT); + } + else if(xaxis == 1.0f) + { + gameplay::Platform::gamepadButtonPressedEventInternal(deviceId, gameplay::Gamepad::BUTTON_RIGHT); + } + else if (xaxis == 0.0f) + { + gameplay::Platform::gamepadButtonReleasedEventInternal(deviceId, gameplay::Gamepad::BUTTON_LEFT); + gameplay::Platform::gamepadButtonReleasedEventInternal(deviceId, gameplay::Gamepad::BUTTON_RIGHT); + } + + if(yaxis == -1.0f) + { + gameplay::Platform::gamepadButtonPressedEventInternal(deviceId, gameplay::Gamepad::BUTTON_UP); + } + else if(yaxis == 1.0f) + { + gameplay::Platform::gamepadButtonPressedEventInternal(deviceId, gameplay::Gamepad::BUTTON_DOWN); + } + else if (yaxis == 0.0f) + { + gameplay::Platform::gamepadButtonReleasedEventInternal(deviceId, gameplay::Gamepad::BUTTON_UP); + gameplay::Platform::gamepadButtonReleasedEventInternal(deviceId, gameplay::Gamepad::BUTTON_DOWN); + } + + // Trigger handling + float leftTrigger = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_BRAKE, 0); + gameplay::Platform::gamepadTriggerChangedEventInternal(deviceId, 0, leftTrigger); + float rightTrigger = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_GAS, 0); + gameplay::Platform::gamepadTriggerChangedEventInternal(deviceId, 1, rightTrigger); + + // Joystick handling + float fuzz = 0.15f; + float x = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_X, 0); + float y = -AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_Y, 0); + gameplay::Platform::gamepadJoystickChangedEventInternal(deviceId, 0, clampFuzz(x, fuzz), clampFuzz(y, fuzz)); + float z = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_Z, 0); + float rz = -AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_RZ, 0); + gameplay::Platform::gamepadJoystickChangedEventInternal(deviceId, 1, clampFuzz(z, fuzz), clampFuzz(rz, fuzz)); + } + else + { + switch (action & AMOTION_EVENT_ACTION_MASK) + { + case AMOTION_EVENT_ACTION_DOWN: { - __pointer0.pressed = true; - __pointer0.time = Game::getInstance()->getAbsoluteTime(); - __pointer0.pointerId = pointerId; - __pointer0.x = x; - __pointer0.y = y; - __gesturePointer0CurrentPosition = __gesturePointer0LastPosition = std::pair(x, y); - } + pointerId = AMotionEvent_getPointerId(event, 0); + x = AMotionEvent_getX(event, 0); + y = AMotionEvent_getY(event, 0); + + // Gesture handling + if ( __gestureEventsProcessed.test(Gesture::GESTURE_TAP) || + __gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) || + __gestureEventsProcessed.test(Gesture::GESTURE_DRAG) || + __gestureEventsProcessed.test(Gesture::GESTURE_DROP) || + __gestureEventsProcessed.test(Gesture::GESTURE_PINCH) || + __gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP)) + { + __pointer0.pressed = true; + __pointer0.time = Game::getInstance()->getAbsoluteTime(); + __pointer0.pointerId = pointerId; + __pointer0.x = x; + __pointer0.y = y; + __gesturePointer0CurrentPosition = __gesturePointer0LastPosition = std::pair(x, y); + } - // Primary pointer down. - gameplay::Platform::touchEventInternal(Touch::TOUCH_PRESS, x, y, pointerId); - __primaryTouchId = pointerId; - } - break; + // Primary pointer down. + gameplay::Platform::touchEventInternal(Touch::TOUCH_PRESS, x, y, pointerId); + __primaryTouchId = pointerId; + } + break; - case AMOTION_EVENT_ACTION_UP: - { - pointerId = AMotionEvent_getPointerId(event, 0); - x = AMotionEvent_getX(event, 0); - y = AMotionEvent_getY(event, 0); - - // Gestures - bool gestureDetected = false; - if (__pointer0.pressed && __pointer0.pointerId == pointerId) + case AMOTION_EVENT_ACTION_UP: { - int deltaX = x - __pointer0.x; - int deltaY = y - __pointer0.y; - - // Test for drop - if (__gesturePinching) - { - __gesturePinching = false; - gestureDetected = true; - } - else if (__gestureDraging) + pointerId = AMotionEvent_getPointerId(event, 0); + x = AMotionEvent_getX(event, 0); + y = AMotionEvent_getY(event, 0); + + // Gestures + bool gestureDetected = false; + if (__pointer0.pressed && __pointer0.pointerId == pointerId && !Form::getActiveControl()) { - if (__gestureEventsProcessed.test(Gesture::GESTURE_DROP)) + int deltaX = x - __pointer0.x; + int deltaY = y - __pointer0.y; + + // Test for drop + if (__gesturePinching) + { + __gesturePinching = false; + gestureDetected = true; + } + else if (__gestureDraging) { - gameplay::Platform::gestureDropEventInternal(x, y); - gestureDetected = true; + if (__gestureEventsProcessed.test(Gesture::GESTURE_DROP)) + { + gameplay::Platform::gestureDropEventInternal(x, y); + gestureDetected = true; + } + __gestureDraging = false; } - __gestureDraging = false; - } - // Test for swipe - else if (__gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time < GESTURE_SWIPE_DURATION_MAX && - (abs(deltaX) > GESTURE_SWIPE_DISTANCE_MIN || abs(deltaY) > GESTURE_SWIPE_DISTANCE_MIN) ) - { - int direction = 0; - if ( abs(deltaX) > abs(deltaY) ) + // Test for swipe + else if (__gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) && + gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time < GESTURE_SWIPE_DURATION_MAX && + (abs(deltaX) > GESTURE_SWIPE_DISTANCE_MIN || abs(deltaY) > GESTURE_SWIPE_DISTANCE_MIN) ) { - if (deltaX > 0) - direction = gameplay::Gesture::SWIPE_DIRECTION_RIGHT; - else if (deltaX < 0) - direction = gameplay::Gesture::SWIPE_DIRECTION_LEFT; + int direction = 0; + if ( abs(deltaX) > abs(deltaY) ) + { + if (deltaX > 0) + direction = gameplay::Gesture::SWIPE_DIRECTION_RIGHT; + else if (deltaX < 0) + direction = gameplay::Gesture::SWIPE_DIRECTION_LEFT; + } + else + { + if (deltaY > 0) + direction = gameplay::Gesture::SWIPE_DIRECTION_DOWN; + else if (deltaY < 0) + direction = gameplay::Gesture::SWIPE_DIRECTION_UP; + } + gameplay::Platform::gestureSwipeEventInternal(x, y, direction); + gestureDetected = true; } - else + // Test for tap + else if(__gestureEventsProcessed.test(Gesture::GESTURE_TAP) && + gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time < GESTURE_TAP_DURATION_MAX) { - if (deltaY > 0) - direction = gameplay::Gesture::SWIPE_DIRECTION_DOWN; - else if (deltaY < 0) - direction = gameplay::Gesture::SWIPE_DIRECTION_UP; + gameplay::Platform::gestureTapEventInternal(x, y); + gestureDetected = true; } - gameplay::Platform::gestureSwipeEventInternal(x, y, direction); - gestureDetected = true; + // Test for long tap + else if(__gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP) && + gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time >= GESTURE_LONG_TAP_DURATION_MIN) + { + gameplay::Platform::gestureLongTapEventInternal(x, y, gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time); + gestureDetected = true; + } } - // Test for tap - else if(__gestureEventsProcessed.test(Gesture::GESTURE_TAP) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time < GESTURE_TAP_DURATION_MAX) + __pointer0.pressed = false; + + if (!gestureDetected && (__multiTouch || __primaryTouchId == pointerId) ) { - gameplay::Platform::gestureTapEventInternal(x, y); - gestureDetected = true; + gameplay::Platform::touchEventInternal(Touch::TOUCH_RELEASE, x, y, pointerId); } - // Test for long tap - else if(__gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time >= GESTURE_LONG_TAP_DURATION_MIN) - { - gameplay::Platform::gestureLongTapEventInternal(x, y, gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time); - gestureDetected = true; - } + __primaryTouchId = -1; } - __pointer0.pressed = false; + break; - if (!gestureDetected && (__multiTouch || __primaryTouchId == pointerId) ) + case AMOTION_EVENT_ACTION_POINTER_DOWN: { - gameplay::Platform::touchEventInternal(Touch::TOUCH_RELEASE, x, y, pointerId); + pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + pointerId = AMotionEvent_getPointerId(event, pointerIndex); + x = AMotionEvent_getX(event, pointerIndex); + y = AMotionEvent_getY(event, pointerIndex); + + // Gesture handling + if ( __gestureEventsProcessed.test(Gesture::GESTURE_TAP) || + __gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) || + __gestureEventsProcessed.test(Gesture::GESTURE_DRAG) || + __gestureEventsProcessed.test(Gesture::GESTURE_DROP) || + __gestureEventsProcessed.test(Gesture::GESTURE_PINCH) || + __gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP)) + { + __pointer1.pressed = true; + __pointer1.time = Game::getInstance()->getAbsoluteTime(); + __pointer1.pointerId = pointerId; + __pointer1.x = x; + __pointer1.y = y; + __gesturePointer1CurrentPosition = __gesturePointer1LastPosition = std::pair(x, y); + } + + // Non-primary pointer down. + if (__multiTouch) + { + gameplay::Platform::touchEventInternal(Touch::TOUCH_PRESS, + AMotionEvent_getX(event, pointerIndex), + AMotionEvent_getY(event, pointerIndex), pointerId); + } } - __primaryTouchId = -1; - } - break; + break; - case AMOTION_EVENT_ACTION_POINTER_DOWN: - { - pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; - pointerId = AMotionEvent_getPointerId(event, pointerIndex); - x = AMotionEvent_getX(event, pointerIndex); - y = AMotionEvent_getY(event, pointerIndex); - - // Gesture handling - if ( __gestureEventsProcessed.test(Gesture::GESTURE_TAP) || - __gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) || - __gestureEventsProcessed.test(Gesture::GESTURE_DRAG) || - __gestureEventsProcessed.test(Gesture::GESTURE_DROP) || - __gestureEventsProcessed.test(Gesture::GESTURE_PINCH) || - __gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP)) - { - __pointer1.pressed = true; - __pointer1.time = Game::getInstance()->getAbsoluteTime(); - __pointer1.pointerId = pointerId; - __pointer1.x = x; - __pointer1.y = y; - __gesturePointer1CurrentPosition = __gesturePointer1LastPosition = std::pair(x, y); - } - - // Non-primary pointer down. - if (__multiTouch) + case AMOTION_EVENT_ACTION_POINTER_UP: { - gameplay::Platform::touchEventInternal(Touch::TOUCH_PRESS, AMotionEvent_getX(event, pointerIndex), AMotionEvent_getY(event, pointerIndex), pointerId); - } - } - break; - - case AMOTION_EVENT_ACTION_POINTER_UP: - { - pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; - pointerId = AMotionEvent_getPointerId(event, pointerIndex); - x = AMotionEvent_getX(event, pointerIndex); - y = AMotionEvent_getY(event, pointerIndex); + pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + pointerId = AMotionEvent_getPointerId(event, pointerIndex); + x = AMotionEvent_getX(event, pointerIndex); + y = AMotionEvent_getY(event, pointerIndex); - bool gestureDetected = false; - if (__pointer1.pressed && __pointer1.pointerId == pointerId) - { - int deltaX = x - __pointer1.x; - int deltaY = y - __pointer1.y; - - if (__gesturePinching) - { - __gesturePinching = false; - gestureDetected = true; - } - // Test for swipe - else if (__gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time < GESTURE_SWIPE_DURATION_MAX && - (abs(deltaX) > GESTURE_SWIPE_DISTANCE_MIN || abs(deltaY) > GESTURE_SWIPE_DISTANCE_MIN) ) + bool gestureDetected = false; + if (__pointer1.pressed && __pointer1.pointerId == pointerId && !Form::getActiveControl()) { - int direction = 0; - if (deltaX > 0) - direction |= gameplay::Gesture::SWIPE_DIRECTION_RIGHT; - else if (deltaX < 0) - direction |= gameplay::Gesture::SWIPE_DIRECTION_LEFT; - - if (deltaY > 0) - direction |= gameplay::Gesture::SWIPE_DIRECTION_DOWN; - else if (deltaY < 0) - direction |= gameplay::Gesture::SWIPE_DIRECTION_UP; + int deltaX = x - __pointer1.x; + int deltaY = y - __pointer1.y; + + if (__gesturePinching) + { + __gesturePinching = false; + gestureDetected = true; + } + // Test for swipe + else if (__gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) && + gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time < GESTURE_SWIPE_DURATION_MAX && + (abs(deltaX) > GESTURE_SWIPE_DISTANCE_MIN || abs(deltaY) > GESTURE_SWIPE_DISTANCE_MIN) ) + { + int direction = 0; + if (deltaX > 0) + direction |= gameplay::Gesture::SWIPE_DIRECTION_RIGHT; + else if (deltaX < 0) + direction |= gameplay::Gesture::SWIPE_DIRECTION_LEFT; + + if (deltaY > 0) + direction |= gameplay::Gesture::SWIPE_DIRECTION_DOWN; + else if (deltaY < 0) + direction |= gameplay::Gesture::SWIPE_DIRECTION_UP; - gameplay::Platform::gestureSwipeEventInternal(x, y, direction); - gestureDetected = true; + gameplay::Platform::gestureSwipeEventInternal(x, y, direction); + gestureDetected = true; + } + else if(__gestureEventsProcessed.test(Gesture::GESTURE_TAP) && + gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time < GESTURE_TAP_DURATION_MAX) + { + gameplay::Platform::gestureTapEventInternal(x, y); + gestureDetected = true; + } + else if(__gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP) && + gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time >= GESTURE_LONG_TAP_DURATION_MIN) + { + gameplay::Platform::gestureLongTapEventInternal(x, y, gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time); + gestureDetected = true; + } } - else if(__gestureEventsProcessed.test(Gesture::GESTURE_TAP) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time < GESTURE_TAP_DURATION_MAX) + __pointer1.pressed = false; + + if (!gestureDetected && (__multiTouch || __primaryTouchId == pointerId) ) { - gameplay::Platform::gestureTapEventInternal(x, y); - gestureDetected = true; + gameplay::Platform::touchEventInternal(Touch::TOUCH_RELEASE, + AMotionEvent_getX(event, pointerIndex), + AMotionEvent_getY(event, pointerIndex), pointerId); } - else if(__gestureEventsProcessed.test(Gesture::GESTURE_LONG_TAP) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time >= GESTURE_LONG_TAP_DURATION_MIN) - { - gameplay::Platform::gestureLongTapEventInternal(x, y, gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time); - gestureDetected = true; - } - } - __pointer1.pressed = false; - - if (!gestureDetected && (__multiTouch || __primaryTouchId == pointerId) ) - { - gameplay::Platform::touchEventInternal(Touch::TOUCH_RELEASE, AMotionEvent_getX(event, pointerIndex), AMotionEvent_getY(event, pointerIndex), pointerId); + if (__primaryTouchId == pointerId) + __primaryTouchId = -1; } - if (__primaryTouchId == pointerId) - __primaryTouchId = -1; - } - break; + break; - case AMOTION_EVENT_ACTION_MOVE: - { - // ACTION_MOVE events are batched, unlike the other events. - pointerCount = AMotionEvent_getPointerCount(event); - for (size_t i = 0; i < pointerCount; ++i) + case AMOTION_EVENT_ACTION_MOVE: { - pointerId = AMotionEvent_getPointerId(event, i); - x = AMotionEvent_getX(event, i); - y = AMotionEvent_getY(event, i); - - bool gestureDetected = false; - if (__pointer0.pressed) - { - //The two pointers are pressed and the event was done by one of it - if (__pointer1.pressed && (pointerId == __pointer0.pointerId || pointerId == __pointer1.pointerId)) - { - if (__pointer0.pointerId == __pointer1.pointerId) - { - __gesturePinching = false; - break; - } - //Test for pinch - if (__gestureEventsProcessed.test(Gesture::GESTURE_PINCH)) - { - int pointer0Distance, pointer1Distance; - - if (__pointer0.pointerId == pointerId) - { - __gesturePointer0LastPosition = __gesturePointer0CurrentPosition; - __gesturePointer0CurrentPosition = std::pair(x, y); - __gesturePointer0Delta = sqrt(pow(static_cast(x - __pointer0.x), 2) + - pow(static_cast(y - __pointer0.y), 2)); - } - else - { - __gesturePointer1LastPosition = __gesturePointer1CurrentPosition; - __gesturePointer1CurrentPosition = std::pair(x, y); - __gesturePointer1Delta = sqrt(pow(static_cast(x - __pointer1.x), 2) + - pow(static_cast(y - __pointer1.y), 2)); - } - if (!__gesturePinching && - __gesturePointer0Delta >= GESTURE_PINCH_DISTANCE_MIN && - __gesturePointer1Delta >= GESTURE_PINCH_DISTANCE_MIN) - { - __gesturePinching = true; - __gesturePinchCentroid = std::pair((__pointer0.x + __pointer1.x) / 2, - (__pointer0.y + __pointer1.y) / 2); - } - if (__gesturePinching) - { - int currentDistancePointer0, currentDistancePointer1; - int lastDistancePointer0, lastDistancePointer1; - float scale; - - currentDistancePointer0 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer0CurrentPosition.first), 2) + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer0CurrentPosition.second), 2)); - lastDistancePointer0 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer0LastPosition.first), 2) + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer0LastPosition.second), 2)); - currentDistancePointer1 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer1CurrentPosition.first), 2) + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer1CurrentPosition.second), 2)); - lastDistancePointer1 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer1LastPosition.first), 2) + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer1LastPosition.second), 2)); - if (pointerId == __pointer0.pointerId) - scale = ((float) currentDistancePointer0) / ((float) lastDistancePointer0); - else - scale = ((float) currentDistancePointer1) / ((float) lastDistancePointer1); - if (currentDistancePointer0 >= lastDistancePointer0 && currentDistancePointer1 >= lastDistancePointer1 || - currentDistancePointer0 <= lastDistancePointer0 && currentDistancePointer1 <= lastDistancePointer1) - { - gameplay::Platform::gesturePinchEventInternal(__gesturePinchCentroid.first, __gesturePinchCentroid.second, scale); - gestureDetected = true; - } - else - __gesturePinching = false; - } - } - } - //Only the primary pointer is done and the event was done by it - else if (!gestureDetected && pointerId == __pointer0.pointerId) - { - //Test for drag - if (__gestureEventsProcessed.test(Gesture::GESTURE_DRAG)) - { - int delta = sqrt(pow(static_cast(x - __pointer0.x), 2) + - pow(static_cast(y - __pointer0.y), 2)); - - if (__gestureDraging || __gestureEventsProcessed.test(Gesture::GESTURE_DRAG) && - gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time >= GESTURE_DRAG_START_DURATION_MIN && - delta >= GESTURE_DRAG_DISTANCE_MIN) - { - gameplay::Platform::gestureDragEventInternal(x, y); - __gestureDraging = true; - gestureDetected = true; - } - } - } - } - - if (!gestureDetected && (__multiTouch || __primaryTouchId == pointerId)) + // ACTION_MOVE events are batched, unlike the other events. + pointerCount = AMotionEvent_getPointerCount(event); + for (size_t i = 0; i < pointerCount; ++i) { - gameplay::Platform::touchEventInternal(Touch::TOUCH_MOVE, AMotionEvent_getX(event, i), AMotionEvent_getY(event, i), pointerId); - } - } - } - break; + pointerId = AMotionEvent_getPointerId(event, i); + x = AMotionEvent_getX(event, i); + y = AMotionEvent_getY(event, i); + + bool gestureDetected = false; + if (__pointer0.pressed && !Form::getActiveControl()) + { + //The two pointers are pressed and the event was done by one of it + if (__pointer1.pressed && (pointerId == __pointer0.pointerId || pointerId == __pointer1.pointerId)) + { + if (__pointer0.pointerId == __pointer1.pointerId) + { + __gesturePinching = false; + break; + } + //Test for pinch + if (__gestureEventsProcessed.test(Gesture::GESTURE_PINCH)) + { + int pointer0Distance, pointer1Distance; + + if (__pointer0.pointerId == pointerId) + { + __gesturePointer0LastPosition = __gesturePointer0CurrentPosition; + __gesturePointer0CurrentPosition = std::pair(x, y); + __gesturePointer0Delta = sqrt(pow(static_cast(x - __pointer0.x), 2) + + pow(static_cast(y - __pointer0.y), 2)); + } + else + { + __gesturePointer1LastPosition = __gesturePointer1CurrentPosition; + __gesturePointer1CurrentPosition = std::pair(x, y); + __gesturePointer1Delta = sqrt(pow(static_cast(x - __pointer1.x), 2) + + pow(static_cast(y - __pointer1.y), 2)); + } + if (!__gesturePinching && + __gesturePointer0Delta >= GESTURE_PINCH_DISTANCE_MIN && + __gesturePointer1Delta >= GESTURE_PINCH_DISTANCE_MIN) + { + __gesturePinching = true; + __gesturePinchCentroid = std::pair((__pointer0.x + __pointer1.x) / 2, + (__pointer0.y + __pointer1.y) / 2); + } + if (__gesturePinching) + { + int currentDistancePointer0, currentDistancePointer1; + int lastDistancePointer0, lastDistancePointer1; + float scale; + + currentDistancePointer0 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer0CurrentPosition.first), 2) + + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer0CurrentPosition.second), 2)); + lastDistancePointer0 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer0LastPosition.first), 2) + + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer0LastPosition.second), 2)); + currentDistancePointer1 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer1CurrentPosition.first), 2) + + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer1CurrentPosition.second), 2)); + lastDistancePointer1 = sqrt(pow(static_cast(__gesturePinchCentroid.first - __gesturePointer1LastPosition.first), 2) + + pow(static_cast(__gesturePinchCentroid.second - __gesturePointer1LastPosition.second), 2)); + if (pointerId == __pointer0.pointerId) + scale = ((float) currentDistancePointer0) / ((float) lastDistancePointer0); + else + scale = ((float) currentDistancePointer1) / ((float) lastDistancePointer1); + if (((currentDistancePointer0 >= lastDistancePointer0) && (currentDistancePointer1 >= lastDistancePointer1)) || + ((currentDistancePointer0 <= lastDistancePointer0) && (currentDistancePointer1 <= lastDistancePointer1))) + { + gameplay::Platform::gesturePinchEventInternal(__gesturePinchCentroid.first, __gesturePinchCentroid.second, scale); + gestureDetected = true; + } + else + __gesturePinching = false; + } + } + } + // Only the primary pointer is done and the event was done by it + else if (!gestureDetected && pointerId == __pointer0.pointerId) + { + //Test for drag + if (__gestureEventsProcessed.test(Gesture::GESTURE_DRAG)) + { + int delta = sqrt(pow(static_cast(x - __pointer0.x), 2) + + pow(static_cast(y - __pointer0.y), 2)); + + if ((__gestureDraging || __gestureEventsProcessed.test(Gesture::GESTURE_DRAG)) && + (gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time >= GESTURE_DRAG_START_DURATION_MIN) && + (delta >= GESTURE_DRAG_DISTANCE_MIN)) + { + gameplay::Platform::gestureDragEventInternal(x, y); + __gestureDraging = true; + gestureDetected = true; + } + } + } + } + + if (!gestureDetected && (__multiTouch || __primaryTouchId == pointerId)) + { + gameplay::Platform::touchEventInternal(Touch::TOUCH_MOVE, AMotionEvent_getX(event, i), AMotionEvent_getY(event, i), pointerId); + } + } + } + break; + } } return 1; } @@ -1028,16 +1143,29 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) switch(action) { case AKEY_EVENT_ACTION_DOWN: - gameplay::Platform::keyEventInternal(Keyboard::KEY_PRESS, getKey(keycode, metastate)); - if (int character = getUnicode(keycode, metastate)) - gameplay::Platform::keyEventInternal(Keyboard::KEY_CHAR, character); + if (((source & AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD) || ((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK)) + { + gameplay::Platform::gamepadButtonPressedEventInternal(deviceId, gameplay::getGamepadButtonMapping(keycode)); + } + else + { + gameplay::Platform::keyEventInternal(Keyboard::KEY_PRESS, getKey(keycode, metastate)); + if (int character = getUnicode(keycode, metastate)) + gameplay::Platform::keyEventInternal(Keyboard::KEY_CHAR, character); + } break; case AKEY_EVENT_ACTION_UP: - gameplay::Platform::keyEventInternal(Keyboard::KEY_RELEASE, getKey(keycode, metastate)); + if (((source & AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD) || ((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK)) + { + gameplay::Platform::gamepadButtonReleasedEventInternal(deviceId, gameplay::getGamepadButtonMapping(keycode)); + } + else + { + gameplay::Platform::keyEventInternal(Keyboard::KEY_RELEASE, getKey(keycode, metastate)); + } break; } - return 1; } return 0; @@ -1049,7 +1177,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) switch (cmd) { case APP_CMD_INIT_WINDOW: - // The window is being shown, get it ready. if (app->window != NULL) { initEGL(); @@ -1065,6 +1192,29 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) destroyEGLMain(); __initialized = false; break; + case APP_CMD_PAUSE: + Game::getInstance()->pause(); + __suspended = true; + break; + case APP_CMD_RESUME: + if (__initialized) + { + Game::getInstance()->resume(); + } + __suspended = false; + break; + case APP_CMD_LOST_FOCUS: + // When our app loses focus, we stop monitoring the sensors. + // This is to avoid consuming battery while not being used. + if (__accelerometerSensor != NULL) + { + ASensorEventQueue_disableSensor(__sensorEventQueue, __accelerometerSensor); + } + if (__gyroscopeSensor != NULL) + { + ASensorEventQueue_disableSensor(__sensorEventQueue, __gyroscopeSensor); + } + break; case APP_CMD_GAINED_FOCUS: // When our app gains focus, we start monitoring the sensors. if (__accelerometerSensor != NULL) @@ -1079,7 +1229,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) // We'd like to get 60 events per second (in microseconds). ASensorEventQueue_setEventRate(__sensorEventQueue, __gyroscopeSensor, (1000L/60)*1000); } - if (Game::getInstance()->getState() == Game::UNINITIALIZED) { Game::getInstance()->run(); @@ -1089,29 +1238,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) Game::getInstance()->resume(); } break; - case APP_CMD_RESUME: - if (__initialized) - { - Game::getInstance()->resume(); - } - __suspended = false; - break; - case APP_CMD_PAUSE: - Game::getInstance()->pause(); - __suspended = true; - break; - case APP_CMD_LOST_FOCUS: - // When our app loses focus, we stop monitoring the sensors. - // This is to avoid consuming battery while not being used. - if (__accelerometerSensor != NULL) - { - ASensorEventQueue_disableSensor(__sensorEventQueue, __accelerometerSensor); - } - if (__gyroscopeSensor != NULL) - { - ASensorEventQueue_disableSensor(__sensorEventQueue, __gyroscopeSensor); - } - break; } } @@ -1277,6 +1403,7 @@ int Platform::enterMessagePump() // Display the keyboard. gameplay::displayKeyboard(__state, __displayKeyboard); } + return 0; } void Platform::signalShutdown() @@ -1342,8 +1469,6 @@ void Platform::setMultiSampling(bool enabled) { return; } - - // TODO __multiSampling = enabled; } @@ -1637,4 +1762,29 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch } +extern "C" +{ + +JNIEXPORT void JNICALL Java_org_gameplay3d_GamePlayNativeActivity_gamepadEventConnectedImpl(JNIEnv* env, jclass clazz, jint deviceId, jint buttonCount, jint joystickCount, jint triggerCount, jstring deviceName) +{ + const char* name = env->GetStringUTFChars(deviceName, JNI_FALSE); + + gameplay::Platform::gamepadEventConnectedInternal(deviceId, buttonCount, joystickCount, triggerCount, name); + + env->ReleaseStringUTFChars(deviceName, name); +} + +JNIEXPORT void JNICALL Java_org_gameplay3d_GamePlayNativeActivity_gamepadEventDisconnectedImpl(JNIEnv* env, jclass clazz, jint deviceId) +{ + gameplay::Platform::gamepadEventDisconnectedInternal(deviceId); +} + +JNIEXPORT void JNICALL Java_org_gameplay3d_GamePlayNativeActivity_screenOrientationChanged(JNIEnv* env, jclass clazz, jint orientation) +{ + __orientationAngle = orientation * 90; +} + +} + #endif + diff --git a/gameplay/src/PlatformBlackBerry.cpp b/gameplay/src/PlatformBlackBerry.cpp deleted file mode 100644 index c3eb713879..0000000000 --- a/gameplay/src/PlatformBlackBerry.cpp +++ /dev/null @@ -1,1665 +0,0 @@ -#ifdef __QNX__ - -#include "Base.h" -#include "Platform.h" -#include "FileSystem.h" -#include "Game.h" -#include "Form.h" -#include "ScriptController.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TOUCH_COUNT_MAX 4 - -using namespace std; - -int __argc = 0; -char** __argv = 0; -struct timespec __timespec; -static double __timeStart; -static double __timeAbsolute; -static bool __vsync = WINDOW_VSYNC; -static screen_context_t __screenContext; -static screen_window_t __screenWindow; -static screen_event_t __screenEvent; -static int __screenWindowSize[2]; -static bool __screenFullscreen = false; -static EGLDisplay __eglDisplay = EGL_NO_DISPLAY; -static EGLContext __eglContext = EGL_NO_CONTEXT; -static EGLSurface __eglSurface = EGL_NO_SURFACE; -static EGLConfig __eglConfig = 0; -static int __orientationAngle; -static bool __multiTouch = false; -static bool __multiSampling = false; -static float __pitch; -static float __roll; -static float __accelRawX; -static float __accelRawY; -static float __accelRawZ; -static float __gyroRawX; -static float __gyroRawY; -static float __gyroRawZ; -static const char* __glExtensions; -static struct gestures_set * __gestureSet; -static bitset<3> __gestureEventsProcessed; -static bool __gestureSwipeRecognized = false; -PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL; -PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL; -PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL; -PFNGLISVERTEXARRAYOESPROC glIsVertexArray = NULL; - -namespace gameplay -{ - -// Gets the Keyboard::Key enumeration constant that corresponds to the given QNX key code. -static Keyboard::Key getKey(int qnxKeycode) -{ - switch (qnxKeycode) - { - case KEYCODE_SYSREQ: - return Keyboard::KEY_SYSREQ; - case KEYCODE_BREAK: - return Keyboard::KEY_BREAK; - case KEYCODE_MENU: - return Keyboard::KEY_MENU; - case KEYCODE_KP_ENTER: - return Keyboard::KEY_KP_ENTER; - case KEYCODE_PAUSE: - return Keyboard::KEY_PAUSE; - case KEYCODE_SCROLL_LOCK: - return Keyboard::KEY_SCROLL_LOCK; - case KEYCODE_PRINT: - return Keyboard::KEY_PRINT; - case KEYCODE_ESCAPE: - return Keyboard::KEY_ESCAPE; - case KEYCODE_BACKSPACE: - return Keyboard::KEY_BACKSPACE; - case KEYCODE_BACK_TAB: - return Keyboard::KEY_BACK_TAB; - case KEYCODE_TAB: - return Keyboard::KEY_TAB; - case KEYCODE_RETURN: - return Keyboard::KEY_RETURN; - case KEYCODE_CAPS_LOCK: - return Keyboard::KEY_CAPS_LOCK; - case KEYCODE_LEFT_SHIFT: - case KEYCODE_RIGHT_SHIFT: - return Keyboard::KEY_SHIFT; - case KEYCODE_LEFT_CTRL: - case KEYCODE_RIGHT_CTRL: - return Keyboard::KEY_CTRL; - case KEYCODE_LEFT_ALT: - case KEYCODE_RIGHT_ALT: - return Keyboard::KEY_ALT; - case KEYCODE_LEFT_HYPER: - case KEYCODE_RIGHT_HYPER: - return Keyboard::KEY_HYPER; - case KEYCODE_INSERT: - return Keyboard::KEY_INSERT; - case KEYCODE_HOME: - return Keyboard::KEY_HOME; - case KEYCODE_PG_UP: - return Keyboard::KEY_PG_UP; - case KEYCODE_DELETE: - return Keyboard::KEY_DELETE; - case KEYCODE_END: - return Keyboard::KEY_END; - case KEYCODE_PG_DOWN: - return Keyboard::KEY_PG_DOWN; - case KEYCODE_LEFT: - return Keyboard::KEY_LEFT_ARROW; - case KEYCODE_RIGHT: - return Keyboard::KEY_RIGHT_ARROW; - case KEYCODE_UP: - return Keyboard::KEY_UP_ARROW; - case KEYCODE_DOWN: - return Keyboard::KEY_DOWN_ARROW; - case KEYCODE_NUM_LOCK: - return Keyboard::KEY_NUM_LOCK; - case KEYCODE_KP_PLUS: - return Keyboard::KEY_KP_PLUS; - case KEYCODE_KP_MINUS: - return Keyboard::KEY_KP_MINUS; - case KEYCODE_KP_MULTIPLY: - return Keyboard::KEY_KP_MULTIPLY; - case KEYCODE_KP_DIVIDE: - return Keyboard::KEY_KP_DIVIDE; - case KEYCODE_KP_HOME: - return Keyboard::KEY_KP_HOME; - case KEYCODE_KP_UP: - return Keyboard::KEY_KP_UP; - case KEYCODE_KP_PG_UP: - return Keyboard::KEY_KP_PG_UP; - case KEYCODE_KP_LEFT: - return Keyboard::KEY_KP_LEFT; - case KEYCODE_KP_FIVE: - return Keyboard::KEY_KP_FIVE; - case KEYCODE_KP_RIGHT: - return Keyboard::KEY_KP_RIGHT; - case KEYCODE_KP_END: - return Keyboard::KEY_KP_END; - case KEYCODE_KP_DOWN: - return Keyboard::KEY_KP_DOWN; - case KEYCODE_KP_PG_DOWN: - return Keyboard::KEY_KP_PG_DOWN; - case KEYCODE_KP_INSERT: - return Keyboard::KEY_KP_INSERT; - case KEYCODE_KP_DELETE: - return Keyboard::KEY_KP_DELETE; - case KEYCODE_F1: - return Keyboard::KEY_F1; - case KEYCODE_F2: - return Keyboard::KEY_F2; - case KEYCODE_F3: - return Keyboard::KEY_F3; - case KEYCODE_F4: - return Keyboard::KEY_F4; - case KEYCODE_F5: - return Keyboard::KEY_F5; - case KEYCODE_F6: - return Keyboard::KEY_F6; - case KEYCODE_F7: - return Keyboard::KEY_F7; - case KEYCODE_F8: - return Keyboard::KEY_F8; - case KEYCODE_F9: - return Keyboard::KEY_F9; - case KEYCODE_F10: - return Keyboard::KEY_F10; - case KEYCODE_F11: - return Keyboard::KEY_F11; - case KEYCODE_F12: - return Keyboard::KEY_F12; - case KEYCODE_SPACE: - return Keyboard::KEY_SPACE; - case KEYCODE_RIGHT_PAREN: - return Keyboard::KEY_RIGHT_PARENTHESIS; - case KEYCODE_ZERO: - return Keyboard::KEY_ZERO; - case KEYCODE_EXCLAM: - return Keyboard::KEY_EXCLAM; - case KEYCODE_ONE: - return Keyboard::KEY_ONE; - case KEYCODE_AT: - return Keyboard::KEY_AT; - case KEYCODE_TWO: - return Keyboard::KEY_TWO; - case KEYCODE_NUMBER: - return Keyboard::KEY_NUMBER; - case KEYCODE_THREE: - return Keyboard::KEY_THREE; - case KEYCODE_DOLLAR: - return Keyboard::KEY_DOLLAR; - case KEYCODE_FOUR: - return Keyboard::KEY_FOUR; - case KEYCODE_PERCENT: - return Keyboard::KEY_PERCENT; - case KEYCODE_FIVE: - return Keyboard::KEY_FIVE; - case KEYCODE_CIRCUMFLEX: - return Keyboard::KEY_CIRCUMFLEX; - case KEYCODE_SIX: - return Keyboard::KEY_SIX; - case KEYCODE_AMPERSAND: - return Keyboard::KEY_AMPERSAND; - case KEYCODE_SEVEN: - return Keyboard::KEY_SEVEN; - case KEYCODE_ASTERISK: - return Keyboard::KEY_ASTERISK; - case KEYCODE_EIGHT: - return Keyboard::KEY_EIGHT; - case KEYCODE_LEFT_PAREN: - return Keyboard::KEY_LEFT_PARENTHESIS; - case KEYCODE_NINE: - return Keyboard::KEY_NINE; - case KEYCODE_EQUAL: - return Keyboard::KEY_EQUAL; - case KEYCODE_PLUS: - return Keyboard::KEY_PLUS; - case KEYCODE_LESS_THAN: - return Keyboard::KEY_LESS_THAN; - case KEYCODE_COMMA: - return Keyboard::KEY_COMMA; - case KEYCODE_UNDERSCORE: - return Keyboard::KEY_UNDERSCORE; - case KEYCODE_MINUS: - return Keyboard::KEY_MINUS; - case KEYCODE_GREATER_THAN: - return Keyboard::KEY_GREATER_THAN; - case KEYCODE_PERIOD: - return Keyboard::KEY_PERIOD; - case KEYCODE_COLON: - return Keyboard::KEY_COLON; - case KEYCODE_SEMICOLON: - return Keyboard::KEY_SEMICOLON; - case KEYCODE_QUESTION: - return Keyboard::KEY_QUESTION; - case KEYCODE_SLASH: - return Keyboard::KEY_SLASH; - case KEYCODE_GRAVE: - return Keyboard::KEY_GRAVE; - case KEYCODE_TILDE: - return Keyboard::KEY_TILDE; - case KEYCODE_LEFT_BRACE: - return Keyboard::KEY_LEFT_BRACE; - case KEYCODE_LEFT_BRACKET: - return Keyboard::KEY_LEFT_BRACKET; - case KEYCODE_BAR: - return Keyboard::KEY_BAR; - case KEYCODE_BACK_SLASH: - return Keyboard::KEY_BACK_SLASH; - case KEYCODE_RIGHT_BRACE: - return Keyboard::KEY_RIGHT_BRACE; - case KEYCODE_RIGHT_BRACKET: - return Keyboard::KEY_RIGHT_BRACKET; - case KEYCODE_QUOTE: - return Keyboard::KEY_QUOTE; - case KEYCODE_APOSTROPHE: - return Keyboard::KEY_APOSTROPHE; - case 0x20AC: - return Keyboard::KEY_EURO; - case KEYCODE_POUND_SIGN: - return Keyboard::KEY_POUND; - case KEYCODE_YEN_SIGN: - return Keyboard::KEY_YEN; - case KEYCODE_MIDDLE_DOT: - return Keyboard::KEY_MIDDLE_DOT; - case KEYCODE_CAPITAL_A: - return Keyboard::KEY_CAPITAL_A; - case KEYCODE_A: - return Keyboard::KEY_A; - case KEYCODE_CAPITAL_B: - return Keyboard::KEY_CAPITAL_B; - case KEYCODE_B: - return Keyboard::KEY_B; - case KEYCODE_CAPITAL_C: - return Keyboard::KEY_CAPITAL_C; - case KEYCODE_C: - return Keyboard::KEY_C; - case KEYCODE_CAPITAL_D: - return Keyboard::KEY_CAPITAL_D; - case KEYCODE_D: - return Keyboard::KEY_D; - case KEYCODE_CAPITAL_E: - return Keyboard::KEY_CAPITAL_E; - case KEYCODE_E: - return Keyboard::KEY_E; - case KEYCODE_CAPITAL_F: - return Keyboard::KEY_CAPITAL_F; - case KEYCODE_F: - return Keyboard::KEY_F; - case KEYCODE_CAPITAL_G: - return Keyboard::KEY_CAPITAL_G; - case KEYCODE_G: - return Keyboard::KEY_G; - case KEYCODE_CAPITAL_H: - return Keyboard::KEY_CAPITAL_H; - case KEYCODE_H: - return Keyboard::KEY_H; - case KEYCODE_CAPITAL_I: - return Keyboard::KEY_CAPITAL_I; - case KEYCODE_I: - return Keyboard::KEY_I; - case KEYCODE_CAPITAL_J: - return Keyboard::KEY_CAPITAL_J; - case KEYCODE_J: - return Keyboard::KEY_J; - case KEYCODE_CAPITAL_K: - return Keyboard::KEY_CAPITAL_K; - case KEYCODE_K: - return Keyboard::KEY_K; - case KEYCODE_CAPITAL_L: - return Keyboard::KEY_CAPITAL_L; - case KEYCODE_L: - return Keyboard::KEY_L; - case KEYCODE_CAPITAL_M: - return Keyboard::KEY_CAPITAL_M; - case KEYCODE_M: - return Keyboard::KEY_M; - case KEYCODE_CAPITAL_N: - return Keyboard::KEY_CAPITAL_N; - case KEYCODE_N: - return Keyboard::KEY_N; - case KEYCODE_CAPITAL_O: - return Keyboard::KEY_CAPITAL_O; - case KEYCODE_O: - return Keyboard::KEY_O; - case KEYCODE_CAPITAL_P: - return Keyboard::KEY_CAPITAL_P; - case KEYCODE_P: - return Keyboard::KEY_P; - case KEYCODE_CAPITAL_Q: - return Keyboard::KEY_CAPITAL_Q; - case KEYCODE_Q: - return Keyboard::KEY_Q; - case KEYCODE_CAPITAL_R: - return Keyboard::KEY_CAPITAL_R; - case KEYCODE_R: - return Keyboard::KEY_R; - case KEYCODE_CAPITAL_S: - return Keyboard::KEY_CAPITAL_S; - case KEYCODE_S: - return Keyboard::KEY_S; - case KEYCODE_CAPITAL_T: - return Keyboard::KEY_CAPITAL_T; - case KEYCODE_T: - return Keyboard::KEY_T; - case KEYCODE_CAPITAL_U: - return Keyboard::KEY_CAPITAL_U; - case KEYCODE_U: - return Keyboard::KEY_U; - case KEYCODE_CAPITAL_V: - return Keyboard::KEY_CAPITAL_V; - case KEYCODE_V: - return Keyboard::KEY_V; - case KEYCODE_CAPITAL_W: - return Keyboard::KEY_CAPITAL_W; - case KEYCODE_W: - return Keyboard::KEY_W; - case KEYCODE_CAPITAL_X: - return Keyboard::KEY_CAPITAL_X; - case KEYCODE_X: - return Keyboard::KEY_X; - case KEYCODE_CAPITAL_Y: - return Keyboard::KEY_CAPITAL_Y; - case KEYCODE_Y: - return Keyboard::KEY_Y; - case KEYCODE_CAPITAL_Z: - return Keyboard::KEY_CAPITAL_Z; - case KEYCODE_Z: - return Keyboard::KEY_Z; - default: - return Keyboard::KEY_NONE; - } -} - -/** - * Returns the unicode value from the given QNX key code value. - * Some non-printable characters also have corresponding unicode values, such as backspace. - * - * @param qnxKeyCode The keyboard key code. - * - * @return The unicode value or 0 if the keycode did not represent a unicode key. - */ -static int getUnicode(int qnxKeyCode) -{ - if (qnxKeyCode >= KEYCODE_PC_KEYS && qnxKeyCode <= UNICODE_PRIVATE_USE_AREA_LAST) - { - switch (qnxKeyCode) - { - case KEYCODE_BACKSPACE: - return 0x0008; - case KEYCODE_TAB: - return 0x0009; - case KEYCODE_KP_ENTER: - case KEYCODE_RETURN: - return 0x000A; - case KEYCODE_ESCAPE: - return 0x001B; - // Win32 doesn't consider delete to be a key char. - default: - return 0; - } - } - return qnxKeyCode; -} - -extern void print(const char* format, ...) -{ - GP_ASSERT(format); - va_list argptr; - va_start(argptr, format); - vfprintf(stderr, format, argptr); - va_end(argptr); -} - -extern int strcmpnocase(const char* s1, const char* s2) -{ - return strcasecmp(s1, s2); -} - -EGLenum checkErrorEGL(const char* msg) -{ - GP_ASSERT(msg); - static const char* errmsg[] = - { - "EGL function failed", - "EGL is not initialized, or could not be initialized, for the specified display", - "EGL cannot access a requested resource", - "EGL failed to allocate resources for the requested operation", - "EGL fail to access an unrecognized attribute or attribute value was passed in an attribute list", - "EGLConfig argument does not name a valid EGLConfig", - "EGLContext argument does not name a valid EGLContext", - "EGL current surface of the calling thread is no longer valid", - "EGLDisplay argument does not name a valid EGLDisplay", - "EGL arguments are inconsistent", - "EGLNativePixmapType argument does not refer to a valid native pixmap", - "EGLNativeWindowType argument does not refer to a valid native window", - "EGL one or more argument values are invalid", - "EGLSurface argument does not name a valid surface configured for rendering", - "EGL power management event has occurred", - }; - EGLenum error = eglGetError(); - fprintf(stderr, "%s: %s\n", msg, errmsg[error - EGL_SUCCESS]); - return error; -} - -void gesture_callback(gesture_base_t* gesture, mtouch_event_t* event, void* param, int async) -{ - switch (gesture->type) - { - case GESTURE_SWIPE: - { - if ( __gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) ) - { - gesture_swipe_t* swipe = (gesture_swipe_t*)gesture; - if (!__gestureSwipeRecognized) - { - Platform::gestureSwipeEventInternal(swipe->coords.x, swipe->coords.y, swipe->direction); - __gestureSwipeRecognized = true; - } - - } - break; - } - - case GESTURE_PINCH: - { - if ( __gestureEventsProcessed.test(Gesture::GESTURE_PINCH) ) - { - gesture_pinch_t* pinch = (gesture_pinch_t*)gesture; - float dist_x = (float)pinch->last_distance.x - (float)pinch->distance.x; - float dist_y = (float)pinch->last_distance.y - (float)pinch->distance.y; - float scale = sqrt( (dist_x * dist_x) + (dist_y * dist_y) ); - Game::getInstance()->gesturePinchEvent(pinch->centroid.x, pinch->centroid.y, scale); - } - break; - } - - case GESTURE_TAP: - { - if ( __gestureEventsProcessed.test(Gesture::GESTURE_TAP) ) - { - gesture_tap_t* tap = (gesture_tap_t*)gesture; - Platform::gestureTapEventInternal(tap->touch_coords.x, tap->touch_coords.y); - } - break; - } - - default: - break; - - } -} - -#ifdef GP_USE_GAMEPAD - -static const char* __vendorStrings[] = -{ - "SteelSeries", - "Nintendo", -}; - -static const char* __productStrings[] = -{ - "FREE", - "Wii Remote", -}; - -static const int __VIDs[] = { - 0x1038, - 0x057e, -}; - -static const int __PIDs[] = { - 0x1412, - 0x0306, -}; - -static const unsigned int __knownGamepads = 2; - -void queryGamepad(GamepadHandle handle, int* buttonCount, int* joystickCount, int* productId, int* vendorId, char* productString, char* vendorString) -{ - char id[128]; - screen_get_device_property_iv(handle, SCREEN_PROPERTY_BUTTON_COUNT, buttonCount); - screen_get_device_property_cv(handle, SCREEN_PROPERTY_ID_STRING, 128, id); - screen_get_device_property_cv(handle, SCREEN_PROPERTY_PRODUCT, 64, productString); - screen_get_device_property_cv(handle, SCREEN_PROPERTY_VENDOR, 64, vendorString); - - // Check for the existence of analog sticks. - int analogs[3]; - if (!screen_get_device_property_iv(handle, SCREEN_PROPERTY_ANALOG0, analogs)) - { - ++(*joystickCount); - } - - if (!screen_get_device_property_iv(handle, SCREEN_PROPERTY_ANALOG1, analogs)) - { - ++(*joystickCount); - } - - // ID string format: A-BBBB-CCCC-D.D - // A is the device's index - // BBBB is the device's Vendor ID (in hexadecimal) - // CCCC is the device's Product ID (also in hexadecimal) - // D.D is the device's version number - char* token = strtok(id, "-"); - token = strtok(NULL, "-"); - if (token) - { - *vendorId = strtol(token, NULL, 16); - } - - token = strtok(NULL, "-"); - if (token) - { - *productId = strtol(token, NULL, 16); - } - - // For gamepads unknown to BB10, - // check VID and PID against gamepads known to gameplay. - if (strlen(productString) == 0 || strlen(vendorString) == 0) - { - for (unsigned int i = 0; i < __knownGamepads; ++i) - { - if (__VIDs[i] == *vendorId && __PIDs[i] == *productId) - { - strcpy(vendorString, __vendorStrings[i]); - strcpy(productString, __productStrings[i]); - } - } - } -} - -void Platform::pollGamepadState(Gamepad* gamepad) -{ - unsigned int buttons; - screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_BUTTONS, (int*)&buttons); - gamepad->setButtons(buttons); - - unsigned int i; - for (i = 0; i < gamepad->_joystickCount; ++i) - { - GP_ASSERT(i < 2); - - int analog[3]; - switch (i) - { - case 0: - screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_ANALOG0, analog); - break; - case 1: - screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_ANALOG1, analog); - break; - } - - // So far we've tested two gamepads with analog sticks on BlackBerry: - // the SteelSeries FREE, and the iControlPad. - // Both return values between -128 and +127, with the y axis starting from - // the top at -128. - // 1 / 128 == 0.0078125f - // 1 / 127 == 0.0078740157480315f - float x = (float)analog[0]; - float y = -(float)analog[1]; - x *= (x < 0) ? 0.0078125f : 0.0078740157480315f; - y *= (y > 0) ? 0.0078125f : 0.0078740157480315f; - - gamepad->setJoystickValue(i, x, y); - } - - for (i = 0; i < gamepad->_triggerCount; ++i) - { - GP_ASSERT(i < 2); - - int analog[3]; - switch (i) - { - case 0: - screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_ANALOG0, analog); - break; - case 1: - screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_ANALOG1, analog); - break; - } - - float value = (float)analog[2] * 0.0078125f; - gamepad->setTriggerValue(i, value); - } -} -#else -void Platform::pollGamepadState(Gamepad* gamepad) -{ -} -#endif - -Platform::Platform(Game* game) - : _game(game) -{ -} - -Platform::~Platform() -{ - if (__eglDisplay != EGL_NO_DISPLAY) - { - eglMakeCurrent(__eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - } - - if (__eglSurface != EGL_NO_SURFACE) - { - eglDestroySurface(__eglDisplay, __eglSurface); - __eglSurface = EGL_NO_SURFACE; - } - - if (__eglContext != EGL_NO_CONTEXT) - { - eglDestroyContext(__eglDisplay, __eglContext); - __eglContext = EGL_NO_CONTEXT; - } - - if (__eglDisplay != EGL_NO_DISPLAY) - { - eglTerminate(__eglDisplay); - __eglDisplay = EGL_NO_DISPLAY; - } - - if (__screenWindow) - { - screen_destroy_window(__screenWindow); - __screenWindow = NULL; - } - - if (__screenEvent) - { - screen_destroy_event(__screenEvent); - __screenEvent = NULL; - } - - if (__screenContext) - { - screen_destroy_context(__screenContext); - __screenContext = NULL; - } -} - -Platform* Platform::create(Game* game) -{ - FileSystem::setResourcePath("./app/native/"); - Platform* platform = new Platform(game); - - // Query game config - int samples = 0; - Properties* config = Game::getInstance()->getConfig()->getNamespace("window", true); - if (config) - { - samples = std::max(config->getInt("samples"), 0); - } - - __gestureSet = gestures_set_alloc(); - swipe_gesture_alloc(NULL, gesture_callback, __gestureSet); - pinch_gesture_alloc(NULL, gesture_callback, __gestureSet); - tap_gesture_alloc(NULL, gesture_callback, __gestureSet); - - bps_initialize(); - - // Initialize navigator and orientation - static const int SENSOR_RATE = 25000; // (25000 microseconds = 40 Hz) - sensor_set_rate(SENSOR_TYPE_AZIMUTH_PITCH_ROLL, SENSOR_RATE); - sensor_set_rate(SENSOR_TYPE_ACCELEROMETER, SENSOR_RATE); - sensor_set_rate(SENSOR_TYPE_GYROSCOPE, SENSOR_RATE); - sensor_set_skip_duplicates(SENSOR_TYPE_AZIMUTH_PITCH_ROLL, true); - sensor_set_skip_duplicates(SENSOR_TYPE_ACCELEROMETER, true); - sensor_set_skip_duplicates(SENSOR_TYPE_GYROSCOPE, true); - sensor_request_events(SENSOR_TYPE_AZIMUTH_PITCH_ROLL); - sensor_request_events(SENSOR_TYPE_ACCELEROMETER); - sensor_request_events(SENSOR_TYPE_GYROSCOPE); - navigator_request_events(0); - navigator_rotation_lock(true); - __orientationAngle = atoi(getenv("ORIENTATION")); - - int rc = 0; - int screenFormat = SCREEN_FORMAT_RGBA8888; -#ifdef __X86__ - int screenUsage = SCREEN_USAGE_OPENGL_ES2; -#else - int screenUsage = SCREEN_USAGE_DISPLAY|SCREEN_USAGE_OPENGL_ES2; // Physical device copy directly into physical display -#endif - int screenSwapInterval = WINDOW_VSYNC ? 1 : 0; - int screenTransparency = SCREEN_TRANSPARENCY_NONE; - - char *width_str = getenv("WIDTH"); - char *height_str = getenv("HEIGHT"); - - // Hard-coded to (0,0). - int windowPosition[] = - { - 0, 0 - }; - - EGLint eglConfigCount; - - // Hard-coded to 32-bit/OpenGL ES 2.0. - // NOTE: EGL_SAMPLE_BUFFERS and EGL_SAMPLES MUST remain at the beginning of the attribute list - // since they are expected to be at indices 0-3 in config fallback code later. - EGLint eglConfigAttrs[] = - { - EGL_SAMPLE_BUFFERS, samples > 0 ? 1 : 0, - EGL_SAMPLES, samples, - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 24, - EGL_STENCIL_SIZE, 8, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_NONE - }; - __multiSampling = samples > 0; - - const EGLint eglContextAttrs[] = - { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - - const EGLint eglSurfaceAttrs[] = - { - EGL_RENDER_BUFFER, EGL_BACK_BUFFER, - EGL_NONE - }; - - // Create the screen context. - rc = screen_create_context(&__screenContext, 0); - if (rc) - { - perror("screen_create_context"); - goto error; - } - - // Create the screen window. - rc = screen_create_window(&__screenWindow, __screenContext); - if (rc) - { - perror("screen_create_window"); - goto error; - } - - // Window group - rc = screen_create_window_group(__screenWindow, "windowgroup"); - if (rc) - { - perror("screen_create_window_group failed"); - goto error; - } - - // Set/get any window properties. - rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_FORMAT, &screenFormat); - if (rc) - { - perror("screen_set_window_property_iv(SCREEN_PROPERTY_FORMAT)"); - goto error; - } - - rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_USAGE, &screenUsage); - if (rc) - { - perror("screen_set_window_property_iv(SCREEN_PROPERTY_USAGE)"); - goto error; - } - - if (width_str && height_str) - { - __screenWindowSize[0] = atoi(width_str); - __screenWindowSize[1] = atoi(height_str); - } - else - { - screen_display_t screen_display; - rc = screen_get_window_property_pv(__screenWindow, SCREEN_PROPERTY_DISPLAY, (void **)&screen_display); - if (rc) - { - perror("screen_get_window_property_pv(SCREEN_PROPERTY_DISPLAY)"); - goto error; - } - - screen_display_mode_t screen_mode; - rc = screen_get_display_property_pv(screen_display, SCREEN_PROPERTY_MODE, (void**)&screen_mode); - if (rc) - { - perror("screen_get_display_property_pv(SCREEN_PROPERTY_MODE)"); - goto error; - } - - int size[2]; - rc = screen_get_window_property_iv(__screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, size); - if (rc) - { - perror("screen_get_window_property_iv(SCREEN_PROPERTY_BUFFER_SIZE)"); - goto error; - } - - __screenWindowSize[0] = size[0]; - __screenWindowSize[1] = size[1]; - - if ((__orientationAngle == 0) || (__orientationAngle == 180)) - { - if (((screen_mode.width > screen_mode.height) && (size[0] < size[1])) || - ((screen_mode.width < screen_mode.height) && (size[0] > size[1]))) - { - __screenWindowSize[1] = size[0]; - __screenWindowSize[0] = size[1]; - } - } - else if ((__orientationAngle == 90) || (__orientationAngle == 270)) - { - if (((screen_mode.width > screen_mode.height) && (size[0] > size[1])) || - ((screen_mode.width < screen_mode.height) && (size[0] < size[1]))) - { - __screenWindowSize[1] = size[0]; - __screenWindowSize[0] = size[1]; - } - } - else - { - perror("Navigator returned an unexpected orientation angle."); - goto error; - } - - - rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_ROTATION, &__orientationAngle); - if (rc) - { - perror("screen_set_window_property_iv(SCREEN_PROPERTY_ROTATION)"); - goto error; - } - } - - rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, __screenWindowSize); - if (rc) - { - perror("screen_set_window_property_iv(SCREEN_PROPERTY_BUFFER_SIZE)"); - goto error; - } - - if (windowPosition[0] != 0 || windowPosition[1] != 0) - { - rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_POSITION, windowPosition); - if (rc) - { - perror("screen_set_window_property_iv(SCREEN_PROPERTY_POSITION)"); - goto error; - } - } - - rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_TRANSPARENCY, &screenTransparency); - if (rc) - { - perror("screen_set_window_property_iv(SCREEN_PROPERTY_TRANSPARENCY)"); - goto error; - } - - // Double buffered. - rc = screen_create_window_buffers(__screenWindow, 2); - if (rc) - { - perror("screen_create_window_buffers"); - goto error; - } - - // Create screen event object. - rc = screen_create_event(&__screenEvent); - if (rc) - { - perror("screen_create_event"); - goto error; - } - - // Request screen events. - screen_request_events(__screenContext); - - // Get the EGL display and initialize. - __eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (__eglDisplay == EGL_NO_DISPLAY) - { - perror("eglGetDisplay"); - goto error; - } - if (eglInitialize(__eglDisplay, NULL, NULL) != EGL_TRUE) - { - perror("eglInitialize"); - goto error; - } - - if (eglChooseConfig(__eglDisplay, eglConfigAttrs, &__eglConfig, 1, &eglConfigCount) != EGL_TRUE || eglConfigCount == 0) - { - bool success = false; - while (samples) - { - // Try lowering the MSAA sample count until we find a supported config - GP_WARN("Failed to find a valid EGL configuration with EGL samples=%d. Trying samples=%d instead.", samples, samples/2); - samples /= 2; - eglConfigAttrs[1] = samples > 0 ? 1 : 0; - eglConfigAttrs[3] = samples; - if (eglChooseConfig(__eglDisplay, eglConfigAttrs, &__eglConfig, 1, &eglConfigCount) == EGL_TRUE && eglConfigCount > 0) - { - success = true; - break; - } - } - - __multiSampling = samples > 0; - - if (!success) - { - checkErrorEGL("eglChooseConfig"); - goto error; - } - } - - __eglContext = eglCreateContext(__eglDisplay, __eglConfig, EGL_NO_CONTEXT, eglContextAttrs); - if (__eglContext == EGL_NO_CONTEXT) - { - checkErrorEGL("eglCreateContext"); - goto error; - } - - __eglSurface = eglCreateWindowSurface(__eglDisplay, __eglConfig, __screenWindow, eglSurfaceAttrs); - if (__eglSurface == EGL_NO_SURFACE) - { - checkErrorEGL("eglCreateWindowSurface"); - goto error; - } - - if (eglMakeCurrent(__eglDisplay, __eglSurface, __eglSurface, __eglContext) != EGL_TRUE) - { - checkErrorEGL("eglMakeCurrent"); - goto error; - } - - // Set vsync. - eglSwapInterval(__eglDisplay, screenSwapInterval); - - // Initialize OpenGL ES extensions. - __glExtensions = (const char*)glGetString(GL_EXTENSIONS); - - if (strstr(__glExtensions, "GL_OES_vertex_array_object") || strstr(__glExtensions, "GL_ARB_vertex_array_object")) - { - glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES"); - glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES"); - glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES"); - glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); - } - - #ifdef GP_USE_GAMEPAD - - screen_device_t* screenDevs; - - // Discover initial gamepad devices. - int count; - screen_get_context_property_iv(__screenContext, SCREEN_PROPERTY_DEVICE_COUNT, &count); - screenDevs = (screen_device_t*)calloc(count, sizeof(screen_device_t)); - screen_get_context_property_pv(__screenContext, SCREEN_PROPERTY_DEVICES, (void**)screenDevs); - - for (int i = 0; i < count; i++) - { - int type; - screen_get_device_property_iv(screenDevs[i], SCREEN_PROPERTY_TYPE, &type); - - if (type == SCREEN_EVENT_GAMEPAD || type == SCREEN_EVENT_JOYSTICK) - { - int buttonCount = 0; - int joystickCount = 0; - int productId; - int vendorId; - char productString[64]; - char vendorString[64]; - queryGamepad(screenDevs[i], &buttonCount, &joystickCount, &productId, &vendorId, productString, vendorString); - Platform::gamepadEventConnectedInternal(screenDevs[i], buttonCount, joystickCount, 0, vendorId, productId, vendorString, productString); - } - } - free(screenDevs); -#endif - - return platform; - -error: - - return NULL; -} - -/** - * Convert the timespec into milliseconds. - */ -double timespec2millis(struct timespec *a) -{ - GP_ASSERT(a); - return (1000.0 * a->tv_sec) + (0.000001 * a->tv_nsec); -} - -/** - * Fires a mouse event or a touch event on the game. - * If the mouse event is not consumed, a touch event is fired instead. - * - * @param mouseEvent The mouse event to fire. - * @param touchEvent The touch event to fire. - * @param x The x position of the touch in pixels. - * @param y The y position of the touch in pixels. - */ -void mouseOrTouchEvent(Mouse::MouseEvent mouseEvent, Touch::TouchEvent touchEvent, int x, int y) -{ - if (!gameplay::Platform::mouseEventInternal(mouseEvent, x, y, 0)) - { - Platform::touchEventInternal(touchEvent, x, y, 0, true); - } -} - -int Platform::enterMessagePump() -{ - GP_ASSERT(_game); - - int rc; - int eventType; - int flags; - int value; - int position[2]; - int domain; - mtouch_event_t touchEvent; - bool suspended = false; - - // Get the initial time. - clock_gettime(CLOCK_REALTIME, &__timespec); - __timeStart = timespec2millis(&__timespec); - __timeAbsolute = 0L; - - _game->run(); - - // Message loop. - while (true) - { - bps_event_t* event = NULL; - - while (true) - { - rc = bps_get_event(&event, 1); - GP_ASSERT(rc == BPS_SUCCESS); - - if (event == NULL) - break; - -#ifdef GP_USE_SOCIAL - // if the social controller needs to deal with the event do that here - if (Game::getInstance()->getSocialController()->handleEvent(event)) - break; -#endif - - domain = bps_event_get_domain(event); - - if (domain == screen_get_domain()) - { - __screenEvent = screen_event_get_event(event); - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_TYPE, &eventType); - switch (eventType) - { - case SCREEN_EVENT_MTOUCH_TOUCH: - { - screen_get_mtouch_event(__screenEvent, &touchEvent, 0); - if (__gestureEventsProcessed.any()) - rc = gestures_set_process_event(__gestureSet, &touchEvent, NULL); - - if ( !rc && (__multiTouch || touchEvent.contact_id == 0) ) - { - gameplay::Platform::touchEventInternal(Touch::TOUCH_PRESS, touchEvent.x, touchEvent.y, touchEvent.contact_id); - } - break; - } - - case SCREEN_EVENT_MTOUCH_RELEASE: - { - screen_get_mtouch_event(__screenEvent, &touchEvent, 0); - if (__gestureEventsProcessed.any()) - rc = gestures_set_process_event(__gestureSet, &touchEvent, NULL); - - if ( !rc && (__multiTouch || touchEvent.contact_id == 0) ) - { - gameplay::Platform::touchEventInternal(Touch::TOUCH_RELEASE, touchEvent.x, touchEvent.y, touchEvent.contact_id); - } - if (__gestureSwipeRecognized) - { - __gestureSwipeRecognized = false; - } - break; - } - - case SCREEN_EVENT_MTOUCH_MOVE: - { - screen_get_mtouch_event(__screenEvent, &touchEvent, 0); - if (__gestureEventsProcessed.any()) - rc = gestures_set_process_event(__gestureSet, &touchEvent, NULL); - - if ( !rc && (__multiTouch || touchEvent.contact_id == 0) ) - { - gameplay::Platform::touchEventInternal(Touch::TOUCH_MOVE, touchEvent.x, touchEvent.y, touchEvent.contact_id); - } - break; - } - - case SCREEN_EVENT_POINTER: - { - static int mouse_pressed = 0; - int buttons; - int wheel; - // A move event will be fired unless a button state changed. - bool move = true; - bool left_move = false; - // This is a mouse move event, it is applicable to a device with a usb mouse or simulator. - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_BUTTONS, &buttons); - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_SOURCE_POSITION, position); - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_MOUSE_WHEEL, &wheel); - - // Handle left mouse. Interpret as touch if the left mouse event is not consumed. - if (buttons & SCREEN_LEFT_MOUSE_BUTTON) - { - if (mouse_pressed & SCREEN_LEFT_MOUSE_BUTTON) - { - left_move = true; - } - else - { - move = false; - mouse_pressed |= SCREEN_LEFT_MOUSE_BUTTON; - mouseOrTouchEvent(Mouse::MOUSE_PRESS_LEFT_BUTTON, Touch::TOUCH_PRESS, position[0], position[1]); - } - } - else if (mouse_pressed & SCREEN_LEFT_MOUSE_BUTTON) - { - move = false; - mouse_pressed &= ~SCREEN_LEFT_MOUSE_BUTTON; - mouseOrTouchEvent(Mouse::MOUSE_RELEASE_LEFT_BUTTON, Touch::TOUCH_RELEASE, position[0], position[1]); - } - - // Handle right mouse. - if (buttons & SCREEN_RIGHT_MOUSE_BUTTON) - { - if ((mouse_pressed & SCREEN_RIGHT_MOUSE_BUTTON) == 0) - { - move = false; - mouse_pressed |= SCREEN_RIGHT_MOUSE_BUTTON; - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_PRESS_RIGHT_BUTTON, position[0], position[1], 0); - } - } - else if (mouse_pressed & SCREEN_RIGHT_MOUSE_BUTTON) - { - move = false; - mouse_pressed &= ~SCREEN_RIGHT_MOUSE_BUTTON; - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_RELEASE_RIGHT_BUTTON, position[0], position[1], 0); - } - - // Handle middle mouse. - if (buttons & SCREEN_MIDDLE_MOUSE_BUTTON) - { - if ((mouse_pressed & SCREEN_MIDDLE_MOUSE_BUTTON) == 0) - { - move = false; - mouse_pressed |= SCREEN_MIDDLE_MOUSE_BUTTON; - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_PRESS_MIDDLE_BUTTON, position[0], position[1], 0); - } - } - else if (mouse_pressed & SCREEN_MIDDLE_MOUSE_BUTTON) - { - move = false; - mouse_pressed &= ~SCREEN_MIDDLE_MOUSE_BUTTON; - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_RELEASE_MIDDLE_BUTTON, position[0], position[1], 0); - } - - // Fire a move event if none of the buttons changed. - if (left_move) - { - mouseOrTouchEvent(Mouse::MOUSE_MOVE, Touch::TOUCH_MOVE, position[0], position[1]); - } - else if (move) - { - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, position[0], position[1], 0); - } - - // Handle mouse wheel events. - if (wheel) - { - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_WHEEL, position[0], position[1], -wheel); - } - break; - } - - case SCREEN_EVENT_KEYBOARD: - { - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_KEY_FLAGS, &flags); - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_KEY_SYM, &value); - gameplay::Keyboard::KeyEvent evt = (flags & KEY_DOWN) ? gameplay::Keyboard::KEY_PRESS : gameplay::Keyboard::KEY_RELEASE; - // Suppress key repeats. - if ((flags & KEY_REPEAT) == 0) - { - keyEventInternal(evt, getKey(value)); - if (evt == gameplay::Keyboard::KEY_PRESS && (flags & KEY_SYM_VALID)) - { - int unicode = getUnicode(value); - if (unicode) - keyEventInternal(gameplay::Keyboard::KEY_CHAR, unicode); - } - } - break; - } -#ifdef GP_USE_GAMEPAD - case SCREEN_EVENT_DEVICE: - { - // A device was attached or removed. - screen_device_t device; - int attached; - - screen_get_event_property_pv(__screenEvent, SCREEN_PROPERTY_DEVICE, (void**)&device); - screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_ATTACHED, &attached); - - if (attached) - { - int type; - screen_get_device_property_iv(device, SCREEN_PROPERTY_TYPE, &type); - if (type == SCREEN_EVENT_GAMEPAD || type == SCREEN_EVENT_JOYSTICK) - { - int buttonCount = 0; - int joystickCount = 0; - int productId; - int vendorId; - char productString[64]; - char vendorString[64]; - queryGamepad(device, &buttonCount, &joystickCount, &productId, &vendorId, productString, vendorString); - Platform::gamepadEventConnectedInternal(device, buttonCount, joystickCount, 0, vendorId, productId, vendorString, productString); - } - } - else - { - Platform::gamepadEventDisconnectedInternal(device); - } - - break; - } -#endif - default: - break; - } - } - else if (domain == navigator_get_domain()) - { - switch (bps_event_get_code(event)) - { - case NAVIGATOR_WINDOW_STATE: - { - navigator_window_state_t state = navigator_event_get_window_state(event); - switch (state) - { - case NAVIGATOR_WINDOW_FULLSCREEN: - if (!__screenFullscreen) - __screenFullscreen = true; - _game->resume(); - suspended = false; - break; - case NAVIGATOR_WINDOW_THUMBNAIL: - case NAVIGATOR_WINDOW_INVISIBLE: - if (__screenFullscreen && !suspended) - { - _game->pause(); - suspended = true; - } - break; - } - break; - } - case NAVIGATOR_EXIT: - // Call Game::shutdown directly, instead of Game::exit. - // We need to do this since exit() queues a request to shutdown for the - // next frame, which will never get executed because we are suspended. - _game->shutdown(); - break; - } - } - else if (domain == sensor_get_domain()) - { - if (bps_event_get_code(event) == SENSOR_AZIMUTH_PITCH_ROLL_READING) - { - float azimuth; - sensor_event_get_apr(event, &azimuth, &__pitch, &__roll); - } - else if (bps_event_get_code(event) == SENSOR_ACCELEROMETER_READING) - { - sensor_event_get_xyz(event, &__accelRawX, &__accelRawY, &__accelRawZ); - } - else if (bps_event_get_code(event) == SENSOR_GYROSCOPE_READING) - { - sensor_event_get_xyz(event, &__gyroRawX, &__gyroRawY, &__gyroRawZ); - } - } - } - - // If we are done, then exit. - if (_game->getState() == Game::UNINITIALIZED) - break; - - if (!suspended) - { - _game->frame(); - - // Post the new frame to the display. - // Note that there are a couple cases where eglSwapBuffers could fail - // with an error code that requires a certain level of re-initialization: - // - // 1) EGL_BAD_NATIVE_WINDOW - Called when the surface we're currently using - // is invalidated. This would require us to destroy our EGL surface, - // close our OpenKODE window, and start again. - // - // 2) EGL_CONTEXT_LOST - Power management event that led to our EGL context - // being lost. Requires us to re-create and re-initalize our EGL context - // and all OpenGL ES state. - // - // For now, if we get these, we'll simply exit. - rc = eglSwapBuffers(__eglDisplay, __eglSurface); - if (rc != EGL_TRUE) - { - _game->shutdown(); - perror("eglSwapBuffers"); - break; - } - } - } - - screen_stop_events(__screenContext); - bps_shutdown(); - screen_destroy_context(__screenContext); - - return 0; -} - -void Platform::signalShutdown() -{ - // nothing to do -} - -bool Platform::canExit() -{ - return true; -} - -unsigned int Platform::getDisplayWidth() -{ - return __screenWindowSize[0]; -} - -unsigned int Platform::getDisplayHeight() -{ - return __screenWindowSize[1]; -} - -double Platform::getAbsoluteTime() -{ - clock_gettime(CLOCK_REALTIME, &__timespec); - double now = timespec2millis(&__timespec); - __timeAbsolute = now - __timeStart; - - return __timeAbsolute; -} - -void Platform::setAbsoluteTime(double time) -{ - __timeAbsolute = time; -} - -bool Platform::isVsync() -{ - return __vsync; -} - -void Platform::setVsync(bool enable) -{ - eglSwapInterval(__eglDisplay, enable ? 1 : 0); - __vsync = enable; -} - -void Platform::swapBuffers() -{ - if (__eglDisplay && __eglSurface) - eglSwapBuffers(__eglDisplay, __eglSurface); -} - -void Platform::sleep(long ms) -{ - usleep(ms * 1000); -} - -void Platform::setMultiSampling(bool enabled) -{ - if (enabled == __multiSampling) - { - return; - } - - // TODO: - __multiSampling = enabled; -} - -bool Platform::isMultiSampling() -{ - return __multiSampling; -} - -void Platform::setMultiTouch(bool enabled) -{ - __multiTouch = enabled; -} - -bool Platform::isMultiTouch() -{ - return __multiTouch; -} - -bool Platform::hasAccelerometer() -{ - return true; -} - -void Platform::getAccelerometerValues(float* pitch, float* roll) -{ - GP_ASSERT(pitch); - GP_ASSERT(roll); - - switch(__orientationAngle) - { - // Landscape based device adjusting for landscape game mode - case 0: - if (pitch) - *pitch = __pitch; - if (roll) - *roll = -__roll; - break; - case 180: - if (pitch) - *pitch = -__pitch; - if (roll) - *roll = __roll; - break; - - // Portrait based device adjusting for landscape game mode - case 90: - if (pitch) - *pitch = -__roll; - if (roll) - *roll = -__pitch; - break; - - case 270: - if (pitch) - *pitch = __roll; - if (roll) - *roll = __pitch; - break; - - default: - break; - } -} - -void Platform::getSensorValues(float* accelX, float* accelY, float* accelZ, float* gyroX, float* gyroY, float* gyroZ) -{ - if (accelX) - { - *accelX = __accelRawX; - } - - if (accelY) - { - *accelY = __accelRawY; - } - - if (accelZ) - { - *accelZ = __accelRawZ; - } - - if (gyroX) - { - *gyroX = __gyroRawX; - } - - if (gyroY) - { - *gyroY = __gyroRawY; - } - - if (gyroZ) - { - *gyroZ = __gyroRawZ; - } -} - -void Platform::getArguments(int* argc, char*** argv) -{ - if (argc) - *argc = __argc; - if (argv) - *argv = __argv; -} - -bool Platform::hasMouse() -{ - // not supported - return false; -} - -void Platform::setMouseCaptured(bool captured) -{ - // not supported -} - -bool Platform::isMouseCaptured() -{ - // not supported - return false; -} - -void Platform::setCursorVisible(bool visible) -{ - // not supported -} - -bool Platform::isCursorVisible() -{ - // not supported - return false; -} - -void Platform::displayKeyboard(bool display) -{ - if (display) - virtualkeyboard_show(); - else - virtualkeyboard_hide(); -} - -void Platform::shutdownInternal() -{ - Game::getInstance()->shutdown(); -} - -bool Platform::isGestureSupported(Gesture::GestureEvent evt) -{ - // All are supported no need to test the bitset - return true; -} - -void Platform::registerGesture(Gesture::GestureEvent evt) -{ - switch(evt) - { - case Gesture::GESTURE_ANY_SUPPORTED: - __gestureEventsProcessed.set(); - break; - - case Gesture::GESTURE_SWIPE: - case Gesture::GESTURE_PINCH: - case Gesture::GESTURE_TAP: - __gestureEventsProcessed.set(evt); - break; - - default: - break; - } -} - -void Platform::unregisterGesture(Gesture::GestureEvent evt) -{ - switch(evt) - { - case Gesture::GESTURE_ANY_SUPPORTED: - __gestureEventsProcessed.reset(); - break; - - case Gesture::GESTURE_SWIPE: - case Gesture::GESTURE_PINCH: - case Gesture::GESTURE_TAP: - __gestureEventsProcessed.set(evt, 0); - break; - - default: - break; - } -} - -bool Platform::isGestureRegistered(Gesture::GestureEvent evt) -{ - return __gestureEventsProcessed.test(evt); -} - -bool Platform::launchURL(const char* url) -{ - if (url == NULL || *url == '\0') - return false; - - return navigator_invoke(url, NULL) == BPS_SUCCESS; -} - -std::string Platform::displayFileDialog(size_t mode, const char* title, const char* filterDescription, const char* filterExtensions, const char* initialDirectory) -{ - return ""; -} - -} - -#endif diff --git a/gameplay/src/PlatformLinux.cpp b/gameplay/src/PlatformLinux.cpp index 3fef4516ac..28e886ee6b 100644 --- a/gameplay/src/PlatformLinux.cpp +++ b/gameplay/src/PlatformLinux.cpp @@ -666,10 +666,9 @@ Platform* Platform::create(Game* game) XSetWindowAttributes winAttribs; long eventMask; - eventMask = ExposureMask | VisibilityChangeMask | StructureNotifyMask | - KeyPressMask | KeyReleaseMask | PointerMotionMask | - ButtonPressMask | ButtonReleaseMask | - EnterWindowMask | LeaveWindowMask; + eventMask = ExposureMask | VisibilityChangeMask | StructureNotifyMask | + KeyPressMask | KeyReleaseMask | PointerMotionMask | + ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask; winAttribs.event_mask = eventMask; winAttribs.border_pixel = 0; winAttribs.bit_gravity = StaticGravity; @@ -678,9 +677,7 @@ Platform* Platform::create(Game* game) GLint winMask; winMask = CWBorderPixel | CWBitGravity | CWEventMask| CWColormap; - __window = XCreateWindow(__display, DefaultRootWindow(__display), __x, __y, __width, __height, 0, - visualInfo->depth, InputOutput, visualInfo->visual, winMask, - &winAttribs); + __window = XCreateWindow(__display, DefaultRootWindow(__display), __x, __y, __width, __height, 0, visualInfo->depth, InputOutput, visualInfo->visual, winMask, &winAttribs); // Tell the window manager that it should send the delete window notification through ClientMessage __atomWmDeleteWindow = XInternAtom(__display, "WM_DELETE_WINDOW", False); @@ -1015,7 +1012,8 @@ void handleConnectedGamepad(dev_t devId, const char* devPath, const char* sysFSI unsigned int vendorId =readIntegerGamepadIdPropery(sysFSIdPath,"vendor"); unsigned int productId =readIntegerGamepadIdPropery(sysFSIdPath,"product"); - if (isBlackListed(vendorId,productId)) return; + if (isBlackListed(vendorId, productId)) + return; GamepadHandle handle = ::open(devPath,O_RDONLY | O_NONBLOCK); if(handle < 0) @@ -1032,13 +1030,15 @@ void handleConnectedGamepad(dev_t devId, const char* devPath, const char* sysFSI ioctl (handle, JSIOCGAXES, &axesNum); ioctl (handle, JSIOCGBUTTONS, &btnsNum); - const GamepadInfoEntry& gpInfo = getGamepadMappedInfo(vendorId,productId,(unsigned int)axesNum,(unsigned int)btnsNum); + const GamepadInfoEntry& gpInfo = getGamepadMappedInfo(vendorId, productId, (unsigned int)axesNum, (unsigned int)btnsNum); unsigned int numJS = gpInfo.numberOfJS; unsigned int numTR = gpInfo.numberOfTriggers; + // Ignore accelerometer devices that register themselves as joysticks. Ensure they have at least 2 buttons. + if (btnsNum < 2) + return; - Platform::gamepadEventConnectedInternal(handle,btnsNum,numJS,numTR,vendorId,productId,"",name); - + Platform::gamepadEventConnectedInternal(handle, btnsNum, numJS, numTR, name); ConnectedGamepadDevInfo info = {devId,handle,gpInfo}; __connectedGamepads.push_back(info); } @@ -1162,16 +1162,24 @@ int Platform::enterMessagePump() } } break; - case DestroyNotify : + + case Expose: { - cleanupX11(); - exit(0); + updateWindowSize(); } break; - case Expose: + case ConfigureNotify: { updateWindowSize(); + gameplay::Platform::resizeEventInternal(evt.xconfigure.width, evt.xconfigure.height); + } + break; + + case DestroyNotify : + { + cleanupX11(); + exit(0); } break; @@ -1227,34 +1235,32 @@ int Platform::enterMessagePump() case ButtonPress: { gameplay::Mouse::MouseEvent mouseEvt; - switch (evt.xbutton.button) + + if (evt.xbutton.button >= 1 && evt.xbutton.button <= 3) { - case 1: + if (evt.xbutton.button == 1) mouseEvt = gameplay::Mouse::MOUSE_PRESS_LEFT_BUTTON; - break; - case 2: + else if (evt.xbutton.button == 2) mouseEvt = gameplay::Mouse::MOUSE_PRESS_MIDDLE_BUTTON; - break; - case 3: + else if (evt.xbutton.button == 3) mouseEvt = gameplay::Mouse::MOUSE_PRESS_RIGHT_BUTTON; - break; - case 4: - case 5: - int wheelDelta; - if (evt.xbutton.button == Button4) - wheelDelta = 1; - else if (evt.xbutton.button == Button5) - wheelDelta = -1; - else - wheelDelta = 0; - gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_WHEEL, evt.xbutton.x, evt.xbutton.y, wheelDelta); - break; - default: - break; + + if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0)) + { + gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_PRESS, evt.xbutton.x, evt.xbutton.y, 0, true); + } } - if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0)) + else if (evt.xbutton.button >= 4 && evt.xbutton.button <= 5) { - gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_PRESS, evt.xbutton.x, evt.xbutton.y, 0, true); + int wheelDelta; + if (evt.xbutton.button == 4) + wheelDelta = 1; + else if (evt.xbutton.button == 5) + wheelDelta = -1; + else + wheelDelta = 0; + + gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_WHEEL, evt.xbutton.x, evt.xbutton.y, wheelDelta); } } break; @@ -1262,23 +1268,20 @@ int Platform::enterMessagePump() case ButtonRelease: { gameplay::Mouse::MouseEvent mouseEvt; - switch (evt.xbutton.button) + + if (evt.xbutton.button >= 1 && evt.xbutton.button <= 3) { - case 1: + if (evt.xbutton.button == 1) mouseEvt = gameplay::Mouse::MOUSE_RELEASE_LEFT_BUTTON; - break; - case 2: + else if (evt.xbutton.button == 2) mouseEvt = gameplay::Mouse::MOUSE_RELEASE_MIDDLE_BUTTON; - break; - case 3: + else if (evt.xbutton.button == 3) mouseEvt = gameplay::Mouse::MOUSE_RELEASE_RIGHT_BUTTON; - break; - default: - break; - } - if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0)) - { - gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_RELEASE, evt.xbutton.x, evt.xbutton.y, 0, true); + + if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0)) + { + gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_RELEASE, evt.xbutton.x, evt.xbutton.y, 0, true); + } } } break; diff --git a/gameplay/src/PlatformMacOSX.mm b/gameplay/src/PlatformMacOSX.mm index 48bc2aa128..2ab2afcb92 100644 --- a/gameplay/src/PlatformMacOSX.mm +++ b/gameplay/src/PlatformMacOSX.mm @@ -13,6 +13,7 @@ #import #import #import +#import #import // These should probably be moved to a platform common file @@ -22,8 +23,6 @@ #define MICROSOFT_XBOX360_PRODUCT_ID 0x028e #define STEELSERIES_VENDOR_ID 0x1038 #define STEELSERIES_FREE_PRODUCT_ID 0x1412 -#define FRUCTEL_VENDOR_ID 0x25B6 -#define FRUCTEL_GAMETEL_PRODUCT_ID 0x0001 using namespace std; using namespace gameplay; @@ -334,7 +333,6 @@ - (void)stopListening; - (NSString*)identifierName; - (NSString*)productName; -- (NSString*)manufacturerName; - (NSString*)serialNumber; - (int)versionNumber; - (int)vendorID; @@ -546,7 +544,6 @@ - (NSString*)identifierName { NSString* idName = NULL; if(idName == NULL) idName = [self productName]; - if(idName == NULL) idName = [self manufacturerName]; if(idName == NULL) idName = [self serialNumber]; if(idName == NULL) idName = [NSString stringWithFormat:@"%d-%d", [self vendorID], [self productID]]; return idName; @@ -562,16 +559,6 @@ - (NSString*)productName return (NSString*)productName; } -- (NSString*)manufacturerName -{ - CFStringRef manufacturerName = (CFStringRef)IOHIDDeviceGetProperty([self rawDevice], CFSTR(kIOHIDManufacturerKey)); - if(manufacturerName == NULL || CFGetTypeID(manufacturerName) != CFStringGetTypeID()) - { - return NULL; - } - return (NSString*)manufacturerName; -} - - (NSString*)serialNumber { CFStringRef serialNumber = (CFStringRef)IOHIDDeviceGetProperty([self rawDevice], CFSTR(kIOHIDSerialNumberKey)); @@ -745,14 +732,19 @@ -(void)windowWillClose:(NSNotification*)note [[NSApplication sharedApplication] terminate:self]; } -- (void)windowDidResize:(NSNotification*)notification +- (void)reshape { [gameLock lock]; + NSSize size = [ [ _window contentView ] frame ].size; __width = size.width; __height = size.height; + CGLContextObj cglContext = (CGLContextObj)[[self openGLContext] CGLContextObj]; + GLint dim[2] = {__width, __height}; + CGLSetParameter(cglContext, kCGLCPSurfaceBackingSize, dim); + CGLEnable(cglContext, kCGLCESurfaceBackingSize); + gameplay::Platform::resizeEventInternal((unsigned int)__width, (unsigned int)__height); - [gameLock unlock]; } @@ -781,9 +773,6 @@ - (void) detectGamepads: (Game*) game [gamepad numberOfButtons], [gamepad numberOfSticks], [gamepad numberOfTriggerButtons], - [gamepad vendorID], - [gamepad productID], - [[gamepad manufacturerName] cStringUsingEncoding:NSASCIIStringEncoding], [[gamepad productName] cStringUsingEncoding:NSASCIIStringEncoding]); [__activeGamepads setObject:locationID forKey:locationID]; @@ -844,8 +833,8 @@ - (id) initWithFrame: (NSRect) frame NSOpenGLPixelFormatAttribute windowedAttrs[] = { NSOpenGLPFAMultisample, - NSOpenGLPFASampleBuffers, samples ? 1 : 0, - NSOpenGLPFASamples, samples, + NSOpenGLPFASampleBuffers, static_cast(samples ? 1 : 0), + NSOpenGLPFASamples, static_cast(samples), NSOpenGLPFAAccelerated, NSOpenGLPFADoubleBuffer, NSOpenGLPFAColorSize, 32, @@ -857,11 +846,13 @@ - (id) initWithFrame: (NSRect) frame NSOpenGLPixelFormatAttribute fullscreenAttrs[] = { NSOpenGLPFAMultisample, - NSOpenGLPFASampleBuffers, samples ? 1 : 0, - NSOpenGLPFASamples, samples, + NSOpenGLPFASampleBuffers, static_cast(samples ? 1 : 0), + NSOpenGLPFASamples, static_cast(samples), NSOpenGLPFADoubleBuffer, NSOpenGLPFAScreenMask, (NSOpenGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(CGMainDisplayID()), + #if (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7) NSOpenGLPFAFullScreen, + #endif NSOpenGLPFAColorSize, 32, NSOpenGLPFADepthSize, 24, NSOpenGLPFAAlphaSize, 8, @@ -1147,7 +1138,7 @@ - (void)scrollWheel: (NSEvent*) event NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil]; [__view->gameLock lock]; - gameplay::Platform::mouseEventInternal(Mouse::MOUSE_WHEEL, point.x, __height - point.y, (int)([event deltaY] * 10.0f)); + gameplay::Platform::mouseEventInternal(Mouse::MOUSE_WHEEL, point.x, __height - point.y, (int)([event deltaY])); [__view->gameLock unlock]; } @@ -2049,52 +2040,26 @@ extern int strcmpnocase(const char* s1, const char* s2) Gamepad::BUTTON_MENU1 }; - static const int GametelMapping103[12] = { - Gamepad::BUTTON_B, - Gamepad::BUTTON_X, - Gamepad::BUTTON_Y, - Gamepad::BUTTON_A, - Gamepad::BUTTON_L1, - Gamepad::BUTTON_R1, - Gamepad::BUTTON_MENU1, - Gamepad::BUTTON_MENU2, - Gamepad::BUTTON_RIGHT, - Gamepad::BUTTON_LEFT, - Gamepad::BUTTON_DOWN, - Gamepad::BUTTON_UP - }; - const int* mapping = NULL; float axisDeadZone = 0.0f; - if (gamepad->_vendorId == SONY_USB_VENDOR_ID && - gamepad->_productId == SONY_USB_PS3_PRODUCT_ID) + if ([gp vendorID] == SONY_USB_VENDOR_ID && + [gp productID] == SONY_USB_PS3_PRODUCT_ID) { mapping = PS3Mapping; axisDeadZone = 0.07f; } - else if (gamepad->_vendorId == MICROSOFT_VENDOR_ID && - gamepad->_productId == MICROSOFT_XBOX360_PRODUCT_ID) + else if ([gp vendorID] == MICROSOFT_VENDOR_ID && + [gp productID] == MICROSOFT_XBOX360_PRODUCT_ID) { mapping = XBox360Mapping; axisDeadZone = 0.2f; } - else if (gamepad->_vendorId == STEELSERIES_VENDOR_ID && - gamepad->_productId == STEELSERIES_FREE_PRODUCT_ID) + else if ([gp vendorID] == STEELSERIES_VENDOR_ID && + [gp productID] == STEELSERIES_FREE_PRODUCT_ID) { mapping = SteelSeriesFreeMapping; axisDeadZone = 0.005f; } - else if (gamepad->_vendorId == FRUCTEL_VENDOR_ID && - gamepad->_productId == FRUCTEL_GAMETEL_PRODUCT_ID) - { - int ver = [gp versionNumber]; - int major = ver >> 8; - int minor = ver & 0x00ff; - if (major >= 1 && minor > 1) - { - mapping = GametelMapping103; - } - } unsigned int buttons = 0; for (int i = 0; i < [gp numberOfButtons]; ++i) diff --git a/gameplay/src/PlatformWindows.cpp b/gameplay/src/PlatformWindows.cpp index 0252e95ec4..33e6caca27 100644 --- a/gameplay/src/PlatformWindows.cpp +++ b/gameplay/src/PlatformWindows.cpp @@ -951,7 +951,7 @@ Platform* Platform::create(Game* game) if (!__connectedXInput[i]) { // Gamepad is connected. - Platform::gamepadEventConnectedInternal(i, XINPUT_BUTTON_COUNT, XINPUT_JOYSTICK_COUNT, XINPUT_TRIGGER_COUNT, 0, 0, "Microsoft", "XBox360 Controller"); + Platform::gamepadEventConnectedInternal(i, XINPUT_BUTTON_COUNT, XINPUT_JOYSTICK_COUNT, XINPUT_TRIGGER_COUNT, "Microsoft XBox360 Controller"); __connectedXInput[i] = true; } } @@ -1008,7 +1008,7 @@ int Platform::enterMessagePump() if (XInputGetState(i, &__xInputState) == NO_ERROR && !__connectedXInput[i]) { // Gamepad was just connected. - Platform::gamepadEventConnectedInternal(i, XINPUT_BUTTON_COUNT, XINPUT_JOYSTICK_COUNT, XINPUT_TRIGGER_COUNT, 0, 0, "Microsoft", "XBox360 Controller"); + Platform::gamepadEventConnectedInternal(i, XINPUT_BUTTON_COUNT, XINPUT_JOYSTICK_COUNT, XINPUT_TRIGGER_COUNT, "Microsoft XBox360 Controller"); __connectedXInput[i] = true; } else if (XInputGetState(i, &__xInputState) != NO_ERROR && __connectedXInput[i]) @@ -1372,18 +1372,18 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch OPENFILENAMEA ofn; memset(&ofn, 0, sizeof(ofn)); - // Set initial directory + char currentDir[1024]; + char absPath[1024]; std::string initialDirectoryStr; - char currentDir[256]; if (initialDirectory == NULL) { - char currentDir[512]; - GetCurrentDirectoryA(512, currentDir); + GetCurrentDirectoryA(1024, currentDir); initialDirectoryStr = currentDir; } else { - initialDirectoryStr = initialDirectory; + GetFullPathNameA(initialDirectory, 1024, absPath, 0); + initialDirectoryStr = absPath; } // Filter on extensions @@ -1408,14 +1408,14 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch strcpy(filter, descStr.c_str()); strcpy(filter + descStr.length() + 1, extStr.c_str()); - char szFileName[512] = ""; + char szFileName[1024] = ""; ofn.lpstrFile = szFileName; ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = GetForegroundWindow(); ofn.lpstrTitle = title; ofn.lpstrFilter = filter; ofn.lpstrInitialDir = initialDirectoryStr.c_str(); - ofn.nMaxFile = 512; + ofn.nMaxFile = 1024; ofn.lpstrDefExt = filter; if (mode == FileSystem::OPEN) @@ -1430,9 +1430,6 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch } filename = szFileName; - - if (initialDirectory == NULL) - SetCurrentDirectoryA(currentDir); return filename; } diff --git a/gameplay/src/PlatformiOS.mm b/gameplay/src/PlatformiOS.mm index 6d3513d536..2583f18909 100644 --- a/gameplay/src/PlatformiOS.mm +++ b/gameplay/src/PlatformiOS.mm @@ -748,20 +748,19 @@ - (void)unregisterGesture: (Gesture::GestureEvent) evt } if((evt & Gesture::GESTURE_LONG_TAP) == Gesture::GESTURE_LONG_TAP && _longTapRecognizer != NULL) { - if (_dragAndDropRecognizer == NULL) + if (_longTapRecognizer == NULL) { - [self removeGestureRecognizer:_longPressRecognizer]; - [_longPressRecognizer release]; + [self removeGestureRecognizer:_longTapRecognizer]; + [_longTapRecognizer release]; } _longTapRecognizer = NULL; } if (((evt & Gesture::GESTURE_DRAG) == Gesture::GESTURE_DRAG || (evt & Gesture::GESTURE_DROP) == Gesture::GESTURE_DROP) && _dragAndDropRecognizer != NULL) { - - if (_longTapRecognizer == NULL) + if (_dragAndDropRecognizer == NULL) { - [self removeGestureRecognizer:_longPressRecognizer]; - [_longPressRecognizer release]; + [self removeGestureRecognizer:_dragAndDropRecognizer]; + [_dragAndDropRecognizer release]; } _dragAndDropRecognizer = NULL; } @@ -770,7 +769,7 @@ - (void)unregisterGesture: (Gesture::GestureEvent) evt - (void)handleTapGesture:(UITapGestureRecognizer*)sender { CGPoint location = [sender locationInView:self]; - gameplay::Platform::gestureTapEventInternal(location.x, location.y); + gameplay::Platform::gestureTapEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE); } - (void)handleLongTapGesture:(UILongPressGestureRecognizer*)sender @@ -790,7 +789,7 @@ - (void)handleLongTapGesture:(UILongPressGestureRecognizer*)sender gettimeofday(&time, NULL); currentTimeStamp = (time.tv_sec * 1000) + (time.tv_usec / 1000); - gameplay::Platform::gestureLongTapEventInternal(location.x, location.y, currentTimeStamp - __gestureLongTapStartTimestamp); + gameplay::Platform::gestureLongTapEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE, currentTimeStamp - __gestureLongTapStartTimestamp); } } @@ -798,7 +797,7 @@ - (void)handlePinchGesture:(UIPinchGestureRecognizer*)sender { CGFloat factor = [sender scale]; CGPoint location = [sender locationInView:self]; - gameplay::Platform::gesturePinchEventInternal(location.x, location.y, factor); + gameplay::Platform::gesturePinchEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE, factor); } - (void)handleSwipeGesture:(UISwipeGestureRecognizer*)sender @@ -820,7 +819,7 @@ - (void)handleSwipeGesture:(UISwipeGestureRecognizer*)sender gameplayDirection = Gesture::SWIPE_DIRECTION_DOWN; break; } - gameplay::Platform::gestureSwipeEventInternal(location.x, location.y, gameplayDirection); + gameplay::Platform::gestureSwipeEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE, gameplayDirection); } - (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender @@ -838,7 +837,7 @@ - (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender if (sender.state == UIGestureRecognizerStateChanged) { if (__gestureDraging) - gameplay::Platform::gestureDragEventInternal(location.x, location.y); + gameplay::Platform::gestureDragEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE); else { float delta = sqrt(pow(__gestureLongPressStartPosition.x - location.x, 2) + pow(__gestureLongPressStartPosition.y - location.y, 2)); @@ -846,7 +845,7 @@ - (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender if (delta >= GESTURE_LONG_PRESS_DISTANCE_MIN) { __gestureDraging = true; - gameplay::Platform::gestureDragEventInternal(__gestureLongPressStartPosition.x, __gestureLongPressStartPosition.y); + gameplay::Platform::gestureDragEventInternal(__gestureLongPressStartPosition.x * WINDOW_SCALE, __gestureLongPressStartPosition.y * WINDOW_SCALE); } } } @@ -854,7 +853,7 @@ - (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender { if (__gestureDraging) { - gameplay::Platform::gestureDropEventInternal(location.x, location.y); + gameplay::Platform::gestureDropEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE); __gestureDraging = false; } else @@ -864,12 +863,12 @@ - (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender gettimeofday(&time, NULL); currentTimeStamp = (time.tv_sec * 1000) + (time.tv_usec / 1000); - gameplay::Platform::gestureLongTapEventInternal(location.x, location.y, currentTimeStamp - __gestureLongTapStartTimestamp); + gameplay::Platform::gestureLongTapEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE, currentTimeStamp - __gestureLongTapStartTimestamp); } } if ((sender.state == UIGestureRecognizerStateCancelled || sender.state == UIGestureRecognizerStateFailed) && __gestureDraging) { - gameplay::Platform::gestureDropEventInternal(location.x, location.y); + gameplay::Platform::gestureDropEventInternal(location.x * WINDOW_SCALE, location.y * WINDOW_SCALE); __gestureDraging = false; } } @@ -1512,14 +1511,34 @@ extern int strcmpnocase(const char* s1, const char* s2) unsigned int Platform::getDisplayWidth() { - CGSize size = DeviceOrientedSize([__appDelegate.viewController interfaceOrientation]); - return size.width; +#ifdef NSFoundationVersionNumber_iOS_7_1 + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) + { + //iOS 8+ + return [[UIScreen mainScreen] bounds].size.width * [[UIScreen mainScreen] scale]; + } + else +#endif + { + CGSize size = DeviceOrientedSize([__appDelegate.viewController interfaceOrientation]); + return size.width; + } } unsigned int Platform::getDisplayHeight() { - CGSize size = DeviceOrientedSize([__appDelegate.viewController interfaceOrientation]); - return size.height; +#ifdef NSFoundationVersionNumber_iOS_7_1 + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) + { + //iOS 8+ + return [[UIScreen mainScreen] bounds].size.height * [[UIScreen mainScreen] scale]; + } + else +#endif + { + CGSize size = DeviceOrientedSize([__appDelegate.viewController interfaceOrientation]); + return size.height; + } } double Platform::getAbsoluteTime() diff --git a/gameplay/src/Properties.cpp b/gameplay/src/Properties.cpp index edde0cd35e..1cfe331a4e 100644 --- a/gameplay/src/Properties.cpp +++ b/gameplay/src/Properties.cpp @@ -80,7 +80,7 @@ Properties* Properties::create(const char* url) std::vector namespacePath; calculateNamespacePath(urlString, fileString, namespacePath); - std::auto_ptr stream(FileSystem::open(fileString.c_str())); + std::unique_ptr stream(FileSystem::open(fileString.c_str())); if (stream.get() == NULL) { GP_WARN("Failed to open file '%s'.", fileString.c_str()); @@ -688,7 +688,7 @@ Properties::Type Properties::getType(const char* name) const // Parse the value to determine the format unsigned int commaCount = 0; char* valuePtr = const_cast(value); - while (valuePtr = strchr(valuePtr, ',')) + while ((valuePtr = strchr(valuePtr, ','))) { valuePtr++; commaCount++; diff --git a/gameplay/src/Quaternion.cpp b/gameplay/src/Quaternion.cpp index 9ab17162ef..2a57c1246a 100644 --- a/gameplay/src/Quaternion.cpp +++ b/gameplay/src/Quaternion.cpp @@ -229,15 +229,15 @@ void Quaternion::setIdentity() float Quaternion::toAxisAngle(Vector3* axis) const { - GP_ASSERT(axis); - Quaternion q(x, y, z, w); q.normalize(); - axis->x = q.x; - axis->y = q.y; - axis->z = q.z; - axis->normalize(); - + if (axis) + { + axis->x = q.x; + axis->y = q.y; + axis->z = q.z; + axis->normalize(); + } return (2.0f * acos(q.w)); } diff --git a/gameplay/src/RadioButton.cpp b/gameplay/src/RadioButton.cpp index 919085ac76..3233ff8a77 100644 --- a/gameplay/src/RadioButton.cpp +++ b/gameplay/src/RadioButton.cpp @@ -60,6 +60,11 @@ void RadioButton::initialize(const char* typeName, Theme::Style* style, Properti } } +const char* RadioButton::getTypeName() const +{ + return "RadioButton"; +} + bool RadioButton::isSelected() const { return _selected; @@ -198,11 +203,6 @@ unsigned int RadioButton::drawImages(Form* form, const Rectangle& clip) return 1; } -const char* RadioButton::getType() const -{ - return "radioButton"; -} - void RadioButton::setGroupId(const char* groupId) { _groupId = groupId; diff --git a/gameplay/src/RadioButton.h b/gameplay/src/RadioButton.h index 43f078bb9a..89431e5d10 100644 --- a/gameplay/src/RadioButton.h +++ b/gameplay/src/RadioButton.h @@ -35,6 +35,16 @@ class RadioButton : public Button */ static RadioButton* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "RadioButton" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Get whether this radio button is currently selected. * @@ -47,11 +57,6 @@ class RadioButton : public Button */ void setSelected(bool selected); - /** - * @see Control::getType - */ - const char* getType() const; - /** * Add a listener to be notified of specific events affecting * this control. Event types can be OR'ed together. diff --git a/gameplay/src/RenderState.cpp b/gameplay/src/RenderState.cpp index d50587db91..693674c7bd 100644 --- a/gameplay/src/RenderState.cpp +++ b/gameplay/src/RenderState.cpp @@ -373,16 +373,26 @@ Vector3 RenderState::autoBindingGetCameraViewPosition() const const Vector4* RenderState::autoBindingGetMatrixPalette() const { - Model* model = _nodeBinding ? _nodeBinding->getModel() : NULL; - MeshSkin* skin = model ? model->getSkin() : NULL; - return skin ? skin->getMatrixPalette() : NULL; + Model* model = dynamic_cast(_nodeBinding->getDrawable()); + if (model) + { + MeshSkin* skin = model->getSkin(); + if (skin) + return skin->getMatrixPalette(); + } + return NULL; } unsigned int RenderState::autoBindingGetMatrixPaletteSize() const { - Model* model = _nodeBinding ? _nodeBinding->getModel() : NULL; - MeshSkin* skin = model ? model->getSkin() : NULL; - return skin ? skin->getMatrixPaletteSize() : 0; + Model* model = dynamic_cast(_nodeBinding->getDrawable()); + if (model) + { + MeshSkin* skin = model->getSkin(); + if (skin) + return skin->getMatrixPaletteSize(); + } + return 0; } const Vector3& RenderState::autoBindingGetAmbientColor() const diff --git a/gameplay/src/Scene.cpp b/gameplay/src/Scene.cpp index 219ca6c2e4..690853dfc3 100644 --- a/gameplay/src/Scene.cpp +++ b/gameplay/src/Scene.cpp @@ -200,16 +200,17 @@ void Scene::visitNode(Node* node, const char* visitMethod) ScriptController* sc = Game::getInstance()->getScriptController(); // Invoke the visit method for this node. - if (!sc->executeFunction(visitMethod, "", node)) + if (!sc->executeFunction(visitMethod, "", dynamic_cast(node))) return; // If this node has a model with a mesh skin, visit the joint hierarchy within it // since we don't add joint hierarcies directly to the scene. If joints are never // visited, it's possible that nodes embedded within the joint hierarchy that contain // models will never get visited (and therefore never get drawn). - if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode) + Model* model = dynamic_cast(node->getDrawable()); + if (model && model->_skin && model->_skin->_rootNode) { - visitNode(node->_model->_skin->_rootNode, visitMethod); + visitNode(model->_skin->_rootNode, visitMethod); } // Recurse for all children. @@ -388,7 +389,7 @@ void Scene::update(float elapsedTime) { for (Node* node = _firstNode; node != NULL; node = node->_nextSibling) { - if (node->isActive()) + if (node->isEnabled()) node->update(elapsedTime); } } @@ -443,10 +444,10 @@ Node* Scene::findNextVisibleSibling(Node* node) bool Scene::isNodeVisible(Node* node) { - if (!node->isActive()) + if (!node->isEnabled()) return false; - if (node->getForm() || node->getParticleEmitter() || node->getTerrain() || node->getLight() || node->getCamera()) + if (node->getDrawable() || node->getLight() || node->getCamera()) { return true; } diff --git a/gameplay/src/Scene.h b/gameplay/src/Scene.h index 31f5b9ea04..a78bfc89b8 100644 --- a/gameplay/src/Scene.h +++ b/gameplay/src/Scene.h @@ -5,6 +5,7 @@ #include "MeshBatch.h" #include "ScriptController.h" #include "Light.h" +#include "Model.h" namespace gameplay { @@ -176,6 +177,17 @@ class Scene : public Ref */ void setAmbientColor(float red, float green, float blue); + /** + * Updates all active nodes in the scene. + * + * This method is recursively calls the Node::update(float) method on all nodes that + * are active within the scene. A Node is considered active if Node::isActive() + * returns true. + * + * @param elapsedTime Elapsed time in milliseconds. + */ + void update(float elapsedTime); + /** * Visits each node in the scene and calls the specified method pointer. * @@ -234,11 +246,6 @@ class Scene : public Ref */ inline void visit(const char* visitMethod); - /** - * Updates all the active nodes in the scene. - */ - void update(float elapsedTime); - /** * @see VisibleSet#getNext */ @@ -340,9 +347,10 @@ void Scene::visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*)) // since we don't add joint hierarchies directly to the scene. If joints are never // visited, it's possible that nodes embedded within the joint hierarchy that contain // models will never get visited (and therefore never get drawn). - if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode) + Model* model = dynamic_cast(node->getDrawable()); + if (model && model->_skin && model->_skin->_rootNode) { - visitNode(node->_model->_skin->_rootNode, instance, visitMethod); + visitNode(model->_skin->_rootNode, instance, visitMethod); } // Recurse for all children. @@ -363,9 +371,10 @@ void Scene::visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*,C), // since we don't add joint hierarchies directly to the scene. If joints are never // visited, it's possible that nodes embedded within the joint hierarchy that contain // models will never get visited (and therefore never get drawn). - if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode) + Model* model = dynamic_cast(node->getDrawable()); + if (model && model->_skin && model->_skin->_rootNode) { - visitNode(node->_model->_skin->_rootNode, instance, visitMethod, cookie); + visitNode(model->_skin->_rootNode, instance, visitMethod, cookie); } // Recurse for all children. diff --git a/gameplay/src/SceneLoader.cpp b/gameplay/src/SceneLoader.cpp index ee34f7662c..74cfdc70fc 100644 --- a/gameplay/src/SceneLoader.cpp +++ b/gameplay/src/SceneLoader.cpp @@ -4,6 +4,10 @@ #include "Bundle.h" #include "SceneLoader.h" #include "Terrain.h" +#include "ParticleEmitter.h" +#include "Sprite.h" +#include "Text.h" +#include "TileSet.h" #include "Light.h" namespace gameplay @@ -91,7 +95,11 @@ Scene* SceneLoader::loadInternal(const char* url) SceneNodeProperty::CAMERA | SceneNodeProperty::ROTATE | SceneNodeProperty::SCALE | - SceneNodeProperty::TRANSLATE); + SceneNodeProperty::TRANSLATE | + SceneNodeProperty::SCRIPT | + SceneNodeProperty::SPRITE | + SceneNodeProperty::TILESET | + SceneNodeProperty::TEXT); applyNodeProperties(sceneProperties, SceneNodeProperty::COLLISION_OBJECT); // Apply node tags @@ -245,7 +253,10 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop snp._type == SceneNodeProperty::TERRAIN || snp._type == SceneNodeProperty::LIGHT || snp._type == SceneNodeProperty::CAMERA || - snp._type == SceneNodeProperty::COLLISION_OBJECT) + snp._type == SceneNodeProperty::COLLISION_OBJECT || + snp._type == SceneNodeProperty::SPRITE || + snp._type == SceneNodeProperty::TILESET || + snp._type == SceneNodeProperty::TEXT) { // Check to make sure the referenced properties object was loaded properly. Properties* p = _properties[snp._value]; @@ -269,29 +280,32 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop break; } case SceneNodeProperty::MATERIAL: - if (!node->getModel()) + { + Model* model = dynamic_cast(node->getDrawable()); + if (model) { - GP_ERROR("Attempting to set a material on node '%s', which has no model.", sceneNode._nodeID); - return; + Material* material = Material::create(p); + model->setMaterial(material, snp._index); + SAFE_RELEASE(material); } else { - Material* material = Material::create(p); - node->getModel()->setMaterial(material, snp._index); - SAFE_RELEASE(material); + GP_ERROR("Attempting to set a material on node '%s', which has no model.", sceneNode._nodeID); + return; } break; + } case SceneNodeProperty::PARTICLE: { ParticleEmitter* particleEmitter = ParticleEmitter::create(p); - node->setParticleEmitter(particleEmitter); + node->setDrawable(particleEmitter); SAFE_RELEASE(particleEmitter); break; } case SceneNodeProperty::TERRAIN: { Terrain* terrain = Terrain::create(p); - node->setTerrain(terrain); + node->setDrawable(terrain); SAFE_RELEASE(terrain); break; } @@ -339,26 +353,26 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop } else { - if (!modelNode->getModel()) + if ( dynamic_cast(modelNode->getDrawable()) == NULL) { GP_ERROR("Node '%s' does not have a model; attempting to use its model for collision object creation.", name); } else { // Temporarily set rigidBody model on model so it's used during collision object creation. - Model* model = node->getModel(); - + Model* model = dynamic_cast(node->getDrawable()); + // Up ref count to prevent node from releasing the model when we swap it. if (model) - model->addRef(); - + model->addRef(); + // Create collision object with new rigidBodyModel (aka collisionMesh) set. - node->setModel(modelNode->getModel()); + node->setDrawable(dynamic_cast(modelNode->getDrawable())); node->setCollisionObject(p); // Restore original model. - node->setModel(model); - + node->setDrawable(model); + // Decrement temporarily added reference. if (model) model->release(); @@ -370,6 +384,27 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop } break; } + case SceneNodeProperty::SPRITE: + { + Sprite* sprite = Sprite::create(p); + node->setDrawable(sprite); + SAFE_RELEASE(sprite); + break; + } + case SceneNodeProperty::TILESET: + { + TileSet* tileset = TileSet::create(p); + node->setDrawable(tileset); + SAFE_RELEASE(tileset); + break; + } + case SceneNodeProperty::TEXT: + { + Text* text = Text::create(p); + node->setDrawable(text); + SAFE_RELEASE(text); + break; + } default: GP_ERROR("Unsupported node property type (%d).", snp._type); break; @@ -377,7 +412,7 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop } else { - // Handle scale, rotate and translate. + // Handle simple types (scale, rotate, translate, script, etc) switch (snp._type) { case SceneNodeProperty::TRANSLATE: @@ -401,6 +436,9 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop node->scale(s); break; } + case SceneNodeProperty::SCRIPT: + node->addScript(snp._value.c_str()); + break; default: GP_ERROR("Unsupported node property type (%d).", snp._type); break; @@ -704,6 +742,24 @@ void SceneLoader::parseNode(Properties* ns, SceneNode* parent, const std::string addSceneNodeProperty(sceneNode, SceneNodeProperty::COLLISION_OBJECT, propertyUrl.c_str()); _properties[propertyUrl] = subns; } + else if (strcmp(subns->getNamespace(), "sprite") == 0) + { + propertyUrl = path + "sprite/" + std::string(subns->getId()); + addSceneNodeProperty(sceneNode, SceneNodeProperty::SPRITE, propertyUrl.c_str()); + _properties[propertyUrl] = subns; + } + else if (strcmp(subns->getNamespace(), "tileset") == 0) + { + propertyUrl = path + "tileset/" + std::string(subns->getId()); + addSceneNodeProperty(sceneNode, SceneNodeProperty::TILESET, propertyUrl.c_str()); + _properties[propertyUrl] = subns; + } + else if (strcmp(subns->getNamespace(), "text") == 0) + { + propertyUrl = path + "text/" + std::string(subns->getId()); + addSceneNodeProperty(sceneNode, SceneNodeProperty::TEXT, propertyUrl.c_str()); + _properties[propertyUrl] = subns; + } else if (strcmp(subns->getNamespace(), "tags") == 0) { while ((name = subns->getNextProperty()) != NULL) @@ -760,6 +816,18 @@ void SceneLoader::parseNode(Properties* ns, SceneNode* parent, const std::string { addSceneNodeProperty(sceneNode, SceneNodeProperty::COLLISION_OBJECT, ns->getString(), true); } + else if (strcmp(name, "sprite") == 0) + { + addSceneNodeProperty(sceneNode, SceneNodeProperty::SPRITE, ns->getString(), true); + } + else if (strcmp(name, "tileset") == 0) + { + addSceneNodeProperty(sceneNode, SceneNodeProperty::TILESET, ns->getString(), true); + } + else if (strcmp(name, "text") == 0) + { + addSceneNodeProperty(sceneNode, SceneNodeProperty::TEXT, ns->getString(), true); + } else if (strcmp(name, "rigidBodyModel") == 0) { // Ignore this for now. We process this when we do rigid body creation. @@ -780,6 +848,10 @@ void SceneLoader::parseNode(Properties* ns, SceneNode* parent, const std::string { addSceneNodeProperty(sceneNode, SceneNodeProperty::SCALE, ns->getString()); } + else if (strcmp(name, "script") == 0) + { + addSceneNodeProperty(sceneNode, SceneNodeProperty::SCRIPT, ns->getString()); + } else { GP_ERROR("Unsupported node property: %s = %s", name, ns->getString()); @@ -1203,29 +1275,33 @@ void splitURL(const std::string& url, std::string* file, std::string* id) return; } - // Check if the url references a file (otherwise, it only references a node within the main GPB). - size_t loc = url.rfind("."); + // Check if the url references a file (otherwise, it only references some sort of ID) + size_t loc = url.rfind("#"); if (loc != std::string::npos) { - // If the url references a specific namespace within the file, - // set the id out parameter appropriately. Otherwise, set the id out - // parameter to the empty string so we know to load the first namespace. - loc = url.rfind("#"); - if (loc != std::string::npos) + *file = url.substr(0, loc); + if (FileSystem::fileExists(file->c_str())) { - *file = url.substr(0, loc); *id = url.substr(loc + 1); } else { - *file = url; - *id = std::string(); + *file = std::string(); + *id = url; } } else { - *file = std::string(); - *id = url; + if (FileSystem::fileExists(url.c_str())) + { + *file = url; + *id = std::string(); + } + else + { + *file = std::string(); + *id = url; + } } } diff --git a/gameplay/src/SceneLoader.h b/gameplay/src/SceneLoader.h index 0ea9df4b02..9e3d45c68b 100644 --- a/gameplay/src/SceneLoader.h +++ b/gameplay/src/SceneLoader.h @@ -57,7 +57,11 @@ class SceneLoader TRANSLATE = 128, ROTATE = 256, SCALE = 512, - URL = 1024 + URL = 1024, + SCRIPT = 2048, + SPRITE = 4096, + TILESET = 8192, + TEXT = 16384 }; SceneNodeProperty(Type type, const std::string& value, int index, bool isUrl); diff --git a/gameplay/src/Script.cpp b/gameplay/src/Script.cpp new file mode 100644 index 0000000000..4c43e00c9e --- /dev/null +++ b/gameplay/src/Script.cpp @@ -0,0 +1,42 @@ +#include "Script.h" +#include "ScriptController.h" + +namespace gameplay +{ + +Script::Script() : _scope(GLOBAL), _env(0) +{ +} + +Script::~Script() +{ + Game::getInstance()->getScriptController()->unloadScript(this); +} + +const char* Script::getPath() const +{ + return _path.c_str(); +} + +Script::Scope Script::getScope() const +{ + return _scope; +} + +bool Script::functionExists(const char* name) const +{ + return Game::getInstance()->getScriptController()->functionExists(name, this); +} + +bool Script::reload() +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // First unload our current script + sc->unloadScript(this); + + // Now attempt to reload the script + return Game::getInstance()->getScriptController()->loadScript(this); +} + +} diff --git a/gameplay/src/Script.h b/gameplay/src/Script.h new file mode 100644 index 0000000000..e5090b1430 --- /dev/null +++ b/gameplay/src/Script.h @@ -0,0 +1,119 @@ +#ifndef SCRIPT_H_ +#define SCRIPT_H_ + +#include "Base.h" +#include "Ref.h" + +namespace gameplay +{ + +/** + * Represents a script that has been loaded by the scripting system. + */ +class Script : public Ref +{ + friend class ScriptController; + +public: + + /** + * Defines the scope of a script environment. + */ + enum Scope + { + /** + * Global scripts execute in a single shared environment that is accessible to + * all other scripts in the system. Global scripts can use code from other global + * scripts and other scripts can use code from a global script. + * + * Scripts that execute in the global environment must be careful to not override + * other variables or functions that already exist in the global environment (unless + * this is intended). Because of this, script naming conventions and the use of + * unique namespaces is important to prevent naming collisions with other global code. + */ + GLOBAL, + + /** + * Protected scripts execute in a more limited sandbox environment that by default does + * not allow other scripts to see their variables or functions. Variables and functions + * in a protected script can be named the same as those in other scripts without + * collision issues. + * + * Although global code cannot access protected scripts, protected scripts can acceess + * global code. Similarly, protected scripts can expose variables and functions to the + * global environment using explicit notation, although the same precautions noted + * for the GLOBAL scope should be used when doing this, to prevent naming collisions. + * + * Protected scripts are best used when associated with a single game object, since + * these scripts are not cached the same way global scripts are. Each time a protected + * script is loaded, a new instance of the script is loaded. This allows protected + * scripts to store per-instance state, since it will not be shared by multiple instances. + * + * @see ScriptTarget + */ + PROTECTED + }; + + /** + * Returns the path from which this Script was loaded. + * + * @return The script's path. + */ + const char* getPath() const; + + /** + * Returns the scope of this script. + * + * @return The scope of this script. + */ + Scope getScope() const; + + /** + * Determines if a function with the given name exists in the script. + * + * @param name Name of the function. + * + * @return True if the function exists, false otherwise. + */ + bool functionExists(const char* name) const; + + /** + * Reloads this script. + * + * The code in the script will be reloaded and any functions and variables will be overwritten + * into the script's envrionment. + * + * If the script is GLOBAL in scope, it will simply be re-run, replacing any existing global + * variables and functions. If the script has changed, any previous variables or functions that + * do not exist in the updated script will remain in the global environment. + * + * @return True if the script is successfully reloaded, false otherwise. + */ + bool reload(); + +private: + + /** + * Constructor. + */ + Script(); + + /** + * Copy constructor (hidden). + */ + Script(const Script& copy); + + /** + * Destructor. + */ + ~Script(); + + std::string _path; + Scope _scope; + int _env; + +}; + +} + +#endif diff --git a/gameplay/src/ScriptController.cpp b/gameplay/src/ScriptController.cpp index 10bc4096aa..4483ddec80 100644 --- a/gameplay/src/ScriptController.cpp +++ b/gameplay/src/ScriptController.cpp @@ -42,9 +42,9 @@ \ return arr -#define PUSH_NESTED_VARIABLE(name, defaultValue) \ +#define PUSH_NESTED_VARIABLE(name, defaultValue, script) \ int top = lua_gettop(_lua); \ - if (!getNestedVariable(_lua, (name))) \ + if (!getNestedVariable(_lua, name, script ? script->_env : 0)) \ { \ lua_settop(_lua, top); \ return (defaultValue); \ @@ -53,28 +53,43 @@ #define POP_NESTED_VARIABLE() \ lua_settop(_lua, top) +namespace gameplay +{ + +extern void splitURL(const std::string& url, std::string* file, std::string* id); + /** - * Pushes onto the stack, the value of the global 'name' or the nested table value if 'name' is a '.' separated + * Pushes onto the stack, the value of the variable 'name' or the nested table value if 'name' is a '.' separated * list of tables of the form "A.B.C.D", where A, B and C are tables and D is a variable name in the table C. * - * If 'name' does not contain any '.' then it is assumed to be the name of a global variable. - * * This function will not restore the stack if there is an error. * * @param lua The Lua state. - * @param name The name of a global variable or a '.' separated list of nested tables ending with a variable name. + * @param name The name of a variable or a '.' separated list of nested tables ending with a variable name. * The name value may be in the format "A.B.C.D" where A is a table and B, C are child tables. * D is any type, which will be accessed by the calling function. + * @param env Optional script environment ID, or zero for the global script environment. * - * @return True if the tables were pushed on the stack or the global variable was pushed. Returns false on error. + * @return True if the tables were pushed on the stack or the variable was pushed. Returns false on error. */ -static bool getNestedVariable(lua_State* lua, const char* name) +static bool getNestedVariable(lua_State* lua, const char* name, int env = 0) { if (strchr(name, '.') == NULL) { - lua_getglobal(lua, name); + // Just a field name, no nested tables + if (env) + { + lua_rawgeti(lua, LUA_REGISTRYINDEX, env); + lua_pushstring(lua, name); + lua_rawget(lua, -2); + } + else + { + lua_getglobal(lua, name); + } return true; } + static std::string str; // Copy the input string to a std::string so we can modify it because // some of the Lua functions require NULL terminated c-strings. @@ -89,12 +104,24 @@ static bool getNestedVariable(lua_State* lua, const char* name) } ++end; *(end - 1) = '\0'; - lua_getglobal(lua, start); + + if (env) + { + lua_rawgeti(lua, LUA_REGISTRYINDEX, env); + lua_pushstring(lua, name); + lua_rawget(lua, -2); + } + else + { + lua_getglobal(lua, start); + } *(end - 1) = '.'; + if (!lua_istable(lua, -1)) { return false; } + // Push the nested tables for (;;) { @@ -128,534 +155,488 @@ static bool getNestedVariable(lua_State* lua, const char* name) return false; } -namespace gameplay +Script* ScriptController::loadScript(const char* path, Script::Scope scope, bool forceReload) { + GP_ASSERT(path); -extern void splitURL(const std::string& url, std::string* file, std::string* id); - -void ScriptUtil::registerLibrary(const char* name, const luaL_Reg* functions) -{ - ScriptController* sc = Game::getInstance()->getScriptController(); - lua_newtable(sc->_lua); + Script* script = NULL; - // Go through the list of functions and add them to the table. - const luaL_Reg* iter = functions; - for (; iter && iter->name; iter++) + // For global scripts, check if a script with the same path and scope is already loaded. + // Protected scripts are always loaded into a new instance. + if (scope == Script::GLOBAL) { - lua_pushcfunction(sc->_lua, iter->func); - lua_setfield(sc->_lua, -2, iter->name); - } - - lua_setglobal(sc->_lua, name); -} + std::map>::iterator itr = _scripts.find(path); + if (itr != _scripts.end()) + { -void ScriptUtil::registerConstantBool(const std::string& name, bool value, const std::vector& scopePath) -{ - ScriptController* sc = Game::getInstance()->getScriptController(); + for (size_t i = 0, count = itr->second.size(); i < count; ++i) + { + if (itr->second[i]->_scope == scope) + { + // Found a script with the same path and scope that's already loaded + script = itr->second[i]; + break; + } + } + } + } - // If the constant is within a scope, get the correct parent - // table on the stack before setting its value. - if (!scopePath.empty()) + // If the script is already loaded and forceReload was not specified, increase its + // reference count and return it + if (script && !forceReload) { - lua_getglobal(sc->_lua, scopePath[0].c_str()); - for (unsigned int i = 1; i < scopePath.size(); i++) - { - lua_pushstring(sc->_lua, scopePath[i].c_str()); - lua_gettable(sc->_lua, -2); - } - - // Add the constant to the parent table. - lua_pushboolean(sc->_lua, value); - lua_setfield(sc->_lua, -2, name.c_str()); + script->addRef(); + return script; + } - // Pop all the parent tables off the stack. - int size = (int)scopePath.size(); - lua_pop(sc->_lua, size); + // Create a new script object if neccessary + if (script == NULL) + { + script = new Script(); + script->_path = path; + script->_scope = scope; } - else + + // Attempt to load the script into the given scope + if (!loadScript(script)) { - // TODO: Currently unsupported (we don't parse for this yet). - // If the constant is global, add it to the global table. - lua_pushboolean(sc->_lua, value); - lua_pushvalue(sc->_lua, -1); - lua_setglobal(sc->_lua, name.c_str()); + // Freeing the script will cause it to be removed from _scripts + SAFE_RELEASE(script); } + + return script; } -void ScriptUtil::registerConstantNumber(const std::string& name, double value, const std::vector& scopePath) +bool ScriptController::loadScript(Script* script) { - ScriptController* sc = Game::getInstance()->getScriptController(); - - // If the constant is within a scope, get the correct parent - // table on the stack before setting its value. - if (!scopePath.empty()) - { - lua_getglobal(sc->_lua, scopePath[0].c_str()); - for (unsigned int i = 1; i < scopePath.size(); i++) - { - lua_pushstring(sc->_lua, scopePath[i].c_str()); - lua_gettable(sc->_lua, -2); - } - - // Add the constant to the parent table. - lua_pushnumber(sc->_lua, value); - lua_setfield(sc->_lua, -2, name.c_str()); + GP_ASSERT(script); - // Pop all the parent tables off the stack. - int size = (int)scopePath.size(); - lua_pop(sc->_lua, size); - } - else + if (!FileSystem::fileExists(script->_path.c_str())) { - // TODO: Currently unsupported (we don't parse for this yet). - // If the constant is global, add it to the global table. - lua_pushnumber(sc->_lua, value); - lua_pushvalue(sc->_lua, -1); - lua_setglobal(sc->_lua, name.c_str()); + GP_WARN("Failed to load script: %s. File does not exist.", script->_path.c_str()); + return false; } -} -void ScriptUtil::registerConstantString(const std::string& name, const std::string& value, const std::vector& scopePath) -{ - ScriptController* sc = Game::getInstance()->getScriptController(); + // Insert an entry into _scripts before loading the script, to prevent load recursion + std::vector& scripts = _scripts[script->_path]; + scripts.push_back(script); - // If the constant is within a scope, get the correct parent - // table on the stack before setting its value. - if (!scopePath.empty()) + // Load the contents of the script, but don't execute it yet + const char* scriptSource = FileSystem::readAll(script->_path.c_str()); + int ret = luaL_loadstring(_lua, scriptSource); // [chunk] + SAFE_DELETE_ARRAY(scriptSource); + + if (ret == LUA_OK) { - lua_getglobal(sc->_lua, scopePath[0].c_str()); - for (unsigned int i = 1; i < scopePath.size(); i++) + // If the requested scope is protected, create a new script env table to execute + // the script within, using a metatable to fallback to the global table (_G) + if (script->_scope == Script::PROTECTED) { - lua_pushstring(sc->_lua, scopePath[i].c_str()); - lua_gettable(sc->_lua, -2); - } - - // Add the constant to the parent table. - lua_pushstring(sc->_lua, value.c_str()); - lua_setfield(sc->_lua, -2, name.c_str()); + // Create a new table as an environment for the new script + lua_newtable(_lua); // new ENV for script [chunk, env] - // Pop all the parent tables off the stack. - int size = (int)scopePath.size(); - lua_pop(sc->_lua, size); - } - else - { - // TODO: Currently unsupported (we don't parse for this yet). - // If the constant is global, add it to the global table. - lua_pushstring(sc->_lua, value.c_str()); - lua_pushvalue(sc->_lua, -1); - lua_setglobal(sc->_lua, name.c_str()); - } -} + // Store a ref to the table in the registry (this pops the table) [chunk] + script->_env = luaL_ref(_lua, LUA_REGISTRYINDEX); -void ScriptUtil::registerClass(const char* name, const luaL_Reg* members, lua_CFunction newFunction, - lua_CFunction deleteFunction, const luaL_Reg* statics, const std::vector& scopePath) -{ - ScriptController* sc = Game::getInstance()->getScriptController(); + // Put the env table back on top of the stack + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); // [chunk, env] - // If the type is an inner type, get the correct parent - // table on the stack before creating the table for the class. - if (!scopePath.empty()) - { - std::string tablename = name; + // Create a metatable that forwards missed lookups to global table _G + lua_newtable(_lua); // metatable [chunk, env, meta] + lua_pushglobaltable(_lua); // pushes _G, which will be the __index metatable entry [chunk, env, meta, _G] - // Strip off the scope path part of the name. - lua_getglobal(sc->_lua, scopePath[0].c_str()); - std::size_t index = tablename.find(scopePath[0]); - if (index != std::string::npos) - tablename = tablename.substr(index + scopePath[0].size()); - - for (unsigned int i = 1; i < scopePath.size(); i++) - { - lua_pushstring(sc->_lua, scopePath[i].c_str()); - lua_gettable(sc->_lua, -2); + // Set the __index property of the metatable to _G + lua_setfield(_lua, -2, "__index"); // metatable on top [chunk, env, meta] - index = tablename.find(scopePath[i]); - if (index != std::string::npos) - tablename = tablename.substr(index + scopePath[i].size()); + // Set the metatable for our new environment table + lua_setmetatable(_lua, -2); // [chunk, env] + + // Store a pointer to the ENV table in the table itself, so it can refer to itself. + // This is similar to how the _G field works for accessing the global table, and + // how _G._G is valid. + lua_pushvalue(_lua, -1); // [chunk, env, env] + lua_setfield(_lua, -2, "_THIS"); // [chunk, env] + + // Set the first upvalue (_ENV) for our chunk to the new environment table + if (lua_setupvalue(_lua, -2, 1) == NULL) // [chunk] + { + GP_WARN("Error setting environment table for script: %s.", script->_path.c_str()); + } } - lua_pushstring(sc->_lua, tablename.c_str()); - lua_newtable(sc->_lua); - } - else - { - // If the type is not an inner type, set it as a global table. - lua_newtable(sc->_lua); - lua_pushvalue(sc->_lua, -1); - lua_setglobal(sc->_lua, name); + // Execute the script + ret = lua_pcall(_lua, 0, 0, 0); } - - // Create the metatable and populate it with the member functions. - lua_pushliteral(sc->_lua, "__metatable"); - luaL_newmetatable(sc->_lua, name); - if (members) - luaL_setfuncs(sc->_lua, members, 0); - lua_pushstring(sc->_lua, "__index"); - lua_pushvalue(sc->_lua, -2); - lua_settable(sc->_lua, -3); - // Add the delete function if it was specified. - if (deleteFunction) + if (ret != LUA_OK) { - lua_pushstring(sc->_lua, "__gc"); - lua_pushcfunction(sc->_lua, deleteFunction); - lua_settable(sc->_lua, -3); + script->_env = 0; // clear _env on failure + GP_WARN("Failed to load script: %s. %s.", script->_path.c_str(), lua_tostring(_lua, -1)); + return false; } - // Set the metatable on the main table. - lua_settable(sc->_lua, -3); - - // Populate the main table with the static functions. - if (statics) - luaL_setfuncs(sc->_lua, statics, 0); + return true; +} - // Set the new function(s) for the class. - if (newFunction) +void ScriptController::unloadScript(Script* script) +{ + if (script->_env != 0) { - lua_pushliteral(sc->_lua, "new"); - lua_pushcfunction(sc->_lua, newFunction); - lua_settable(sc->_lua, -3); + // Release the reference to the environment table for this non-global script + luaL_unref(_lua, LUA_REGISTRYINDEX, script->_env); + script->_env = 0; } - // Set the table we just created within the correct parent table. - if (!scopePath.empty()) - { - lua_settable(sc->_lua, -3); + // TODO: What else can we clean up here? + // Can we test this with manual GC and breaking on gameplay object constructors that were delcared in the script? - // Pop all the parent tables off the stack. - int size = (int)scopePath.size(); - lua_pop(sc->_lua, size); - } - else + // Remove the script from our managed list + std::map>::iterator itr = _scripts.find(script->_path); + if (itr != _scripts.end()) { - // Pop the main table off the stack. - lua_pop(sc->_lua, 1); + std::vector& scripts = itr->second; + for (size_t i = 0, count = scripts.size(); i < count; ++i) + { + if (scripts[i] == script) + { + scripts.erase(scripts.begin() + i); + break; + } + } + + if (scripts.empty()) + { + _scripts.erase(itr); + } } } -void ScriptUtil::registerFunction(const char* luaFunction, lua_CFunction cppFunction) +bool ScriptController::getBool(const char* name, bool defaultValue, Script* script) { - lua_pushcfunction(Game::getInstance()->getScriptController()->_lua, cppFunction); - lua_setglobal(Game::getInstance()->getScriptController()->_lua, luaFunction); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + bool b = lua_isboolean(_lua, -1) ? ScriptUtil::luaCheckBool(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return b; } -void ScriptUtil::setGlobalHierarchyPair(const std::string& base, const std::string& derived) +char ScriptController::getChar(const char* name, char defaultValue, Script* script) { - Game::getInstance()->getScriptController()->_hierarchy[base].push_back(derived); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + char c = lua_isnumber(_lua, -1) ? (char)luaL_checkint(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return c; } -void ScriptUtil::addStringFromEnumConversionFunction(luaStringEnumConversionFunction stringFromEnum) +short ScriptController::getShort(const char* name, short defaultValue, Script* script) { - Game::getInstance()->getScriptController()->_stringFromEnum.push_back(stringFromEnum); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + short n = lua_isnumber(_lua, -1) ? (short)luaL_checkint(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getBoolPointer(int index) +int ScriptController::getInt(const char* name, int defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(bool, luaCheckBool); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + int n = lua_isnumber(_lua, -1) ? luaL_checkint(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getShortPointer(int index) +long ScriptController::getLong(const char* name, long defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(short, (short)luaL_checkint); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + long n = lua_isnumber(_lua, -1) ? luaL_checklong(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getIntPointer(int index) +unsigned char ScriptController::getUnsignedChar(const char* name, unsigned char defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(int, (int)luaL_checkint); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + unsigned char c = lua_isnumber(_lua, -1) ? (unsigned char)luaL_checkunsigned(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return c; } -ScriptUtil::LuaArray ScriptUtil::getLongPointer(int index) +unsigned short ScriptController::getUnsignedShort(const char* name, unsigned short defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(long, (long)luaL_checkint); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + unsigned short n = lua_isnumber(_lua, -1) ? (unsigned short)luaL_checkunsigned(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getUnsignedCharPointer(int index) +unsigned int ScriptController::getUnsignedInt(const char* name, unsigned int defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(unsigned char, (unsigned char)luaL_checkunsigned); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + unsigned int n = lua_isnumber(_lua, -1) ? (unsigned int)luaL_checkunsigned(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getUnsignedShortPointer(int index) +unsigned long ScriptController::getUnsignedLong(const char* name, unsigned long defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(unsigned short, (unsigned short)luaL_checkunsigned); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + unsigned long n = lua_isnumber(_lua, -1) ? (unsigned long)luaL_checkunsigned(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getUnsignedIntPointer(int index) +float ScriptController::getFloat(const char* name, float defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(unsigned int, (unsigned int)luaL_checkunsigned); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + float f = lua_isnumber(_lua, -1) ? (float)luaL_checknumber(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return f; } -ScriptUtil::LuaArray ScriptUtil::getUnsignedLongPointer(int index) +double ScriptController::getDouble(const char* name, double defaultValue, Script* script) { - GENERATE_LUA_GET_POINTER(unsigned long, (unsigned long)luaL_checkunsigned); + PUSH_NESTED_VARIABLE(name, defaultValue, script); + double n = lua_isnumber(_lua, -1) ? (double)luaL_checknumber(_lua, -1) : defaultValue; + POP_NESTED_VARIABLE(); + return n; } -ScriptUtil::LuaArray ScriptUtil::getFloatPointer(int index) +const char* ScriptController::getString(const char* name, Script* script) { - GENERATE_LUA_GET_POINTER(float, (float)luaL_checknumber); + PUSH_NESTED_VARIABLE(name, NULL, script); + const char* s = lua_isstring(_lua, -1) ? luaL_checkstring(_lua, -1) : NULL; + POP_NESTED_VARIABLE(); + return s; } -ScriptUtil::LuaArray ScriptUtil::getDoublePointer(int index) +void* ScriptController::getObjectPointer(const char* type, const char* name, Script* script) { - GENERATE_LUA_GET_POINTER(double, (double)luaL_checknumber); + PUSH_NESTED_VARIABLE(name, NULL, script); + void* userData = lua_isuserdata(_lua, -1) ? luaL_checkudata(_lua, -1, type) : NULL; + POP_NESTED_VARIABLE(); + return ((ScriptUtil::LuaObject*)userData)->instance; } -const char* ScriptUtil::getString(int index, bool isStdString) +void ScriptController::setBool(const char* name, bool v, Script* script) { - if (lua_type(Game::getInstance()->getScriptController()->_lua, index) == LUA_TSTRING) - return luaL_checkstring(Game::getInstance()->getScriptController()->_lua, index); - else if (lua_type(Game::getInstance()->getScriptController()->_lua, index) == LUA_TNIL && !isStdString) - return NULL; + // TODO: Support setting variables in nested tables. Should just need to execute code similar to + // that in getNestedVariable, except we only need to push the parent tables onto the stack, + // NOT the actual field/variable (since we're going to set it). + + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushboolean(_lua, v); + lua_setfield(_lua, -2, name); + } else { - GP_ERROR("Invalid string parameter (index = %d).", index); - return NULL; + lua_pushboolean(_lua, v); + lua_setglobal(_lua, name); } } -bool ScriptUtil::luaCheckBool(lua_State* state, int n) +void ScriptController::setChar(const char* name, char v, Script* script) { - if (!lua_isboolean(state, n)) + if (script && script->_env) { - const char* msg = lua_pushfstring(state, "%s expected, got %s", lua_typename(state, LUA_TBOOLEAN), luaL_typename(state, n)); - luaL_argerror(state, n, msg); - return false; + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushinteger(_lua, v); + lua_setfield(_lua, -2, name); } - return (lua_toboolean(state, n) != 0); -} - - -void ScriptController::loadScript(const char* path, bool forceReload) -{ - GP_ASSERT(path); - std::set::iterator iter = _loadedScripts.find(path); - if (iter == _loadedScripts.end() || forceReload) + else { - bool success = false; - if (iter == _loadedScripts.end()) - _loadedScripts.insert(path); // insert before loading script to prevent load recursion - -#ifdef __ANDROID__ - const char* scriptContents = FileSystem::readAll(path); - if (luaL_dostring(_lua, scriptContents)) - { - GP_WARN("Failed to run Lua script with error: '%s'.", lua_tostring(_lua, -1)); - } - else - { - success = true; - } - SAFE_DELETE_ARRAY(scriptContents); -#else - std::string fullPath; - if (!FileSystem::isAbsolutePath(path)) - { - fullPath.append(FileSystem::getResourcePath()); - } - fullPath.append(path); - if (luaL_dofile(_lua, fullPath.c_str())) - { - GP_WARN("Failed to run Lua script with error: '%s'.", lua_tostring(_lua, -1)); - } - else - { - success = true; - } -#endif - if (!success && (iter == _loadedScripts.end())) - { - iter = _loadedScripts.find(path); - _loadedScripts.erase(iter); - } + lua_pushinteger(_lua, v); + lua_setglobal(_lua, name); } } -std::string ScriptController::loadUrl(const char* url) +void ScriptController::setShort(const char* name, short v, Script* script) { - std::string file; - std::string id; - splitURL(url, &file, &id); - - if (id.size() <= 0) + if (script && script->_env) { - // The url does not reference a script - only a function - return file; + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushinteger(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushinteger(_lua, v); + lua_setglobal(_lua, name); } - - // Ensure the script is loaded. - if (file.size() > 0) - Game::getInstance()->getScriptController()->loadScript(file.c_str()); - - // Return the function name. - return id; -} - -bool ScriptController::getBool(const char* name, bool defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - bool b = lua_isboolean(_lua, -1) ? ScriptUtil::luaCheckBool(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return b; -} - -char ScriptController::getChar(const char* name, char defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - char c = lua_isnumber(_lua, -1) ? (char)luaL_checkint(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return c; -} - -short ScriptController::getShort(const char* name, short defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - short n = lua_isnumber(_lua, -1) ? (short)luaL_checkint(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; -} - -int ScriptController::getInt(const char* name, int defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - int n = lua_isnumber(_lua, -1) ? luaL_checkint(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; -} - -long ScriptController::getLong(const char* name, long defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - long n = lua_isnumber(_lua, -1) ? luaL_checklong(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; -} - -unsigned char ScriptController::getUnsignedChar(const char* name, unsigned char defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - unsigned char c = lua_isnumber(_lua, -1) ? (unsigned char)luaL_checkunsigned(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return c; -} - -unsigned short ScriptController::getUnsignedShort(const char* name, unsigned short defaultValue) -{ - PUSH_NESTED_VARIABLE(name, defaultValue); - unsigned short n = lua_isnumber(_lua, -1) ? (unsigned short)luaL_checkunsigned(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; } -unsigned int ScriptController::getUnsignedInt(const char* name, unsigned int defaultValue) +void ScriptController::setInt(const char* name, int v, Script* script) { - PUSH_NESTED_VARIABLE(name, defaultValue); - unsigned int n = lua_isnumber(_lua, -1) ? (unsigned int)luaL_checkunsigned(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushinteger(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushinteger(_lua, v); + lua_setglobal(_lua, name); + } } -unsigned long ScriptController::getUnsignedLong(const char* name, unsigned long defaultValue) +void ScriptController::setLong(const char* name, long v, Script* script) { - PUSH_NESTED_VARIABLE(name, defaultValue); - unsigned long n = lua_isnumber(_lua, -1) ? (unsigned long)luaL_checkunsigned(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushinteger(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushinteger(_lua, v); + lua_setglobal(_lua, name); + } } -float ScriptController::getFloat(const char* name, float defaultValue) +void ScriptController::setUnsignedChar(const char* name, unsigned char v, Script* script) { - PUSH_NESTED_VARIABLE(name, defaultValue); - float f = lua_isnumber(_lua, -1) ? (float)luaL_checknumber(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return f; + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushunsigned(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushunsigned(_lua, v); + lua_setglobal(_lua, name); + } } -double ScriptController::getDouble(const char* name, double defaultValue) +void ScriptController::setUnsignedShort(const char* name, unsigned short v, Script* script) { - PUSH_NESTED_VARIABLE(name, defaultValue); - double n = lua_isnumber(_lua, -1) ? (double)luaL_checknumber(_lua, -1) : defaultValue; - POP_NESTED_VARIABLE(); - return n; + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushunsigned(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushunsigned(_lua, v); + lua_setglobal(_lua, name); + } } -const char* ScriptController::getString(const char* name) +void ScriptController::setUnsignedInt(const char* name, unsigned int v, Script* script) { - PUSH_NESTED_VARIABLE(name, NULL); - const char* s = lua_isstring(_lua, -1) ? luaL_checkstring(_lua, -1) : NULL; - POP_NESTED_VARIABLE(); - return s; + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushunsigned(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushunsigned(_lua, v); + lua_setglobal(_lua, name); + } } -void ScriptController::setBool(const char* name, bool v) +void ScriptController::setUnsignedLong(const char* name, unsigned long v, Script* script) { - lua_pushboolean(_lua, v); - lua_setglobal(_lua, name); + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushunsigned(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushunsigned(_lua, v); + lua_setglobal(_lua, name); + } } -void ScriptController::setChar(const char* name, char v) +void ScriptController::setFloat(const char* name, float v, Script* script) { - lua_pushinteger(_lua, v); - lua_setglobal(_lua, name); + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushnumber(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushnumber(_lua, v); + lua_setglobal(_lua, name); + } } -void ScriptController::setShort(const char* name, short v) +void ScriptController::setDouble(const char* name, double v, Script* script) { - lua_pushinteger(_lua, v); - lua_setglobal(_lua, name); + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushnumber(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushnumber(_lua, v); + lua_setglobal(_lua, name); + } } -void ScriptController::setInt(const char* name, int v) +void ScriptController::setString(const char* name, const char* v, Script* script) { - lua_pushinteger(_lua, v); - lua_setglobal(_lua, name); + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + lua_pushstring(_lua, v); + lua_setfield(_lua, -2, name); + } + else + { + lua_pushstring(_lua, v); + lua_setglobal(_lua, name); + } } -void ScriptController::setLong(const char* name, long v) +void ScriptController::setObjectPointer(const char* type, const char* name, void* v, Script* script) { - lua_pushinteger(_lua, v); - lua_setglobal(_lua, name); -} + if (script && script->_env) + { + lua_rawgeti(_lua, LUA_REGISTRYINDEX, script->_env); + } -void ScriptController::setUnsignedChar(const char* name, unsigned char v) -{ - lua_pushunsigned(_lua, v); - lua_setglobal(_lua, name); -} + // Push a new user data onto the stack (and setup its metatable) + ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(_lua, sizeof(ScriptUtil::LuaObject)); + object->instance = v; + object->owns = false; + luaL_getmetatable(_lua, type); + lua_setmetatable(_lua, -2); -void ScriptController::setUnsignedShort(const char* name, unsigned short v) -{ - lua_pushunsigned(_lua, v); - lua_setglobal(_lua, name); + if (script && script->_env) + { + lua_setfield(_lua, -2, name); + } + else + { + lua_setglobal(_lua, name); + } } -void ScriptController::setUnsignedInt(const char* name, unsigned int v) +bool ScriptController::functionExists(const char* name, const Script* script) const { - lua_pushunsigned(_lua, v); - lua_setglobal(_lua, name); -} + PUSH_NESTED_VARIABLE(name, false, script); -void ScriptController::setUnsignedLong(const char* name, unsigned long v) -{ - lua_pushunsigned(_lua, v); - lua_setglobal(_lua, name); -} + bool result = lua_isfunction(_lua, -1) ? true : false; -void ScriptController::setFloat(const char* name, float v) -{ - lua_pushnumber(_lua, v); - lua_setglobal(_lua, name); -} + POP_NESTED_VARIABLE(); -void ScriptController::setDouble(const char* name, double v) -{ - lua_pushnumber(_lua, v); - lua_setglobal(_lua, name); + return result; } -void ScriptController::setString(const char* name, const char* v) +Script* ScriptController::getCurrentScript() const { - lua_pushstring(_lua, v); - lua_setglobal(_lua, name); + return _envStack.empty() ? NULL : _envStack.back(); } void ScriptController::print(const char* str) @@ -771,128 +752,29 @@ void ScriptController::initialize() } } -void ScriptController::initializeGame() -{ - std::vector& list = _callbacks[INITIALIZE]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str()); -} - void ScriptController::finalize() { + // Cleanup any outstanding time listeners + for (std::list::iterator itr = _timeListeners.begin(); itr != _timeListeners.end(); ++itr) + { + SAFE_DELETE(*itr); + } + _timeListeners.clear(); + if (_lua) { + // Perform a full garbage collection cycle. + // Note that this does NOT free any global variables declared in scripts, since + // they are stored in the global state and are still referenced. Only after + // closing the state (lua_close) will those variables be released. + lua_gc(_lua, LUA_GCCOLLECT, 0); + lua_close(_lua); _lua = NULL; } } -void ScriptController::finalizeGame() -{ - std::vector finalizeCallbacks = _callbacks[FINALIZE]; // no & : makes a copy of the vector - - // Remove any registered callbacks so they don't get called after shutdown - for (unsigned int i = 0; i < CALLBACK_COUNT; i++) - _callbacks[i].clear(); - - // Fire script finalize callbacks - for (size_t i = 0; i < finalizeCallbacks.size(); ++i) - executeFunction(finalizeCallbacks[i].c_str()); - - // Perform a full garbage collection cycle. - // Note that this does NOT free any global variables declared in scripts, since - // they are stored in the global state and are still referenced. Only after - // closing the state (lua_close) will those variables be released. - lua_gc(_lua, LUA_GCCOLLECT, 0); -} - -void ScriptController::update(float elapsedTime) -{ - std::vector& list = _callbacks[UPDATE]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "f", elapsedTime); -} - -void ScriptController::render(float elapsedTime) -{ - std::vector& list = _callbacks[RENDER]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "f", elapsedTime); -} - -void ScriptController::resizeEvent(unsigned int width, unsigned int height) -{ - std::vector& list = _callbacks[RESIZE_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "uiui", width, height); -} - -void ScriptController::keyEvent(Keyboard::KeyEvent evt, int key) -{ - std::vector& list = _callbacks[KEY_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "[Keyboard::KeyEvent][Keyboard::Key]", evt, key); -} - -void ScriptController::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) -{ - std::vector& list = _callbacks[TOUCH_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "[Touch::TouchEvent]iiui", evt, x, y, contactIndex); -} - -bool ScriptController::mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta) -{ - std::vector& list = _callbacks[MOUSE_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - { - if (executeFunction(list[i].c_str(), "[Mouse::MouseEvent]iii", evt, x, y, wheelDelta)) - return true; - } - return false; -} - -void ScriptController::gestureSwipeEvent(int x, int y, int direction) -{ - std::vector& list = _callbacks[GESTURE_SWIPE_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "iii", x, y, direction); -} - -void ScriptController::gesturePinchEvent(int x, int y, float scale) -{ - std::vector& list = _callbacks[GESTURE_PINCH_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "iif", x, y, scale); -} - -void ScriptController::gestureTapEvent(int x, int y) -{ - std::vector& list = _callbacks[GESTURE_TAP_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "ii", x, y); -} - -void ScriptController::gestureLongTapEvent(int x, int y, float duration) -{ -} - -void ScriptController::gestureDragEvent(int x, int y) -{ -} - -void ScriptController::gestureDropEvent(int x, int y) -{ -} - -void ScriptController::gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex) -{ - std::vector& list = _callbacks[GAMEPAD_EVENT]; - for (size_t i = 0; i < list.size(); ++i) - executeFunction(list[i].c_str(), "[Gamepad::GamepadEvent]", evt, gamepad); -} - -void ScriptController::executeFunctionHelper(int resultCount, const char* func, const char* args, va_list* list) +void ScriptController::executeFunctionHelper(int resultCount, const char* func, const char* args, va_list* list, Script* script) { if (!_lua) return; // handles calling this method after script is finalized @@ -903,7 +785,18 @@ void ScriptController::executeFunctionHelper(int resultCount, const char* func, return; } - if (!getNestedVariable(_lua, func)) + // If script was not specified and we are currently executing another function, + // call this function in the previous call's environment (stored in _envStack). + // This allows gameplay script callbacks (such as Scene.visit) to work locally when called + // from an sandboxed script. + if (!script && !_envStack.empty()) + { + // Execute in the currently running script's environment + script = _envStack.back(); + } + int env = script ? script->_env : 0; + + if (!getNestedVariable(_lua, func, env)) { GP_WARN("Failed to call function '%s'", func); return; @@ -961,14 +854,8 @@ void ScriptController::executeFunctionHelper(int resultCount, const char* func, // Skip past the closing ']' (the semi-colon here is intentional-do not remove). while (*sig++ != ']'); - unsigned int value = va_arg(*list, int); - std::string enumStr = ""; - for (unsigned int i = 0; enumStr.size() == 0 && i < _stringFromEnum.size(); i++) - { - enumStr = (*_stringFromEnum[i])(type, value); - } - - lua_pushstring(_lua, enumStr.c_str()); + // We simply push enums as the integer values they represent + lua_pushnumber(_lua, va_arg(*list, int)); break; } // Object references/pointers (Lua userdata). @@ -1015,68 +902,13 @@ void ScriptController::executeFunctionHelper(int resultCount, const char* func, } } + pushScript(script); + // Perform the function call. if (lua_pcall(_lua, argumentCount, resultCount, 0) != 0) GP_WARN("Failed to call function '%s' with error '%s'.", func, lua_tostring(_lua, -1)); -} - -void ScriptController::registerCallback(const char* callback, const char* function) -{ - ScriptCallback scb = toCallback(callback); - if (scb < INVALID_CALLBACK) - { - _callbacks[scb].push_back(function); - } - else - { - GP_WARN("Invalid script callback function specified: %s", callback); - } -} -void ScriptController::unregisterCallback(const char* callback, const char* function) -{ - ScriptCallback scb = toCallback(callback); - if (scb < INVALID_CALLBACK) - { - std::vector& list = _callbacks[scb]; - std::vector::iterator itr = std::find(list.begin(), list.end(), std::string(function)); - if (itr != list.end()) - list.erase(itr); - } - else - { - GP_WARN("Invalid script callback function specified: %s", callback); - } -} - -ScriptController::ScriptCallback ScriptController::toCallback(const char* name) -{ - if (strcmp(name, "initialize") == 0) - return ScriptController::INITIALIZE; - else if (strcmp(name, "update") == 0) - return ScriptController::UPDATE; - else if (strcmp(name, "render") == 0) - return ScriptController::RENDER; - else if (strcmp(name, "finalize") == 0) - return ScriptController::FINALIZE; - else if (strcmp(name, "resizeEvent") == 0) - return ScriptController::RESIZE_EVENT; - else if (strcmp(name, "keyEvent") == 0) - return ScriptController::KEY_EVENT; - else if (strcmp(name, "touchEvent") == 0) - return ScriptController::TOUCH_EVENT; - else if (strcmp(name, "mouseEvent") == 0) - return ScriptController::MOUSE_EVENT; - else if (strcmp(name, "gestureSwipeEvent") == 0) - return ScriptController::GESTURE_SWIPE_EVENT; - else if (strcmp(name, "gesturePinchEvent") == 0) - return ScriptController::GESTURE_PINCH_EVENT; - else if (strcmp(name, "gestureTapEvent") == 0) - return ScriptController::GESTURE_TAP_EVENT; - else if (strcmp(name, "gamepadEvent") == 0) - return ScriptController::GAMEPAD_EVENT; - else - return ScriptController::INVALID_CALLBACK; + popScript(); } int ScriptController::convert(lua_State* state) @@ -1114,29 +946,93 @@ int ScriptController::convert(lua_State* state) return 0; } -// Helper macros. -#define SCRIPT_EXECUTE_FUNCTION_NO_PARAM(type, checkfunc) \ - int top = lua_gettop(_lua); \ - executeFunctionHelper(1, func, NULL, NULL); \ - type value = (type)checkfunc(_lua, -1); \ +void ScriptController::schedule(float timeOffset, const char* function) +{ + // Get the currently execute script + Script* script = _envStack.empty() ? NULL : _envStack.back(); + if (script) + { + // Increase the reference count of the script while we hold it so it doesn't + // get destroyed while waiting for the event to fire. + script->addRef(); + } + + ScriptTimeListener* listener = new ScriptTimeListener(script, function); + _timeListeners.push_back(listener); + + Game::getInstance()->schedule(timeOffset, listener, NULL); +} + +void ScriptController::pushScript(Script* script) +{ + // Increase the reference count of the script while it's pushed, + // to prevent it from being destroyed during this time. + if (script) + script->addRef(); + + _envStack.push_back(script); +} + +void ScriptController::popScript() +{ + GP_ASSERT(!_envStack.empty()); + + Script* script = _envStack.back(); + + _envStack.pop_back(); + + SAFE_RELEASE(script); +} + +ScriptController::ScriptTimeListener::ScriptTimeListener(Script* script, const char* function) : script(script), function(function) +{ +} + +ScriptController::ScriptTimeListener::~ScriptTimeListener() +{ + // Release + SAFE_RELEASE(script); +} + +void ScriptController::ScriptTimeListener::timeEvent(long timeDiff, void* cookie) +{ + // Remove ourself from the script controller's list + std::list& list = Game::getInstance()->getScriptController()->_timeListeners; + std::list::iterator itr = std::find(list.begin(), list.end(), this); + if (itr != list.end()) + list.erase(itr); + + // Call the script function + Game::getInstance()->getScriptController()->executeFunction(script, function.c_str(), "l", timeDiff); + + // Free ourself. + // IMPORTANT: Don't do anything else after this line!! + delete this; +} + +// Helper macros. +#define SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, type, checkfunc) \ + int top = lua_gettop(_lua); \ + executeFunctionHelper(1, func, NULL, NULL, script); \ + type value = (type)checkfunc(_lua, -1); \ lua_pop(_lua, -1); \ lua_settop(_lua, top); \ return value; -#define SCRIPT_EXECUTE_FUNCTION_PARAM(type, checkfunc) \ +#define SCRIPT_EXECUTE_FUNCTION_PARAM(script, type, checkfunc) \ int top = lua_gettop(_lua); \ va_list list; \ va_start(list, args); \ - executeFunctionHelper(1, func, args, &list); \ + executeFunctionHelper(1, func, args, &list, script); \ type value = (type)checkfunc(_lua, -1); \ lua_pop(_lua, -1); \ va_end(list); \ lua_settop(_lua, top); \ return value; -#define SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(type, checkfunc) \ +#define SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, type, checkfunc) \ int top = lua_gettop(_lua); \ - executeFunctionHelper(1, func, args, list); \ + executeFunctionHelper(1, func, args, list, script); \ type value = (type)checkfunc(_lua, -1); \ lua_pop(_lua, -1); \ lua_settop(_lua, top); \ @@ -1144,69 +1040,134 @@ int ScriptController::convert(lua_State* state) template<> void ScriptController::executeFunction(const char* func) { - int top = lua_gettop(_lua); - executeFunctionHelper(0, func, NULL, NULL); - lua_settop(_lua, top); + executeFunction((Script*)NULL, func); } template<> bool ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(bool, ScriptUtil::luaCheckBool); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, bool, ScriptUtil::luaCheckBool); } template<> char ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(char, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, char, luaL_checkint); } template<> short ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(short, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, short, luaL_checkint); } template<> int ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(int, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, int, luaL_checkint); } template<> long ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(long, luaL_checklong); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, long, luaL_checklong); } template<> unsigned char ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(unsigned char, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, unsigned char, luaL_checkunsigned); } template<> unsigned short ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(unsigned short, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, unsigned short, luaL_checkunsigned); } template<> unsigned int ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(unsigned int, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, unsigned int, luaL_checkunsigned); } template<> unsigned long ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(unsigned long, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, unsigned long, luaL_checkunsigned); } template<> float ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(float, luaL_checknumber); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, float, luaL_checknumber); } template<> double ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(double, luaL_checknumber); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, double, luaL_checknumber); } template<> std::string ScriptController::executeFunction(const char* func) { - SCRIPT_EXECUTE_FUNCTION_NO_PARAM(std::string, luaL_checkstring); + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(NULL, std::string, luaL_checkstring); +} + +template<> void ScriptController::executeFunction(Script* script, const char* func) +{ + int top = lua_gettop(_lua); + executeFunctionHelper(0, func, NULL, NULL, script); + lua_settop(_lua, top); +} + +template<> bool ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, bool, ScriptUtil::luaCheckBool); +} + +template<> char ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, char, luaL_checkint); +} + +template<> short ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, short, luaL_checkint); +} + +template<> int ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, int, luaL_checkint); +} + +template<> long ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, long, luaL_checklong); +} + +template<> unsigned char ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, unsigned char, luaL_checkunsigned); +} + +template<> unsigned short ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, unsigned short, luaL_checkunsigned); +} + +template<> unsigned int ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, unsigned int, luaL_checkunsigned); +} + +template<> unsigned long ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, unsigned long, luaL_checkunsigned); +} + +template<> float ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, float, luaL_checknumber); +} + +template<> double ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, double, luaL_checknumber); +} + +template<> std::string ScriptController::executeFunction(Script* script, const char* func) +{ + SCRIPT_EXECUTE_FUNCTION_NO_PARAM(script, std::string, luaL_checkstring); } /** Template specialization. */ @@ -1215,7 +1176,7 @@ template<> void ScriptController::executeFunction(const char* func, const int top = lua_gettop(_lua); va_list list; va_start(list, args); - executeFunctionHelper(0, func, args, &list); + executeFunctionHelper(0, func, args, &list, NULL); va_end(list); lua_settop(_lua, top); } @@ -1223,151 +1184,631 @@ template<> void ScriptController::executeFunction(const char* func, const /** Template specialization. */ template<> bool ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(bool, ScriptUtil::luaCheckBool); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, bool, ScriptUtil::luaCheckBool); } /** Template specialization. */ template<> char ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(char, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, char, luaL_checkint); } /** Template specialization. */ template<> short ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(short, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, short, luaL_checkint); } /** Template specialization. */ template<> int ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(int, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, int, luaL_checkint); } /** Template specialization. */ template<> long ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(long, luaL_checklong); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, long, luaL_checklong); } /** Template specialization. */ template<> unsigned char ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(unsigned char, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, unsigned char, luaL_checkunsigned); } /** Template specialization. */ template<> unsigned short ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(unsigned short, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, unsigned short, luaL_checkunsigned); } /** Template specialization. */ template<> unsigned int ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(unsigned int, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, unsigned int, luaL_checkunsigned); } /** Template specialization. */ template<> unsigned long ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(unsigned long, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, unsigned long, luaL_checkunsigned); } /** Template specialization. */ template<> float ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(float, luaL_checknumber); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, float, luaL_checknumber); } /** Template specialization. */ template<> double ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(double, luaL_checknumber); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, double, luaL_checknumber); } /** Template specialization. */ template<> std::string ScriptController::executeFunction(const char* func, const char* args, ...) { - SCRIPT_EXECUTE_FUNCTION_PARAM(std::string, luaL_checkstring); + SCRIPT_EXECUTE_FUNCTION_PARAM(NULL, std::string, luaL_checkstring); +} + +/** Template specialization. */ +template<> void ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + int top = lua_gettop(_lua); + va_list list; + va_start(list, args); + executeFunctionHelper(0, func, args, &list, script); + va_end(list); + lua_settop(_lua, top); +} + +/** Template specialization. */ +template<> bool ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, bool, ScriptUtil::luaCheckBool); +} + +/** Template specialization. */ +template<> char ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, char, luaL_checkint); +} + +/** Template specialization. */ +template<> short ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, short, luaL_checkint); +} + +/** Template specialization. */ +template<> int ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, int, luaL_checkint); +} + +/** Template specialization. */ +template<> long ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, long, luaL_checklong); +} + +/** Template specialization. */ +template<> unsigned char ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, unsigned char, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> unsigned short ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, unsigned short, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> unsigned int ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, unsigned int, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> unsigned long ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, unsigned long, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> float ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, float, luaL_checknumber); +} + +/** Template specialization. */ +template<> double ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, double, luaL_checknumber); +} + +/** Template specialization. */ +template<> std::string ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM(script, std::string, luaL_checkstring); } /** Template specialization. */ template<> void ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - executeFunctionHelper(0, func, args, list); + executeFunctionHelper(0, func, args, list, NULL); } /** Template specialization. */ template<> bool ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(bool, ScriptUtil::luaCheckBool); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, bool, ScriptUtil::luaCheckBool); } /** Template specialization. */ template<> char ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(char, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, char, luaL_checkint); } /** Template specialization. */ template<> short ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(short, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, short, luaL_checkint); } /** Template specialization. */ template<> int ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(int, luaL_checkint); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, int, luaL_checkint); } /** Template specialization. */ template<> long ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(long, luaL_checklong); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, long, luaL_checklong); } /** Template specialization. */ template<> unsigned char ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(unsigned char, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, unsigned char, luaL_checkunsigned); } /** Template specialization. */ template<> unsigned short ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(unsigned short, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, unsigned short, luaL_checkunsigned); } /** Template specialization. */ template<> unsigned int ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(unsigned int, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, unsigned int, luaL_checkunsigned); } /** Template specialization. */ template<> unsigned long ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(unsigned long, luaL_checkunsigned); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, unsigned long, luaL_checkunsigned); } /** Template specialization. */ template<> float ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(float, luaL_checknumber); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, float, luaL_checknumber); } /** Template specialization. */ template<> double ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(double, luaL_checknumber); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, double, luaL_checknumber); } /** Template specialization. */ template<> std::string ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(std::string, luaL_checkstring); + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(NULL, std::string, luaL_checkstring); +} + +/** Template specialization. */ +template<> void ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + executeFunctionHelper(0, func, args, list, script); +} + +/** Template specialization. */ +template<> bool ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, bool, ScriptUtil::luaCheckBool); +} + +/** Template specialization. */ +template<> char ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, char, luaL_checkint); +} + +/** Template specialization. */ +template<> short ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, short, luaL_checkint); +} + +/** Template specialization. */ +template<> int ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, int, luaL_checkint); +} + +/** Template specialization. */ +template<> long ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, long, luaL_checklong); +} + +/** Template specialization. */ +template<> unsigned char ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, unsigned char, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> unsigned short ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, unsigned short, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> unsigned int ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, unsigned int, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> unsigned long ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, unsigned long, luaL_checkunsigned); +} + +/** Template specialization. */ +template<> float ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, float, luaL_checknumber); +} + +/** Template specialization. */ +template<> double ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, double, luaL_checknumber); +} + +/** Template specialization. */ +template<> std::string ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) +{ + SCRIPT_EXECUTE_FUNCTION_PARAM_LIST(script, std::string, luaL_checkstring); +} + +void ScriptUtil::registerLibrary(const char* name, const luaL_Reg* functions) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + lua_newtable(sc->_lua); + + // Go through the list of functions and add them to the table. + const luaL_Reg* iter = functions; + for (; iter && iter->name; iter++) + { + lua_pushcfunction(sc->_lua, iter->func); + lua_setfield(sc->_lua, -2, iter->name); + } + + lua_setglobal(sc->_lua, name); +} + +void ScriptUtil::registerConstantBool(const std::string& name, bool value, const std::vector& scopePath) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // If the constant is within a scope, get the correct parent + // table on the stack before setting its value. + if (!scopePath.empty()) + { + lua_getglobal(sc->_lua, scopePath[0].c_str()); + for (unsigned int i = 1; i < scopePath.size(); i++) + { + lua_pushstring(sc->_lua, scopePath[i].c_str()); + lua_gettable(sc->_lua, -2); + } + + // Add the constant to the parent table. + lua_pushboolean(sc->_lua, value); + lua_setfield(sc->_lua, -2, name.c_str()); + + // Pop all the parent tables off the stack. + int size = (int)scopePath.size(); + lua_pop(sc->_lua, size); + } + else + { + // TODO: Currently unsupported (we don't parse for this yet). + // If the constant is global, add it to the global table. + lua_pushboolean(sc->_lua, value); + lua_pushvalue(sc->_lua, -1); + lua_setglobal(sc->_lua, name.c_str()); + } +} + +void ScriptUtil::registerConstantNumber(const std::string& name, double value, const std::vector& scopePath) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // If the constant is within a scope, get the correct parent + // table on the stack before setting its value. + if (!scopePath.empty()) + { + lua_getglobal(sc->_lua, scopePath[0].c_str()); + for (unsigned int i = 1; i < scopePath.size(); i++) + { + lua_pushstring(sc->_lua, scopePath[i].c_str()); + lua_gettable(sc->_lua, -2); + } + + // Add the constant to the parent table. + lua_pushnumber(sc->_lua, value); + lua_setfield(sc->_lua, -2, name.c_str()); + + // Pop all the parent tables off the stack. + int size = (int)scopePath.size(); + lua_pop(sc->_lua, size); + } + else + { + // TODO: Currently unsupported (we don't parse for this yet). + // If the constant is global, add it to the global table. + lua_pushnumber(sc->_lua, value); + lua_pushvalue(sc->_lua, -1); + lua_setglobal(sc->_lua, name.c_str()); + } +} + +void ScriptUtil::registerConstantString(const std::string& name, const std::string& value, const std::vector& scopePath) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // If the constant is within a scope, get the correct parent + // table on the stack before setting its value. + if (!scopePath.empty()) + { + lua_getglobal(sc->_lua, scopePath[0].c_str()); + for (unsigned int i = 1; i < scopePath.size(); i++) + { + lua_pushstring(sc->_lua, scopePath[i].c_str()); + lua_gettable(sc->_lua, -2); + } + + // Add the constant to the parent table. + lua_pushstring(sc->_lua, value.c_str()); + lua_setfield(sc->_lua, -2, name.c_str()); + + // Pop all the parent tables off the stack. + int size = (int)scopePath.size(); + lua_pop(sc->_lua, size); + } + else + { + // TODO: Currently unsupported (we don't parse for this yet). + // If the constant is global, add it to the global table. + lua_pushstring(sc->_lua, value.c_str()); + lua_pushvalue(sc->_lua, -1); + lua_setglobal(sc->_lua, name.c_str()); + } +} + +void ScriptUtil::registerEnumValue(int enumValue, const std::string& enumValueString, const std::vector& scopePath) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // If the constant is within a scope, get the correct parent + // table on the stack before setting its value. + if (!scopePath.empty()) + { + lua_getglobal(sc->_lua, scopePath[0].c_str()); + for (unsigned int i = 1; i < scopePath.size(); i++) + { + lua_pushstring(sc->_lua, scopePath[i].c_str()); + lua_gettable(sc->_lua, -2); + } + + // Add the enum value to the parent table. + lua_pushnumber(sc->_lua, enumValue); + lua_setfield(sc->_lua, -2, enumValueString.c_str()); + + // Pop all the parent tables off the stack. + int size = (int)scopePath.size(); + lua_pop(sc->_lua, size); + } + else + { + // TODO: Currently unsupported (we don't parse for this yet). + // If the constant is global, add it to the global table. + lua_pushnumber(sc->_lua, enumValue); + lua_pushvalue(sc->_lua, -1); + lua_setglobal(sc->_lua, enumValueString.c_str()); + } +} + +void ScriptUtil::registerClass(const char* name, const luaL_Reg* members, lua_CFunction newFunction, + lua_CFunction deleteFunction, const luaL_Reg* statics, const std::vector& scopePath) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // If the type is an inner type, get the correct parent + // table on the stack before creating the table for the class. + if (!scopePath.empty()) + { + std::string tablename = name; + + // Strip off the scope path part of the name. + lua_getglobal(sc->_lua, scopePath[0].c_str()); + std::size_t index = tablename.find(scopePath[0]); + if (index != std::string::npos) + tablename = tablename.substr(index + scopePath[0].size()); + + for (unsigned int i = 1; i < scopePath.size(); i++) + { + lua_pushstring(sc->_lua, scopePath[i].c_str()); + lua_gettable(sc->_lua, -2); + + index = tablename.find(scopePath[i]); + if (index != std::string::npos) + tablename = tablename.substr(index + scopePath[i].size()); + } + + lua_pushstring(sc->_lua, tablename.c_str()); + lua_newtable(sc->_lua); + } + else + { + // If the type is not an inner type, set it as a global table. + lua_newtable(sc->_lua); + lua_pushvalue(sc->_lua, -1); + lua_setglobal(sc->_lua, name); + } + + // Create the metatable and populate it with the member functions. + lua_pushliteral(sc->_lua, "__metatable"); + luaL_newmetatable(sc->_lua, name); + if (members) + luaL_setfuncs(sc->_lua, members, 0); + lua_pushstring(sc->_lua, "__index"); + lua_pushvalue(sc->_lua, -2); + lua_settable(sc->_lua, -3); + + // Add the delete function if it was specified. + if (deleteFunction) + { + lua_pushstring(sc->_lua, "__gc"); + lua_pushcfunction(sc->_lua, deleteFunction); + lua_settable(sc->_lua, -3); + } + + // Set the metatable on the main table. + lua_settable(sc->_lua, -3); + + // Populate the main table with the static functions. + if (statics) + luaL_setfuncs(sc->_lua, statics, 0); + + // Set the new function(s) for the class. + if (newFunction) + { + lua_pushliteral(sc->_lua, "new"); + lua_pushcfunction(sc->_lua, newFunction); + lua_settable(sc->_lua, -3); + } + + // Set the table we just created within the correct parent table. + if (!scopePath.empty()) + { + lua_settable(sc->_lua, -3); + + // Pop all the parent tables off the stack. + int size = (int)scopePath.size(); + lua_pop(sc->_lua, size); + } + else + { + // Pop the main table off the stack. + lua_pop(sc->_lua, 1); + } +} + +void ScriptUtil::registerFunction(const char* luaFunction, lua_CFunction cppFunction) +{ + lua_pushcfunction(Game::getInstance()->getScriptController()->_lua, cppFunction); + lua_setglobal(Game::getInstance()->getScriptController()->_lua, luaFunction); +} + +void ScriptUtil::setGlobalHierarchyPair(const std::string& base, const std::string& derived) +{ + Game::getInstance()->getScriptController()->_hierarchy[base].push_back(derived); +} + +ScriptUtil::LuaArray ScriptUtil::getBoolPointer(int index) +{ + GENERATE_LUA_GET_POINTER(bool, luaCheckBool); +} + +ScriptUtil::LuaArray ScriptUtil::getShortPointer(int index) +{ + GENERATE_LUA_GET_POINTER(short, (short)luaL_checkint); +} + +ScriptUtil::LuaArray ScriptUtil::getIntPointer(int index) +{ + GENERATE_LUA_GET_POINTER(int, (int)luaL_checkint); +} + +ScriptUtil::LuaArray ScriptUtil::getLongPointer(int index) +{ + GENERATE_LUA_GET_POINTER(long, (long)luaL_checkint); +} + +ScriptUtil::LuaArray ScriptUtil::getUnsignedCharPointer(int index) +{ + GENERATE_LUA_GET_POINTER(unsigned char, (unsigned char)luaL_checkunsigned); +} + +ScriptUtil::LuaArray ScriptUtil::getUnsignedShortPointer(int index) +{ + GENERATE_LUA_GET_POINTER(unsigned short, (unsigned short)luaL_checkunsigned); +} + +ScriptUtil::LuaArray ScriptUtil::getUnsignedIntPointer(int index) +{ + GENERATE_LUA_GET_POINTER(unsigned int, (unsigned int)luaL_checkunsigned); +} + +ScriptUtil::LuaArray ScriptUtil::getUnsignedLongPointer(int index) +{ + GENERATE_LUA_GET_POINTER(unsigned long, (unsigned long)luaL_checkunsigned); +} + +ScriptUtil::LuaArray ScriptUtil::getFloatPointer(int index) +{ + GENERATE_LUA_GET_POINTER(float, (float)luaL_checknumber); +} + +ScriptUtil::LuaArray ScriptUtil::getDoublePointer(int index) +{ + GENERATE_LUA_GET_POINTER(double, (double)luaL_checknumber); +} + +const char* ScriptUtil::getString(int index, bool isStdString) +{ + if (lua_type(Game::getInstance()->getScriptController()->_lua, index) == LUA_TSTRING) + return luaL_checkstring(Game::getInstance()->getScriptController()->_lua, index); + else if (lua_type(Game::getInstance()->getScriptController()->_lua, index) == LUA_TNIL && !isStdString) + return NULL; + else + { + GP_ERROR("Invalid string parameter (index = %d).", index); + return NULL; + } +} + +bool ScriptUtil::luaCheckBool(lua_State* state, int n) +{ + if (!lua_isboolean(state, n)) + { + const char* msg = lua_pushfstring(state, "%s expected, got %s", lua_typename(state, LUA_TBOOLEAN), luaL_typename(state, n)); + luaL_argerror(state, n, msg); + return false; + } + return (lua_toboolean(state, n) != 0); } } diff --git a/gameplay/src/ScriptController.h b/gameplay/src/ScriptController.h index c69d136628..eeff34843b 100644 --- a/gameplay/src/ScriptController.h +++ b/gameplay/src/ScriptController.h @@ -1,345 +1,12 @@ #ifndef SCRIPTCONTROLLER_H_ #define SCRIPTCONTROLLER_H_ -#include "Base.h" +#include "Script.h" #include "Game.h" -#include "Control.h" namespace gameplay { -/** Function pointer typedef for string-from-enum conversion functions. */ -typedef const char* (*luaStringEnumConversionFunction)(std::string&, unsigned int); - -/** - * Functions and structures used by the generated Lua script bindings. - */ -namespace ScriptUtil -{ - -/** - * Represents a C++ object from within Lua. - * - * @script{ignore} - */ -struct LuaObject -{ - /** The actual object instance. */ - void* instance; - /** Whether object is owned by Lua. */ - bool owns; -}; - -/** - * Stores a Lua parameter of an array/pointer type that is passed from Lua to C. - * Handles automatic cleanup of any temporary memory associated with the array. - * - * @script{ignore} - */ -template -class LuaArray -{ -public: - - /** - * Creates a LuaArray to store a single pointer value. - */ - LuaArray(T* param); - - /** - * Allocates a LuaArray to store an array of values. - * - * Individual items in the array can be set using the - * set(unsigned int, const T&) method. - * - * @param count Number of elements to store in the parameter. - */ - LuaArray(int count); - - /** - * Copy constructor. - */ - LuaArray(const LuaArray& copy); - - /** - * Destructor. - */ - ~LuaArray(); - - /** - * Assignment operator. - */ - LuaArray& operator = (const LuaArray& p); - - /** - * Copies the value of the object pointed to by itemPtr into the specified - * index of this LuaArray's array. - */ - void set(unsigned int index, const T* itemPtr); - - /** - * Conversion operator from LuaArray to T*. - */ - operator T* () const; - - /** - * Overloads [] operator to get/set item value at index. - */ - T& operator[] (int index); - -private: - - struct Data - { - Data() : value(NULL), refCount(0) { } - T* value; - int refCount; - }; - - Data* _data; -}; - -/** - * Registers the given library with Lua. - * - * @param name The name of the library from within Lua. - * @param functions The library function mapping (Lua function names to C++ functions). - * - * @script{ignore} - */ -void registerLibrary(const char* name, const luaL_Reg* functions); - -/** - * Registers the given boolean constant as valid for the given scope path. - * - * @param name The name of the constant (what the user would use from Lua). - * @param value The constant's value. - * @param scopePath The list of containing classes, going inward from the most outer class. - * - * @script{ignore} - */ -void registerConstantBool(const std::string& name, bool value, const std::vector& scopePath); - -/** - * Registers the given number constant as valid for the given scope path. - * - * @param name The name of the constant (what the user would use from Lua). - * @param value The constant's value. - * @param scopePath The list of containing classes, going inward from the most outer class. - * - * @script{ignore} - */ -void registerConstantNumber(const std::string& name, double value, const std::vector& scopePath); - -/** - * Registers the given string constant as valid for the given scope path. - * - * @param name The name of the constant (what the user would use from Lua). - * @param value The constant's value. - * @param scopePath The list of containing classes, going inward from the most outer class. - * - * @script{ignore} - */ -void registerConstantString(const std::string& name, const std::string& value, const std::vector& scopePath); - -/** - * Registers the given class type with Lua. - * - * @param name The name of the class from within Lua. - * @param members The library function mapping for all the member functions (Lua function names to C++ functions). - * @param newFunction The function to call that creates an instance of the class. - * @param deleteFunction The function to call that destroys an instance of the class. - * @param statics The library function mapping for all the static functions (Lua function names to C++ functions). - * @param scopePath For an inner class, this is a list of its containing classes, going inward from the most outer class. - * - * @script{ignore} - */ -void registerClass(const char* name, const luaL_Reg* members, lua_CFunction newFunction, lua_CFunction deleteFunction, const luaL_Reg* statics, - const std::vector& scopePath); - -/** - * Register a function with Lua. - * - * @param luaFunction The name of the function from within Lua. - * @param cppFunction The C++ function pointer. - * - * @script{ignore} - */ -void registerFunction(const char* luaFunction, lua_CFunction cppFunction); - -/** - * Sets an inheritance pair within the global inheritance hierarchy (base, derived). - * - * @param base The base class of the inheritance pair. - * @param derived The derived class of the inheritance pair. - * - * @script{ignore} - */ -void setGlobalHierarchyPair(const std::string& base, const std::string& derived); - -/** - * Adds the given function as a string-from-enumerated value conversion function. - * - * @param stringFromEnum The pointer to the string-from-enum conversion function. - * - * @script{ignore} - */ -void addStringFromEnumConversionFunction(luaStringEnumConversionFunction stringFromEnum); - -/** - * Gets a pointer to a bool (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getBoolPointer(int index); - -/** - * Gets a pointer to a short (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getShortPointer(int index); - -/** - * Gets a pointer to an int (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getIntPointer(int index); - -/** - * Gets a pointer to a long (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getLongPointer(int index); - -/** - * Gets a pointer to an unsigned char (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getUnsignedCharPointer(int index); - -/** - * Gets a pointer to an unsigned short (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getUnsignedShortPointer(int index); - -/** - * Gets a pointer to an unsigned int (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getUnsignedIntPointer(int index); - -/** - * Gets a pointer to an unsigned long (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getUnsignedLongPointer(int index); - -/** - * Gets a pointer to a float (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getFloatPointer(int index); - -/** - * Gets a pointer to a double (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. - * - * @param index The stack index. - * - * @return The pointer. - * - * @script{ignore} - */ -LuaArray getDoublePointer(int index); - -/** - * Gets an object pointer of the given type for the given stack index. - * - * @param type The type of object pointer to retrieve. - * @param index The stack index. - * @param nonNull Whether the pointer must be non-null (e.g. if the parameter we - * are retrieving is actually a reference or by-value parameter). - * @param success An out parameter that is set to true if the Lua parameter was successfully - * converted to a valid object, or false if it was unable to perform a valid conversion. - * - * @return The object pointer or NULL if the data at the stack index - * is not an object or if the object is not derived from the given type. - * - * @script{ignore} - */ -template -LuaArray getObjectPointer(int index, const char* type, bool nonNull, bool* success); - -/** - * Gets a string for the given stack index. - * - * @param index The stack index. - * @param isStdString Whether the string being retrieved is a std::string object or not. - * - * @return The string or NULL. - * - * @script{ignore} - */ -const char* getString(int index, bool isStdString); - -/** - * 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} - */ -bool luaCheckBool(lua_State* state, int n); - -} - /** * Controls and manages all scripts. */ @@ -347,64 +14,115 @@ class ScriptController { friend class Game; friend class Platform; + friend class Script; + friend class ScriptUtil; + friend class ScriptTimeListener; public: /** - * Loads the given script file and executes its global code. + * Loads the given script file and executes its code (if it is not + * alreay loaded). + * + * The script is loaded into an environment that is defined by the scope parameter. + * If the script scope is GLOBAL and the forceReload parameter is false, a + * previously-loaded script object may be returned. PROTECTED scope always results + * in a new script being loaded and executed. * * @param path The path to the script. - * @param forceReload Whether the script should be reloaded if it has already been loaded. + * @param scope The scope for the script to be executed in. + * @param forceReload Whether the script should be reloaded if it has already been loaded + * (applicable for GLOBAL scripts only). + * + * @return The loaded script, or NULL if the script could not be loaded. */ - void loadScript(const char* path, bool forceReload = false); + Script* loadScript(const char* path, Script::Scope scope = Script::GLOBAL, bool forceReload = false); /** - * Given a URL, loads the referenced file and returns the referenced function name. + * Calls a zero-parameter global function. * - * @param url The url to load. + * @param func The name of the function to call. * - * @return The function that the URL references. + * @return The return value of the executed Lua function. + * + * @script{ignore} */ - std::string loadUrl(const char* url); + template T executeFunction(const char* func); /** - * Registers the given script callback. - * - * The 'callback' parameter must be one of the supported global callback - * event functions. The following strings are accepted: initialize, finalize, - * update, render, resizeEvent, keyEvent, touchEvent, mouseEvent, gamepadEvent. - * Signatures for the registered script function must match that of the - * corresponding signatures of these events on the Game class. + * Calls a zero-parameter function. + * + * @param script The script to execute the function on, or NULL for the global script environment. + * @param func The name of the function to call. + * + * @return The return value of the executed Lua function. * - * @param callback The script callback to register for. - * @param function The name of the script function to register. + * @script{ignore} */ - void registerCallback(const char* callback, const char* function); + template T executeFunction(Script* script, const char* func); /** - * Unregisters the given script callback. + * Calls a global function using the given parameters. + * + * @param func The name of the function to call. + * @param args The argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of: + * - 'b' - bool + * - 'c' - char + * - 'h' - short + * - 'i' - int + * - 'l' - long + * - 'f' - float + * - 'd' - double + * - 'ui' - unsigned int + * - 'ul' - unsigned long + * - 'uc' - unsigned char + * - 'uh' - unsigned short + * - 's' - string + * - 'p' - pointer + * - '' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets). + * - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets). + * @param ... Parameters to pass to the script fucntion, as specified by the args parameter. * - * @param callback The script callback to unregister for. - * @param function The name of the script function to unregister. + * @return The return value of the executed Lua function. * - * @see registerCallback(const char*, const char*) + * @script{ignore} */ - void unregisterCallback(const char* callback, const char* function); + template T executeFunction(const char* func, const char* args, ...); /** - * Calls the specified no-parameter Lua function. + * Calls the a function from the specified script, using the given parameters. * + * @param script The script to execute the function on, or NULL for the global script environment. * @param func The name of the function to call. + * @param args The argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of: + * - 'b' - bool + * - 'c' - char + * - 'h' - short + * - 'i' - int + * - 'l' - long + * - 'f' - float + * - 'd' - double + * - 'ui' - unsigned int + * - 'ul' - unsigned long + * - 'uc' - unsigned char + * - 'uh' - unsigned short + * - 's' - string + * - 'p' - pointer + * - '' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets). + * - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets). + * @param ... Parameters to pass to the script fucntion, as specified by the args parameter. * * @return The return value of the executed Lua function. + * + * @script{ignore} */ - template T executeFunction(const char* func); + template T executeFunction(Script* script, const char* func, const char* args, ...); /** - * Calls the specified Lua function using the given parameters. + * Calls the specified global Lua function using the given parameters. * * @param func The name of the function to call. - * @param args The argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of: + * @param args The optional argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of: * - 'b' - bool * - 'c' - char * - 'h' - short @@ -420,16 +138,20 @@ class ScriptController * - 'p' - pointer * - '' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets). * - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets). - * + * @param list The variable argument list containing the function's parameters, or NULL for an empty parameter list. + * * @return The return value of the executed Lua function. + * + * @script{ignore} */ - template T executeFunction(const char* func, const char* args, ...); + template T executeFunction(const char* func, const char* args, va_list* list); /** - * Calls the specified Lua function using the given parameters. + * Calls the specified global Lua function using the given parameters. * + * @param script Optional script to use, or NULL for the global script environment. * @param func The name of the function to call. - * @param args The argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of: + * @param args The optional argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of: * - 'b' - bool * - 'c' - char * - 'h' - short @@ -445,297 +167,357 @@ class ScriptController * - 'p' - pointer * - '' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets). * - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets). - * @param list The variable argument list containing the function's parameters. - * + * @param list The variable argument list containing the function's parameters, or NULL for an empty parameter list. + * * @return The return value of the executed Lua function. + * + * @script{ignore} */ - template T executeFunction(const char* func, const char* args, va_list* list); + template T executeFunction(Script* script, const char* func, const char* args, va_list* list); /** * Gets the global boolean script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a bool. - * + * @param script Optional script to use, or NULL for the global script environment. + * * @return The global boolean script variable. * * @script{ignore} */ - bool getBool(const char* name, bool defaultValue = false); + bool getBool(const char* name, bool defaultValue = false, Script* script = NULL); /** * Gets the global char script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global char script variable. * * @script{ignore} */ - char getChar(const char* name, char defaultValue = 0); + char getChar(const char* name, char defaultValue = 0, Script* script = NULL); /** * Gets the global short script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global short script variable. * * @script{ignore} */ - short getShort(const char* name, short defaultValue = 0); + short getShort(const char* name, short defaultValue = 0, Script* script = NULL); /** * Gets the global int script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global int script variable. * * @script{ignore} */ - int getInt(const char* name, int defaultValue = 0); + int getInt(const char* name, int defaultValue = 0, Script* script = NULL); /** * Gets the global long script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global long script variable. * * @script{ignore} */ - long getLong(const char* name, long defaultValue = 0); + long getLong(const char* name, long defaultValue = 0, Script* script = NULL); /** * Gets the global unsigned char script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global unsigned char script variable. * * @script{ignore} */ - unsigned char getUnsignedChar(const char* name, unsigned char defaultValue = 0); + unsigned char getUnsignedChar(const char* name, unsigned char defaultValue = 0, Script* script = NULL); /** * Gets the global unsigned short script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global unsigned short script variable. * * @script{ignore} */ - unsigned short getUnsignedShort(const char* name, unsigned short defaultValue = 0); + unsigned short getUnsignedShort(const char* name, unsigned short defaultValue = 0, Script* script = NULL); /** * Gets the global unsigned int script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global unsigned int script variable. * * @script{ignore} */ - unsigned int getUnsignedInt(const char* name, unsigned int defaultValue = 0); + unsigned int getUnsignedInt(const char* name, unsigned int defaultValue = 0, Script* script = NULL); /** * Gets the global unsigned long script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global unsigned long script variable. * * @script{ignore} */ - unsigned long getUnsignedLong(const char* name, unsigned long defaultValue = 0); + unsigned long getUnsignedLong(const char* name, unsigned long defaultValue = 0, Script* script = NULL); /** * Gets the global float script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global float script variable. * * @script{ignore} */ - float getFloat(const char* name, float defaultValue = 0); + float getFloat(const char* name, float defaultValue = 0, Script* script = NULL); /** * Gets the global double script variable with the given name. * * @param name The name of the variable. * @param defaultValue The default value to return if the variable is not a number. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global double script variable. * * @script{ignore} */ - double getDouble(const char* name, double defaultValue = 0); + double getDouble(const char* name, double defaultValue = 0, Script* script = NULL); /** * Gets the global string variable with the given name. - * + * + * The returned character string is temporary and is not gauranteed to live forever, therefore you + * should not store a pointer to the returned value. If long-term access to the returned string is + * required, it should be copied into another string for storage. + * * @param name The name of the variable. + * @param script Optional script to use, or NULL for the global script environment. * * @return The string variable or NULL if the variable is not a string. * * @script{ignore} */ - const char* getString(const char* name); + const char* getString(const char* name, Script* script = NULL); /** * Gets the global pointer script variable of the given type with the given name. * * @param type The type of the variable in Lua. * @param name The name of the variable. + * @param script Optional script to use, or NULL for the global script environment. * * @return The global pointer script variable. * * @script{ignore} */ - templateT* getObjectPointer(const char* type, const char* name); + void* getObjectPointer(const char* type, const char* name, Script* script = NULL); /** * Sets the global boolean script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The boolean value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setBool(const char* name, bool v); + void setBool(const char* name, bool v, Script* script = NULL); /** * Sets the global char script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The char value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setChar(const char* name, char v); + void setChar(const char* name, char v, Script* script = NULL); /** * Sets the global short script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The short value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setShort(const char* name, short v); + void setShort(const char* name, short v, Script* script = NULL); /** * Sets the global int script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The int value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setInt(const char* name, int v); + void setInt(const char* name, int v, Script* script = NULL); /** * Sets the global long script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The long value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setLong(const char* name, long v); + void setLong(const char* name, long v, Script* script = NULL); /** * Gets the global unsigned char script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The unsigned char value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setUnsignedChar(const char* name, unsigned char v); + void setUnsignedChar(const char* name, unsigned char v, Script* script = NULL); /** * Sets the global unsigned short script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The unsigned short value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setUnsignedShort(const char* name, unsigned short v); + void setUnsignedShort(const char* name, unsigned short v, Script* script = NULL); /** * Sets the global unsigned int script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The unsigned int value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setUnsignedInt(const char* name, unsigned int v); + void setUnsignedInt(const char* name, unsigned int v, Script* script = NULL); /** * Sets the global unsigned long script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The unsigned long value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setUnsignedLong(const char* name, unsigned long v); + void setUnsignedLong(const char* name, unsigned long v, Script* script = NULL); /** * Sets the global float script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The float value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setFloat(const char* name, float v); + void setFloat(const char* name, float v, Script* script = NULL); /** * Sets the global double script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The double value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setDouble(const char* name, double v); + void setDouble(const char* name, double v, Script* script = NULL); /** * Sets the global string script variable with the given name to the given value. * * @param name The name of the script variable. * @param v The string value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - void setString(const char* name, const char* v); + void setString(const char* name, const char* v, Script* script = NULL); /** * Sets the global pointer script variable of the given type with the given name to the given value. - * - * @param type The type of the script variable. + * + * When passing an argument for the 'v' parameter, it is recommended that the object passed in + * be converted to void* using 'dynamic_cast(o)', to ensure that the address of the + * most derived class possible be stored. In this case, the 'type' parameter should also be + * set to the most derived type to ensure that the full set of methods for that object are + * available to the script engine. + * + * @param type The type of the object point value being set. * @param name The name of the variable. * @param v The pointer value. + * @param script Optional script to use, or NULL for the global script environment. * * @script{ignore} */ - templatevoid setObjectPointer(const char* type, const char* name, T* v); + void setObjectPointer(const char* type, const char* name, void* v, Script* script = NULL); + + /** + * Determines if there exists a function with the specified name in the given script environment. + * + * @param name The name of the function to check. + * @param script Optional script to inspect, or NULL to inspect the global script environment. + * + * @return True if the specified function exists, false otherwise. + */ + bool functionExists(const char* name, const Script* script = NULL) const; + + /** + * Returns the currently executing script. + * + * Note that this function returns the currently executing Script object, + * which is not guaranteed to be valid unless the returned script's + * reference count is increased while the caller holds onto it. + * + * @return The currently executing script, or NULL if either there is no currently + * executing script or the global script environment is current. + */ + Script* getCurrentScript() const; /** * Prints the string to the platform's output stream or log file. @@ -757,24 +539,29 @@ class ScriptController private: /** - * Represents a callback function that can be registered for. + * Allows time listener interaction from Lua scripts. */ - enum ScriptCallback + struct ScriptTimeListener : public TimeListener { - INITIALIZE = 0, - UPDATE, - RENDER, - FINALIZE, - RESIZE_EVENT, - KEY_EVENT, - MOUSE_EVENT, - TOUCH_EVENT, - GESTURE_SWIPE_EVENT, - GESTURE_PINCH_EVENT, - GESTURE_TAP_EVENT, - GAMEPAD_EVENT, - CALLBACK_COUNT, - INVALID_CALLBACK = CALLBACK_COUNT + /** + * Constructor. + */ + ScriptTimeListener(Script* script, const char* function); + + /** + * Destructor. + */ + ~ScriptTimeListener(); + + /** + * @see TimeListener#timeEvent(long, void*) + */ + void timeEvent(long timeDiff, void* cookie); + + /** Holds the script to execute the function within. */ + Script* script; + /** Holds the name of the Lua script function to call back. */ + std::string function; }; /** @@ -793,152 +580,49 @@ class ScriptController ~ScriptController(); /** - * Callback for when the controller is initialized. + * Called to initialize the script controller. */ void initialize(); - /** - * Initializes the game using the appropriate callback script (if it was specified). - */ - void initializeGame(); - /* - * Callback for when the controller is finalized. + * Called to finalize the script controller. */ void finalize(); /** - * Finalizes the game using the appropriate callback script (if it was specified). - */ - void finalizeGame(); - - /** - * Callback for when the controller receives a frame update event. - */ - void update(float elapsedTime); - - /** - * Renders the game using the appropriate callback script (if it was specified). - */ - void render(float elapsedTime); - - /** - * Script callback for game resize events. - * - * @param width The new width of the game window content area. - * @param height The new height of the game window content area. - */ - void resizeEvent(unsigned int width, unsigned int height); - - /** - * Script keyboard callback on key events. - * - * @param evt The key event that occurred. - * @param key If evt is KEY_PRESS or KEY_RELEASE then key is the key code from Keyboard::Key. - * If evt is KEY_CHAR then key is the unicode value of the character. - * - * @see Keyboard::KeyEvent - * @see Keyboard::Key - */ - void keyEvent(Keyboard::KeyEvent evt, int key); - - /** - * Script touch callback on touch events. - * - * @param evt The touch event that occurred. - * @param x The x position of the touch in pixels. Left edge is zero. - * @param y The y position of the touch in pixels. Top edge is zero. - * @param contactIndex The order of occurrence for multiple touch contacts starting at zero. - * - * @see Touch::TouchEvent - */ - void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex); - - /** - * Script mouse callback on mouse events. If the game does not consume the mouse move event or left mouse click event - * then it is interpreted as a touch event instead. + * Internal loadScript variant that supports loading into an existing Script object + * for reloading purposes. * - * @param evt The mouse event that occurred. - * @param x The x position of the mouse in pixels. Left edge is zero. - * @param y The y position of the mouse in pixels. Top edge is zero. - * @param wheelDelta The number of mouse wheel ticks. Positive is up (forward), negative is down (backward). + * @param script A Script object containing a valid path and scope to load. * - * @return True if the mouse event is consumed or false if it is not consumed. + * @return True if the script is successfully loaded, false otherwise. * - * @see Mouse::MouseEvent + * @see loadScript(const char*, Script::scope, bool) */ - bool mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta); + bool loadScript(Script* script); /** - * Script callback for Gesture::SWIPE events. + * Attempts to unload the specified script. * - * @param x The x-coordinate of the start of the swipe. - * @param y The y-coordinate of the start of the swipe. - * @param direction The direction of the swipe + * Unloading a script causes the non-global data within the script to be + * released such that a reference is no longer held to it. It will then + * be garbage collected at some point in the future. If the script stored + * any data in the global environment or if any other code still references + * data from the script, that data will not be freed. * - * @see Gesture::SWIPE_DIRECTION_UP - * @see Gesture::SWIPE_DIRECTION_DOWN - * @see Gesture::SWIPE_DIRECTION_LEFT - * @see Gesture::SWIPE_DIRECTION_RIGHT - */ - void gestureSwipeEvent(int x, int y, int direction); - - /** - * Script callback for Gesture::PINCH events. + * Global scripts cannot be explicitly unloaded and this function will do + * nothing for such scripts. * - * @param x The centroid x-coordinate of the pinch. - * @param y The centroid y-coordinate of the pinch. - * @param scale The scale of the pinch. + * @param script The script to be unloaded. */ - void gesturePinchEvent(int x, int y, float scale); - - /** - * Script callback for Gesture::TAP events. - * - * @param x The x-coordinate of the tap. - * @param y The y-coordinate of the tap. - */ - void gestureTapEvent(int x, int y); - - /** - * Gesture callback on Gesture::LONG_TAP events. - * - * @param x The x-coordinate of the long tap. - * @param y The y-coordinate of the long tap. - * @param duration The duration of the long tap in ms. - */ - void gestureLongTapEvent(int x, int y, float duration); - - /** - * Gesture callback on Gesture::DRAG events. - * - * @param x The x-coordinate of the start of the drag event. - * @param y The y-coordinate of the start of the drag event. - */ - void gestureDragEvent(int x, int y); - - /** - * Gesture callback on Gesture::DROP events. - * - * @param x The x-coordinate of the drop event. - * @param y The y-coordinate of the drop event. - */ - void gestureDropEvent(int x, int y); - - /** - * Script gamepad callback on gamepad events. - * - * @param evt The gamepad event that occurred. - * @param gamepad the gamepad the event occurred on - */ - void gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex = 0); + void unloadScript(Script* script); /** * Calls the specified Lua function using the given parameters. * * @param resultCount The expected number of returned values. * @param func The name of the function to call. - * @param args The argument signature of the function, as a string of the form + * @param args The optional argument signature of the function, as a string of the form * 'xxx', where each 'x' is a parameter type and must be one of: * - 'b' - bool * - 'c' - char @@ -956,18 +640,9 @@ class ScriptController * - '' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets). * - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets). * @param list The variable argument list. + * @param script Optional script to execute the function in, or NULL for to execute it in the global environment. */ - void executeFunctionHelper(int resultCount, const char* func, const char* args, va_list* list); - - /** - * Converts the given string to a valid script callback enumeration value - * or to ScriptController::INVALID_CALLBACK if there is no valid conversion. - * - * @param name The name of the callback. - * - * @return The corresponding callback enumeration value. - */ - static ScriptController::ScriptCallback toCallback(const char* name); + void executeFunctionHelper(int resultCount, const char* func, const char* args, va_list* list, Script* script = NULL); /** * Converts a Gameplay userdata value to the type with the given class name. @@ -995,35 +670,26 @@ class ScriptController */ static int convert(lua_State* state); - // Friend functions (used by Lua script bindings). - friend void ScriptUtil::registerLibrary(const char* name, const luaL_Reg* functions); - friend void ScriptUtil::registerConstantBool(const std::string& name, bool value, const std::vector& scopePath); - friend void ScriptUtil::registerConstantNumber(const std::string& name, double value, const std::vector& scopePath); - friend void ScriptUtil::registerConstantString(const std::string& name, const std::string& value, const std::vector& scopePath); - friend void ScriptUtil::registerClass(const char* name, const luaL_Reg* members, lua_CFunction newFunction, - lua_CFunction deleteFunction, const luaL_Reg* statics, const std::vector& scopePath); - friend void ScriptUtil::registerFunction(const char* luaFunction, lua_CFunction cppFunction); - friend void ScriptUtil::setGlobalHierarchyPair(const std::string& base, const std::string& derived); - friend void ScriptUtil::addStringFromEnumConversionFunction(luaStringEnumConversionFunction stringFromEnum); - friend ScriptUtil::LuaArray ScriptUtil::getBoolPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getShortPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getIntPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getLongPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getUnsignedCharPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getUnsignedShortPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getUnsignedIntPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getUnsignedLongPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getFloatPointer(int index); - friend ScriptUtil::LuaArray ScriptUtil::getDoublePointer(int index); - template friend ScriptUtil::LuaArray ScriptUtil::getObjectPointer(int index, const char* type, bool nonNull, bool* success); - friend const char* ScriptUtil::getString(int index, bool isStdString); + /** + * Schedules a script function to execute after the given time interval. + * + * This function is executed in the environment of the script that calls this function. + * + * @param timeOffset The number of game milliseconds in the future to schedule the event to be fired. + * @param function The Lua script function that will receive the event. + */ + void schedule(float timeOffset, const char* function); + + void pushScript(Script* script); + + void popScript(); lua_State* _lua; unsigned int _returnCount; std::map > _hierarchy; - std::vector _callbacks[CALLBACK_COUNT]; - std::set _loadedScripts; - std::vector _stringFromEnum; + std::map > _scripts; + std::vector _envStack; + std::list _timeListeners; }; /** Template specialization. */ @@ -1053,6 +719,33 @@ template<> double ScriptController::executeFunction(const char* func); /** Template specialization. */ template<> std::string ScriptController::executeFunction(const char* func); +/** Template specialization. */ +template<> void ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> bool ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> char ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> short ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> int ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> long ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> unsigned char ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> unsigned short ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> unsigned int ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> unsigned long ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> float ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> double ScriptController::executeFunction(Script* script, const char* func); +/** Template specialization. */ +template<> std::string ScriptController::executeFunction(Script* script, const char* func); + /** Template specialization. */ template<> void ScriptController::executeFunction(const char* func, const char* args, ...); /** Template specialization. */ @@ -1080,6 +773,33 @@ template<> double ScriptController::executeFunction(const char* func, co /** Template specialization. */ template<> std::string ScriptController::executeFunction(const char* func, const char* args, ...); +/** Template specialization. */ +template<> void ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> bool ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> char ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> short ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> int ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> long ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> unsigned char ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> unsigned short ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> unsigned int ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> unsigned long ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> float ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> double ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); +/** Template specialization. */ +template<> std::string ScriptController::executeFunction(Script* script, const char* func, const char* args, ...); + /** Template specialization. */ template<> void ScriptController::executeFunction(const char* func, const char* args, va_list* list); /** Template specialization. */ @@ -1107,6 +827,328 @@ template<> double ScriptController::executeFunction(const char* func, co /** Template specialization. */ template<> std::string ScriptController::executeFunction(const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> void ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> bool ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> char ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> short ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> int ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> long ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> unsigned char ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> unsigned short ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> unsigned int ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> unsigned long ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> float ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> double ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); +/** Template specialization. */ +template<> std::string ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list); + +/** + * Functions and structures used by the generated Lua script bindings. + * + * This class is used internally by the generated script bindings and is not intended + * to be used directly. + * + * @script{ignore} + */ +class ScriptUtil +{ +public: + + /** + * Represents a C++ object from within Lua. + * + * @script{ignore} + */ + struct LuaObject + { + /** The actual object instance. */ + void* instance; + /** Whether object is owned by Lua. */ + bool owns; + }; + + /** + * Stores a Lua parameter of an array/pointer type that is passed from Lua to C. + * Handles automatic cleanup of any temporary memory associated with the array. + * + * @script{ignore} + */ + template + class LuaArray + { + public: + + /** + * Creates a LuaArray to store a single pointer value. + */ + LuaArray(T* param); + + /** + * Allocates a LuaArray to store an array of values. + * + * Individual items in the array can be set using the + * set(unsigned int, const T&) method. + * + * @param count Number of elements to store in the parameter. + */ + LuaArray(int count); + + /** + * Copy constructor. + */ + LuaArray(const LuaArray& copy); + + /** + * Destructor. + */ + ~LuaArray(); + + /** + * Assignment operator. + */ + LuaArray& operator = (const LuaArray& p); + + /** + * Copies the value of the object pointed to by itemPtr into the specified + * index of this LuaArray's array. + */ + void set(unsigned int index, const T* itemPtr); + + /** + * Conversion operator from LuaArray to T*. + */ + operator T* () const; + + /** + * Overloads [] operator to get/set item value at index. + */ + T& operator[] (int index); + + private: + + struct Data + { + Data() : value(NULL), refCount(0) { } + T* value; + int refCount; + }; + + Data* _data; + }; + + /** + * Registers the given library with Lua. + * + * @param name The name of the library from within Lua. + * @param functions The library function mapping (Lua function names to C++ functions). + */ + static void registerLibrary(const char* name, const luaL_Reg* functions); + + /** + * Registers the given boolean constant as valid for the given scope path. + * + * @param name The name of the constant (what the user would use from Lua). + * @param value The constant's value. + * @param scopePath The list of containing classes, going inward from the most outer class. + */ + static void registerConstantBool(const std::string& name, bool value, const std::vector& scopePath); + + /** + * Registers the given number constant as valid for the given scope path. + * + * @param name The name of the constant (what the user would use from Lua). + * @param value The constant's value. + * @param scopePath The list of containing classes, going inward from the most outer class. + */ + static void registerConstantNumber(const std::string& name, double value, const std::vector& scopePath); + + /** + * Registers the given string constant as valid for the given scope path. + * + * @param name The name of the constant (what the user would use from Lua). + * @param value The constant's value. + * @param scopePath The list of containing classes, going inward from the most outer class. + */ + static void registerConstantString(const std::string& name, const std::string& value, const std::vector& scopePath); + + /** + * Registers the given enum value as valid for the given scope path. + * + * @param enumValue The enumeration value, expressed as an integer. + * @param enumValueString The string representation of the enum value (what the user would use from Lua). + * @param scopePath The list of containing classes, going inward from the most outer class. + */ + static void registerEnumValue(int enumValue, const std::string& enumValueString, const std::vector& scopePath); + + /** + * Registers the given class type with Lua. + * + * @param name The name of the class from within Lua. + * @param members The library function mapping for all the member functions (Lua function names to C++ functions). + * @param newFunction The function to call that creates an instance of the class. + * @param deleteFunction The function to call that destroys an instance of the class. + * @param statics The library function mapping for all the static functions (Lua function names to C++ functions). + * @param scopePath For an inner class, this is a list of its containing classes, going inward from the most outer class. + */ + static void registerClass(const char* name, const luaL_Reg* members, lua_CFunction newFunction, lua_CFunction deleteFunction, const luaL_Reg* statics, + const std::vector& scopePath); + + /** + * Register a function with Lua. + * + * @param luaFunction The name of the function from within Lua. + * @param cppFunction The C++ function pointer. + */ + static void registerFunction(const char* luaFunction, lua_CFunction cppFunction); + + /** + * Sets an inheritance pair within the global inheritance hierarchy (base, derived). + * + * @param base The base class of the inheritance pair. + * @param derived The derived class of the inheritance pair. + */ + static void setGlobalHierarchyPair(const std::string& base, const std::string& derived); + + /** + * Gets a pointer to a bool (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getBoolPointer(int index); + + /** + * Gets a pointer to a short (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getShortPointer(int index); + + /** + * Gets a pointer to an int (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getIntPointer(int index); + + /** + * Gets a pointer to a long (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getLongPointer(int index); + + /** + * Gets a pointer to an unsigned char (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getUnsignedCharPointer(int index); + + /** + * Gets a pointer to an unsigned short (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getUnsignedShortPointer(int index); + + /** + * Gets a pointer to an unsigned int (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getUnsignedIntPointer(int index); + + /** + * Gets a pointer to an unsigned long (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getUnsignedLongPointer(int index); + + /** + * Gets a pointer to a float (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getFloatPointer(int index); + + /** + * Gets a pointer to a double (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index. + * + * @param index The stack index. + * + * @return The pointer. + */ + static LuaArray getDoublePointer(int index); + + /** + * Gets an object pointer of the given type for the given stack index. + * + * @param type The type of object pointer to retrieve. + * @param index The stack index. + * @param nonNull Whether the pointer must be non-null (e.g. if the parameter we + * are retrieving is actually a reference or by-value parameter). + * @param success An out parameter that is set to true if the Lua parameter was successfully + * converted to a valid object, or false if it was unable to perform a valid conversion. + * + * @return The object pointer or NULL if the data at the stack index + * is not an object or if the object is not derived from the given type. + */ + template + static LuaArray getObjectPointer(int index, const char* type, bool nonNull, bool* success); + + /** + * Gets a string for the given stack index. + * + * @param index The stack index. + * @param isStdString Whether the string being retrieved is a std::string object or not. + * + * @return The string or NULL. + */ + static const char* getString(int index, bool isStdString); + + /** + * 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); + +}; + } #include "ScriptController.inl" diff --git a/gameplay/src/ScriptController.inl b/gameplay/src/ScriptController.inl index 304c7e8c49..aaf5aecc1a 100644 --- a/gameplay/src/ScriptController.inl +++ b/gameplay/src/ScriptController.inl @@ -21,7 +21,7 @@ ScriptUtil::LuaArray::LuaArray(int count) // Allocate a chunk of memory to store 'count' number of T. // Use new instead of malloc since we track memory allocations // int DebugMem configurations. - _data->value = (T*)new unsigned char[sizeof(T) * count]; + _data->value = (T*)new unsigned char[sizeof(T)* count]; // Positive ref count means we automatically cleanup memory _data->refCount = 1; @@ -272,7 +272,12 @@ ScriptUtil::LuaArray ScriptUtil::getObjectPointer(int index, const char* type template T ScriptController::executeFunction(const char* func) { - executeFunctionHelper(1, func, NULL, NULL); + return executeFunction((Script*)NULL, func); +} + +template T ScriptController::executeFunction(Script* script, const char* func) +{ + executeFunctionHelper(1, func, NULL, NULL, script); T value = (T)((ScriptUtil::LuaObject*)lua_touserdata(_lua, -1))->instance; lua_pop(_lua, -1); return value; @@ -282,40 +287,32 @@ template T ScriptController::executeFunction(const char* func, const { va_list list; va_start(list, args); - executeFunctionHelper(1, func, args, &list); - - T value = (T)((ScriptUtil::LuaObject*)lua_touserdata(_lua, -1))->instance; - lua_pop(_lua, -1); + T value = executeFunction((Script*)NULL, func, args, list); va_end(list); return value; } -template T ScriptController::executeFunction(const char* func, const char* args, va_list* list) +template T ScriptController::executeFunction(Script* script, const char* func, const char* args, ...) { - executeFunctionHelper(1, func, args, list); - - T value = (T)((ScriptUtil::LuaObject*)lua_touserdata(_lua, -1))->instance; - lua_pop(_lua, -1); + va_list list; + va_start(list, args); + T value = executeFunction(script, func, args, list); + va_end(list); return value; } -templateT* ScriptController::getObjectPointer(const char* type, const char* name) +template T ScriptController::executeFunction(const char* func, const char* args, va_list* list) { - lua_getglobal(_lua, name); - void* userdata = luaL_checkudata(_lua, -1, type); - std::string msg = std::string("'") + std::string(type) + std::string("' expected."); - luaL_argcheck(_lua, userdata != NULL, 1, msg.c_str()); - return (T*)((ScriptUtil::LuaObject*)userdata)->instance; + return executeFunctionHelper(1, func, args, list, (Script*)NULL); } -templatevoid ScriptController::setObjectPointer(const char* type, const char* name, T* v) +template T ScriptController::executeFunction(Script* script, const char* func, const char* args, va_list* list) { - ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(_lua, sizeof(ScriptUtil::LuaObject)); - object->instance = (void*)v; - object->owns = false; - luaL_getmetatable(_lua, type); - lua_setmetatable(_lua, -2); - lua_setglobal(_lua, name); + executeFunctionHelper(1, func, args, list, script); + + T value = (T)((ScriptUtil::LuaObject*)lua_touserdata(_lua, -1))->instance; + lua_pop(_lua, -1); + return value; } } diff --git a/gameplay/src/ScriptTarget.cpp b/gameplay/src/ScriptTarget.cpp index 5b6abebcca..32aadf818e 100644 --- a/gameplay/src/ScriptTarget.cpp +++ b/gameplay/src/ScriptTarget.cpp @@ -5,146 +5,473 @@ namespace gameplay { +// TODO: Handle reloading scripts and then case where EventRegistries have events added AFTER a script has been loaded (i.e. need to reload callbacks for the script). + extern void splitURL(const std::string& url, std::string* file, std::string* id); -ScriptTarget::ScriptTarget() +const char* ScriptTarget::Event::getName() const +{ + return name.c_str(); +} + +const char* ScriptTarget::Event::getArgs() const +{ + return args.c_str(); +} + +ScriptTarget::EventRegistry::EventRegistry() +{ +} + +ScriptTarget::EventRegistry::~EventRegistry() +{ + for (size_t i = 0, count = _events.size(); i < count; ++i) + { + SAFE_DELETE(_events[i]); + } +} + +const ScriptTarget::Event* ScriptTarget::EventRegistry::addEvent(const char* name, const char* args) +{ + GP_ASSERT(name); + + Event* evt = new Event; + evt->name = name; + evt->args = args ? args : ""; + + _events.push_back(evt); + + return evt; +} + +unsigned int ScriptTarget::EventRegistry::getEventCount() const +{ + return _events.size(); +} + +const ScriptTarget::Event* ScriptTarget::EventRegistry::getEvent(unsigned int index) const +{ + GP_ASSERT(index < _events.size()); + + return _events[index]; +} + +const ScriptTarget::Event* ScriptTarget::EventRegistry::getEvent(const char* name) const +{ + GP_ASSERT(name); + + for (size_t i = 0, count = _events.size(); i < count; ++i) + { + if (_events[i]->name == name) + return _events[i]; + } + + return NULL; +} + +ScriptTarget::ScriptTarget() : _scriptRegistries(NULL), _scripts(NULL), _scriptCallbacks(NULL) { } ScriptTarget::~ScriptTarget() { - std::map* >::iterator iter = _callbacks.begin(); - for (; iter != _callbacks.end(); iter++) + // Free callbacks + SAFE_DELETE(_scriptCallbacks); + + // Free scripts + ScriptEntry* se = _scripts; + while (se) + { + ScriptEntry* tmp = se; + se = se->next; + + SAFE_RELEASE(tmp->script); + SAFE_DELETE(tmp); + } + + // Free registry entries + RegistryEntry* re = _scriptRegistries; + while (re) { - SAFE_DELETE(iter->second); + RegistryEntry* tmp = re; + re = re->next; + + // Don't delete the actual EventRegistry, since it's shared by all + // ScriptTargets of the same type + SAFE_DELETE(tmp); } } -template<> void ScriptTarget::fireScriptEvent(const char* eventName, ...) +void ScriptTarget::registerEvents(EventRegistry* registry) { - va_list list; - va_start(list, eventName); + GP_ASSERT(registry); - std::map* >::iterator iter = _callbacks.find(eventName); - if (iter != _callbacks.end() && iter->second != NULL) + // Attach the registry + RegistryEntry* re = new RegistryEntry(registry); + if (_scriptRegistries) { - ScriptController* sc = Game::getInstance()->getScriptController(); + RegistryEntry* last = _scriptRegistries; + while (last->next) + last = last->next; + last->next = re; + re->prev = last; + } + else + { + _scriptRegistries = re; + } +} - if (_events[eventName].size() > 0) +Script* ScriptTarget::addScript(const char* path) +{ + ScriptController* sc = Game::getInstance()->getScriptController(); + + // Load the script + Script* script = sc->loadScript(path, Script::PROTECTED); + if (!script) + return NULL; + + // Attach the script + ScriptEntry* se = new ScriptEntry(script); + if (_scripts) + { + ScriptEntry* last = _scripts; + while (last->next) + last = last->next; + last->next = se; + se->prev = last; + } + else + { + _scripts = se; + } + + // Inspect the loaded script for event functions that are supported by this ScriptTarget. + // TODO: We'll need to re-load eventCallbacks when EventRegistries change for this ScriptObject. + RegistryEntry* re = _scriptRegistries; + while (re) + { + std::vector& events = re->registry->_events; + for (size_t i = 0, count = events.size(); i < count; ++i) { - for (unsigned int i = 0; i < iter->second->size(); i++) + const Event* event = events[i]; + if (sc->functionExists(event->name.c_str(), script)) { - sc->executeFunction((*iter->second)[i].function.c_str(), _events[eventName].c_str(), &list); + if (!_scriptCallbacks) + _scriptCallbacks = new std::map>(); + (*_scriptCallbacks)[event].push_back(CallbackFunction(script, event->name.c_str())); } } - else + re = re->next; + } + + // Automatically call the 'attached' event if it is defined within the script + if (sc->functionExists("attached", script)) + { + char args[256]; + sprintf(args, "<%s>", getTypeName()); + sc->executeFunction(script, "attached", args, dynamic_cast(this)); + } + + return script; +} + +bool ScriptTarget::removeScript(const char* path) +{ + GP_ASSERT(path); + + ScriptEntry* se = _scripts; + while (se) + { + if (strcmp(se->script->getPath(), path) == 0 && se->script->getScope() == Script::PROTECTED) + { + removeScript(se); + return true; + } + se = se->next; + } + + return false; +} + +void ScriptTarget::removeScript(ScriptEntry* se) +{ + GP_ASSERT(se); + + // Link out this ScriptEntry + if (se->prev) + se->prev->next = se->next; + if (se->next) + se->next->prev = se->prev; + if (_scripts == se) + _scripts = se->next; + + Script* script = se->script; + + // Delete the ScriptEntry + SAFE_DELETE(se); + + // Erase any callback functions registered for this script + if (_scriptCallbacks) + { + std::map>::iterator itr = _scriptCallbacks->begin(); + for ( ; itr != _scriptCallbacks->end(); ++itr) { - for (unsigned int i = 0; i < iter->second->size(); i++) + std::vector& callbacks = itr->second; + std::vector::iterator itr2 = callbacks.begin(); + while (itr2 != callbacks.end()) { - sc->executeFunction((*iter->second)[i].function.c_str(), _events[eventName].c_str()); + if (itr2->script == script) + itr2 = callbacks.erase(itr2); + else + ++itr2; } } } - va_end(list); + // Free the script + SAFE_RELEASE(script); } -template<> bool ScriptTarget::fireScriptEvent(const char* eventName, ...) +void ScriptTarget::addScriptCallback(const Event* event, const char* function) { - va_list list; - va_start(list, eventName); + GP_ASSERT(event); + GP_ASSERT(function); - std::map* >::iterator iter = _callbacks.find(eventName); - if (iter != _callbacks.end() && iter->second) + // Parse the script name (if it exists) and function out + std::string scriptPath, func; + splitURL(function, &scriptPath, &func); + if (func.length() == 0) { - ScriptController* sc = Game::getInstance()->getScriptController(); + // The url doesn't reference a script, only a function + func = scriptPath; + scriptPath = ""; + } - if (_events[eventName].size() > 0) + // Have we already loaded this global script? + bool loaded = true; + Script* script = NULL; + if (!scriptPath.empty()) + { + loaded = false; + ScriptEntry* se = _scripts; + while (se) { - for (unsigned int i = 0; i < iter->second->size(); i++) + if (scriptPath == se->script->getPath() && se->script->getScope() == Script::GLOBAL) { - if (sc->executeFunction((*iter->second)[i].function.c_str(), _events[eventName].c_str(), &list)) - { - va_end(list); - return true; - } + // Script is already loaded + script = se->script; + loaded = true; + break; + } + se = se->next; + } + } + + if (!loaded) + { + // The specified global script is not yet loaded, so do so + script = Game::getInstance()->getScriptController()->loadScript(scriptPath.c_str(), Script::GLOBAL); + if (script) + { + loaded = true; + ScriptEntry* se = new ScriptEntry(script); + if (_scripts) + { + ScriptEntry* last = _scripts; + while (last->next) + last = last->next; + last->next = se; + se->prev = last; + } + else + { + _scripts = se; } } else { - for (unsigned int i = 0; i < iter->second->size(); i++) + GP_WARN("Failed to load script '%s' for script target while registering for function: %s", scriptPath.c_str(), function); + } + } + + if (loaded) + { + // Store the callback + if (!_scriptCallbacks) + _scriptCallbacks = new std::map>(); + (*_scriptCallbacks)[event].push_back(CallbackFunction(script, func.c_str())); + } +} + +void ScriptTarget::removeScriptCallback(const Event* event, const char* function) +{ + // Parse the script name (if it exists) and function out + std::string scriptPath, func; + splitURL(function, &scriptPath, &func); + if (func.length() == 0) + { + // The url doesn't reference a script, only a function + func = scriptPath; + scriptPath = ""; + } + + // Find the script entry for this callback + ScriptEntry* scriptEntry = NULL; + if (!scriptPath.empty()) + { + ScriptEntry* se = _scripts; + while (se) + { + if (scriptPath == se->script->getPath() && se->script->getScope() == Script::GLOBAL) + { + scriptEntry = se; + break; + } + se = se->next; + } + } + Script* script = scriptEntry ? scriptEntry->script : NULL; + + // Remove any registered callback functions that match the specified one + int removedCallbacks = 0; + int totalCallbacks = 0; + if (_scriptCallbacks) + { + std::map>::iterator itr = _scriptCallbacks->begin(); + for (; itr != _scriptCallbacks->end(); ++itr) + { + // Erase matching callback functions for this event + bool forEvent = itr->first == event; + std::vector& callbacks = itr->second; + std::vector::iterator itr2 = callbacks.begin(); + while (itr2 != callbacks.end()) { - if (sc->executeFunction((*iter->second)[i].function.c_str(), _events[eventName].c_str())) + if (itr2->script == script) { - va_end(list); - return true; + ++totalCallbacks; // sum total number of callbacks found for this script + if (forEvent && itr2->function == func) + { + itr2 = callbacks.erase(itr2); + ++removedCallbacks; // sum number of callbacks removed + } + else + ++itr2; } } } } - va_end(list); - return false; + // Cleanup the script if there are no remaining callbacks for it + if (scriptEntry && (totalCallbacks - removedCallbacks) <= 0) + { + removeScript(scriptEntry); + } } -void ScriptTarget::addScriptCallback(const std::string& eventName, const std::string& function) +void ScriptTarget::clearScripts() { - std::map* >::iterator iter = _callbacks.find(eventName); - if (iter != _callbacks.end()) + while (_scripts) { - if (!iter->second) - iter->second = new std::vector(); + removeScript(_scripts); + } +} - // Add the function to the list of callbacks. - std::string functionName = Game::getInstance()->getScriptController()->loadUrl(function.c_str()); - iter->second->push_back(Callback(functionName)); +bool ScriptTarget::hasScriptListener(const char* eventName) const +{ + const Event* event = getScriptEvent(eventName); + return event ? hasScriptListener(event) : false; +} + +const ScriptTarget::Event* ScriptTarget::getScriptEvent(const char* eventName) const +{ + GP_ASSERT(eventName); + + // Lookup the event for this name + const Event* event = NULL; + RegistryEntry* re = _scriptRegistries; + while (re) + { + if ((event = re->registry->getEvent(eventName)) != NULL) + break; + re = re->next; } - else + + return event; +} + +bool ScriptTarget::hasScriptListener(const Event* event) const +{ + GP_ASSERT(event); + + if (_scriptCallbacks) { - GP_ERROR("Attempting to add a script callback for unsupported event '%s'.", eventName.c_str()); + std::map>::iterator itr = _scriptCallbacks->find(event); + if (itr != _scriptCallbacks->end()) + { + return !itr->second.empty(); + } } + + return false; } -void ScriptTarget::removeScriptCallback(const std::string& eventName, const std::string& function) +template<> void ScriptTarget::fireScriptEvent(const Event* event, ...) { - std::map* >::iterator iter = _callbacks.find(eventName); - if (iter != _callbacks.end()) + GP_ASSERT(event); + + if (!_scriptCallbacks) + return; // no registered callbacks + + va_list list; + va_start(list, event); + + // Lookup registered callbacks for this event and fire them + std::map>::iterator itr = _scriptCallbacks->find(event); + if (itr != _scriptCallbacks->end()) { - if (!iter->second) - return; + ScriptController* sc = Game::getInstance()->getScriptController(); + std::vector& callbacks = itr->second; + for (size_t i = 0, count = callbacks.size(); i < count; ++i) + { + CallbackFunction& cb = callbacks[i]; + sc->executeFunction(cb.script, cb.function.c_str(), event->args.c_str(), &list); + } + } + + va_end(list); +} - std::string file; - std::string id; - splitURL(function, &file, &id); +template<> bool ScriptTarget::fireScriptEvent(const Event* event, ...) +{ + GP_ASSERT(event); - // Make sure the function isn't empty. - if (id.size() <= 0) - return; + if (!_scriptCallbacks) + return false; // no registered callbacks - // Remove the function from the list of callbacks. - for (unsigned int i = 0; i < iter->second->size(); i++) + va_list list; + va_start(list, event); + + // Lookup registered callbacks for this event and fire them + std::map>::iterator itr = _scriptCallbacks->find(event); + if (itr != _scriptCallbacks->end()) + { + ScriptController* sc = Game::getInstance()->getScriptController(); + std::vector& callbacks = itr->second; + for (size_t i = 0, count = callbacks.size(); i < count; ++i) { - if ((*iter->second)[i].function == id) + CallbackFunction& cb = callbacks[i]; + if (sc->executeFunction(cb.script, cb.function.c_str(), event->args.c_str(), &list)) { - iter->second->erase(iter->second->begin() + i); - return; + va_end(list); + return true; } } } - else - { - GP_ERROR("Attempting to remove a script callback for unsupported event '%s'.", eventName.c_str()); - } -} -void ScriptTarget::addScriptEvent(const std::string& eventName, const char* argsString) -{ - _events[eventName] = (argsString ? argsString : ""); - _callbacks[eventName] = NULL; -} + va_end(list); -ScriptTarget::Callback::Callback(const std::string& function) : function(function) -{ + return false; } } diff --git a/gameplay/src/ScriptTarget.h b/gameplay/src/ScriptTarget.h index 94bf79ac41..64214d2015 100644 --- a/gameplay/src/ScriptTarget.h +++ b/gameplay/src/ScriptTarget.h @@ -1,89 +1,410 @@ #ifndef SCRIPTTARGET_H_ #define SCRIPTTARGET_H_ -#include "Base.h" +#include "Script.h" namespace gameplay { +/** + * Macro to indidate the start of script event definitions for a class. + * + * This macro should be used at the top of a class declaration. The class + * should extend ScriptTarget and the lines immediately following this + * macro should be one or more GP_SCRIPT_EVENT macros, followed by + * exactly one GP_SCRIPT_EVENTS_END macro. + * + * @script{ignore} + */ +#define GP_SCRIPT_EVENTS_START() \ +public: \ + class ScriptEvents { \ + public: \ + static ScriptEvents* getInstance() \ + { \ + static ScriptEvents instance; \ + return &instance; \ + } \ + static ScriptTarget::EventRegistry* getRegistry() \ + { \ + static ScriptTarget::EventRegistry registry; \ + return ®istry; \ + } + +/** + * Macro to define a single supported script event for a class. + * + * This macro should follow exactly one prior GP_SCRIPT_EVENTS_START macro + * and zero or more other GP_SCRIPT_EVENT macros. + * + * @param eventName The name of the script event. + * @param eventArgs A string of arguments to be passed to the script event, using + * the format specified in ScriptController::executeFunction. + * + * @script{ignore} + */ +#define GP_SCRIPT_EVENT(eventName, eventArgs) \ + struct SCRIPT_EVENT_ ## eventName \ + { \ + SCRIPT_EVENT_ ## eventName() \ + { \ + _event = ScriptEvents::getRegistry()->addEvent(#eventName, eventArgs); \ + } \ + const ScriptTarget::Event* getEvent() \ + { \ + return _event; \ + } \ + private: \ + const ScriptTarget::Event* _event; \ + }; \ + SCRIPT_EVENT_ ## eventName eventName; + +/** + * Macro to indiate the end of a series of script event defintions. + * + * @script{ignore} + */ +#define GP_SCRIPT_EVENTS_END() \ + private: \ + ScriptEvents() { } \ + }; + +/** + * Macro used to retrieve a script event object the given class name. + * + * @param eventClass The C++ class that contains the specified script event. + * @param eventName The name of the registered script event to retrieve. + * + * @script{ignore} + */ +#define GP_GET_SCRIPT_EVENT(eventClass, eventName) \ + eventClass::ScriptEvents::getInstance()->eventName.getEvent() + + +/** + * Registers the defined script events for a ScriptTarget. + * + * This macro should be called at the beginning of all constructors of a + * ScriptTarget child class that contains one or more script event + * declarations (via the GP_SCRIPT_EVENT macro). + * + * @script{ignore} + */ +#define GP_REGISTER_SCRIPT_EVENTS() \ + ScriptTarget::registerEvents(ScriptEvents::getInstance()->getRegistry()) + /** * Defines an interface for supporting script callbacks. + * + * Classes that extend ScriptTarget can expose script events using the GP_SCRIPT_EVENT macros. + * Custom events should be registered using these macros at the top of the class definition. + * Events can be fired by calling the ScriptTarget::fireScriptEvent method, passing the + * registered ScriptTarget::Event object and any required parameters. + * + * In addition to script events that are explicitly defined by a custom ScriptTarget class, + * all ScriptTarget scripts implicitly support an "attached" event. This event is called + * immediately after such a script is attached to a ScriptTarget and it takes a single + * parameter: the ScriptTarget object. */ class ScriptTarget { + friend class Game; + public: /** - * Adds the given Lua script function as a callback for the given event. + * Defines a single script event. + */ + class Event + { + friend class ScriptTarget; + + public: + + /** + * Returns the name of this event. + * + * @return The event name. + */ + const char* getName() const; + + /** + * Returns the argument string for this event. + * + * @return The argument string. + */ + const char* getArgs() const; + + private: + + /** + * The event name. + */ + std::string name; + + /** + * The event arguments. + * + * @see ScriptController::executeFunction + */ + std::string args; + + }; + + /** + * Script event registry that defines the supported script events + * for a ScriptTarget. + * + * This class should generally only be used via the GP_REGISTER_SCRIPT_EVENTS macro. + */ + class EventRegistry + { + friend class ScriptTarget; + + public: + + /** + * Creates an empty event registry. + */ + EventRegistry(); + + /** + * Destructor. + */ + ~EventRegistry(); + + /** + * Adds a registered event to the registry. + * + * @param name The name of the script event. + * @param args The argument string for the event. + * + * @return The added event. + * + * @see ScriptController::executeFunction + */ + const Event* addEvent(const char* name, const char* args = NULL); + + /** + * Returns the number of registered script events. + * + * @return The number of script events registered. + */ + unsigned int getEventCount() const; + + /** + * Returns the event with the given index. + * + * @param index The index of the event to retrieve. + * + * @return The event for the given index. + */ + const Event* getEvent(unsigned int index) const; + + /** + * Returns the event that matches the given name. + * + * @param name The name of the event to search for. + * + * @return The matching event, or NULL if no such event exists. + */ + const Event* getEvent(const char* name) const; + + private: + + std::vector _events; + }; + + /** + * Implemented by child classes to return the type name identifier for + * the class that extends ScriptTarget. + * + * @return A string describing the type name of the ScriptTarget child + * class, as it is defined in the lua bindings (i.e. "Node"). + */ + virtual const char* getTypeName() const = 0; + + /** + * Attaches a script to this object. + * + * Scripts attached to a ScriptTarget are loaded using the PROTECTED scope, + * which loads scripts into their own protected script environment, allowing + * variables with the same name to be used without colliding with other scripts. + * + * @param path Path to the script. + * + * @return A pointer to the successfully loaded script, or NULL if unsuccessful. + */ + Script* addScript(const char* path); + + /** + * Removes a previously attached script from this object. + * + * @param path The same path that was used to load the script being removed. + * + * @return True if a script is successfully removed, false otherwise. + */ + bool removeScript(const char* path); + + /** + * Adds the given global script function as a callback for the given event. + * + * Individual script callback events registered via this method are expected + * to be global script functions. Registering individual callbacks in this + * manner is generally slower than registering a single script to handle script + * events for an object. * - * @param eventName The name of the event. - * @param function The name of the Lua script function to call when the event is fired; can either be + * @param event The event to add the callback for. + * @param function The name of the script function to call when the event is fired; can either be * just the name of a function (if the function's script file has already been loaded), or can be * a URL of the form scriptFile.lua#functionName. */ - virtual void addScriptCallback(const std::string& eventName, const std::string& function); + void addScriptCallback(const Event* event, const char* function); /** - * Removes the given Lua script function as a callback for the given event. + * Removes the given script function as a callback for the given event. * - * @param eventName The name of the event. - * @param function The name of the Lua script function. + * @param event The event to remove the callback for. + * @param function The name of the script function. */ - virtual void removeScriptCallback(const std::string& eventName, const std::string& function); + void removeScriptCallback(const Event* event, const char* function); -protected: + /** + * Removes all scripts and callbacks from this object. + */ + void clearScripts(); /** - * Hidden constructor. + * Determines if there is a script installed that is listening for the given script + * event (i.e. has a function callback defined for the given event). + * + * @param eventName The script event to check. + * + * @return True if there is a listener for the specified event, false otherwise. */ - ScriptTarget(); + bool hasScriptListener(const char* eventName) const; /** - * Destructor. + * Determines if there is a script installed that is listening for the given script + * event (i.e. has a function callback defined for the given event). + * + * @param event The script event to check. + * + * @return True if there is a listener for the specified event, false otherwise. */ - virtual ~ScriptTarget(); + bool hasScriptListener(const Event* event) const; /** - * Adds the given event with the given Lua script parameter string ({@link ScriptController::executeFunction}) - * as a supported event for this script target. - * - * @param eventName The name of the event. - * @param argsString The argument string for the event. + * Returns the event object for the given event name, if it exists. + * + * @param eventName Name of the event. + * + * @return The event object for the given name, or NULL if no such event exists. */ - void addScriptEvent(const std::string& eventName, const char* argsString = NULL); + const Event* getScriptEvent(const char* eventName) const; /** - * Fires the event with the given event name and the given arguments. + * Fires the specified script event, passing the specified arguments. + * + * The only supported return types are void and boolean. When a boolean + * return type is used and there are multiple scripts registered for the + * given script event, event delegation will stop at the first script + * that returns a value of true. * - * @param eventName The name of the event. + * @param event The script event to fire, which was returned from EventRegistry::addEvent. + * @param ... Optional list of arguments to pass to the script event (should match the + * script event argument definition). + * + * @script{ignore} */ - template T fireScriptEvent(const char* eventName, ...); + template T fireScriptEvent(const Event* event, ...); + +protected: - /** Used to store a script callbacks for given event. */ - struct Callback + /** + * Stores an EventRegistry entry for a ScriptTarget. + */ + struct RegistryEntry { - /** Constructor. */ - Callback(const std::string& string); + EventRegistry* registry; + RegistryEntry* next; + RegistryEntry* prev; - /** Holds the Lua script callback function. */ + RegistryEntry(EventRegistry* registry) : registry(registry), next(NULL), prev(NULL) { } + }; + + /** + * Stores a Script that is registered for a ScriptTarget. + */ + struct ScriptEntry + { + Script* script; + ScriptEntry* next; + ScriptEntry* prev; + ScriptEntry(Script* script) : script(script), next(NULL), prev(NULL) { } + }; + + /** + * Stores a single registered script callback function. + */ + struct CallbackFunction + { + // The script the callback belongs to (or NULL if the callback is a global function) + Script* script; + + // The function within the script to call std::string function; + + CallbackFunction(Script* script, const char* function) : script(script), function(function) { } }; - /** Holds the supported events for this script target. */ - std::map _events; - /** Holds the callbacks for this script target's events. */ - std::map*> _callbacks; + /** + * Constructor. + */ + ScriptTarget(); + + /** + * Destructor. + */ + virtual ~ScriptTarget(); + + /** + * Removes the specified script. + */ + void removeScript(ScriptEntry* se); + + /** + * Registers a set of supported script events and event arguments for this ScriptTarget. + * + * The passed in EventRegistry object should contain a list of all script events to + * be supported by this ScriptTarget, along with their parameter definitions. This + * registry object will be held onto for the lifetime of the ScriptTarget and it is + * recommended that it be shared among all ScriptTargets of the same class/type. + * + * This should normally be set using the GP_REGISTER_SCRIPT_EVENTS macro in the + * constructor of the child class. + * + * @param registry The EventRegistry containing the list of supported script events. + */ + void registerEvents(EventRegistry* registry); + + /** Holds the event registries for this script target. */ + RegistryEntry* _scriptRegistries; + /** Holds the list of scripts referenced by this ScriptTarget. */ + ScriptEntry* _scripts; + /** Holds the list of callback functions registered for this ScriptTarget. */ + std::map >* _scriptCallbacks; }; -template T ScriptTarget::fireScriptEvent(const char* eventName, ...) +template T ScriptTarget::fireScriptEvent(const Event* evt, ...) { - GP_ERROR("Unsupported return type!"); + GP_ERROR("Unsupported return type for template function ScriptTarget::fireScriptEvent."); } /** Template specialization. */ -template<> void ScriptTarget::fireScriptEvent(const char* eventName, ...); +template<> void ScriptTarget::fireScriptEvent(const Event* event, ...); /** Template specialization. */ -template<> bool ScriptTarget::fireScriptEvent(const char* eventName, ...); +template<> bool ScriptTarget::fireScriptEvent(const Event* event, ...); } diff --git a/gameplay/src/Slider.cpp b/gameplay/src/Slider.cpp index c4079c8d0a..9d9a8a06c9 100644 --- a/gameplay/src/Slider.cpp +++ b/gameplay/src/Slider.cpp @@ -59,6 +59,11 @@ void Slider::initialize(const char* typeName, Theme::Style* style, Properties* p setValue(_value); } +const char* Slider::getTypeName() const +{ + return "Slider"; +} + void Slider::setMin(float min) { _min = min; @@ -169,7 +174,7 @@ void Slider::updateValue(int x, int y) const Rectangle& maxCapRegion = _maxImage->getRegion(); const Rectangle& markerRegion = _markerImage->getRegion(); - float markerPosition = x / (_viewportBounds.width - markerRegion.width); + float markerPosition = (x - markerRegion.width * 0.5f) / (_viewportBounds.width - markerRegion.width); if (markerPosition > 1.0f) { @@ -252,26 +257,18 @@ bool Slider::mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta) return false; } -bool Slider::gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex) +bool Slider::gamepadJoystickEvent(Gamepad* gamepad, unsigned int index) { - switch (evt) + // The right analog stick can be used to change a slider's value. + if (index == 1) { - case Gamepad::JOYSTICK_EVENT: - { - // The right analog stick can be used to change a slider's value. - if (analogIndex == 1) - { - Vector2 joy; - gamepad->getJoystickValues(analogIndex, &joy); - _gamepadValue = _value; - _delta = joy.x; - return true; - } - break; - } + Vector2 joy; + gamepad->getJoystickValues(index, &joy); + _gamepadValue = _value; + _delta = joy.x; + return true; } - - return Label::gamepadEvent(evt, gamepad, analogIndex); + return Label::gamepadJoystickEvent(gamepad, index); } bool Slider::keyEvent(Keyboard::KeyEvent evt, int key) @@ -485,7 +482,7 @@ unsigned int Slider::drawText(Form* form, const Rectangle& clip) SpriteBatch* batch = _font->getSpriteBatch(fontSize); startBatch(form, batch); - _font->drawText(_valueText.c_str(), _textBounds, _textColor, fontSize, _valueTextAlignment, true, getTextRightToLeft(state), &_viewportClipBounds); + _font->drawText(_valueText.c_str(), _textBounds, _textColor, fontSize, _valueTextAlignment, true, getTextRightToLeft(state), _viewportClipBounds); finishBatch(form, batch); ++drawCalls; @@ -494,9 +491,4 @@ unsigned int Slider::drawText(Form* form, const Rectangle& clip) return drawCalls; } -const char* Slider::getType() const -{ - return "slider"; -} - } diff --git a/gameplay/src/Slider.h b/gameplay/src/Slider.h index b03e571968..9d15d2bb9e 100644 --- a/gameplay/src/Slider.h +++ b/gameplay/src/Slider.h @@ -35,6 +35,16 @@ class Slider : public Label */ static Slider* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "Slider" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Set the minimum value that can be set on this slider. * @@ -93,11 +103,6 @@ class Slider : public Label */ float getValue() const; - /** - * @see Control::getType - */ - const char* getType() const; - /** * Sets if the slider value text is rendered below the control. * @@ -180,47 +185,24 @@ class Slider : public Label void initialize(const char* typeName, Theme::Style* style, Properties* properties); /** - * Touch callback on touch events. Controls return true if they consume the touch event. - * - * @param evt The touch event that occurred. - * @param x The x position of the touch in pixels. Left edge is zero. - * @param y The y position of the touch in pixels. Top edge is zero. - * @param contactIndex The order of occurrence for multiple touch contacts starting at zero. - * - * @return Whether the touch event was consumed by the control. - * - * @see Touch::TouchEvent + * @see Control::KeyEvent */ - bool touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex); + bool keyEvent(Keyboard::KeyEvent evt, int key); /** - * Mouse callback on mouse events. - * - * @param evt The mouse event that occurred. - * @param x The x position of the mouse in pixels. Left edge is zero. - * @param y The y position of the mouse in pixels. Top edge is zero. - * @param wheelDelta The number of mouse wheel ticks. Positive is up (forward), negative is down (backward). - * - * @return True if the mouse event is consumed or false if it is not consumed. - * - * @see Mouse::MouseEvent + * @see Control::TouchEvent */ - bool mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta); + bool touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex); /** - * Gamepad callback on gamepad events. - * - * @see Control::gamepadEvent + * @see Control::MouseEvent */ - bool gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex); + bool mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta); /** - * Keyboard callback on key events. - * - * @see Keyboard::KeyEvent - * @see Keyboard::Key + * @see Control::gamepadJoystickEvent */ - bool keyEvent(Keyboard::KeyEvent evt, int key); + bool gamepadJoystickEvent(Gamepad* gamepad, unsigned int index); /** * @see Control::drawImages diff --git a/gameplay/src/Sprite.cpp b/gameplay/src/Sprite.cpp new file mode 100644 index 0000000000..5fe2b52903 --- /dev/null +++ b/gameplay/src/Sprite.cpp @@ -0,0 +1,767 @@ +#include "Base.h" +#include "Sprite.h" +#include "Scene.h" + +namespace gameplay +{ + +Sprite::Sprite() : Drawable(), + _width(0), _height(0), _offset(OFFSET_BOTTOM_LEFT), _anchor(Vector2(0.5f, 0.5f)), _flipFlags(FLIP_NONE), + _frames(NULL), _frameCount(1), _frameStride(0), _framePadding(1), _frameIndex(0), + _opacity(1.0f), _color(Vector4::one()), _blendMode(BLEND_ALPHA), _batch(NULL) +{ +} + +Sprite::~Sprite() +{ + SAFE_DELETE_ARRAY(_frames); + SAFE_DELETE(_batch); +} + +Sprite& Sprite::operator=(const Sprite& sprite) +{ + return *this; +} + +Sprite* Sprite::create(const char* imagePath, float width, float height, Effect* effect) +{ + return Sprite::create(imagePath, width, height, Rectangle(0, 0, -1, -1), 1, effect); +} + +Sprite* Sprite::create(const char* imagePath, float width, float height, + const Rectangle& source, unsigned int frameCount, Effect* effect) +{ + GP_ASSERT(imagePath != NULL); + GP_ASSERT(width >= -1 && height >= -1); + GP_ASSERT(source.width >= -1 && source.height >= -1); + GP_ASSERT(frameCount > 0); + + SpriteBatch* batch = SpriteBatch::create(imagePath, effect); + batch->getSampler()->setWrapMode(Texture::CLAMP, Texture::CLAMP); + batch->getSampler()->setFilterMode(Texture::Filter::LINEAR, Texture::Filter::LINEAR); + batch->getStateBlock()->setDepthWrite(false); + batch->getStateBlock()->setDepthTest(true); + + unsigned int imageWidth = batch->getSampler()->getTexture()->getWidth(); + unsigned int imageHeight = batch->getSampler()->getTexture()->getHeight(); + if (width == -1) + width = imageWidth; + if (height == -1) + height = imageHeight; + + Sprite* sprite = new Sprite(); + sprite->_width = width; + sprite->_height = height; + sprite->_batch = batch; + sprite->_frameCount = frameCount; + sprite->_frames = new Rectangle[frameCount]; + sprite->_frames[0] = source; + if (sprite->_frames[0].width == -1.0f) + sprite->_frames[0].width = imageWidth; + if (sprite->_frames[0].height == -1.0f) + sprite->_frames[0].height = imageHeight; + return sprite; +} + +static bool parseBlendMode(const char* str, Sprite::BlendMode* blend) +{ + GP_ASSERT(blend); + + if (!str) + { + *blend = Sprite::BLEND_NONE; + return false; + } + + if (strcmp(str, "BLEND_ALPHA") == 0) + { + *blend = Sprite::BLEND_ALPHA; + } + else if (strcmp(str, "BLEND_ADDITIVE") == 0) + { + *blend = Sprite::BLEND_ADDITIVE; + } + else if (strcmp(str, "BLEND_MULTIPLIED") == 0) + { + *blend = Sprite::BLEND_MULTIPLIED; + } + else if (strcmp(str, "BLEND_NONE") != 0) + { + GP_ERROR("Failed to get corresponding sprite blend mode for unsupported value '%s'.", str); + *blend = Sprite::BLEND_NONE; + return false; + } + else + { + *blend = Sprite::BLEND_NONE; + } + + return true; +} + +static bool parseFlipFlags(const char* str, Sprite::FlipFlags* flip) +{ + GP_ASSERT(flip); + + if (!str) + { + *flip = Sprite::FLIP_NONE; + return false; + } + + if (strcmp(str, "FLIP_VERTICAL") == 0) + { + *flip = Sprite::FLIP_VERTICAL; + } + else if (strcmp(str, "FLIP_HORIZONTAL") == 0) + { + *flip = Sprite::FLIP_HORIZONTAL; + } + else if (strcmp(str, "FLIP_VERTICAL_HORIZONTAL") == 0) + { + *flip = (Sprite::FlipFlags)(Sprite::FLIP_VERTICAL | Sprite::FLIP_HORIZONTAL); + } + else if (strcmp(str, "FLIP_NONE") != 0) + { + GP_ERROR("Failed to get corresponding sprite flip flag for unsupported value '%s'.", str); + *flip = Sprite::FLIP_NONE; + return false; + } + else + { + *flip = Sprite::FLIP_NONE; + } + + return true; +} + +static bool parseOffset(const char* str, Sprite::Offset* offset) +{ + GP_ASSERT(offset); + + if (!str) + { + *offset = Sprite::OFFSET_LEFT; + return false; + } + + if (strcmp(str, "OFFSET_LEFT") == 0) + { + *offset = Sprite::OFFSET_LEFT; + } + else if (strcmp(str, "OFFSET_HCENTER") == 0) + { + *offset = Sprite::OFFSET_HCENTER; + } + else if (strcmp(str, "OFFSET_RIGHT") == 0) + { + *offset = Sprite::OFFSET_RIGHT; + } + else if (strcmp(str, "OFFSET_TOP") == 0) + { + *offset = Sprite::OFFSET_TOP; + } + else if (strcmp(str, "OFFSET_VCENTER") == 0) + { + *offset = Sprite::OFFSET_VCENTER; + } + else if (strcmp(str, "OFFSET_BOTTOM") == 0) + { + *offset = Sprite::OFFSET_BOTTOM; + } + else if (strcmp(str, "OFFSET_ANCHOR") == 0) + { + *offset = Sprite::OFFSET_ANCHOR; + } + else if (strcmp(str, "OFFSET_TOP_LEFT") == 0) + { + *offset = Sprite::OFFSET_TOP_LEFT; + } + else if (strcmp(str, "OFFSET_VCENTER_LEFT") == 0) + { + *offset = Sprite::OFFSET_VCENTER_LEFT; + } + else if (strcmp(str, "OFFSET_BOTTOM_LEFT") == 0) + { + *offset = Sprite::OFFSET_BOTTOM_LEFT; + } + else if (strcmp(str, "OFFSET_TOP_HCENTER") == 0) + { + *offset = Sprite::OFFSET_TOP_HCENTER; + } + else if (strcmp(str, "OFFSET_VCENTER_HCENTER") == 0) + { + *offset = Sprite::OFFSET_VCENTER_HCENTER; + } + else if (strcmp(str, "OFFSET_BOTTOM_HCENTER") == 0) + { + *offset = Sprite::OFFSET_BOTTOM_HCENTER; + } + else if (strcmp(str, "OFFSET_TOP_RIGHT") == 0) + { + *offset = Sprite::OFFSET_TOP_RIGHT; + } + else if (strcmp(str, "OFFSET_VCENTER_RIGHT") == 0) + { + *offset = Sprite::OFFSET_VCENTER_RIGHT; + } + else if (strcmp(str, "OFFSET_BOTTOM_RIGHT") != 0) + { + GP_ERROR("Failed to get corresponding sprite offset for unsupported value '%s'.", str); + *offset = Sprite::OFFSET_LEFT; + return false; + } + else + { + *offset = Sprite::OFFSET_BOTTOM_RIGHT; + } + + return true; +} + +Sprite* Sprite::create(Properties* properties) +{ + // Check if the Properties is valid and has a valid namespace. + if (!properties || strcmp(properties->getNamespace(), "sprite") != 0) + { + GP_ERROR("Properties object must be non-null and have namespace equal to 'sprite'."); + return NULL; + } + + // Get image path. + const char* imagePath = properties->getString("path"); + if (imagePath == NULL || strlen(imagePath) == 0) + { + GP_ERROR("Sprite is missing required image file path."); + return NULL; + } + + // Don't support loading custom effects + Effect* effect = NULL; + + // Get width and height + float width = -1.0f; + float height = -1.0f; + float widthPercentage = 0.0f; + float heightPercentage = 0.0f; + if (properties->exists("width")) + { + if (properties->getType("width") == Properties::NUMBER) //TODO: Verify that this works for "100" but fails for "100%" + { + width = properties->getFloat("width"); + } + else + { + widthPercentage = properties->getFloat("width") / 100.0f; + } + } + if (properties->exists("height")) + { + if (properties->getType("height") == Properties::NUMBER) + { + height = properties->getFloat("height"); + } + else + { + heightPercentage = properties->getFloat("height") / 100.0f; + } + } + + Sprite* sprite; + if (properties->exists("source")) + { + // Get source frame + Rectangle source; + properties->getVector4("source", (Vector4*)&source); + + // Get frame count + int frameCount = properties->getInt("frameCount"); + if (frameCount < 0) + { + GP_WARN("Sprites require at least one frame. Defaulting to frame count 1."); + } + if (frameCount < 1) + { + frameCount = 1; + } + + // Load sprite + sprite = Sprite::create(imagePath, width, height, source, frameCount, effect); + } + else + { + // Load sprite + sprite = Sprite::create(imagePath, width, height, effect); + } + + // Edit scaling of sprites if needed + if (widthPercentage != 0.0f || heightPercentage != 0.0f) + { + if (widthPercentage != 0.0f) + { + sprite->_width *= widthPercentage; + sprite->_frames[0].width *= widthPercentage; + } + if (heightPercentage != 0.0f) + { + sprite->_height *= heightPercentage; + sprite->_frames[0].height *= heightPercentage; + } + } + + // Get anchor + Vector4 vect; + if (properties->getVector2("anchor", (Vector2*)&vect)) + { + sprite->setAnchor(*((Vector2*)&vect)); + } + + // Get color + if (properties->exists("color")) + { + switch (properties->getType("color")) + { + case Properties::VECTOR3: + vect.w = 1.0f; + properties->getVector3("color", (Vector3*)&vect); + break; + case Properties::VECTOR4: + properties->getVector4("color", &vect); + break; + case Properties::STRING: + default: + properties->getColor("color", &vect); + break; + } + sprite->setColor(vect); + } + + // Get opacity + if (properties->exists("opacity")) + { + sprite->setOpacity(properties->getFloat("opacity")); + } + + // Get blend mode + BlendMode mode; + if (parseBlendMode(properties->getString("blendMode"), &mode)) + { + sprite->setBlendMode(mode); + } + + // Get flip flags + FlipFlags flags; + if (parseFlipFlags(properties->getString("flip"), &flags)) + { + sprite->setFlip(flags); + } + + // Get sprite offset + Offset offset; + if (parseOffset(properties->getString("offset"), &offset)) + { + sprite->setOffset(offset); + } + + return sprite; +} + +float Sprite::getWidth() const +{ + return _width; +} + +float Sprite::getHeight() const +{ + return _height; +} + +void Sprite::setOffset(Sprite::Offset offset) +{ + _offset = offset; +} + +Sprite::Offset Sprite::getOffset() const +{ + return _offset; +} + +void Sprite::setAnchor(const Vector2& anchor) +{ + _anchor = anchor; +} + +const Vector2& Sprite::getAnchor() const +{ + return _anchor; +} + +void Sprite::setFlip(int flipFlags) +{ + _flipFlags = flipFlags; +} + +int Sprite::getFlip() const +{ + return _flipFlags; +} + +void Sprite::setFrameSource(unsigned int frameIndex, const Rectangle& source) +{ + GP_ASSERT(frameIndex < _frameCount); + + _frames[frameIndex] = source; +} + +const Rectangle& Sprite::getFrameSource(unsigned int frameIndex) const +{ + GP_ASSERT(frameIndex < _frameCount); + + return _frames[frameIndex]; +} + +void Sprite::computeFrames(unsigned int frameStride, unsigned int framePadding) +{ + _frameStride = frameStride; + _framePadding = framePadding; + + if (_frameCount < 2) + return; + unsigned int imageWidth = _batch->getSampler()->getTexture()->getWidth(); + unsigned int imageHeight = _batch->getSampler()->getTexture()->getHeight(); + float textureWidthRatio = 1.0f / imageWidth; + float textureHeightRatio = 1.0f / imageHeight; + + // If we have a stride then compute the wrap width + float strideWidth; + if (_frameStride > 0) + strideWidth = _frameStride * _frames[0].width; + else + strideWidth = imageWidth; + + // Mark the start as reference + float x = _frames[0].x; + float y = _frames[0].y; + float width = _frames[0].width; + float height = _frames[0].height; + + // Compute frames 1+ + for (unsigned int frameIndex = 1; frameIndex < _frameCount; frameIndex++) + { + _frames[frameIndex].x = x; + _frames[frameIndex].y = y; + _frames[frameIndex].width = _width; + _frames[frameIndex].height = _height; + + x += _frames[frameIndex].width + (float)_framePadding; + if (x >= imageWidth) + { + y += _frames[frameIndex].height + (float)_framePadding; + if (y >= imageHeight) + { + y = 0.0f; + } + x = 0.0f; + } + } +} + +unsigned int Sprite::getFrameCount() const +{ + return _frameCount; +} + +unsigned int Sprite::getFramePadding() const +{ + return _framePadding; +} + +unsigned int Sprite::getFrameStride() const +{ + return _frameStride; +} + +void Sprite::setFrameIndex(unsigned int index) +{ + _frameIndex = index; +} + +unsigned int Sprite::getFrameIndex() const +{ + return _frameIndex; +} + +void Sprite::setOpacity(float opacity) +{ + _opacity = opacity; +} + +float Sprite::getOpacity() const +{ + return _opacity; +} + +void Sprite::setColor(const Vector4& color) +{ + _color = color; +} + +const Vector4& Sprite::getColor() const +{ + return _color; +} + +Sprite::BlendMode Sprite::getBlendMode() const +{ + return _blendMode; +} + +void Sprite::setBlendMode(BlendMode mode) +{ + switch (mode) + { + case BLEND_NONE: + _batch->getStateBlock()->setBlend(false); + break; + case BLEND_ALPHA: + _batch->getStateBlock()->setBlend(true); + _batch->getStateBlock()->setBlendSrc(RenderState::BLEND_SRC_ALPHA); + _batch->getStateBlock()->setBlendDst(RenderState::BLEND_ONE_MINUS_SRC_ALPHA); + break; + case BLEND_ADDITIVE: + _batch->getStateBlock()->setBlend(true); + _batch->getStateBlock()->setBlendSrc(RenderState::BLEND_SRC_ALPHA); + _batch->getStateBlock()->setBlendDst(RenderState::BLEND_ONE); + break; + case BLEND_MULTIPLIED: + _batch->getStateBlock()->setBlend(true); + _batch->getStateBlock()->setBlendSrc(RenderState::BLEND_ZERO); + _batch->getStateBlock()->setBlendDst(RenderState::BLEND_SRC_COLOR); + break; + default: + GP_ERROR("Unsupported blend mode (%d).", mode); + break; + } +} + +Texture::Sampler* Sprite::getSampler() const +{ + return _batch->getSampler(); +} + +RenderState::StateBlock* Sprite::getStateBlock() const +{ + return _batch->getStateBlock(); +} + +Material* Sprite::getMaterial() const +{ + return _batch->getMaterial(); +} + +unsigned int Sprite::draw(bool wireframe) +{ + // Apply scene camera projection and translation offsets + Vector3 position = Vector3::zero(); + if (_node && _node->getScene()) + { + Camera* activeCamera = _node->getScene()->getActiveCamera(); + if (activeCamera) + { + Node* cameraNode = _node->getScene()->getActiveCamera()->getNode(); + if (cameraNode) + { + // Scene projection + Matrix projectionMatrix; + projectionMatrix = _node->getProjectionMatrix(); + _batch->setProjectionMatrix(projectionMatrix); + + // Camera translation offsets + position.x -= cameraNode->getTranslationWorld().x; + position.y -= cameraNode->getTranslationWorld().y; + + } + } + + // Apply node translation offsets + Vector3 translation = _node->getTranslationWorld(); + position.x += translation.x; + position.y += translation.y; + position.z += translation.z; + } + + // Apply local offset translation offsets + if ((_offset & OFFSET_HCENTER) == OFFSET_HCENTER) + position.x -= _width * 0.5; + if ((_offset & OFFSET_RIGHT) == OFFSET_RIGHT) + position.x -= _width; + if ((_offset & OFFSET_VCENTER) == OFFSET_VCENTER) + position.y -= _height * 0.5f; + if ((_offset & OFFSET_TOP) == OFFSET_TOP) + position.y -= _height; + if ((_offset & OFFSET_ANCHOR) == OFFSET_ANCHOR) + { + position.x -= _width * _anchor.x; + position.y -= _height * _anchor.y; + } + + // Apply node scale and rotation + float rotationAngle = 0.0f; + Vector2 scale = Vector2(_width, _height); + if (_node) + { + // Apply node rotation + const Quaternion& rot = _node->getRotation(); + if (rot.x != 0.0f || rot.y != 0.0f || rot.z != 0.0f) + rotationAngle = rot.toAxisAngle(NULL); + + // Apply node scale + if (_node->getScaleX() != 1.0f) + scale.x *= _node->getScaleX(); + if (_node->getScaleY() != 1.0f) + scale.y *= _node->getScaleY(); + } + + // Apply flip flags + if ((_flipFlags & FLIP_HORIZONTAL) == FLIP_HORIZONTAL) + { + position.x += scale.x; + scale.x = -scale.x; + } + if ((_flipFlags & FLIP_VERTICAL) == FLIP_VERTICAL) + { + position.y += scale.y; + scale.y = -scale.y; + } + + // TODO: Proper batching from cache based on batching rules (image, layers, etc) + _batch->start(); + _batch->draw(position, _frames[_frameIndex], scale, Vector4(_color.x, _color.y, _color.z, _color.w * _opacity), + _anchor, rotationAngle); + _batch->finish(); + + return 1; +} + +Drawable* Sprite::clone(NodeCloneContext& context) +{ + Sprite* spriteClone = new Sprite(); + + // Clone animations + AnimationTarget::cloneInto(static_cast(spriteClone), context); + + // Get copied node if it exists + if (Node* node = getNode()) + { + Node* clonedNode = context.findClonedNode(node); + if (clonedNode) + { + spriteClone->setNode(clonedNode); + } + } + + // Clone properties + spriteClone->_width = _width; + spriteClone->_height = _height; + spriteClone->_offset = _offset; + spriteClone->_anchor = _anchor; + spriteClone->_flipFlags = _flipFlags; + spriteClone->_opacity = _opacity; + spriteClone->_color = _color; + spriteClone->_blendMode = _blendMode; + spriteClone->_frames = new Rectangle[_frameCount]; + memcpy(spriteClone->_frames, _frames, sizeof(Rectangle) * _frameCount); + spriteClone->_frameCount = _frameCount; + spriteClone->_frameStride = _frameStride; + spriteClone->_framePadding = _framePadding; + spriteClone->_frameIndex = _frameIndex; + spriteClone->_batch = _batch; + + return spriteClone; +} + +int Sprite::getPropertyId(TargetType type, const char* propertyIdStr) +{ + GP_ASSERT(propertyIdStr); + + if (type == AnimationTarget::TRANSFORM) + { + if (strcmp(propertyIdStr, "ANIMATE_OPACITY") == 0) + { + return Sprite::ANIMATE_OPACITY; + } + else if (strcmp(propertyIdStr, "ANIMATE_COLOR") == 0) + { + return Sprite::ANIMATE_COLOR; + } + else if (strcmp(propertyIdStr, "ANIMATE_KEYFRAME") == 0) + { + return Sprite::ANIMATE_KEYFRAME; + } + } + + return AnimationTarget::getPropertyId(type, propertyIdStr); +} + +unsigned int Sprite::getAnimationPropertyComponentCount(int propertyId) const +{ + switch (propertyId) + { + case ANIMATE_OPACITY: + return 1; + case ANIMATE_COLOR: + return 4; + case ANIMATE_KEYFRAME: + return 1; + default: + return -1; + } +} + +void Sprite::getAnimationPropertyValue(int propertyId, AnimationValue* value) +{ + GP_ASSERT(value); + + switch (propertyId) + { + case ANIMATE_OPACITY: + value->setFloat(0, _opacity); + break; + case ANIMATE_COLOR: + value->setFloat(0, _color.x); + value->setFloat(1, _color.y); + value->setFloat(2, _color.z); + value->setFloat(3, _color.w); + break; + case ANIMATE_KEYFRAME: + value->setFloat(0, (float)_frameIndex); + break; + default: + break; + } +} + +void Sprite::setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight) +{ + GP_ASSERT(value); + + switch(propertyId) + { + case ANIMATE_OPACITY: + setOpacity(Curve::lerp(blendWeight, _opacity, value->getFloat(0))); + break; + case ANIMATE_COLOR: + setColor(Vector4(Curve::lerp(blendWeight, _color.x, value->getFloat(0)), + Curve::lerp(blendWeight, _color.x, value->getFloat(1)), + Curve::lerp(blendWeight, _color.x, value->getFloat(2)), + Curve::lerp(blendWeight, _color.x, value->getFloat(3)))); + break; + case ANIMATE_KEYFRAME: + _frameIndex = (unsigned int)value->getFloat(0); + break; + default: + break; + } +} + +} diff --git a/gameplay/src/Sprite.h b/gameplay/src/Sprite.h new file mode 100644 index 0000000000..0e6a9bb46b --- /dev/null +++ b/gameplay/src/Sprite.h @@ -0,0 +1,395 @@ +#ifndef SPRITE_H_ +#define SPRITE_H_ + +#include "Ref.h" +#include "Drawable.h" +#include "AnimationTarget.h" +#include "Properties.h" +#include "Rectangle.h" +#include "Vector4.h" +#include "SpriteBatch.h" +#include "Effect.h" + +namespace gameplay +{ + +/** + * Defines a sprite for rendering a 2D region. + * + * A sprite has alignment for controlling the local offset bounds. + * A sprite has an anchor for controlling the origin for rotation and physics. + * + * You can add transformation and hierarchial by attaching sprites to Nodes within a Scene. + * + * The active camera in a scene effects the rendering location in the viewport for each sprite. + * + * Sprites can be animated using the animation system. + * Sprites can have physics applied to them via their node binding. + */ +class Sprite : public Ref, public Drawable, public AnimationTarget +{ + friend class Node; + +public: + + /** + * Opacity property. Data=opacity + */ + static const int ANIMATE_OPACITY = 1; + + /** + * Color property. Data = red, green, blue, alpha + */ + static const int ANIMATE_COLOR = 2; + + /** + * Image keyframe index property. Data=index + */ + static const int ANIMATE_KEYFRAME = 3; + + /** + * Defines the offset for position. + */ + enum Offset + { + OFFSET_LEFT = 0x01, + OFFSET_HCENTER = 0x02, + OFFSET_RIGHT = 0x04, + OFFSET_TOP = 0x10, + OFFSET_VCENTER = 0x20, + OFFSET_BOTTOM = 0x40, + OFFSET_ANCHOR = 0x80, + OFFSET_TOP_LEFT = OFFSET_TOP | OFFSET_LEFT, + OFFSET_VCENTER_LEFT = OFFSET_VCENTER | OFFSET_LEFT, + OFFSET_BOTTOM_LEFT = OFFSET_BOTTOM | OFFSET_LEFT, + OFFSET_TOP_HCENTER = OFFSET_TOP | OFFSET_HCENTER, + OFFSET_VCENTER_HCENTER = OFFSET_VCENTER | OFFSET_HCENTER, + OFFSET_BOTTOM_HCENTER = OFFSET_BOTTOM | OFFSET_HCENTER, + OFFSET_TOP_RIGHT = OFFSET_TOP | OFFSET_RIGHT, + OFFSET_VCENTER_RIGHT = OFFSET_VCENTER | OFFSET_RIGHT, + OFFSET_BOTTOM_RIGHT = OFFSET_BOTTOM | OFFSET_RIGHT + }; + + /** + * Defines the flip flags used for rendering the sprite. + */ + enum FlipFlags + { + FLIP_NONE, + FLIP_VERTICAL, + FLIP_HORIZONTAL + }; + + /** + * Defines the blend modes. + */ + enum BlendMode + { + BLEND_NONE, + BLEND_ALPHA, + BLEND_ADDITIVE, + BLEND_MULTIPLIED + }; + + /** + * Create a sprite image using + * + * @param imagePath The path to the image to create the sprite from. + * @param width The width of a frame. + * @param height The width of a frame. + * @param effect The custom effect to render with. + * @return The new sprite. + */ + static Sprite* create(const char* imagePath, float width = -1, float height = -1, + Effect* effect = NULL); + + /** + * Creates a sprite from a user specified source region within the image. + * + * Passing -1 for width/height or source.width/.height, + * will default to using the images width/height. + * + * @param imagePath The path to the image to create the sprite from. + * @param width The width of a frame. + * @param height The width of a frame. + * @param source The starting frame source region used from the image. + * @param frameCount The number from frames to source clips from. + * @param effect The custom effect to render with. + * @return The new sprite. + */ + static Sprite* create(const char* imagePath, float width, float height, + const Rectangle& source, unsigned int frameCount = 1, + Effect* effect = NULL); + + /** + * Creates a sprite from properties. + * + * @return The new Sprite. + */ + static Sprite* create(Properties* properties); + + /** + * Gets the width of the sprite. + * + * @return The width of the sprite. + */ + float getWidth() const; + + /** + * Gets the height of the sprite. + * + * @return The height of the sprite. + */ + float getHeight() const; + + /** + * Sets the offset used for how much to locally adjust the bounds of the sprite. + * + * Note: The default offset is Offset::OFFSET_BOTTOM_LEFT + * + * @param offset The offset used for how much to locally adjust the bounds of the sprite. + */ + void setOffset(Offset offset); + + /** + * Gets the offset used for how much to locally adjust the bounds of the sprite. + * + * Note: The default offset is Offset::OFFSET_BOTTOM_LEFT + * + * @return The offset used for how much to locally adjust the bounds of the sprite. + */ + Offset getOffset() const; + + /** + * Sets the anchor which is a origin ratio of the sprite width and height from [0.0,1.0]. + * + * @param anchor The anchor which is a origin ratio of the sprite width and height from [0.0,1.0]. + */ + void setAnchor(const Vector2& anchor); + + /** + * Gets the anchor which is a origin ratio of the sprite width and height from [0.0,1.0]. + * + * @return The anchor which is a origin ratio of the sprite width and height from [0.0,1.0]. + */ + const Vector2& getAnchor() const; + + /** + * Sets the flip flags used for rendering the sprite. + * + * @param flipFlags The flip flags used for rendering the sprite. + * @see Sprite::FlipFlags + */ + void setFlip(int flipFlags); + + /** + * Gets the flip flags used for rendering the sprite. + * + * @return The flip flags used for rendering the sprite. + * @see Sprite::FlipFlags + */ + int getFlip() const; + + /** + * Sets the source region from the source image. + * + * @param sourceClip The source clip region from the source image. + */ + void setFrameSource(unsigned int frameIndex, const Rectangle& source); + + /** + * Gets the source region from the source image. + * + * @return The source clip region from the source image. + */ + const Rectangle& getFrameSource(unsigned int frameIndex) const; + + /** + * Computes the source frames for sprites with frameCount > 1. + * + * This walks the image starting from the first source region and traverses + * the image moving across the image by the frame stride and then wrapping at the + * edges of the image. + * + * @param frameStride The number of frames to move across before moving down or wrapping to the top. + * @param framePadding The number of pixels used as padding between frame. + */ + void computeFrames(unsigned int frameStride = 0, unsigned int framePadding = 1); + + /** + * Gets the number of frames this sprite can render. + * + * @return The total number of frames this sprite can render. + */ + unsigned int getFrameCount() const; + + /** + * Gets the number of frames to travel across before + * wrapping to the next row or column. + * + * @return The total number of frames this sprite can render. + */ + unsigned int getFrameStride() const; + + /** + * Gets the source padding in pixels around the source region. + * + * @return The source flip flags from the source image. + * @see Sprite::FlipFlags + */ + unsigned int getFramePadding() const; + + /** + * Sets the current frame index to be rendered. + * + * @param index The current frame index to be rendered. + */ + void setFrameIndex(unsigned int frameIndex); + + /** + * Gets the current frame index to be rendered. + * + * @return The current frame index to be rendered. + */ + unsigned int getFrameIndex() const; + + /** + * Sets the opacity for the sprite. + * + * The range is from full transparent to opaque [0.0,1.0]. + * + * @param opacity The opacity for the sprite. + */ + void setOpacity(float opacity); + + /** + * Gets the opacity for the sprite. + * + * The range is from full transparent to opaque [0.0,1.0]. + * + * @preturn The opacity for the sprite. + */ + float getOpacity() const; + + /** + * Sets the color (RGBA) for the sprite. + * + * @param color The color(RGBA) for the sprite. + */ + void setColor(const Vector4& color); + + /** + * Gets the color (RGBA) for the sprite. + * + * @return The color(RGBA) for the sprite. + */ + const Vector4& getColor() const; + + /** + * Sets the blend mode for the sprite. + * + * @param mode The blend mode for the sprite. + * @see Sprite::BlendMode + */ + void setBlendMode(BlendMode mode); + + /** + * Gets the blend mode for the sprite. + * + * @return The blend mode for the sprite. + * @see Sprite::BlendMode + */ + BlendMode getBlendMode() const; + + /** + * Gets the texture sampler. + * + * This return texture sampler is used when sampling the texture in the + * effect. This can be modified for controlling sampler setting such as + * filtering modes. + */ + Texture::Sampler* getSampler() const; + + /** + * Gets the StateBlock for the SpriteBatch. + * + * The returned state block controls the renderer state used when drawing items + * with this sprite batch. Modification can be made to the returned state block + * to change how primitives are rendered. + * + * @return The StateBlock for this SpriteBatch. + */ + RenderState::StateBlock* getStateBlock() const; + + /** + * Gets the material used by this batch. + * + * @return The material. + */ + Material* getMaterial() const; + + /** + * @see Drawable::draw + */ + unsigned int draw(bool wireframe = false); + +protected: + + /** + * Constructor. + */ + Sprite(); + + /** + * Destructor. + */ + ~Sprite(); + + /** + * operator= + */ + Sprite& operator=(const Sprite& sprite); + + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext& context); + + /** + * @see AnimationTarget::getPropertyId + */ + int getPropertyId(TargetType type, const char* propertyIdStr); + + /** + * @see AnimationTarget::getAnimationPropertyComponentCount + */ + unsigned int getAnimationPropertyComponentCount(int propertyId) const; + + /** + * @see AnimationTarget::getAnimationProperty + */ + void getAnimationPropertyValue(int propertyId, AnimationValue* value); + + /** + * @see AnimationTarget::setAnimationProperty + */ + void setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight = 1.0f); + + float _width; + float _height; + Offset _offset; + Vector2 _anchor; + int _flipFlags; + Rectangle* _frames; + unsigned int _frameCount; + unsigned int _frameStride; + unsigned int _framePadding; + unsigned int _frameIndex; + SpriteBatch* _batch; + float _opacity; + Vector4 _color; + BlendMode _blendMode; +}; + +} +#endif diff --git a/gameplay/src/SpriteBatch.cpp b/gameplay/src/SpriteBatch.cpp index cd4aff624d..8716c05396 100644 --- a/gameplay/src/SpriteBatch.cpp +++ b/gameplay/src/SpriteBatch.cpp @@ -58,6 +58,7 @@ SpriteBatch* SpriteBatch::create(const char* texturePath, Effect* effect, unsign SpriteBatch* SpriteBatch::create(Texture* texture, Effect* effect, unsigned int initialCapacity) { GP_ASSERT(texture != NULL); + GP_ASSERT(texture->getType() == Texture::TEXTURE_2D); bool customEffect = (effect != NULL); if (!customEffect) @@ -99,16 +100,15 @@ SpriteBatch* SpriteBatch::create(Texture* texture, Effect* effect, unsigned int } // Wrap the effect in a material - Material* material = Material::create(effect); // +ref effect + Material* material = Material::create(effect); // Set initial material state material->getStateBlock()->setBlend(true); material->getStateBlock()->setBlendSrc(RenderState::BLEND_SRC_ALPHA); material->getStateBlock()->setBlendDst(RenderState::BLEND_ONE_MINUS_SRC_ALPHA); - //material->getStateBlock()->setDepthFunction(RenderState::DEPTH_LEQUAL); // Bind the texture to the material as a sampler - Texture::Sampler* sampler = Texture::Sampler::create(texture); // +ref texture + Texture::Sampler* sampler = Texture::Sampler::create(texture); material->getParameter(samplerUniform->getName())->setValue(sampler); // Define the vertex format for the batch @@ -210,15 +210,18 @@ void SpriteBatch::draw(float x, float y, float z, float width, float height, flo Vector2 downRight(x2, y2); // Rotate points around rotationAxis by rotationAngle. - Vector2 pivotPoint(rotationPoint); - pivotPoint.x *= width; - pivotPoint.y *= height; - pivotPoint.x += x; - pivotPoint.y += y; - upLeft.rotate(pivotPoint, rotationAngle); - upRight.rotate(pivotPoint, rotationAngle); - downLeft.rotate(pivotPoint, rotationAngle); - downRight.rotate(pivotPoint, rotationAngle); + if (rotationAngle != 0) + { + Vector2 pivotPoint(rotationPoint); + pivotPoint.x *= width; + pivotPoint.y *= height; + pivotPoint.x += x; + pivotPoint.y += y; + upLeft.rotate(pivotPoint, rotationAngle); + upRight.rotate(pivotPoint, rotationAngle); + downLeft.rotate(pivotPoint, rotationAngle); + downRight.rotate(pivotPoint, rotationAngle); + } // Write sprite vertex data. static SpriteVertex v[4]; @@ -257,34 +260,34 @@ void SpriteBatch::draw(const Vector3& position, const Vector3& right, const Vect p3 += tForward; // Calculate the rotation point. - Vector3 rp = p0; - tRight = right; - tRight *= width * rotationPoint.x; - tForward *= rotationPoint.y; - rp += tRight; - rp += tForward; - - // Rotate all points the specified amount about the given point (about the up vector). - static Vector3 u; - Vector3::cross(right, forward, &u); - static Matrix rotation; - Matrix::createRotation(u, rotationAngle, &rotation); - - p0 -= rp; - p0 *= rotation; - p0 += rp; - - p1 -= rp; - p1 *= rotation; - p1 += rp; - - p2 -= rp; - p2 *= rotation; - p2 += rp; - - p3 -= rp; - p3 *= rotation; - p3 += rp; + if (rotationAngle != 0) + { + Vector3 rp = p0; + tRight = right; + tRight *= width * rotationPoint.x; + tForward *= rotationPoint.y; + rp += tRight; + rp += tForward; + + // Rotate all points the specified amount about the given point (about the up vector). + static Vector3 u; + Vector3::cross(right, forward, &u); + static Matrix rotation; + Matrix::createRotation(u, rotationAngle, &rotation); + p0 -= rp; + p0 *= rotation; + p0 += rp; + p1 -= rp; + p1 *= rotation; + p1 += rp; + p2 -= rp; + p2 *= rotation; + p2 += rp; + p3 -= rp; + p3 *= rotation; + p3 += rp; + } + // Add the sprite vertex data to the batch. static SpriteVertex v[4]; diff --git a/gameplay/src/SpriteBatch.h b/gameplay/src/SpriteBatch.h index 07ebf774ae..6f36c6f8f4 100644 --- a/gameplay/src/SpriteBatch.h +++ b/gameplay/src/SpriteBatch.h @@ -26,6 +26,7 @@ class SpriteBatch { friend class Bundle; friend class Font; + friend class Text; public: @@ -261,6 +262,34 @@ class SpriteBatch */ void draw(float x, float y, float z, float width, float height, float u1, float v1, float u2, float v2, const Vector4& color, bool positionIsCenter = false); + /** + * Sprite vertex structure used for batching. + */ + struct SpriteVertex + { + float x; + float y; + float z; + float u; + float v; + float r; + float g; + float b; + float a; + }; + + /** + * Draws an array of vertices. + * + * This is for more advanced usage. + * + * @param vertices The vertices to draw. + * @param vertexCount The number of vertices within the vertex array. + * @param indices The vertex indices. + * @param indexCount The number of indices within the index array. + */ + void draw(SpriteBatch::SpriteVertex* vertices, unsigned int vertexCount, unsigned short* indices, unsigned int indexCount); + /** * Finishes sprite drawing. * @@ -317,22 +346,6 @@ class SpriteBatch private: - /** - * Sprite vertex structure used for batching. - */ - struct SpriteVertex - { - float x; - float y; - float z; - float u; - float v; - float r; - float g; - float b; - float a; - }; - /** * Constructor. */ @@ -378,16 +391,6 @@ class SpriteBatch */ void addSprite(float x, float y, float width, float height, float u1, float v1, float u2, float v2, const Vector4& color, const Rectangle& clip, SpriteBatch::SpriteVertex* vertices); - /** - * Draws an array of vertices. - * - * @param vertices The vertices to draw. - * @param vertexCount The number of vertices within the vertex array. - * @param indices The vertex indices. - * @param indexCount The number of indices within the index array. - */ - void draw(SpriteBatch::SpriteVertex* vertices, unsigned int vertexCount, unsigned short* indices, unsigned int indexCount); - /** * Clip position and size to fit within clip region. * diff --git a/gameplay/src/Terrain.cpp b/gameplay/src/Terrain.cpp index 10094a3652..ad4e498c84 100644 --- a/gameplay/src/Terrain.cpp +++ b/gameplay/src/Terrain.cpp @@ -27,8 +27,9 @@ static const unsigned int DIRTY_FLAG_INVERSE_WORLD = 1; static float getDefaultHeight(unsigned int width, unsigned int height); -Terrain::Terrain() : - _heightfield(NULL), _node(NULL), _normalMap(NULL), _flags(FRUSTUM_CULLING | LEVEL_OF_DETAIL), _dirtyFlags(DIRTY_FLAG_INVERSE_WORLD) +Terrain::Terrain() : Drawable(), + _heightfield(NULL), _normalMap(NULL), _flags(FRUSTUM_CULLING | LEVEL_OF_DETAIL), + _dirtyFlags(DIRTY_FLAG_INVERSE_WORLD) { } @@ -259,7 +260,10 @@ Terrain* Terrain::create(HeightField* heightfield, const Vector3& scale, BoundingBox& bounds = terrain->_boundingBox; if (normalMapPath) + { terrain->_normalMap = Texture::Sampler::create(normalMapPath, true); + GP_ASSERT( terrain->_normalMap->getTexture()->getType() == Texture::TEXTURE_2D ); + } float halfWidth = (width - 1) * 0.5f; float halfHeight = (height - 1) * 0.5f; @@ -373,26 +377,22 @@ Terrain* Terrain::create(HeightField* heightfield, const Vector3& scale, void Terrain::setNode(Node* node) { + if (_node != node) { if (_node) - { _node->removeListener(this); - } - _node = node; + Drawable::setNode(node); if (_node) - { _node->addListener(this); - } // Update patch node bindings for (size_t i = 0, count = _patches.size(); i < count; ++i) { _patches[i]->updateNodeBindings(); } - _dirtyFlags |= DIRTY_FLAG_INVERSE_WORLD; } } @@ -409,10 +409,13 @@ const Matrix& Terrain::getInverseWorldMatrix() const _dirtyFlags &= ~DIRTY_FLAG_INVERSE_WORLD; if (_node) + { _inverseWorldMatrix.set(_node->getWorldMatrix()); + } else + { _inverseWorldMatrix = Matrix::identity(); - + } // Apply local scale and invert _inverseWorldMatrix.scale(_localScale); _inverseWorldMatrix.invert(); @@ -438,15 +441,9 @@ bool Terrain::setLayer(int index, const char* texturePath, const Vector2& textur result = false; } } - return result; } -Node* Terrain::getNode() const -{ - return _node; -} - bool Terrain::isFlagSet(Flags flag) const { return (_flags & flag) == flag; @@ -477,7 +474,9 @@ void Terrain::setFlag(Flags flag, bool on) { // Dirty all materials since they need to be updated to support debug drawing for (size_t i = 0, count = _patches.size(); i < count; ++i) + { _patches[i]->setMaterialDirty(); + } } } @@ -539,6 +538,12 @@ unsigned int Terrain::draw(bool wireframe) return visibleCount; } +Drawable* Terrain::clone(NodeCloneContext& context) +{ + // TODO: + return NULL; +} + static float getDefaultHeight(unsigned int width, unsigned int height) { // When terrain height is not specified, we'll use a default height of ~ 0.3 of the image dimensions diff --git a/gameplay/src/Terrain.h b/gameplay/src/Terrain.h index 68769a3f15..ae6ad46219 100644 --- a/gameplay/src/Terrain.h +++ b/gameplay/src/Terrain.h @@ -1,6 +1,8 @@ #ifndef TERRAIN_H_ #define TERRAIN_H_ +#include "Ref.h" +#include "Drawable.h" #include "Transform.h" #include "Properties.h" #include "HeightField.h" @@ -11,7 +13,6 @@ namespace gameplay { -class Node; class TerrainPatch; class TerrainAutoBindingResolver; @@ -80,7 +81,7 @@ class TerrainAutoBindingResolver; * * @see http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-Terrain */ -class Terrain : public Ref, private Transform::Listener +class Terrain : public Ref, public Drawable, private Transform::Listener { friend class Node; friend class PhysicsController; @@ -175,13 +176,6 @@ class Terrain : public Ref, private Transform::Listener unsigned int detailLevels = 1, float skirtScale = 0.0f, const char* normalMapPath = NULL, const char* materialPath = NULL); - /** - * Returns the node that this terrain is bound to. - * - * @return The node this terrain is bound to, or NULL if the terrain is not bound to a node. - */ - Node* getNode() const; - /** * Determines if the specified terrain flag is currently set. */ @@ -229,53 +223,61 @@ class Terrain : public Ref, private Transform::Listener float getHeight(float x, float z) const; /** - * Draws the terrain. + * Sets the detail textures information for a terrain layer. + * + * A detail layer includes a color texture, a repeat count across the terrain for the texture and + * a region of the texture to use. + * + * Optionally, a layer can also include a blend texture, which is used to instruct the terrain how + * to blend the new layer with the layer underneath it. Blend maps use only a single channel of a + * texture and are best supplied by packing the blend map for a layer into the alpha channel of + * the color texture. Blend maps are always stretched over the entire terrain * - * @param wireframe True to draw the terrain as wireframe, false to draw it solid (default). - * @return The number of draw calls taken to drawn the terrain + * The lowest/base layer of the terrain should not include a blend map, since there is no lower + * level to blend with. All other layers should normally include a blend map. However, since no + * blend map will result in the texture completely masking the layer underneath it. + * + * Detail layers can be applied globally (to the entire terrain), or to one or more specific + * patches in the terrain. Patches are specified by row and column number, which is dependent + * on the patch size configuration of your terrain. For layers that span the entire terrain, + * the repeat count is relative to the entire terrain. For layers that span only specific + * patches, the repeat count is relative to those patches only. + * + * @param index Layer index number. Layer indexes do not necessarily need to be sequential and + * are used simply to uniquely identify layers, where higher numbers specify higher-level + * layers. + * @param texturePath Path to the color texture for this layer. + * @param textureRepeat Repeat count for the color texture across the terrain or patches. + * @param blendPath Path to the blend texture for this layer (optional). + * @param blendChannel Channel of the blend texture to sample for the blend map (0 == R, 1 == G, 2 == B, 3 == A). + * @param row Specifies the row index of patches to use this layer (optional, -1 means all rows). + * @param column Specifies the column index of patches to use this layer (optional, -1 means all columns). + * + * @return True if the layer was successfully set, false otherwise. The most common reason for failure is an + * invalid texture path. + * + * @script{ignore} + */ + bool setLayer(int index, const char* texturePath, const Vector2& textureRepeat = Vector2::one(), + const char* blendPath = NULL, int blendChannel = 0, + int row = -1, int column = -1); + + /** + * @see Drawable#draw */ unsigned int draw(bool wireframe = false); +protected: + /** - * Sets the detail textures information for a terrain layer. - * - * A detail layer includes a color texture, a repeat count across the terrain for the texture and - * a region of the texture to use. - * - * Optionally, a layer can also include a blend texture, which is used to instruct the terrain how - * to blend the new layer with the layer underneath it. Blend maps use only a single channel of a - * texture and are best supplied by packing the blend map for a layer into the alpha channel of - * the color texture. Blend maps are always stretched over the entire terrain - * - * The lowest/base layer of the terrain should not include a blend map, since there is no lower - * level to blend with. All other layers should normally include a blend map. However, since no - * blend map will result in the texture completely masking the layer underneath it. - * - * Detail layers can be applied globally (to the entire terrain), or to one or more specific - * patches in the terrain. Patches are specified by row and column number, which is dependent - * on the patch size configuration of your terrain. For layers that span the entire terrain, - * the repeat count is relative to the entire terrain. For layers that span only specific - * patches, the repeat count is relative to those patches only. - * - * @param index Layer index number. Layer indexes do not necessarily need to be sequential and - * are used simply to uniquely identify layers, where higher numbers specify higher-level - * layers. - * @param texturePath Path to the color texture for this layer. - * @param textureRepeat Repeat count for the color texture across the terrain or patches. - * @param blendPath Path to the blend texture for this layer (optional). - * @param blendChannel Channel of the blend texture to sample for the blend map (0 == R, 1 == G, 2 == B, 3 == A). - * @param row Specifies the row index of patches to use this layer (optional, -1 means all rows). - * @param column Specifies the column index of patches to use this layer (optional, -1 means all columns). - * - * @return True if the layer was successfully set, false otherwise. The most common reason for failure is an - * invalid texture path. - * - * @script{ignore} - */ - bool setLayer(int index, - const char* texturePath, const Vector2& textureRepeat = Vector2::one(), - const char* blendPath = NULL, int blendChannel = 0, - int row = -1, int column = -1); + * @see Drawable::setNode + */ + void setNode(Node* node); + + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext& context); private: @@ -311,11 +313,6 @@ class Terrain : public Ref, private Transform::Listener */ static Terrain* create(const char* path, Properties* properties); - /** - * Sets the node that the terrain is attached to. - */ - void setNode(Node* node); - /** * @see Transform::Listener::transformChanged. */ @@ -334,7 +331,6 @@ class Terrain : public Ref, private Transform::Listener std::string _materialPath; HeightField* _heightfield; - Node* _node; Vector3 _localScale; std::vector _patches; Texture::Sampler* _normalMap; diff --git a/gameplay/src/TerrainPatch.cpp b/gameplay/src/TerrainPatch.cpp index 5763fc29e0..a74c58d6f2 100644 --- a/gameplay/src/TerrainPatch.cpp +++ b/gameplay/src/TerrainPatch.cpp @@ -384,6 +384,13 @@ int TerrainPatch::addSampler(const char* path) if (!texture) return -1; + // Textures should only be 2D + if (texture->getType() != Texture::TEXTURE_2D) + { + SAFE_RELEASE(texture); + return -1; + } + int firstAvailableIndex = -1; for (size_t i = 0, count = _samplers.size(); i < count; ++i) { @@ -704,11 +711,13 @@ bool TerrainAutoBindingResolver::resolveAutoBinding(const char* autoBinding, Nod { static TerrainPatch* getPatch(Node* node) { - Terrain* terrain = node->getTerrain(); + Terrain* terrain = dynamic_cast(node->getDrawable()); if (terrain) { if (__currentPatchIndex >= 0 && __currentPatchIndex < (int)terrain->_patches.size()) + { return terrain->_patches[__currentPatchIndex]; + } } return NULL; } @@ -723,7 +732,7 @@ bool TerrainAutoBindingResolver::resolveAutoBinding(const char* autoBinding, Nod } else if (strcmp(autoBinding, "TERRAIN_NORMAL_MAP") == 0) { - Terrain* terrain = node->getTerrain(); + Terrain* terrain = dynamic_cast(node->getDrawable()); if (terrain && terrain->_normalMap) parameter->setValue(terrain->_normalMap); return true; diff --git a/gameplay/src/Text.cpp b/gameplay/src/Text.cpp new file mode 100644 index 0000000000..bb5966af68 --- /dev/null +++ b/gameplay/src/Text.cpp @@ -0,0 +1,341 @@ +#include "Base.h" +#include "Text.h" +#include "Matrix.h" +#include "Scene.h" + +namespace gameplay +{ + +Text::Text() : + _font(NULL), _text(""), _size(0), _width(0), _height(0), _wrap(true), _rightToLeft(false), + _align(Font::ALIGN_TOP_LEFT), _clip(Rectangle(0, 0, 0, 0)), + _opacity(1.0f), _color(Vector4::one()) +{ +} + +Text::~Text() +{ + SAFE_RELEASE(_font); +} + +Text& Text::operator=(const Text& text) +{ + return *this; +} + +Text* Text::create(const char* fontPath, const char* str, const Vector4& color, unsigned int size) +{ + GP_ASSERT(fontPath); + GP_ASSERT(str); + + Font* font = Font::create(fontPath); + + if (size == 0) + { + size = font->_size; + } + else + { + // Delegate to closest sized font + font = font->findClosestSize(size); + size = font->_size; + } + unsigned int widthOut, heightOut; + font->measureText(str, size, &widthOut, &heightOut); + Text* text = new Text(); + text->_font = font; + text->_text = str; + text->_size = size; + text->_width = (float)widthOut + 1; + text->_height = (float)heightOut + 1; + text->_color = color; + + return text; +} + +Text* Text::create(Properties* properties) +{ + // Check if the Properties is valid and has a valid namespace. + if (!properties || strcmp(properties->getNamespace(), "text") != 0) + { + GP_ERROR("Properties object must be non-null and have namespace equal to 'text'."); + return NULL; + } + + // Get font path. + const char* fontPath = properties->getString("font"); + if (fontPath == NULL || strlen(fontPath) == 0) + { + GP_ERROR("Text is missing required font file path."); + return NULL; + } + + // Get text + const char* text = properties->getString("text"); + if (text == NULL || strlen(text) == 0) + { + GP_ERROR("Text is missing required 'text' value."); + return NULL; + } + + // Get size + int size = properties->getInt("size"); // Default return is 0 if a value doesn't exist + if (size < 0) + { + GP_WARN("Text size must be a positive value, with zero being default font size. Using default font size."); + size = 0; + } + + // Get text color + Vector4 color = Vector4::one(); + if (properties->exists("color")) + { + switch (properties->getType("color")) + { + case Properties::VECTOR3: + color.w = 1.0f; + properties->getVector3("color", (Vector3*)&color); + break; + case Properties::VECTOR4: + properties->getVector4("color", &color); + break; + case Properties::STRING: + default: + properties->getColor("color", &color); + break; + } + } + + // Create + return Text::create(fontPath, text, color, size); +} + +void Text::setText(const char* str) +{ + _text = str; +} + +const char* Text::getText() const +{ + return _text.c_str(); +} + +unsigned int Text::getSize() const +{ + return _size; +} + +void Text::setWidth(float width) +{ + _width = width; +} + +float Text::getWidth() const +{ + return _width; +} + +void Text::setHeight(float height) +{ + _height = height; +} + +float Text::getHeight() const +{ + return _height; +} + +void Text::setWrap(bool wrap) +{ + _wrap = wrap; +} + +bool Text::getWrap() const +{ + return _wrap; +} + +void Text::setRightToLeft(bool rightToLeft) +{ + _rightToLeft = rightToLeft; +} + +bool Text::getRightToLeft() const +{ + return _rightToLeft; +} + +void Text::setJustify(Font::Justify align) +{ + _align = align; +} + +Font::Justify Text::getJustify() const +{ + return _align; +} + +void Text::setClip(const Rectangle& clip) +{ + _clip = clip; +} + +const Rectangle& Text::getClip() const +{ + return _clip; +} + +void Text::setOpacity(float opacity) +{ + _opacity = opacity; +} + +float Text::getOpacity() const +{ + return _opacity; +} + +void Text::setColor(const Vector4& color) +{ + _color = color; +} + +const Vector4& Text::getColor() const +{ + return _color; +} + +Drawable* Text::clone(NodeCloneContext& context) +{ + Text* textClone = new Text(); + textClone->_font = _font; + _font->addRef(); + textClone->_text = _text; + textClone->_size = _size; + textClone->_width = _width; + textClone->_height = _height; + textClone->_wrap = _wrap; + textClone->_rightToLeft = _rightToLeft; + textClone->_align = _align; + textClone->_clip = _clip; + textClone->_opacity = _opacity; + textClone->_color = _color; + return textClone; +} + +unsigned int Text::draw(bool wireframe) +{ + // Apply scene camera projection and translation offsets + Rectangle viewport = Game::getInstance()->getViewport(); + Vector3 position = Vector3::zero(); + + // Font is always using a offset projection matrix to top-left. So we need to adjust it back to cartesian + position.x += viewport.width / 2; + position.y += viewport.height / 2; + Rectangle clipViewport = _clip; + if (_node && _node->getScene()) + { + Camera* activeCamera = _node->getScene()->getActiveCamera(); + if (activeCamera) + { + Node* cameraNode = _node->getScene()->getActiveCamera()->getNode(); + if (cameraNode) + { + // Camera translation offsets + position.x -= cameraNode->getTranslationWorld().x; + position.y += cameraNode->getTranslationWorld().y - getHeight(); + } + } + + // Apply node translation offsets + Vector3 translation = _node->getTranslationWorld(); + position.x += translation.x; + position.y -= translation.y; + + if (!clipViewport.isEmpty()) + { + clipViewport.x += position.x; + clipViewport.y += position.y; + } + } + _font->start(); + _font->drawText(_text.c_str(), Rectangle(position.x, position.y, _width, _height), + Vector4(_color.x, _color.y, _color.z, _color.w * _opacity), _size, + _align, _wrap, _rightToLeft, clipViewport); + _font->finish(); + return 1; +} + +int Text::getPropertyId(TargetType type, const char* propertyIdStr) +{ + GP_ASSERT(propertyIdStr); + + if (type == AnimationTarget::TRANSFORM) + { + if (strcmp(propertyIdStr, "ANIMATE_OPACITY") == 0) + { + return Text::ANIMATE_OPACITY; + } + else if (strcmp(propertyIdStr, "ANIMATE_COLOR") == 0) + { + return Text::ANIMATE_COLOR; + } + } + + return AnimationTarget::getPropertyId(type, propertyIdStr); +} + +unsigned int Text::getAnimationPropertyComponentCount(int propertyId) const +{ + switch (propertyId) + { + case ANIMATE_OPACITY: + return 1; + case ANIMATE_COLOR: + return 4; + default: + return -1; + } +} + +void Text::getAnimationPropertyValue(int propertyId, AnimationValue* value) +{ + GP_ASSERT(value); + + switch (propertyId) + { + case ANIMATE_OPACITY: + value->setFloat(0, _opacity); + break; + case ANIMATE_COLOR: + value->setFloat(0, _color.x); + value->setFloat(1, _color.y); + value->setFloat(2, _color.z); + value->setFloat(3, _color.w); + break; + default: + break; + } +} + +void Text::setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight) +{ + GP_ASSERT(value); + + switch(propertyId) + { + case ANIMATE_OPACITY: + setOpacity(Curve::lerp(blendWeight, _opacity, value->getFloat(0))); + break; + case ANIMATE_COLOR: + setColor(Vector4(Curve::lerp(blendWeight, _color.x, value->getFloat(0)), + Curve::lerp(blendWeight, _color.x, value->getFloat(1)), + Curve::lerp(blendWeight, _color.x, value->getFloat(2)), + Curve::lerp(blendWeight, _color.x, value->getFloat(3)))); + break; + default: + break; + } +} + +} diff --git a/gameplay/src/Text.h b/gameplay/src/Text.h new file mode 100644 index 0000000000..f37a692b7a --- /dev/null +++ b/gameplay/src/Text.h @@ -0,0 +1,268 @@ +#ifndef TEXT_H__ +#define TEXT_H__ + +#include "Ref.h" +#include "AnimationTarget.h" +#include "Properties.h" +#include "Font.h" +#include "Vector2.h" +#include "Vector4.h" +#include "Effect.h" +#include "Drawable.h" + +namespace gameplay +{ + +/** + * Defines a text block of characters to be drawn. + * + * Text can be attached to a node. + */ +class Text : public Ref, public Drawable, public AnimationTarget +{ + friend class Node; + +public: + + /** + * Opacity property. Data=opacity + */ + static const int ANIMATE_OPACITY = 1; + + /** + * Color property. Data = red, green, blue, alpha + */ + static const int ANIMATE_COLOR = 2; + + /** + * Creates a Text object from a given string. + * Vertex coordinates, UVs and indices will be computed and stored in the Text object. + * For static text labels that do not change frequently, this means these computations + * need not be performed every frame. + * + * @param fontPath The font path. + * @param str The text string to draw. + * @param color The text color. + * @param size The font size to draw text (0 for default font size). + * + * @return A Text object. + */ + static Text* create(const char* fontPath, const char* str, const Vector4& color = Vector4::one(), unsigned int size = 0); + + /** + * Creates text from a properties object. + * + * @param properties The properties object to load from. + * @return The tile set created. + */ + static Text* create(Properties* properties); + + /** + * Sets the text to be drawn. + * + * @param str The text string to be drawn. + */ + void setText(const char* str); + + /** + * Get the string that will be drawn from this Text object. + * + * @return The text string to be drawn. + */ + const char* getText() const; + + /** + * Gets the size of the text to be drawn. + * + * @return The size of the text to be drawn. + */ + unsigned int getSize() const; + + /** + * Set the width to draw the text within. + * + * @param width The width to draw the text. + */ + void setWidth(float width); + + /** + * Gets the width of the text. + * + * @return The width of the text. + */ + float getWidth() const; + + /** + * Set the height of text to be drawn within. + * + * @param height The height to draw the text. + */ + void setHeight(float height); + + /** + * Gets the width of the text. + * + * @return The overall width of the text. + */ + float getHeight() const; + + /** + * Sets if the the text is wrapped by the text width. + * + * @param wrap true if the the text is wrapped by the text width. + */ + void setWrap(bool wrap); + + /** + * Gets if the the text is wrapped by the text width. + * + * Default is true. + * + * @return true if the the text is wrapped by the text width. + */ + bool getWrap() const; + + /** + * Sets if the text is rendered right-to-left. + * + * @param rightToLeft true if the text is rendered right-to-left, false if left-to-right. + */ + void setRightToLeft(bool rightToLeft); + + /** + * Sets if the text is rendered right-to-left. + * + * Default is false (left-to-right) + * @return rightToLeft true if the text is rendered right-to-left, false if left-to-right. + */ + bool getRightToLeft() const; + + /** + * Sets the justification to align the text within the text bounds. + * + * @param align The text justification alignment. + */ + void setJustify(Font::Justify align); + + /** + * Gets the justification to align the text within the text bounds. + * + * @return The text justification alignment. + */ + Font::Justify getJustify() const; + + /** + * Sets the local clipping region for this text. + * + * This is used for clipping unwanted regions of text. + * + * @param clip The clipping region for this text. + */ + void setClip(const Rectangle& clip); + + /** + * Gets the local clipping region for this text. + * + * This is used for clipping unwanted regions of text. + * + * Default is Rectangle(0, 0, 0, 0) which means no clipping region is applied. + * + * @param clip The clipping region for this text. + */ + const Rectangle& getClip() const; + + /** + * Sets the opacity for the sprite. + * + * The range is from full transparent to opaque [0.0,1.0]. + * + * @param opacity The opacity for the sprite. + */ + void setOpacity(float opacity); + + /** + * Gets the opacity for the sprite. + * + * The range is from full transparent to opaque [0.0,1.0]. + * + * @preturn The opacity for the sprite. + */ + float getOpacity() const; + + /** + * Sets the color (RGBA) for the sprite. + * + * @param color The color(RGBA) for the sprite. + */ + void setColor(const Vector4& color); + + /** + * Gets the color (RGBA) for the sprite. + * + * @return The color(RGBA) for the sprite. + */ + const Vector4& getColor() const; + + /** + * @see Drawable::draw + */ + unsigned int draw(bool wireframe = false); + +protected: + + /** + * Constructor + */ + Text(); + + /** + * Destructor + */ + ~Text(); + + /** + * operator= + */ + Text& operator=(const Text& text); + + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext &context); + + /** + * @see AnimationTarget::getPropertyId + */ + int getPropertyId(TargetType type, const char* propertyIdStr); + + /** + * @see AnimationTarget::getAnimationPropertyComponentCount + */ + unsigned int getAnimationPropertyComponentCount(int propertyId) const; + + /** + * @see AnimationTarget::getAnimationProperty + */ + void getAnimationPropertyValue(int propertyId, AnimationValue* value); + + /** + * @see AnimationTarget::setAnimationProperty + */ + void setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight = 1.0f); + + Font* _font; + std::string _text; + unsigned int _size; + float _width; + float _height; + bool _wrap; + bool _rightToLeft; + Font::Justify _align; + Rectangle _clip; + float _opacity; + Vector4 _color; +}; + +} + +#endif diff --git a/gameplay/src/TextBox.cpp b/gameplay/src/TextBox.cpp index f7e6e25622..bd4758b928 100644 --- a/gameplay/src/TextBox.cpp +++ b/gameplay/src/TextBox.cpp @@ -4,12 +4,7 @@ namespace gameplay { -static bool space(char c) -{ - return isspace(c); -} - -TextBox::TextBox() : _caretLocation(0), _lastKeypress(0), _fontSize(0), _caretImage(NULL), _passwordChar('*'), _inputMode(TEXT), _ctrlPressed(false) +TextBox::TextBox() : _caretLocation(0), _lastKeypress(0), _fontSize(0), _caretImage(NULL), _passwordChar('*'), _inputMode(TEXT), _ctrlPressed(false), _shiftPressed(false) { _canFocus = true; } @@ -43,6 +38,21 @@ void TextBox::initialize(const char* typeName, Theme::Style* style, Properties* } } +const char* TextBox::getTypeName() const +{ + return "TextBox"; +} + +void TextBox::addListener(Control::Listener* listener, int eventFlags) +{ + if ((eventFlags & Control::Listener::VALUE_CHANGED) == Control::Listener::VALUE_CHANGED) + { + GP_ERROR("VALUE_CHANGED event is not applicable to this control."); + } + + Control::addListener(listener, eventFlags); +} + int TextBox::getLastKeypress() { return _lastKeypress; @@ -62,22 +72,18 @@ void TextBox::setCaretLocation(unsigned int index) bool TextBox::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) { - State state = getState(); - - switch (evt) - { - case Touch::TOUCH_PRESS: - if (state == ACTIVE) + if (getState() == ACTIVE) { + switch (evt) { + case Touch::TOUCH_PRESS: setCaretLocation(x, y); - } - break; - case Touch::TOUCH_MOVE: - if (state == ACTIVE) - { + break; + case Touch::TOUCH_MOVE: setCaretLocation(x, y); + break; + default: + break; } - break; } return Label::touchEvent(evt, x, y, contactIndex); @@ -139,6 +145,11 @@ bool TextBox::keyEvent(Keyboard::KeyEvent evt, int key) { switch (key) { + case Keyboard::KEY_SHIFT: + { + _shiftPressed = true; + break; + } case Keyboard::KEY_CTRL: { _ctrlPressed = true; @@ -256,6 +267,11 @@ bool TextBox::keyEvent(Keyboard::KeyEvent evt, int key) return false; default: { + // Insert character into string, only if our font supports this character + if (_shiftPressed && islower(key)) + { + key = toupper(key); + } // Insert character into string, only if our font supports this character if (_font && _font->isCharacterSupported(key)) { @@ -277,6 +293,11 @@ bool TextBox::keyEvent(Keyboard::KeyEvent evt, int key) case Keyboard::KEY_RELEASE: switch (key) { + case Keyboard::KEY_SHIFT: + { + _shiftPressed = false; + break; + } case Keyboard::KEY_CTRL: { _ctrlPressed = false; @@ -303,6 +324,8 @@ void TextBox::controlEvent(Control::Listener::EventType evt) case Control::Listener::FOCUS_LOST: Game::getInstance()->displayKeyboard(false); break; + default: + break; } } @@ -362,7 +385,7 @@ unsigned int TextBox::drawText(Form* form, const Rectangle& clip) SpriteBatch* batch = _font->getSpriteBatch(fontSize); startBatch(form, batch); - _font->drawText(displayedText.c_str(), _textBounds, _textColor, fontSize, getTextAlignment(state), true, getTextRightToLeft(state), &_viewportClipBounds); + _font->drawText(displayedText.c_str(), _textBounds, _textColor, fontSize, getTextAlignment(state), true, getTextRightToLeft(state), _viewportClipBounds); finishBatch(form, batch); return 1; @@ -438,11 +461,6 @@ void TextBox::getCaretLocation(Vector2* p) getFont(state)->getLocationAtIndex(getDisplayedText().c_str(), _textBounds, getFontSize(state), p, _caretLocation, getTextAlignment(state), true, getTextRightToLeft(state)); } -const char* TextBox::getType() const -{ - return "textBox"; -} - void TextBox::setPasswordChar(char character) { _passwordChar = character; diff --git a/gameplay/src/TextBox.h b/gameplay/src/TextBox.h index ad79c76951..f9b808d14f 100644 --- a/gameplay/src/TextBox.h +++ b/gameplay/src/TextBox.h @@ -1,10 +1,8 @@ #ifndef TEXTBOX_H_ #define TEXTBOX_H_ -#include "Base.h" +#include #include "Label.h" -#include "Theme.h" -#include "Keyboard.h" namespace gameplay { @@ -53,6 +51,16 @@ class TextBox : public Label */ static TextBox* create(const char* id, Theme::Style* style = NULL); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * Child controls should override this function to return the correct type name. + * + * @return The type name of this class: "TextBox" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Returns the current location of the caret with the text of this TextBox. * @@ -74,11 +82,6 @@ class TextBox : public Label */ int getLastKeypress(); - /** - * @see Control::getType - */ - const char* getType() const; - /** * Set the character displayed in password mode. * @@ -107,6 +110,8 @@ class TextBox : public Label */ InputMode getInputMode() const; + virtual void addListener(Control::Listener* listener, int eventFlags); + protected: /** @@ -236,6 +241,11 @@ class TextBox : public Label */ bool _ctrlPressed; + /** + * Indicate if the SHIFT key is currently pressed. + */ + bool _shiftPressed = false; + private: /** diff --git a/gameplay/src/Texture.cpp b/gameplay/src/Texture.cpp index 83a5583ce6..3f92012073 100644 --- a/gameplay/src/Texture.cpp +++ b/gameplay/src/Texture.cpp @@ -48,10 +48,11 @@ namespace gameplay { static std::vector __textureCache; -static TextureHandle __currentTextureId; +static TextureHandle __currentTextureId = 0; +static Texture::Type __currentTextureType = Texture::TEXTURE_2D; -Texture::Texture() : _handle(0), _format(UNKNOWN), _width(0), _height(0), _mipmapped(false), _cached(false), _compressed(false), - _wrapS(Texture::REPEAT), _wrapT(Texture::REPEAT), _minFilter(Texture::NEAREST_MIPMAP_LINEAR), _magFilter(Texture::LINEAR) +Texture::Texture() : _handle(0), _format(UNKNOWN), _type((Texture::Type)0), _width(0), _height(0), _mipmapped(false), _cached(false), _compressed(false), + _wrapS(Texture::REPEAT), _wrapT(Texture::REPEAT), _wrapR(Texture::REPEAT), _minFilter(Texture::NEAREST_MIPMAP_LINEAR), _magFilter(Texture::LINEAR) { } @@ -76,13 +77,13 @@ Texture::~Texture() Texture* Texture::create(const char* path, bool generateMipmaps) { - GP_ASSERT(path); + GP_ASSERT( path ); // Search texture cache first. for (size_t i = 0, count = __textureCache.size(); i < count; ++i) { Texture* t = __textureCache[i]; - GP_ASSERT(t); + GP_ASSERT( t ); if (t->_path == path) { // If 'generateMipmaps' is true, call Texture::generateMipamps() to force the @@ -146,7 +147,7 @@ Texture* Texture::create(const char* path, bool generateMipmaps) Texture* Texture::create(Image* image, bool generateMipmaps) { - GP_ASSERT(image); + GP_ASSERT( image ); switch (image->getFormat()) { @@ -160,28 +161,69 @@ Texture* Texture::create(Image* image, bool generateMipmaps) } } -Texture* Texture::create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps) +Texture* Texture::create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps, Texture::Type type) { - // Create and load the texture. + GP_ASSERT( type == Texture::TEXTURE_2D || type == Texture::TEXTURE_CUBE ); + + GLenum target = (GLenum)type; + + // Create the texture. GLuint textureId; GL_ASSERT( glGenTextures(1, &textureId) ); - GL_ASSERT( glBindTexture(GL_TEXTURE_2D, textureId) ); + GL_ASSERT( glBindTexture(target, textureId) ); GL_ASSERT( glPixelStorei(GL_UNPACK_ALIGNMENT, 1) ); #ifndef OPENGL_ES // glGenerateMipmap is new in OpenGL 3.0. For OpenGL 2.0 we must fallback to use glTexParameteri // with GL_GENERATE_MIPMAP prior to actual texture creation (glTexImage2D) - if ( generateMipmaps && glGenerateMipmap == NULL ) - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE) ); + if ( generateMipmaps && !std::addressof(glGenerateMipmap) ) + GL_ASSERT( glTexParameteri(target, GL_GENERATE_MIPMAP, GL_TRUE) ); #endif - GL_ASSERT( glTexImage2D(GL_TEXTURE_2D, 0, (GLenum)format, width, height, 0, (GLenum)format, GL_UNSIGNED_BYTE, data) ); + + // Load the texture + if (type == Texture::TEXTURE_2D) + { + // Texture 2D + GL_ASSERT( glTexImage2D(GL_TEXTURE_2D, 0, (GLenum)format, width, height, 0, (GLenum)format, GL_UNSIGNED_BYTE, data) ); + } + else + { + // Get texture size + unsigned int textureSize = width * height; + switch (format) + { + case Texture::RGB: + textureSize *= 3; + break; + case Texture::RGBA: + textureSize *= 4; + break; + case Texture::ALPHA: + break; + case Texture::UNKNOWN: + if (data) + { + glDeleteTextures(1, &textureId); + GP_ERROR("Failed to determine texture size because format is UNKNOWN."); + return NULL; + } + break; + } + // Texture Cube + for (unsigned int i = 0; i < 6; i++) + { + const unsigned char* texturePtr = (data == NULL) ? NULL : &data[i * textureSize]; + GL_ASSERT( glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, (GLenum)format, width, height, 0, (GLenum)format, GL_UNSIGNED_BYTE, texturePtr) ); + } + } // Set initial minification filter based on whether or not mipmaping was enabled. Filter minFilter = generateMipmaps ? NEAREST_MIPMAP_LINEAR : LINEAR; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilter) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter) ); Texture* texture = new Texture(); texture->_handle = textureId; texture->_format = format; + texture->_type = type; texture->_width = width; texture->_height = height; texture->_minFilter = minFilter; @@ -191,16 +233,33 @@ Texture* Texture::create(Format format, unsigned int width, unsigned int height, } // Restore the texture id - GL_ASSERT( glBindTexture(GL_TEXTURE_2D, __currentTextureId) ); + GL_ASSERT( glBindTexture((GLenum)__currentTextureType, __currentTextureId) ); return texture; } Texture* Texture::create(TextureHandle handle, int width, int height, Format format) { - GP_ASSERT(handle); + GP_ASSERT( handle ); Texture* texture = new Texture(); + if (glIsTexture(handle)) + { + // There is no real way to query for texture type, but an error will be returned if a cube texture is bound to a 2D texture... so check for that + glBindTexture(GL_TEXTURE_CUBE_MAP, handle); + if (glGetError() == GL_NO_ERROR) + { + texture->_type = TEXTURE_CUBE; + } + else + { + // For now, it's either or. But if 3D textures and others are added, it might be useful to simply test a bunch of bindings and seeing which one doesn't error out + texture->_type = TEXTURE_2D; + } + + // Restore the texture id + GL_ASSERT( glBindTexture((GLenum)__currentTextureType, __currentTextureId) ); + } texture->_handle = handle; texture->_format = format; texture->_width = width; @@ -209,6 +268,50 @@ Texture* Texture::create(TextureHandle handle, int width, int height, Format for return texture; } +void Texture::setData(const unsigned char* data) +{ + // Don't work with any compressed or cached textures + GP_ASSERT( data ); + GP_ASSERT( (!_compressed) ); + GP_ASSERT( (!_cached) ); + + GL_ASSERT( glBindTexture((GLenum)_type, _handle) ); + + if (_type == Texture::TEXTURE_2D) + { + GL_ASSERT( glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _width, _height, (GLenum)_format, GL_UNSIGNED_BYTE, data) ); + } + else + { + // Get texture size + unsigned int textureSize = _width * _height; + switch (_format) + { + case Texture::RGB: + textureSize *= 3; + break; + case Texture::RGBA: + textureSize *= 4; + break; + case Texture::ALPHA: + break; + } + // Texture Cube + for (unsigned int i = 0; i < 6; i++) + { + GL_ASSERT( glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, _width, _height, (GLenum)_format, GL_UNSIGNED_BYTE, &data[i * textureSize]) ); + } + } + + if (_mipmapped) + { + generateMipmaps(); + } + + // Restore the texture id + GL_ASSERT( glBindTexture((GLenum)__currentTextureType, __currentTextureId) ); +} + // Computes the size of a PVRTC data chunk for a mipmap level of the given size. static unsigned int computePVRTCDataSize(int width, int height, int bpp) { @@ -234,7 +337,7 @@ static unsigned int computePVRTCDataSize(int width, int height, int bpp) Texture* Texture::createCompressedPVRTC(const char* path) { - std::auto_ptr stream(FileSystem::open(path)); + std::unique_ptr stream(FileSystem::open(path)); if (stream.get() == NULL || !stream->canRead()) { GP_ERROR("Failed to load file '%s'.", path); @@ -263,16 +366,18 @@ Texture* Texture::createCompressedPVRTC(const char* path) GLenum format; GLubyte* data = NULL; unsigned int mipMapCount; + unsigned int faceCount; + GLenum faces[6] = { GL_TEXTURE_2D }; if (version == 0x03525650) { // Modern PVR file format. - data = readCompressedPVRTC(path, stream.get(), &width, &height, &format, &mipMapCount); + data = readCompressedPVRTC(path, stream.get(), &width, &height, &format, &mipMapCount, &faceCount, faces); } else { // Legacy PVR file format. - data = readCompressedPVRTCLegacy(path, stream.get(), &width, &height, &format, &mipMapCount); + data = readCompressedPVRTCLegacy(path, stream.get(), &width, &height, &format, &mipMapCount, &faceCount, faces); } if (data == NULL) { @@ -284,15 +389,17 @@ Texture* Texture::createCompressedPVRTC(const char* path) int bpp = (format == GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG || format == GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG) ? 2 : 4; // Generate our texture. + GLenum target = faceCount > 1 ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D; GLuint textureId; GL_ASSERT( glGenTextures(1, &textureId) ); - GL_ASSERT( glBindTexture(GL_TEXTURE_2D, textureId) ); + GL_ASSERT( glBindTexture(target, textureId) ); Filter minFilter = mipMapCount > 1 ? NEAREST_MIPMAP_LINEAR : LINEAR; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilter) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter) ); Texture* texture = new Texture(); texture->_handle = textureId; + texture->_type = faceCount > 1 ? TEXTURE_CUBE : TEXTURE_2D; texture->_width = width; texture->_height = height; texture->_mipmapped = mipMapCount > 1; @@ -305,28 +412,36 @@ Texture* Texture::createCompressedPVRTC(const char* path) { unsigned int dataSize = computePVRTCDataSize(width, height, bpp); - // Upload data to GL. - GL_ASSERT( glCompressedTexImage2D(GL_TEXTURE_2D, level, format, width, height, 0, dataSize, ptr) ); + for (unsigned int face = 0; face < faceCount; ++face) + { + // Upload data to GL. + GL_ASSERT(glCompressedTexImage2D(faces[face], level, format, width, height, 0, dataSize, &ptr[face * dataSize])); + } width = std::max(width >> 1, 1); height = std::max(height >> 1, 1); - ptr += dataSize; + ptr += dataSize * faceCount; } // Free data. SAFE_DELETE_ARRAY(data); + // Restore the texture id + GL_ASSERT( glBindTexture((GLenum)__currentTextureType, __currentTextureId) ); + return texture; } -GLubyte* Texture::readCompressedPVRTC(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount) +GLubyte* Texture::readCompressedPVRTC(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount, unsigned int* faceCount, GLenum* faces) { - GP_ASSERT(stream); - GP_ASSERT(path); - GP_ASSERT(width); - GP_ASSERT(height); - GP_ASSERT(format); - GP_ASSERT(mipMapCount); + GP_ASSERT( stream ); + GP_ASSERT( path ); + GP_ASSERT( width ); + GP_ASSERT( height ); + GP_ASSERT( format ); + GP_ASSERT( mipMapCount ); + GP_ASSERT( faceCount ); + GP_ASSERT( faces ); struct pvrtc_file_header { @@ -344,6 +459,13 @@ GLubyte* Texture::readCompressedPVRTC(const char* path, Stream* stream, GLsizei* unsigned int metaDataSize; }; + struct pvrtc_metadata + { + char fourCC[4]; + unsigned int key; + unsigned int dataSize; + }; + size_t read; // Read header data. @@ -390,12 +512,78 @@ GLubyte* Texture::readCompressedPVRTC(const char* path, Stream* stream, GLsizei* *width = (GLsizei)header.width; *height = (GLsizei)header.height; *mipMapCount = header.mipMapCount; + *faceCount = std::min(header.faceCount, 6u); - // Skip meta-data. - if (stream->seek(header.metaDataSize, SEEK_CUR) == false) + if ((*faceCount) > 1) { - GP_ERROR("Failed to seek past header meta data in PVR file '%s'.", path); - return NULL; + // Look for cubemap metadata and setup faces + unsigned int remainingMetadata = header.metaDataSize; + pvrtc_metadata mdHeader; + bool foundTextureCubeMeta = false; + while (remainingMetadata > 0) + { + read = stream->read(&mdHeader, sizeof(pvrtc_metadata), 1); + if (read != 1) + { + GP_ERROR("Failed to read PVR metadata header data for file '%s'.", path); + return NULL; + } + remainingMetadata -= sizeof(pvrtc_metadata) + mdHeader.dataSize; + + // Check that it's a known metadata type (specifically, cubemap order), otherwise skip to next metadata + if ((mdHeader.fourCC[0] != 'P') || + (mdHeader.fourCC[1] != 'V') || + (mdHeader.fourCC[2] != 'R') || + (mdHeader.fourCC[3] != 3) || + (mdHeader.key != 2) || // Everything except cubemap order (cubemap order key is 2) + (mdHeader.dataSize != 6)) // Cubemap order datasize should be 6 + { + if (stream->seek(mdHeader.dataSize, SEEK_CUR) == false) + { + GP_ERROR("Failed to seek to next meta data header in PVR file '%s'.", path); + return NULL; + } + continue; + } + + // Get cubemap order + foundTextureCubeMeta = true; + char faceOrder[6]; + read = stream->read(faceOrder, 1, sizeof(faceOrder)); + if (read != sizeof(faceOrder)) + { + GP_ERROR("Failed to read cubemap face order meta data for file '%s'.", path); + return NULL; + } + for (unsigned int face = 0; face < (*faceCount); ++face) + { + faces[face] = GL_TEXTURE_CUBE_MAP_POSITIVE_X + (faceOrder[face] <= 'Z' ? + ((faceOrder[face] - 'X') * 2) : + (((faceOrder[face] - 'x') * 2) + 1)); + if (faces[face] < GL_TEXTURE_CUBE_MAP_POSITIVE_X) + { + // Just overwrite this face + faces[face] = GL_TEXTURE_CUBE_MAP_POSITIVE_X; + } + } + } + if (!foundTextureCubeMeta) + { + // Didn't find cubemap metadata. Just assume it's "in order" + for (unsigned int face = 0; face < (*faceCount); ++face) + { + faces[face] = GL_TEXTURE_CUBE_MAP_POSITIVE_X + face; + } + } + } + else + { + // Skip meta-data. + if (stream->seek(header.metaDataSize, SEEK_CUR) == false) + { + GP_ERROR("Failed to seek past header meta data in PVR file '%s'.", path); + return NULL; + } } // Compute total size of data to be read. @@ -404,7 +592,7 @@ GLubyte* Texture::readCompressedPVRTC(const char* path, Stream* stream, GLsizei* size_t dataSize = 0; for (unsigned int level = 0; level < header.mipMapCount; ++level) { - dataSize += computePVRTCDataSize(w, h, bpp); + dataSize += computePVRTCDataSize(w, h, bpp) * (*faceCount); w = std::max(w>>1, 1); h = std::max(h>>1, 1); } @@ -422,7 +610,7 @@ GLubyte* Texture::readCompressedPVRTC(const char* path, Stream* stream, GLsizei* return data; } -GLubyte* Texture::readCompressedPVRTCLegacy(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount) +GLubyte* Texture::readCompressedPVRTCLegacy(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount, unsigned int* faceCount, GLenum* faces) { char PVRTCIdentifier[] = "PVR!"; @@ -481,13 +669,32 @@ GLubyte* Texture::readCompressedPVRTCLegacy(const char* path, Stream* stream, GL *width = (GLsizei)header.width; *height = (GLsizei)header.height; *mipMapCount = header.mipmapCount + 1; // +1 because mipmapCount does not include the base level + *faceCount = 1; - GLubyte* data = new GLubyte[header.dataSize]; - read = (int)stream->read(data, 1, header.dataSize); - if (read != header.dataSize) + // Flags (needed legacy documentation on format, pre-PVR Format 3.0) + if ((header.formatflags & 0x1000) != 0) + { + // Texture cube + *faceCount = std::min(header.surfaceCount, 6u); + for (unsigned int face = 0; face < (*faceCount); ++face) + { + faces[face] = GL_TEXTURE_CUBE_MAP_POSITIVE_X + face; + } + } + else if ((header.formatflags & 0x4000) != 0) + { + // Volume texture + GP_ERROR("Failed to load pvrtc file '%s': volume texture is not supported.", path); + return NULL; + } + + unsigned int totalSize = header.dataSize; // Docs say dataSize is the size of the whole surface, or one face of a texture cube. But this does not appear to be the case with the latest PVRTexTool + GLubyte* data = new GLubyte[totalSize]; + read = (int)stream->read(data, 1, totalSize); + if (read != totalSize) { - GP_ERROR("Failed to load texture data for pvrtc file '%s'.", path); SAFE_DELETE_ARRAY(data); + GP_ERROR("Failed to load texture data for pvrtc file '%s'.", path); return NULL; } @@ -513,7 +720,7 @@ int Texture::getMaskByteIndex(unsigned int mask) Texture* Texture::createCompressedDDS(const char* path) { - GP_ASSERT(path); + GP_ASSERT( path ); // DDS file structures. struct dds_pixel_format @@ -557,7 +764,7 @@ Texture* Texture::createCompressedDDS(const char* path) Texture* texture = NULL; // Read DDS file. - std::auto_ptr stream(FileSystem::open(path)); + std::unique_ptr stream(FileSystem::open(path)); if (stream.get() == NULL || !stream->canRead()) { GP_ERROR("Failed to open file '%s'.", path); @@ -586,9 +793,32 @@ Texture* Texture::createCompressedDDS(const char* path) header.dwMipMapCount = 1; } + // Check type of images. Default is a regular texture + unsigned int facecount = 1; + GLenum faces[6] = { GL_TEXTURE_2D }; + GLenum target = GL_TEXTURE_2D; + if ((header.dwCaps2 & 0x200/*DDSCAPS2_CUBEMAP*/) != 0) + { + facecount = 0; + for (unsigned int off = 0, flag = 0x400/*DDSCAPS2_CUBEMAP_POSITIVEX*/; off < 6; ++off, flag <<= 1) + { + if ((header.dwCaps2 & flag) != 0) + { + faces[facecount++] = GL_TEXTURE_CUBE_MAP_POSITIVE_X + off; + } + } + target = GL_TEXTURE_CUBE_MAP; + } + else if ((header.dwCaps2 & 0x200000/*DDSCAPS2_VOLUME*/) != 0) + { + // Volume textures unsupported. + GP_ERROR("Failed to create texture from DDS file '%s': volume textures are unsupported.", path); + return NULL; + } + // Allocate mip level structures. - dds_mip_level* mipLevels = new dds_mip_level[header.dwMipMapCount]; - memset(mipLevels, 0, sizeof(dds_mip_level) * header.dwMipMapCount); + dds_mip_level* mipLevels = new dds_mip_level[header.dwMipMapCount * facecount]; + memset(mipLevels, 0, sizeof(dds_mip_level) * header.dwMipMapCount * facecount); GLenum format = 0; GLenum internalFormat = 0; @@ -639,28 +869,34 @@ Texture* Texture::createCompressedDDS(const char* path) return NULL; } - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + for (unsigned int face = 0; face < facecount; ++face) { - dds_mip_level& level = mipLevels[i]; + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + { + dds_mip_level& level = mipLevels[i + face * header.dwMipMapCount]; - level.width = width; - level.height = height; - level.size = std::max(1, (width+3) >> 2) * std::max(1, (height+3) >> 2) * bytesPerBlock; - level.data = new GLubyte[level.size]; + level.width = width; + level.height = height; + level.size = std::max(1, (width + 3) >> 2) * std::max(1, (height + 3) >> 2) * bytesPerBlock; + level.data = new GLubyte[level.size]; - if (stream->read(level.data, 1, level.size) != (unsigned int)level.size) - { - GP_ERROR("Failed to load dds compressed texture bytes for texture: %s", path); + if (stream->read(level.data, 1, level.size) != (unsigned int)level.size) + { + GP_ERROR("Failed to load dds compressed texture bytes for texture: %s", path); + + // Cleanup mip data. + for (unsigned int face = 0; face < facecount; ++face) + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + SAFE_DELETE_ARRAY(mipLevels[i + face * header.dwMipMapCount].data); + SAFE_DELETE_ARRAY(mipLevels); + return texture; + } - // Cleanup mip data. - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) - SAFE_DELETE_ARRAY(level.data); - SAFE_DELETE_ARRAY(mipLevels); - return texture; + width = std::max(1, width >> 1); + height = std::max(1, height >> 1); } - - width = std::max(1, width >> 1); - height = std::max(1, height >> 1); + width = header.dwWidth; + height = header.dwHeight; } } else if (header.ddspf.dwFlags & 0x40/*DDPF_RGB*/) @@ -710,28 +946,34 @@ Texture* Texture::createCompressedDDS(const char* path) } // Read data. - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + for (unsigned int face = 0; face < facecount; ++face) { - dds_mip_level& level = mipLevels[i]; + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + { + dds_mip_level& level = mipLevels[i + face * header.dwMipMapCount]; - level.width = width; - level.height = height; - level.size = width * height * (header.ddspf.dwRGBBitCount >> 3); - level.data = new GLubyte[level.size]; + level.width = width; + level.height = height; + level.size = width * height * (header.ddspf.dwRGBBitCount >> 3); + level.data = new GLubyte[level.size]; - if (stream->read(level.data, 1, level.size) != (unsigned int)level.size) - { - GP_ERROR("Failed to load bytes for RGB dds texture: %s", path); + if (stream->read(level.data, 1, level.size) != (unsigned int)level.size) + { + GP_ERROR("Failed to load bytes for RGB dds texture: %s", path); + + // Cleanup mip data. + for (unsigned int face = 0; face < facecount; ++face) + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + SAFE_DELETE_ARRAY(mipLevels[i + face * header.dwMipMapCount].data); + SAFE_DELETE_ARRAY(mipLevels); + return texture; + } - // Cleanup mip data. - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) - SAFE_DELETE_ARRAY(level.data); - SAFE_DELETE_ARRAY(mipLevels); - return texture; + width = std::max(1, width >> 1); + height = std::max(1, height >> 1); } - - width = std::max(1, width >> 1); - height = std::max(1, height >> 1); + width = header.dwWidth; + height = header.dwHeight; } // Perform color conversion. @@ -746,27 +988,33 @@ Texture* Texture::createCompressedDDS(const char* path) GLubyte *pixel, r, g, b, a; if (format == GL_RGB) { - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + for (unsigned int face = 0; face < facecount; ++face) { - dds_mip_level& level = mipLevels[i]; - for (int j = 0; j < level.size; j += 3) + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) { - pixel = &level.data[j]; - r = pixel[ridx]; g = pixel[gidx]; b = pixel[bidx]; - pixel[0] = r; pixel[1] = g; pixel[2] = b; + dds_mip_level& level = mipLevels[i + face * header.dwMipMapCount]; + for (int j = 0; j < level.size; j += 3) + { + pixel = &level.data[j]; + r = pixel[ridx]; g = pixel[gidx]; b = pixel[bidx]; + pixel[0] = r; pixel[1] = g; pixel[2] = b; + } } } } else if (format == GL_RGBA) { - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + for (unsigned int face = 0; face < facecount; ++face) { - dds_mip_level& level = mipLevels[i]; - for (int j = 0; j < level.size; j += 4) + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) { - pixel = &level.data[j]; - r = pixel[ridx]; g = pixel[gidx]; b = pixel[bidx]; a = pixel[aidx]; - pixel[0] = r; pixel[1] = g; pixel[2] = b; pixel[3] = a; + dds_mip_level& level = mipLevels[i + face * header.dwMipMapCount]; + for (int j = 0; j < level.size; j += 4) + { + pixel = &level.data[j]; + r = pixel[ridx]; g = pixel[gidx]; b = pixel[bidx]; a = pixel[aidx]; + pixel[0] = r; pixel[1] = g; pixel[2] = b; pixel[3] = a; + } } } } @@ -786,14 +1034,15 @@ Texture* Texture::createCompressedDDS(const char* path) // Generate GL texture. GLuint textureId; GL_ASSERT( glGenTextures(1, &textureId) ); - GL_ASSERT( glBindTexture(GL_TEXTURE_2D, textureId) ); + GL_ASSERT( glBindTexture(target, textureId) ); Filter minFilter = header.dwMipMapCount > 1 ? NEAREST_MIPMAP_LINEAR : LINEAR; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilter ) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter ) ); // Create gameplay texture. texture = new Texture(); texture->_handle = textureId; + texture->_type = (Type)target; texture->_width = header.dwWidth; texture->_height = header.dwHeight; texture->_compressed = compressed; @@ -801,25 +1050,32 @@ Texture* Texture::createCompressedDDS(const char* path) texture->_minFilter = minFilter; // Load texture data. - for (unsigned int i = 0; i < header.dwMipMapCount; ++i) + for (unsigned int face = 0; face < facecount; ++face) { - dds_mip_level& level = mipLevels[i]; - if (compressed) - { - GL_ASSERT( glCompressedTexImage2D(GL_TEXTURE_2D, i, format, level.width, level.height, 0, level.size, level.data) ); - } - else + GLenum texImageTarget = faces[face]; + for (unsigned int i = 0; i < header.dwMipMapCount; ++i) { - GL_ASSERT( glTexImage2D(GL_TEXTURE_2D, i, internalFormat, level.width, level.height, 0, format, GL_UNSIGNED_BYTE, level.data) ); - } + dds_mip_level& level = mipLevels[i + face * header.dwMipMapCount]; + if (compressed) + { + GL_ASSERT(glCompressedTexImage2D(texImageTarget, i, format, level.width, level.height, 0, level.size, level.data)); + } + else + { + GL_ASSERT(glTexImage2D(texImageTarget, i, internalFormat, level.width, level.height, 0, format, GL_UNSIGNED_BYTE, level.data)); + } - // Clean up the texture data. - SAFE_DELETE_ARRAY(level.data); + // Clean up the texture data. + SAFE_DELETE_ARRAY(level.data); + } } // Clean up mip levels structure. SAFE_DELETE_ARRAY(mipLevels); + // Restore the texture id + GL_ASSERT( glBindTexture((GLenum)__currentTextureType, __currentTextureId) ); + return texture; } @@ -828,6 +1084,11 @@ Texture::Format Texture::getFormat() const return _format; } +Texture::Type Texture::getType() const +{ + return _type; +} + const char* Texture::getPath() const { return _path.c_str(); @@ -852,12 +1113,16 @@ void Texture::generateMipmaps() { if (!_mipmapped) { - GL_ASSERT( glBindTexture(GL_TEXTURE_2D, _handle) ); + GLenum target = (GLenum)_type; + GL_ASSERT( glBindTexture(target, _handle) ); GL_ASSERT( glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST) ); - if (glGenerateMipmap) - GL_ASSERT( glGenerateMipmap(GL_TEXTURE_2D) ); + if( std::addressof(glGenerateMipmap) ) + GL_ASSERT( glGenerateMipmap(target) ); _mipmapped = true; + + // Restore the texture id + GL_ASSERT( glBindTexture((GLenum)__currentTextureType, __currentTextureId) ); } } @@ -872,9 +1137,9 @@ bool Texture::isCompressed() const } Texture::Sampler::Sampler(Texture* texture) - : _texture(texture), _wrapS(Texture::REPEAT), _wrapT(Texture::REPEAT) + : _texture(texture), _wrapS(Texture::REPEAT), _wrapT(Texture::REPEAT), _wrapR(Texture::REPEAT) { - GP_ASSERT(texture); + GP_ASSERT( texture ); _minFilter = texture->_minFilter; _magFilter = texture->_magFilter; } @@ -886,7 +1151,8 @@ Texture::Sampler::~Sampler() Texture::Sampler* Texture::Sampler::create(Texture* texture) { - GP_ASSERT(texture); + GP_ASSERT( texture ); + GP_ASSERT( texture->_type == Texture::TEXTURE_2D || texture->_type == Texture::TEXTURE_CUBE ); texture->addRef(); return new Sampler(texture); } @@ -897,10 +1163,11 @@ Texture::Sampler* Texture::Sampler::create(const char* path, bool generateMipmap return texture ? new Sampler(texture) : NULL; } -void Texture::Sampler::setWrapMode(Wrap wrapS, Wrap wrapT) +void Texture::Sampler::setWrapMode(Wrap wrapS, Wrap wrapT, Wrap wrapR) { _wrapS = wrapS; _wrapT = wrapT; + _wrapR = wrapR; } void Texture::Sampler::setFilterMode(Filter minificationFilter, Filter magnificationFilter) @@ -916,33 +1183,48 @@ Texture* Texture::Sampler::getTexture() const void Texture::Sampler::bind() { - GP_ASSERT(_texture); + GP_ASSERT( _texture ); - GL_ASSERT( glBindTexture(GL_TEXTURE_2D, _texture->_handle) ); + GLenum target = (GLenum)_texture->_type; + if (__currentTextureId != _texture->_handle) + { + GL_ASSERT( glBindTexture(target, _texture->_handle) ); + __currentTextureId = _texture->_handle; + __currentTextureType = _texture->_type; + } if (_texture->_minFilter != _minFilter) { _texture->_minFilter = _minFilter; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (GLenum)_minFilter) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_MIN_FILTER, (GLenum)_minFilter) ); } if (_texture->_magFilter != _magFilter) { _texture->_magFilter = _magFilter; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLenum)_magFilter) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_MAG_FILTER, (GLenum)_magFilter) ); } if (_texture->_wrapS != _wrapS) { _texture->_wrapS = _wrapS; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (GLenum)_wrapS) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_WRAP_S, (GLenum)_wrapS) ); } if (_texture->_wrapT != _wrapT) { _texture->_wrapT = _wrapT; - GL_ASSERT( glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (GLenum)_wrapT) ); + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_WRAP_T, (GLenum)_wrapT) ); } + +#if defined(GL_TEXTURE_WRAP_R) // OpenGL ES 3.x and up, OpenGL 1.2 and up + if (_texture->_wrapR != _wrapR) + { + _texture->_wrapR = _wrapR; + if (target == GL_TEXTURE_CUBE_MAP) // We don't want to run this on something that we know will fail + GL_ASSERT( glTexParameteri(target, GL_TEXTURE_WRAP_R, (GLenum)_wrapR) ); + } +#endif } } diff --git a/gameplay/src/Texture.h b/gameplay/src/Texture.h index 5e70c5cbab..d87283c5fd 100644 --- a/gameplay/src/Texture.h +++ b/gameplay/src/Texture.h @@ -50,6 +50,28 @@ class Texture : public Ref REPEAT = GL_REPEAT, CLAMP = GL_CLAMP_TO_EDGE }; + + /** + * Defines the type of Texture in use. + */ + enum Type + { + TEXTURE_2D = GL_TEXTURE_2D, + TEXTURE_CUBE = GL_TEXTURE_CUBE_MAP + }; + + /** + * Defines a face of a Texture of Type: cube. + */ + enum CubeFace + { + POSITIVE_X, + NEGATIVE_X, + POSITIVE_Y, + NEGATIVE_Y, + POSITIVE_Z, + NEGATIVE_Z + }; /** * Defines a texture sampler. @@ -96,8 +118,9 @@ class Texture : public Ref * * @param wrapS The horizontal wrap mode. * @param wrapT The vertical wrap mode. + * @param wrapR The depth wrap mode. */ - void setWrapMode(Wrap wrapS, Wrap wrapT); + void setWrapMode(Wrap wrapS, Wrap wrapT, Wrap wrapR = REPEAT); /** * Sets the texture filter modes for this sampler. @@ -134,6 +157,7 @@ class Texture : public Ref Texture* _texture; Wrap _wrapS; Wrap _wrapT; + Wrap _wrapR; Filter _minFilter; Filter _magFilter; }; @@ -169,15 +193,18 @@ class Texture : public Ref * The data in the texture is expected to be tightly packed (no padding at the end of rows). * * @param format Format of the texture data. - * @param width Width of the texture data. - * @param height Height of the texture data. - * @param data Raw texture data (expected to be tightly packed). + * @param width Width of the texture data. If type is TEX_CUBE, then this is the cube face width. + * @param height Height of the texture data. If type is TEX_CUBE, then this is the cube face height. + * @param data Raw texture data (expected to be tightly packed). If the type parameter is set + * to TEXTURE_CUBE, then data is expected to be each face stored back contiguously within the + * array. * @param generateMipmaps True to generate a full mipmap chain, false otherwise. + * @param type What type of Texture should be created. * * @return The new texture. * @script{create} */ - static Texture* create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps = false); + static Texture* create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps = false, Type type = TEXTURE_2D); /** * Creates a texture object to wrap the specified pre-created native texture handle. @@ -199,6 +226,15 @@ class Texture : public Ref */ static Texture* create(TextureHandle handle, int width, int height, Format format = UNKNOWN); + /** + * Set texture data to replace current texture image. + * + * @param data Raw texture data (expected to be tightly packed). If the type parameter is set + * to TEXTURE_CUBE, then data is expected to be each face stored back contiguously within the + * array. + */ + void setData(const unsigned char* data); + /** * Returns the path that the texture was originally loaded from (if applicable). * @@ -213,6 +249,13 @@ class Texture : public Ref */ Format getFormat() const; + /** + * Gets the texture type. + * + * @return The texture type. + */ + Type getType() const; + /** * Gets the texture width. * @@ -277,15 +320,16 @@ class Texture : public Ref static Texture* createCompressedDDS(const char* path); - static GLubyte* readCompressedPVRTC(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount); + static GLubyte* readCompressedPVRTC(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount, unsigned int* faceCount, GLenum faces[6]); - static GLubyte* readCompressedPVRTCLegacy(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount); + static GLubyte* readCompressedPVRTCLegacy(const char* path, Stream* stream, GLsizei* width, GLsizei* height, GLenum* format, unsigned int* mipMapCount, unsigned int* faceCount, GLenum faces[6]); static int getMaskByteIndex(unsigned int mask); std::string _path; TextureHandle _handle; Format _format; + Type _type; unsigned int _width; unsigned int _height; bool _mipmapped; @@ -293,6 +337,7 @@ class Texture : public Ref bool _compressed; Wrap _wrapS; Wrap _wrapT; + Wrap _wrapR; Filter _minFilter; Filter _magFilter; }; diff --git a/gameplay/src/Theme.cpp b/gameplay/src/Theme.cpp index 1b747f915b..18f2b6d6ec 100644 --- a/gameplay/src/Theme.cpp +++ b/gameplay/src/Theme.cpp @@ -72,8 +72,6 @@ Theme* Theme::getDefault() if (!__defaultTheme) { - GP_WARN("No default theme detected."); - // Create an empty theme so that UI's with no theme don't just crash __defaultTheme = new Theme(); unsigned int color = 0x00000000; diff --git a/gameplay/src/TileSet.cpp b/gameplay/src/TileSet.cpp new file mode 100644 index 0000000000..668f41770d --- /dev/null +++ b/gameplay/src/TileSet.cpp @@ -0,0 +1,296 @@ +#include "Base.h" +#include "TileSet.h" +#include "Matrix.h" +#include "Scene.h" + +namespace gameplay +{ + +TileSet::TileSet() : Drawable(), + _tiles(NULL), _tileWidth(0), _tileHeight(0), + _rowCount(0), _columnCount(0), _width(0), _height(0), + _opacity(1.0f), _color(Vector4::one()), _batch(NULL) +{ +} + +TileSet::~TileSet() +{ + SAFE_DELETE_ARRAY(_tiles); + SAFE_DELETE(_batch); +} + +TileSet& TileSet::operator=(const TileSet& set) +{ + return *this; +} + +TileSet* TileSet::create(const char* imagePath, + float tileWidth, float tileHeight, + unsigned int rowCount, unsigned int columnCount) +{ + GP_ASSERT(imagePath); + GP_ASSERT(tileWidth > 0 && tileHeight > 0); + GP_ASSERT(rowCount > 0 && columnCount > 0); + + SpriteBatch* batch = SpriteBatch::create(imagePath); + batch->getSampler()->setWrapMode(Texture::CLAMP, Texture::CLAMP); + batch->getSampler()->setFilterMode(Texture::Filter::NEAREST, Texture::Filter::NEAREST); + batch->getStateBlock()->setDepthWrite(false); + batch->getStateBlock()->setDepthTest(true); + + TileSet* tileset = new TileSet(); + tileset->_batch = batch; + tileset->_tiles = new Vector2[rowCount * columnCount]; + memset(tileset->_tiles, -1, sizeof(float) * rowCount * columnCount * 2); + tileset->_tileWidth = tileWidth; + tileset->_tileHeight = tileHeight; + tileset->_rowCount = rowCount; + tileset->_columnCount = columnCount; + tileset->_width = tileWidth * columnCount; + tileset->_height = tileHeight * rowCount; + return tileset; +} + +TileSet* TileSet::create(Properties* properties) +{ + // Check if the Properties is valid and has a valid namespace. + if (!properties || strcmp(properties->getNamespace(), "tileset") != 0) + { + GP_ERROR("Properties object must be non-null and have namespace equal to 'tileset'."); + return NULL; + } + + // Get image path. + const char* imagePath = properties->getString("path"); + if (imagePath == NULL || strlen(imagePath) == 0) + { + GP_ERROR("TileSet is missing required image file path."); + return NULL; + } + + // Get set size + int rows = properties->getInt("rows"); + if (rows <= 0) + { + GP_ERROR("TileSet row count must be greater then zero."); + return NULL; + } + int columns = properties->getInt("columns"); + if (columns <= 0) + { + GP_ERROR("TileSet column count must be greater then zero."); + return NULL; + } + + // Get tile size + float tileWidth = properties->getFloat("tileWidth"); + if (tileWidth <= 0) + { + GP_ERROR("TileSet tile width must be greater then zero."); + return NULL; + } + float tileHeight = properties->getFloat("tileHeight"); + if (tileHeight <= 0) + { + GP_ERROR("TileSet tile height must be greater then zero."); + return NULL; + } + + // Create tile set + TileSet* set = TileSet::create(imagePath, tileWidth, tileHeight, rows, columns); + + // Get color + if (properties->exists("color")) + { + Vector4 color; + switch (properties->getType("color")) + { + case Properties::VECTOR3: + color.w = 1.0f; + properties->getVector3("color", (Vector3*)&color); + break; + case Properties::VECTOR4: + properties->getVector4("color", &color); + break; + case Properties::STRING: + default: + properties->getColor("color", &color); + break; + } + set->setColor(color); + } + + // Get opacity + if (properties->exists("opacity")) + { + set->setOpacity(properties->getFloat("opacity")); + } + + // Get tile sources + properties->rewind(); + Properties* tileProperties = NULL; + while ((tileProperties = properties->getNextNamespace())) + { + if (strcmp(tileProperties->getNamespace(), "tile") == 0) + { + Vector2 cell; + Vector2 source; + if (tileProperties->getVector2("cell", &cell) && tileProperties->getVector2("source", &source) && + (cell.x > 0 && cell.y > 0 && cell.x < set->_columnCount && cell.y < set->_rowCount)) + { + set->_tiles[(int)cell.y * set->_columnCount + (int)cell.x] = source; + } + } + } + + return set; +} + +void TileSet::setTileSource(unsigned int column, unsigned int row, const Vector2& source) +{ + GP_ASSERT(column < _columnCount); + GP_ASSERT(row < _rowCount); + + _tiles[row * _columnCount + column] = source; +} + +void TileSet::getTileSource(unsigned int column, unsigned int row, Vector2* source) +{ + GP_ASSERT(column < _columnCount); + GP_ASSERT(row < _rowCount); + GP_ASSERT(source); + + source->x = _tiles[row * _columnCount + column].x; + source->y = _tiles[row * _columnCount + column].y; +} + +float TileSet::getTileWidth() const +{ + return _tileWidth; +} + +float TileSet::getTileHeight() const +{ + return _tileHeight; +} + +unsigned int TileSet::getRowCount() const +{ + return _rowCount; +} + +unsigned int TileSet::getColumnCount() const +{ + return _columnCount; +} + +float TileSet::getWidth() const +{ + return _width; +} + +float TileSet::getHeight() const +{ + return _height; +} + +void TileSet::setOpacity(float opacity) +{ + _opacity = opacity; +} + +float TileSet::getOpacity() const +{ + return _opacity; +} + +void TileSet::setColor(const Vector4& color) +{ + _color = color; +} + +const Vector4& TileSet::getColor() const +{ + return _color; +} + +unsigned int TileSet::draw(bool wireframe) +{ + // Apply scene camera projection and translation offsets + Vector3 position = Vector3::zero(); + if (_node && _node->getScene()) + { + Camera* activeCamera = _node->getScene()->getActiveCamera(); + if (activeCamera) + { + Node* cameraNode = _node->getScene()->getActiveCamera()->getNode(); + if (cameraNode) + { + // Scene projection + Matrix projectionMatrix; + projectionMatrix = _node->getProjectionMatrix(); + _batch->setProjectionMatrix(projectionMatrix); + + position.x -= cameraNode->getTranslationWorld().x; + position.y -= cameraNode->getTranslationWorld().y; + } + } + + // Apply node translation offsets + Vector3 translation = _node->getTranslationWorld(); + position.x += translation.x; + position.y += translation.y; + position.z += translation.z; + } + + // Draw each cell in the tile set + position.y += _tileHeight * (_rowCount - 1); + float xStart = position.x; + _batch->start(); + for (unsigned int row = 0; row < _rowCount; row++) + { + for (unsigned int col = 0; col < _columnCount; col++) + { + Vector2 scale = Vector2(_tileWidth, _tileHeight); + + // Negative values are skipped to allow blank tiles + if (_tiles[row * _columnCount + col].x >= 0 && + _tiles[row * _columnCount + col].y >= 0) + { + Rectangle source = Rectangle(_tiles[row * _columnCount + col].x, + _tiles[row * _columnCount + col].y, _tileWidth, _tileHeight); + _batch->draw(position, source, scale, Vector4(_color.x, _color.y, _color.z, _color.w * _opacity), + Vector2(0.5f, 0.5f), 0); + } + + position.x += _tileWidth; + } + position.x = xStart; + position.y -= _tileHeight; + } + _batch->finish(); + return 1; +} + +Drawable* TileSet::clone(NodeCloneContext& context) +{ + TileSet* tilesetClone = new TileSet(); + + // Clone properties + tilesetClone->_tiles = new Vector2[tilesetClone->_rowCount * tilesetClone->_columnCount]; + memset(tilesetClone->_tiles, -1, sizeof(float) * tilesetClone->_rowCount * tilesetClone->_columnCount * 2); + memcpy(tilesetClone->_tiles, _tiles, sizeof(Vector2) * tilesetClone->_rowCount * tilesetClone->_columnCount); + tilesetClone->_tileWidth = _tileWidth; + tilesetClone->_tileHeight = _tileHeight; + tilesetClone->_rowCount = _rowCount; + tilesetClone->_columnCount = _columnCount; + tilesetClone->_width = _tileWidth * _columnCount; + tilesetClone->_height = _tileHeight * _rowCount; + tilesetClone->_opacity = _opacity; + tilesetClone->_color = _color; + tilesetClone->_batch = _batch; + + return tilesetClone; +} + +} diff --git a/gameplay/src/TileSet.h b/gameplay/src/TileSet.h new file mode 100644 index 0000000000..5d4c4cd606 --- /dev/null +++ b/gameplay/src/TileSet.h @@ -0,0 +1,190 @@ +#ifndef TILESET_H__ +#define TILESET_H__ + +#include "Ref.h" +#include "Drawable.h" +#include "Properties.h" +#include "Vector2.h" +#include "Vector4.h" +#include "SpriteBatch.h" +#include "Effect.h" + +namespace gameplay +{ + +/** + * Defines a grid of tiles for rendering a 2D planer region. + * + * The UVs are sourced from the texture atlas image. + * The columns(x) and rows(y) are set individually for each + * in the tile set. Specifying a source (x,y) of -1, -1 will allow + * for tiles in the set to be empty. + * The size of all the tiles must be equal to the tileWidth/tileHeight + * provided. + * + * To avoid seams in the tiles the tile should be padded with + * a gutter of duplicate pixels on each side of the region. + * + * The tile set does not support rotation or scaling. + */ +class TileSet : public Ref, public Drawable +{ + friend class Node; + +public: + + /** + * Creates a tile set. + * + * @param imagePath The path to the image to create the sprite from. + * @param tileWidth The width of each tile in the tile set. + * @param tileHeight The height of each tile in the tile set. + * @param rowCount The number of tile rows. + * @param columnCount The number of tile columns. + * @return The tile set created. + */ + static TileSet* create(const char* imagePath, float tileWidth, float tileHeight, + unsigned int rowCount, unsigned int columnCount); + + /** + * Creates a tile set from a properties object. + * + * @param properties The properties object to load from. + * @return The tile set created. + */ + static TileSet* create(Properties* properties); + + /** + * Sets the tile source location for the specified column and row. + * + * @param column The column to set the source for. + * @param row The row to set the source for. + * @param source The source top-left corner where the tile is positioned. + */ + void setTileSource(unsigned int column, unsigned int row, const Vector2& source); + + /** + * Gets the source clip region and flip flags for the specified column and row. + * + * @param column The column to get the source clip region and flip flags for. + * @param row The row to specify the source clip region and flip flags for. + * @param source The source region to be returned back. + * @see Sprite::FlipFlags + */ + void getTileSource(unsigned int column, unsigned int row, Vector2* source); + + /** + * Gets the width of each tile in the tile set. + * + * @return The width of each tile in the tile set. + */ + float getTileWidth() const; + + /** + * Gets the height of each tile in the tile set. + * + * @return The height of each tile in the tile set. + */ + float getTileHeight() const; + + /** + * Gets the number of tile rows. + * + * @return The number of tile rows. + */ + unsigned int getRowCount() const; + + /** + * Gets the number of tile columns. + * + * @return The number of tile columns. + */ + unsigned int getColumnCount() const; + + /** + * Gets the overall width of the tileset. + * + * @return The overall width of the tileset. + */ + float getWidth() const; + + /** + * Gets the overall width of the tileset. + * + * @return The overall width of the tileset. + */ + float getHeight() const; + + /** + * Sets the opacity for the sprite. + * + * The range is from full transparent to opaque [0.0,1.0]. + * + * @param opacity The opacity for the sprite. + */ + void setOpacity(float opacity); + + /** + * Gets the opacity for the sprite. + * + * The range is from full transparent to opaque [0.0,1.0]. + * + * @preturn The opacity for the sprite. + */ + float getOpacity() const; + + /** + * Sets the color (RGBA) for the sprite. + * + * @param color The color(RGBA) for the sprite. + */ + void setColor(const Vector4& color); + + /** + * Gets the color (RGBA) for the sprite. + * + * @return The color(RGBA) for the sprite. + */ + const Vector4& getColor() const; + + /** + * @see Drawable::draw + */ + unsigned int draw(bool wireframe = false); + +protected: + /** + * Constructor + */ + TileSet(); + + /** + * Destructor + */ + ~TileSet(); + + /** + * operator= + */ + TileSet& operator=(const TileSet& set); + + /** + * @see Drawable::clone + */ + Drawable* clone(NodeCloneContext &context); + + Vector2* _tiles; + float _tileWidth; + float _tileHeight; + unsigned int _rowCount; + unsigned int _columnCount; + float _width; + float _height; + SpriteBatch* _batch; + float _opacity; + Vector4 _color; +}; + +} + +#endif diff --git a/gameplay/src/Transform.cpp b/gameplay/src/Transform.cpp index 5b6618829d..6bd713bb2e 100644 --- a/gameplay/src/Transform.cpp +++ b/gameplay/src/Transform.cpp @@ -12,33 +12,37 @@ std::vector Transform::_transformsChanged; Transform::Transform() : _matrixDirtyBits(0), _listeners(NULL) { + GP_REGISTER_SCRIPT_EVENTS(); + _targetType = AnimationTarget::TRANSFORM; _scale.set(Vector3::one()); - addScriptEvent("transformChanged", ""); } Transform::Transform(const Vector3& scale, const Quaternion& rotation, const Vector3& translation) : _matrixDirtyBits(0), _listeners(NULL) { + GP_REGISTER_SCRIPT_EVENTS(); + _targetType = AnimationTarget::TRANSFORM; set(scale, rotation, translation); - addScriptEvent("transformChanged", ""); } Transform::Transform(const Vector3& scale, const Matrix& rotation, const Vector3& translation) : _matrixDirtyBits(0), _listeners(NULL) { + GP_REGISTER_SCRIPT_EVENTS(); + _targetType = AnimationTarget::TRANSFORM; set(scale, rotation, translation); - addScriptEvent("transformChanged", ""); } Transform::Transform(const Transform& copy) : _matrixDirtyBits(0), _listeners(NULL) { + GP_REGISTER_SCRIPT_EVENTS(); + _targetType = AnimationTarget::TRANSFORM; set(copy); - addScriptEvent("transformChanged", ""); } Transform::~Transform() @@ -88,6 +92,11 @@ bool Transform::isTransformChangedSuspended() return (_suspendTransformChanged > 0); } +const char* Transform::getTypeName() const +{ + return "Transform"; +} + const Matrix& Transform::getMatrix() const { if (_matrixDirtyBits) @@ -991,7 +1000,7 @@ void Transform::transformChanged() l.listener->transformChanged(this, l.cookie); } } - fireScriptEvent("transformChanged", this); + fireScriptEvent(GP_GET_SCRIPT_EVENT(Transform, transformChanged), dynamic_cast(this)); } void Transform::cloneInto(Transform* transform, NodeCloneContext &context) const diff --git a/gameplay/src/Transform.h b/gameplay/src/Transform.h index 6dd29a8ac5..946d897811 100644 --- a/gameplay/src/Transform.h +++ b/gameplay/src/Transform.h @@ -1,12 +1,11 @@ #ifndef TRANSFORM_H_ #define TRANSFORM_H_ -#include "Ref.h" +#include "ScriptTarget.h" #include "Vector3.h" #include "Quaternion.h" #include "Matrix.h" #include "AnimationTarget.h" -#include "ScriptTarget.h" namespace gameplay { @@ -31,6 +30,10 @@ class ScriptListener; */ class Transform : public AnimationTarget, public ScriptTarget { + GP_SCRIPT_EVENTS_START(); + GP_SCRIPT_EVENT(transformChanged, ""); + GP_SCRIPT_EVENTS_END(); + public: /** @@ -173,6 +176,14 @@ class Transform : public AnimationTarget, public ScriptTarget */ virtual ~Transform(); + /** + * Extends ScriptTarget::getTypeName() to return the type name of this class. + * + * @return The type name of this class: "Transform" + * @see ScriptTarget::getTypeName() + */ + const char* getTypeName() const; + /** * Gets the matrix corresponding to this transform. * diff --git a/gameplay/src/VertexAttributeBinding.cpp b/gameplay/src/VertexAttributeBinding.cpp index 74c8503832..09d2201f75 100644 --- a/gameplay/src/VertexAttributeBinding.cpp +++ b/gameplay/src/VertexAttributeBinding.cpp @@ -89,7 +89,7 @@ VertexAttributeBinding* VertexAttributeBinding::create(Mesh* mesh, const VertexF // Create a new VertexAttributeBinding. VertexAttributeBinding* b = new VertexAttributeBinding(); -#ifdef USE_VAO +#ifdef GP_USE_VAO if (mesh && glGenVertexArrays) { GL_ASSERT( glBindBuffer(GL_ARRAY_BUFFER, 0) ); diff --git a/gameplay/src/gameplay-main-blackberry.cpp b/gameplay/src/gameplay-main-blackberry.cpp deleted file mode 100644 index 085ef8b2c1..0000000000 --- a/gameplay/src/gameplay-main-blackberry.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifdef __QNX__ - -#include "gameplay.h" - -using namespace gameplay; - -extern int __argc; -extern char** __argv; - -/** - * Main entry point. - */ -int main(int argc, char** argv) -{ - __argc = argc; - __argv = argv; - Game* game = Game::getInstance(); - Platform* platform = Platform::create(game); - GP_ASSERT(platform); - int result = platform->enterMessagePump(); - delete platform; - return result; -} - -#endif diff --git a/gameplay/src/gameplay.h b/gameplay/src/gameplay.h index 47da1b6f32..2652b372a5 100644 --- a/gameplay/src/gameplay.h +++ b/gameplay/src/gameplay.h @@ -28,8 +28,8 @@ #include "Curve.h" // Graphics -#include "Texture.h" #include "Image.h" +#include "Texture.h" #include "Mesh.h" #include "MeshPart.h" #include "Effect.h" @@ -37,6 +37,7 @@ #include "RenderState.h" #include "VertexFormat.h" #include "VertexAttributeBinding.h" +#include "Drawable.h" #include "Model.h" #include "Camera.h" #include "Light.h" @@ -45,6 +46,9 @@ #include "Scene.h" #include "Font.h" #include "SpriteBatch.h" +#include "Sprite.h" +#include "Text.h" +#include "TileSet.h" #include "ParticleEmitter.h" #include "FrameBuffer.h" #include "RenderTarget.h" @@ -54,7 +58,6 @@ #include "Terrain.h" #include "TerrainPatch.h" - // Audio #include "AudioController.h" #include "AudioListener.h" diff --git a/gameplay/src/lua/lua_AIAgent.cpp b/gameplay/src/lua/lua_AIAgent.cpp index d3ead6416c..4083b01806 100644 --- a/gameplay/src/lua/lua_AIAgent.cpp +++ b/gameplay/src/lua/lua_AIAgent.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIAgent.h" @@ -6,8 +7,6 @@ #include "Game.h" #include "Node.h" #include "Ref.h" -#include "ScriptController.h" -#include "ScriptTarget.h" namespace gameplay { @@ -17,14 +16,12 @@ void luaRegister_AIAgent() const luaL_Reg lua_members[] = { {"addRef", lua_AIAgent_addRef}, - {"addScriptCallback", lua_AIAgent_addScriptCallback}, {"getId", lua_AIAgent_getId}, {"getNode", lua_AIAgent_getNode}, {"getRefCount", lua_AIAgent_getRefCount}, {"getStateMachine", lua_AIAgent_getStateMachine}, {"isEnabled", lua_AIAgent_isEnabled}, {"release", lua_AIAgent_release}, - {"removeScriptCallback", lua_AIAgent_removeScriptCallback}, {"setEnabled", lua_AIAgent_setEnabled}, {"setListener", lua_AIAgent_setListener}, {NULL, NULL} @@ -116,46 +113,6 @@ int lua_AIAgent_addRef(lua_State* state) return 0; } -int lua_AIAgent_addScriptCallback(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 3: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); - - // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); - - AIAgent* instance = getInstance(state); - instance->addScriptCallback(param1, param2); - - return 0; - } - - lua_pushstring(state, "lua_AIAgent_addScriptCallback - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 3)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_AIAgent_getId(lua_State* state) { // Get the number of parameters. @@ -204,7 +161,7 @@ int lua_AIAgent_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AIAgent* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -283,7 +240,7 @@ int lua_AIAgent_getStateMachine(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AIAgent* instance = getInstance(state); - void* returnPtr = (void*)instance->getStateMachine(); + void* returnPtr = ((void*)instance->getStateMachine()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -381,46 +338,6 @@ int lua_AIAgent_release(lua_State* state) return 0; } -int lua_AIAgent_removeScriptCallback(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 3: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); - - // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); - - AIAgent* instance = getInstance(state); - instance->removeScriptCallback(param1, param2); - - return 0; - } - - lua_pushstring(state, "lua_AIAgent_removeScriptCallback - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 3)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_AIAgent_setEnabled(lua_State* state) { // Get the number of parameters. @@ -509,7 +426,7 @@ int lua_AIAgent_static_create(lua_State* state) { case 0: { - void* returnPtr = (void*)AIAgent::create(); + void* returnPtr = ((void*)AIAgent::create()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AIAgent.h b/gameplay/src/lua/lua_AIAgent.h index 9b76ca8002..6c7fe83be8 100644 --- a/gameplay/src/lua/lua_AIAgent.h +++ b/gameplay/src/lua/lua_AIAgent.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AIAGENT_H_ #define LUA_AIAGENT_H_ @@ -7,14 +8,12 @@ namespace gameplay // Lua bindings for AIAgent. int lua_AIAgent__gc(lua_State* state); int lua_AIAgent_addRef(lua_State* state); -int lua_AIAgent_addScriptCallback(lua_State* state); int lua_AIAgent_getId(lua_State* state); int lua_AIAgent_getNode(lua_State* state); int lua_AIAgent_getRefCount(lua_State* state); int lua_AIAgent_getStateMachine(lua_State* state); int lua_AIAgent_isEnabled(lua_State* state); int lua_AIAgent_release(lua_State* state); -int lua_AIAgent_removeScriptCallback(lua_State* state); int lua_AIAgent_setEnabled(lua_State* state); int lua_AIAgent_setListener(lua_State* state); int lua_AIAgent_static_create(lua_State* state); diff --git a/gameplay/src/lua/lua_AIAgentListener.cpp b/gameplay/src/lua/lua_AIAgentListener.cpp index f892f9a519..566044cb93 100644 --- a/gameplay/src/lua/lua_AIAgentListener.cpp +++ b/gameplay/src/lua/lua_AIAgentListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIAgentListener.h" @@ -6,8 +7,6 @@ #include "Game.h" #include "Node.h" #include "Ref.h" -#include "ScriptController.h" -#include "ScriptTarget.h" namespace gameplay { diff --git a/gameplay/src/lua/lua_AIAgentListener.h b/gameplay/src/lua/lua_AIAgentListener.h index 4e268d88a9..4a0960ec69 100644 --- a/gameplay/src/lua/lua_AIAgentListener.h +++ b/gameplay/src/lua/lua_AIAgentListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AIAGENTLISTENER_H_ #define LUA_AIAGENTLISTENER_H_ diff --git a/gameplay/src/lua/lua_AIController.cpp b/gameplay/src/lua/lua_AIController.cpp index 4f1b41df63..69de6aee9e 100644 --- a/gameplay/src/lua/lua_AIController.cpp +++ b/gameplay/src/lua/lua_AIController.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIController.h" @@ -46,7 +47,7 @@ int lua_AIController_findAgent(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); AIController* instance = getInstance(state); - void* returnPtr = (void*)instance->findAgent(param1); + void* returnPtr = ((void*)instance->findAgent(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AIController.h b/gameplay/src/lua/lua_AIController.h index 344e9e9d11..ce93ba3e4c 100644 --- a/gameplay/src/lua/lua_AIController.h +++ b/gameplay/src/lua/lua_AIController.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AICONTROLLER_H_ #define LUA_AICONTROLLER_H_ diff --git a/gameplay/src/lua/lua_AIMessage.cpp b/gameplay/src/lua/lua_AIMessage.cpp index 77b8663bc4..f86cd1ab56 100644 --- a/gameplay/src/lua/lua_AIMessage.cpp +++ b/gameplay/src/lua/lua_AIMessage.cpp @@ -1,9 +1,9 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIMessage.h" #include "AIMessage.h" #include "Base.h" -#include "lua_AIMessageParameterType.h" namespace gameplay { @@ -334,7 +334,7 @@ int lua_AIMessage_getParameterType(lua_State* state) AIMessage::ParameterType result = instance->getParameterType(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_AIMessageParameterType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -729,7 +729,7 @@ int lua_AIMessage_static_create(lua_State* state) // Get parameter 4 off the stack. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 4); - void* returnPtr = (void*)AIMessage::create(param1, param2, param3, param4); + void* returnPtr = ((void*)AIMessage::create(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AIMessage.h b/gameplay/src/lua/lua_AIMessage.h index fd49a808a3..08cea42d11 100644 --- a/gameplay/src/lua/lua_AIMessage.h +++ b/gameplay/src/lua/lua_AIMessage.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AIMESSAGE_H_ #define LUA_AIMESSAGE_H_ diff --git a/gameplay/src/lua/lua_AIMessageParameterType.cpp b/gameplay/src/lua/lua_AIMessageParameterType.cpp deleted file mode 100644 index 6fb25f60fb..0000000000 --- a/gameplay/src/lua/lua_AIMessageParameterType.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "Base.h" -#include "lua_AIMessageParameterType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_AIMessageParameterType_UNDEFINED = "UNDEFINED"; -static const char* luaEnumString_AIMessageParameterType_INTEGER = "INTEGER"; -static const char* luaEnumString_AIMessageParameterType_LONG = "LONG"; -static const char* luaEnumString_AIMessageParameterType_FLOAT = "FLOAT"; -static const char* luaEnumString_AIMessageParameterType_DOUBLE = "DOUBLE"; -static const char* luaEnumString_AIMessageParameterType_BOOLEAN = "BOOLEAN"; -static const char* luaEnumString_AIMessageParameterType_STRING = "STRING"; - -AIMessage::ParameterType lua_enumFromString_AIMessageParameterType(const char* s) -{ - if (strcmp(s, luaEnumString_AIMessageParameterType_UNDEFINED) == 0) - return AIMessage::UNDEFINED; - if (strcmp(s, luaEnumString_AIMessageParameterType_INTEGER) == 0) - return AIMessage::INTEGER; - if (strcmp(s, luaEnumString_AIMessageParameterType_LONG) == 0) - return AIMessage::LONG; - if (strcmp(s, luaEnumString_AIMessageParameterType_FLOAT) == 0) - return AIMessage::FLOAT; - if (strcmp(s, luaEnumString_AIMessageParameterType_DOUBLE) == 0) - return AIMessage::DOUBLE; - if (strcmp(s, luaEnumString_AIMessageParameterType_BOOLEAN) == 0) - return AIMessage::BOOLEAN; - if (strcmp(s, luaEnumString_AIMessageParameterType_STRING) == 0) - return AIMessage::STRING; - return AIMessage::UNDEFINED; -} - -const char* lua_stringFromEnum_AIMessageParameterType(AIMessage::ParameterType e) -{ - if (e == AIMessage::UNDEFINED) - return luaEnumString_AIMessageParameterType_UNDEFINED; - if (e == AIMessage::INTEGER) - return luaEnumString_AIMessageParameterType_INTEGER; - if (e == AIMessage::LONG) - return luaEnumString_AIMessageParameterType_LONG; - if (e == AIMessage::FLOAT) - return luaEnumString_AIMessageParameterType_FLOAT; - if (e == AIMessage::DOUBLE) - return luaEnumString_AIMessageParameterType_DOUBLE; - if (e == AIMessage::BOOLEAN) - return luaEnumString_AIMessageParameterType_BOOLEAN; - if (e == AIMessage::STRING) - return luaEnumString_AIMessageParameterType_STRING; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_AIMessageParameterType.h b/gameplay/src/lua/lua_AIMessageParameterType.h deleted file mode 100644 index e5afc86574..0000000000 --- a/gameplay/src/lua/lua_AIMessageParameterType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_AIMESSAGEPARAMETERTYPE_H_ -#define LUA_AIMESSAGEPARAMETERTYPE_H_ - -#include "AIMessage.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for AIMessage::ParameterType. -AIMessage::ParameterType lua_enumFromString_AIMessageParameterType(const char* s); -const char* lua_stringFromEnum_AIMessageParameterType(AIMessage::ParameterType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_AIState.cpp b/gameplay/src/lua/lua_AIState.cpp index d7b4ff2123..99b3734f74 100644 --- a/gameplay/src/lua/lua_AIState.cpp +++ b/gameplay/src/lua/lua_AIState.cpp @@ -1,13 +1,14 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIState.h" +#include "AIAgent.h" #include "AIState.h" #include "AIStateMachine.h" #include "Base.h" #include "Game.h" +#include "Node.h" #include "Ref.h" -#include "ScriptController.h" -#include "ScriptTarget.h" namespace gameplay { @@ -17,11 +18,9 @@ void luaRegister_AIState() const luaL_Reg lua_members[] = { {"addRef", lua_AIState_addRef}, - {"addScriptCallback", lua_AIState_addScriptCallback}, {"getId", lua_AIState_getId}, {"getRefCount", lua_AIState_getRefCount}, {"release", lua_AIState_release}, - {"removeScriptCallback", lua_AIState_removeScriptCallback}, {"setListener", lua_AIState_setListener}, {NULL, NULL} }; @@ -112,46 +111,6 @@ int lua_AIState_addRef(lua_State* state) return 0; } -int lua_AIState_addScriptCallback(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 3: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); - - // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); - - AIState* instance = getInstance(state); - instance->addScriptCallback(param1, param2); - - return 0; - } - - lua_pushstring(state, "lua_AIState_addScriptCallback - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 3)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_AIState_getId(lua_State* state) { // Get the number of parameters. @@ -254,46 +213,6 @@ int lua_AIState_release(lua_State* state) return 0; } -int lua_AIState_removeScriptCallback(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 3: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); - - // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); - - AIState* instance = getInstance(state); - instance->removeScriptCallback(param1, param2); - - return 0; - } - - lua_pushstring(state, "lua_AIState_removeScriptCallback - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 3)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_AIState_setListener(lua_State* state) { // Get the number of parameters. @@ -351,7 +270,7 @@ int lua_AIState_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)AIState::create(param1); + void* returnPtr = ((void*)AIState::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AIState.h b/gameplay/src/lua/lua_AIState.h index 43a1d95139..187cc7a83c 100644 --- a/gameplay/src/lua/lua_AIState.h +++ b/gameplay/src/lua/lua_AIState.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AISTATE_H_ #define LUA_AISTATE_H_ @@ -7,11 +8,9 @@ namespace gameplay // Lua bindings for AIState. int lua_AIState__gc(lua_State* state); int lua_AIState_addRef(lua_State* state); -int lua_AIState_addScriptCallback(lua_State* state); int lua_AIState_getId(lua_State* state); int lua_AIState_getRefCount(lua_State* state); int lua_AIState_release(lua_State* state); -int lua_AIState_removeScriptCallback(lua_State* state); int lua_AIState_setListener(lua_State* state); int lua_AIState_static_create(lua_State* state); diff --git a/gameplay/src/lua/lua_AIStateListener.cpp b/gameplay/src/lua/lua_AIStateListener.cpp index 28da61894f..cd2988cd79 100644 --- a/gameplay/src/lua/lua_AIStateListener.cpp +++ b/gameplay/src/lua/lua_AIStateListener.cpp @@ -1,13 +1,14 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIStateListener.h" +#include "AIAgent.h" #include "AIState.h" #include "AIStateMachine.h" #include "Base.h" #include "Game.h" +#include "Node.h" #include "Ref.h" -#include "ScriptController.h" -#include "ScriptTarget.h" namespace gameplay { @@ -83,7 +84,7 @@ int lua_AIStateListener__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new AIState::Listener(); + void* returnPtr = ((void*)new AIState::Listener()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AIStateListener.h b/gameplay/src/lua/lua_AIStateListener.h index 9b9aa62153..7183e54909 100644 --- a/gameplay/src/lua/lua_AIStateListener.h +++ b/gameplay/src/lua/lua_AIStateListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AISTATELISTENER_H_ #define LUA_AISTATELISTENER_H_ diff --git a/gameplay/src/lua/lua_AIStateMachine.cpp b/gameplay/src/lua/lua_AIStateMachine.cpp index 64e3e50ce1..158818981b 100644 --- a/gameplay/src/lua/lua_AIStateMachine.cpp +++ b/gameplay/src/lua/lua_AIStateMachine.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AIStateMachine.h" @@ -54,7 +55,7 @@ int lua_AIStateMachine_addState(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); AIStateMachine* instance = getInstance(state); - void* returnPtr = (void*)instance->addState(param1); + void* returnPtr = ((void*)instance->addState(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -117,7 +118,7 @@ int lua_AIStateMachine_getActiveState(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AIStateMachine* instance = getInstance(state); - void* returnPtr = (void*)instance->getActiveState(); + void* returnPtr = ((void*)instance->getActiveState()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -161,7 +162,7 @@ int lua_AIStateMachine_getAgent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AIStateMachine* instance = getInstance(state); - void* returnPtr = (void*)instance->getAgent(); + void* returnPtr = ((void*)instance->getAgent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -209,7 +210,7 @@ int lua_AIStateMachine_getState(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); AIStateMachine* instance = getInstance(state); - void* returnPtr = (void*)instance->getState(param1); + void* returnPtr = ((void*)instance->getState(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -301,7 +302,7 @@ int lua_AIStateMachine_setState(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); AIStateMachine* instance = getInstance(state); - void* returnPtr = (void*)instance->setState(param1); + void* returnPtr = ((void*)instance->setState(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AIStateMachine.h b/gameplay/src/lua/lua_AIStateMachine.h index 61d3bed717..8b94973745 100644 --- a/gameplay/src/lua/lua_AIStateMachine.h +++ b/gameplay/src/lua/lua_AIStateMachine.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AISTATEMACHINE_H_ #define LUA_AISTATEMACHINE_H_ diff --git a/gameplay/src/lua/lua_AbsoluteLayout.cpp b/gameplay/src/lua/lua_AbsoluteLayout.cpp index 2694d6d6ce..65332c33a7 100644 --- a/gameplay/src/lua/lua_AbsoluteLayout.cpp +++ b/gameplay/src/lua/lua_AbsoluteLayout.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AbsoluteLayout.h" @@ -8,7 +9,6 @@ #include "Game.h" #include "Layout.h" #include "Ref.h" -#include "lua_LayoutType.h" namespace gameplay { @@ -157,7 +157,7 @@ int lua_AbsoluteLayout_getType(lua_State* state) Layout::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_LayoutType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_AbsoluteLayout.h b/gameplay/src/lua/lua_AbsoluteLayout.h index 6701e7c9d2..b02ef091a6 100644 --- a/gameplay/src/lua/lua_AbsoluteLayout.h +++ b/gameplay/src/lua/lua_AbsoluteLayout.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ABSOLUTELAYOUT_H_ #define LUA_ABSOLUTELAYOUT_H_ diff --git a/gameplay/src/lua/lua_Animation.cpp b/gameplay/src/lua/lua_Animation.cpp index d38d25ed64..5f469c2f95 100644 --- a/gameplay/src/lua/lua_Animation.cpp +++ b/gameplay/src/lua/lua_Animation.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Animation.h" @@ -141,7 +142,7 @@ int lua_Animation_createClip(lua_State* state) unsigned long param3 = (unsigned long)luaL_checkunsigned(state, 4); Animation* instance = getInstance(state); - void* returnPtr = (void*)instance->createClip(param1, param2, param3); + void* returnPtr = ((void*)instance->createClip(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -223,7 +224,7 @@ int lua_Animation_getClip(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Animation* instance = getInstance(state); - void* returnPtr = (void*)instance->getClip(); + void* returnPtr = ((void*)instance->getClip()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -256,7 +257,7 @@ int lua_Animation_getClip(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Animation* instance = getInstance(state); - void* returnPtr = (void*)instance->getClip(param1); + void* returnPtr = ((void*)instance->getClip(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -283,7 +284,7 @@ int lua_Animation_getClip(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Animation* instance = getInstance(state); - void* returnPtr = (void*)instance->getClip(param1); + void* returnPtr = ((void*)instance->getClip(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Animation.h b/gameplay/src/lua/lua_Animation.h index 6ae0daeef6..29d3067e0c 100644 --- a/gameplay/src/lua/lua_Animation.h +++ b/gameplay/src/lua/lua_Animation.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ANIMATION_H_ #define LUA_ANIMATION_H_ diff --git a/gameplay/src/lua/lua_AnimationClip.cpp b/gameplay/src/lua/lua_AnimationClip.cpp index 90a619c20d..fc6c8a3031 100644 --- a/gameplay/src/lua/lua_AnimationClip.cpp +++ b/gameplay/src/lua/lua_AnimationClip.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AnimationClip.h" @@ -9,7 +10,7 @@ #include "Quaternion.h" #include "Ref.h" #include "ScriptController.h" -#include "lua_AnimationClipListenerEventType.h" +#include "ScriptTarget.h" namespace gameplay { @@ -22,6 +23,9 @@ void luaRegister_AnimationClip() {"addEndListener", lua_AnimationClip_addEndListener}, {"addListener", lua_AnimationClip_addListener}, {"addRef", lua_AnimationClip_addRef}, + {"addScript", lua_AnimationClip_addScript}, + {"addScriptCallback", lua_AnimationClip_addScriptCallback}, + {"clearScripts", lua_AnimationClip_clearScripts}, {"crossFade", lua_AnimationClip_crossFade}, {"getActiveDuration", lua_AnimationClip_getActiveDuration}, {"getAnimation", lua_AnimationClip_getAnimation}, @@ -33,12 +37,20 @@ void luaRegister_AnimationClip() {"getLoopBlendTime", lua_AnimationClip_getLoopBlendTime}, {"getRefCount", lua_AnimationClip_getRefCount}, {"getRepeatCount", lua_AnimationClip_getRepeatCount}, + {"getScriptEvent", lua_AnimationClip_getScriptEvent}, {"getSpeed", lua_AnimationClip_getSpeed}, {"getStartTime", lua_AnimationClip_getStartTime}, + {"getTypeName", lua_AnimationClip_getTypeName}, + {"hasScriptListener", lua_AnimationClip_hasScriptListener}, {"isPlaying", lua_AnimationClip_isPlaying}, {"pause", lua_AnimationClip_pause}, {"play", lua_AnimationClip_play}, {"release", lua_AnimationClip_release}, + {"removeBeginListener", lua_AnimationClip_removeBeginListener}, + {"removeEndListener", lua_AnimationClip_removeEndListener}, + {"removeListener", lua_AnimationClip_removeListener}, + {"removeScript", lua_AnimationClip_removeScript}, + {"removeScriptCallback", lua_AnimationClip_removeScriptCallback}, {"setActiveDuration", lua_AnimationClip_setActiveDuration}, {"setBlendWeight", lua_AnimationClip_setBlendWeight}, {"setLoopBlendTime", lua_AnimationClip_setLoopBlendTime}, @@ -112,38 +124,23 @@ int lua_AnimationClip_addBeginListener(lua_State* state) { case 2: { - do + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); + if (!param1Valid) { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); - if (!param1Valid) - break; - - AnimationClip* instance = getInstance(state); - instance->addBeginListener(param1); - - return 0; + lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip::Listener'."); + lua_error(state); } - } while (0); - - do - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - AnimationClip* instance = getInstance(state); - instance->addBeginListener(param1); - - return 0; - } - } while (0); + AnimationClip* instance = getInstance(state); + instance->addBeginListener(param1); + + return 0; + } lua_pushstring(state, "lua_AnimationClip_addBeginListener - Failed to match the given parameters to a valid function signature."); lua_error(state); @@ -169,38 +166,23 @@ int lua_AnimationClip_addEndListener(lua_State* state) { case 2: { - do + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); + if (!param1Valid) { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); - if (!param1Valid) - break; - - AnimationClip* instance = getInstance(state); - instance->addEndListener(param1); - - return 0; + lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip::Listener'."); + lua_error(state); } - } while (0); - - do - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - AnimationClip* instance = getInstance(state); - instance->addEndListener(param1); - - return 0; - } - } while (0); + AnimationClip* instance = getInstance(state); + instance->addEndListener(param1); + + return 0; + } lua_pushstring(state, "lua_AnimationClip_addEndListener - Failed to match the given parameters to a valid function signature."); lua_error(state); @@ -226,48 +208,155 @@ int lua_AnimationClip_addListener(lua_State* state) { case 3: { - do + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER) { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - lua_type(state, 3) == LUA_TNUMBER) + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); + if (!param1Valid) { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); - if (!param1Valid) - break; + lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip::Listener'."); + lua_error(state); + } - // Get parameter 2 off the stack. - unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3); + // Get parameter 2 off the stack. + unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3); - AnimationClip* instance = getInstance(state); - instance->addListener(param1, param2); - - return 0; - } - } while (0); + AnimationClip* instance = getInstance(state); + instance->addListener(param1, param2); + + return 0; + } - do + lua_pushstring(state, "lua_AnimationClip_addListener - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 3)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_AnimationClip_addRef(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - lua_type(state, 3) == LUA_TNUMBER) + AnimationClip* instance = getInstance(state); + instance->addRef(); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_addRef - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_AnimationClip_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + AnimationClip* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } - // Get parameter 2 off the stack. - unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3); + return 1; + } - AnimationClip* instance = getInstance(state); - instance->addListener(param1, param2); - - return 0; + lua_pushstring(state, "lua_AnimationClip_addScript - 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; +} + +int lua_AnimationClip_addScriptCallback(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 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); } - } while (0); - lua_pushstring(state, "lua_AnimationClip_addListener - Failed to match the given parameters to a valid function signature."); + // Get parameter 2 off the stack. + const char* param2 = gameplay::ScriptUtil::getString(3, false); + + AnimationClip* instance = getInstance(state); + instance->addScriptCallback(param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_addScriptCallback - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -281,7 +370,7 @@ int lua_AnimationClip_addListener(lua_State* state) return 0; } -int lua_AnimationClip_addRef(lua_State* state) +int lua_AnimationClip_clearScripts(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -294,12 +383,12 @@ int lua_AnimationClip_addRef(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationClip* instance = getInstance(state); - instance->addRef(); + instance->clearScripts(); return 0; } - lua_pushstring(state, "lua_AnimationClip_addRef - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_AnimationClip_clearScripts - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -407,7 +496,7 @@ int lua_AnimationClip_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationClip* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -718,7 +807,7 @@ int lua_AnimationClip_getRepeatCount(lua_State* state) return 0; } -int lua_AnimationClip_getSpeed(lua_State* state) +int lua_AnimationClip_getScriptEvent(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -726,26 +815,39 @@ int lua_AnimationClip_getSpeed(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 1: + case 2: { - if ((lua_type(state, 1) == LUA_TUSERDATA)) + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { - AnimationClip* instance = getInstance(state); - float result = instance->getSpeed(); + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); - // Push the return value onto the stack. - lua_pushnumber(state, result); + AnimationClip* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } return 1; } - lua_pushstring(state, "lua_AnimationClip_getSpeed - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_AnimationClip_getScriptEvent - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 2)."); lua_error(state); break; } @@ -753,7 +855,7 @@ int lua_AnimationClip_getSpeed(lua_State* state) return 0; } -int lua_AnimationClip_getStartTime(lua_State* state) +int lua_AnimationClip_getSpeed(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -766,15 +868,15 @@ int lua_AnimationClip_getStartTime(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationClip* instance = getInstance(state); - unsigned long result = instance->getStartTime(); + float result = instance->getSpeed(); // Push the return value onto the stack. - lua_pushunsigned(state, result); + lua_pushnumber(state, result); return 1; } - lua_pushstring(state, "lua_AnimationClip_getStartTime - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_AnimationClip_getSpeed - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -788,7 +890,7 @@ int lua_AnimationClip_getStartTime(lua_State* state) return 0; } -int lua_AnimationClip_isPlaying(lua_State* state) +int lua_AnimationClip_getStartTime(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -801,15 +903,15 @@ int lua_AnimationClip_isPlaying(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationClip* instance = getInstance(state); - bool result = instance->isPlaying(); + unsigned long result = instance->getStartTime(); // Push the return value onto the stack. - lua_pushboolean(state, result); + lua_pushunsigned(state, result); return 1; } - lua_pushstring(state, "lua_AnimationClip_isPlaying - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_AnimationClip_getStartTime - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -823,7 +925,7 @@ int lua_AnimationClip_isPlaying(lua_State* state) return 0; } -int lua_AnimationClip_pause(lua_State* state) +int lua_AnimationClip_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -836,12 +938,15 @@ int lua_AnimationClip_pause(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationClip* instance = getInstance(state); - instance->pause(); - - return 0; + const char* result = instance->getTypeName(); + + // Push the return value onto the stack. + lua_pushstring(state, result); + + return 1; } - lua_pushstring(state, "lua_AnimationClip_pause - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_AnimationClip_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -855,7 +960,7 @@ int lua_AnimationClip_pause(lua_State* state) return 0; } -int lua_AnimationClip_play(lua_State* state) +int lua_AnimationClip_hasScriptListener(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -863,9 +968,139 @@ int lua_AnimationClip_play(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 1: + case 2: { - if ((lua_type(state, 1) == LUA_TUSERDATA)) + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + AnimationClip* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + AnimationClip* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_AnimationClip_hasScriptListener - 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; +} + +int lua_AnimationClip_isPlaying(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + AnimationClip* instance = getInstance(state); + bool result = instance->isPlaying(); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_AnimationClip_isPlaying - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_AnimationClip_pause(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + AnimationClip* instance = getInstance(state); + instance->pause(); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_pause - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_AnimationClip_play(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationClip* instance = getInstance(state); instance->play(); @@ -919,6 +1154,221 @@ int lua_AnimationClip_release(lua_State* state) return 0; } +int lua_AnimationClip_removeBeginListener(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip::Listener'."); + lua_error(state); + } + + AnimationClip* instance = getInstance(state); + instance->removeBeginListener(param1); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_removeBeginListener - 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; +} + +int lua_AnimationClip_removeEndListener(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip::Listener'."); + lua_error(state); + } + + AnimationClip* instance = getInstance(state); + instance->removeEndListener(param1); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_removeEndListener - 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; +} + +int lua_AnimationClip_removeListener(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 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "AnimationClipListener", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip::Listener'."); + lua_error(state); + } + + // Get parameter 2 off the stack. + unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3); + + AnimationClip* instance = getInstance(state); + instance->removeListener(param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_removeListener - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 3)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_AnimationClip_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + AnimationClip* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_AnimationClip_removeScript - 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; +} + +int lua_AnimationClip_removeScriptCallback(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 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } + + // Get parameter 2 off the stack. + const char* param2 = gameplay::ScriptUtil::getString(3, false); + + AnimationClip* instance = getInstance(state); + instance->removeScriptCallback(param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_AnimationClip_removeScriptCallback - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 3)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_AnimationClip_setActiveDuration(lua_State* state) { // Get the number of parameters. diff --git a/gameplay/src/lua/lua_AnimationClip.h b/gameplay/src/lua/lua_AnimationClip.h index 140b2317b6..9f9ccec0c7 100644 --- a/gameplay/src/lua/lua_AnimationClip.h +++ b/gameplay/src/lua/lua_AnimationClip.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ANIMATIONCLIP_H_ #define LUA_ANIMATIONCLIP_H_ @@ -10,6 +11,9 @@ int lua_AnimationClip_addBeginListener(lua_State* state); int lua_AnimationClip_addEndListener(lua_State* state); int lua_AnimationClip_addListener(lua_State* state); int lua_AnimationClip_addRef(lua_State* state); +int lua_AnimationClip_addScript(lua_State* state); +int lua_AnimationClip_addScriptCallback(lua_State* state); +int lua_AnimationClip_clearScripts(lua_State* state); int lua_AnimationClip_crossFade(lua_State* state); int lua_AnimationClip_getActiveDuration(lua_State* state); int lua_AnimationClip_getAnimation(lua_State* state); @@ -21,12 +25,20 @@ int lua_AnimationClip_getId(lua_State* state); int lua_AnimationClip_getLoopBlendTime(lua_State* state); int lua_AnimationClip_getRefCount(lua_State* state); int lua_AnimationClip_getRepeatCount(lua_State* state); +int lua_AnimationClip_getScriptEvent(lua_State* state); int lua_AnimationClip_getSpeed(lua_State* state); int lua_AnimationClip_getStartTime(lua_State* state); +int lua_AnimationClip_getTypeName(lua_State* state); +int lua_AnimationClip_hasScriptListener(lua_State* state); int lua_AnimationClip_isPlaying(lua_State* state); int lua_AnimationClip_pause(lua_State* state); int lua_AnimationClip_play(lua_State* state); int lua_AnimationClip_release(lua_State* state); +int lua_AnimationClip_removeBeginListener(lua_State* state); +int lua_AnimationClip_removeEndListener(lua_State* state); +int lua_AnimationClip_removeListener(lua_State* state); +int lua_AnimationClip_removeScript(lua_State* state); +int lua_AnimationClip_removeScriptCallback(lua_State* state); int lua_AnimationClip_setActiveDuration(lua_State* state); int lua_AnimationClip_setBlendWeight(lua_State* state); int lua_AnimationClip_setLoopBlendTime(lua_State* state); diff --git a/gameplay/src/lua/lua_AnimationClipListener.cpp b/gameplay/src/lua/lua_AnimationClipListener.cpp index a2ed8ccd65..6dc878eb90 100644 --- a/gameplay/src/lua/lua_AnimationClipListener.cpp +++ b/gameplay/src/lua/lua_AnimationClipListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AnimationClipListener.h" @@ -9,7 +10,7 @@ #include "Quaternion.h" #include "Ref.h" #include "ScriptController.h" -#include "lua_AnimationClipListenerEventType.h" +#include "ScriptTarget.h" namespace gameplay { @@ -85,7 +86,7 @@ int lua_AnimationClipListener_animationEvent(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. bool param1Valid; @@ -97,7 +98,7 @@ int lua_AnimationClipListener_animationEvent(lua_State* state) } // Get parameter 2 off the stack. - AnimationClip::Listener::EventType param2 = (AnimationClip::Listener::EventType)lua_enumFromString_AnimationClipListenerEventType(luaL_checkstring(state, 3)); + AnimationClip::Listener::EventType param2 = (AnimationClip::Listener::EventType)luaL_checkint(state, 3); AnimationClip::Listener* instance = getInstance(state); instance->animationEvent(param1, param2); diff --git a/gameplay/src/lua/lua_AnimationClipListener.h b/gameplay/src/lua/lua_AnimationClipListener.h index aae201d11f..666cf65fb2 100644 --- a/gameplay/src/lua/lua_AnimationClipListener.h +++ b/gameplay/src/lua/lua_AnimationClipListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ANIMATIONCLIPLISTENER_H_ #define LUA_ANIMATIONCLIPLISTENER_H_ diff --git a/gameplay/src/lua/lua_AnimationClipListenerEventType.cpp b/gameplay/src/lua/lua_AnimationClipListenerEventType.cpp deleted file mode 100644 index 58ee4ec6d6..0000000000 --- a/gameplay/src/lua/lua_AnimationClipListenerEventType.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_AnimationClipListenerEventType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_AnimationClipListenerEventType_BEGIN = "BEGIN"; -static const char* luaEnumString_AnimationClipListenerEventType_END = "END"; -static const char* luaEnumString_AnimationClipListenerEventType_TIME = "TIME"; - -AnimationClip::Listener::EventType lua_enumFromString_AnimationClipListenerEventType(const char* s) -{ - if (strcmp(s, luaEnumString_AnimationClipListenerEventType_BEGIN) == 0) - return AnimationClip::Listener::BEGIN; - if (strcmp(s, luaEnumString_AnimationClipListenerEventType_END) == 0) - return AnimationClip::Listener::END; - if (strcmp(s, luaEnumString_AnimationClipListenerEventType_TIME) == 0) - return AnimationClip::Listener::TIME; - return AnimationClip::Listener::BEGIN; -} - -const char* lua_stringFromEnum_AnimationClipListenerEventType(AnimationClip::Listener::EventType e) -{ - if (e == AnimationClip::Listener::BEGIN) - return luaEnumString_AnimationClipListenerEventType_BEGIN; - if (e == AnimationClip::Listener::END) - return luaEnumString_AnimationClipListenerEventType_END; - if (e == AnimationClip::Listener::TIME) - return luaEnumString_AnimationClipListenerEventType_TIME; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_AnimationClipListenerEventType.h b/gameplay/src/lua/lua_AnimationClipListenerEventType.h deleted file mode 100644 index 9e5077f311..0000000000 --- a/gameplay/src/lua/lua_AnimationClipListenerEventType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_ANIMATIONCLIPLISTENEREVENTTYPE_H_ -#define LUA_ANIMATIONCLIPLISTENEREVENTTYPE_H_ - -#include "AnimationClip.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for AnimationClip::Listener::EventType. -AnimationClip::Listener::EventType lua_enumFromString_AnimationClipListenerEventType(const char* s); -const char* lua_stringFromEnum_AnimationClipListenerEventType(AnimationClip::Listener::EventType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_AnimationController.cpp b/gameplay/src/lua/lua_AnimationController.cpp index f4e657b974..641b01c96a 100644 --- a/gameplay/src/lua/lua_AnimationController.cpp +++ b/gameplay/src/lua/lua_AnimationController.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AnimationController.h" diff --git a/gameplay/src/lua/lua_AnimationController.h b/gameplay/src/lua/lua_AnimationController.h index 7069c402df..cc9decf904 100644 --- a/gameplay/src/lua/lua_AnimationController.h +++ b/gameplay/src/lua/lua_AnimationController.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ANIMATIONCONTROLLER_H_ #define LUA_ANIMATIONCONTROLLER_H_ diff --git a/gameplay/src/lua/lua_AnimationTarget.cpp b/gameplay/src/lua/lua_AnimationTarget.cpp index c629566e7a..07efb9934d 100644 --- a/gameplay/src/lua/lua_AnimationTarget.cpp +++ b/gameplay/src/lua/lua_AnimationTarget.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AnimationTarget.h" @@ -5,8 +6,8 @@ #include "AnimationTarget.h" #include "Base.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { @@ -61,7 +62,7 @@ int lua_AnimationTarget_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -95,7 +96,7 @@ int lua_AnimationTarget_createAnimation(lua_State* state) break; AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -127,7 +128,7 @@ int lua_AnimationTarget_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -145,10 +146,10 @@ int lua_AnimationTarget_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -182,7 +183,7 @@ int lua_AnimationTarget_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -206,10 +207,10 @@ int lua_AnimationTarget_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -256,7 +257,7 @@ int lua_AnimationTarget_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -272,13 +273,13 @@ int lua_AnimationTarget_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -324,7 +325,7 @@ int lua_AnimationTarget_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -340,13 +341,13 @@ int lua_AnimationTarget_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -440,7 +441,7 @@ int lua_AnimationTarget_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -470,7 +471,7 @@ int lua_AnimationTarget_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); AnimationTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AnimationTarget.h b/gameplay/src/lua/lua_AnimationTarget.h index 857c1af2ee..dcfbc1e0d1 100644 --- a/gameplay/src/lua/lua_AnimationTarget.h +++ b/gameplay/src/lua/lua_AnimationTarget.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ANIMATIONTARGET_H_ #define LUA_ANIMATIONTARGET_H_ diff --git a/gameplay/src/lua/lua_AnimationValue.cpp b/gameplay/src/lua/lua_AnimationValue.cpp index 268b0a5b2e..385183d48c 100644 --- a/gameplay/src/lua/lua_AnimationValue.cpp +++ b/gameplay/src/lua/lua_AnimationValue.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AnimationValue.h" diff --git a/gameplay/src/lua/lua_AnimationValue.h b/gameplay/src/lua/lua_AnimationValue.h index f26404ccf2..a97ef1503e 100644 --- a/gameplay/src/lua/lua_AnimationValue.h +++ b/gameplay/src/lua/lua_AnimationValue.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_ANIMATIONVALUE_H_ #define LUA_ANIMATIONVALUE_H_ diff --git a/gameplay/src/lua/lua_AudioBuffer.cpp b/gameplay/src/lua/lua_AudioBuffer.cpp index a1994b061a..8e0535a887 100644 --- a/gameplay/src/lua/lua_AudioBuffer.cpp +++ b/gameplay/src/lua/lua_AudioBuffer.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AudioBuffer.h" diff --git a/gameplay/src/lua/lua_AudioBuffer.h b/gameplay/src/lua/lua_AudioBuffer.h index 0cb0c596ef..0f08124b6e 100644 --- a/gameplay/src/lua/lua_AudioBuffer.h +++ b/gameplay/src/lua/lua_AudioBuffer.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AUDIOBUFFER_H_ #define LUA_AUDIOBUFFER_H_ diff --git a/gameplay/src/lua/lua_AudioController.cpp b/gameplay/src/lua/lua_AudioController.cpp index 21c63831ca..c5df713552 100644 --- a/gameplay/src/lua/lua_AudioController.cpp +++ b/gameplay/src/lua/lua_AudioController.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AudioController.h" diff --git a/gameplay/src/lua/lua_AudioController.h b/gameplay/src/lua/lua_AudioController.h index 92950181f0..4a1459a86b 100644 --- a/gameplay/src/lua/lua_AudioController.h +++ b/gameplay/src/lua/lua_AudioController.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AUDIOCONTROLLER_H_ #define LUA_AUDIOCONTROLLER_H_ diff --git a/gameplay/src/lua/lua_AudioListener.cpp b/gameplay/src/lua/lua_AudioListener.cpp index 59b7e9141d..8129ebc72a 100644 --- a/gameplay/src/lua/lua_AudioListener.cpp +++ b/gameplay/src/lua/lua_AudioListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AudioListener.h" @@ -7,7 +8,6 @@ #include "Game.h" #include "Node.h" #include "PhysicsController.h" -#include "lua_CameraType.h" namespace gameplay { @@ -59,7 +59,7 @@ int lua_AudioListener_getCamera(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AudioListener* instance = getInstance(state); - void* returnPtr = (void*)instance->getCamera(); + void* returnPtr = ((void*)instance->getCamera()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -621,7 +621,7 @@ int lua_AudioListener_static_getInstance(lua_State* state) { case 0: { - void* returnPtr = (void*)AudioListener::getInstance(); + void* returnPtr = ((void*)AudioListener::getInstance()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_AudioListener.h b/gameplay/src/lua/lua_AudioListener.h index f8f781a388..ebccbb5a3d 100644 --- a/gameplay/src/lua/lua_AudioListener.h +++ b/gameplay/src/lua/lua_AudioListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AUDIOLISTENER_H_ #define LUA_AUDIOLISTENER_H_ diff --git a/gameplay/src/lua/lua_AudioSource.cpp b/gameplay/src/lua/lua_AudioSource.cpp index 49e1c22598..be1d3f50c1 100644 --- a/gameplay/src/lua/lua_AudioSource.cpp +++ b/gameplay/src/lua/lua_AudioSource.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_AudioSource.h" @@ -8,13 +9,12 @@ #include "AudioSource.h" #include "Base.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Transform.h" -#include "lua_AudioSourceState.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { @@ -31,6 +31,7 @@ void luaRegister_AudioSource() {"getState", lua_AudioSource_getState}, {"getVelocity", lua_AudioSource_getVelocity}, {"isLooped", lua_AudioSource_isLooped}, + {"isStreamed", lua_AudioSource_isStreamed}, {"pause", lua_AudioSource_pause}, {"play", lua_AudioSource_play}, {"release", lua_AudioSource_release}, @@ -178,7 +179,7 @@ int lua_AudioSource_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { AudioSource* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -295,7 +296,7 @@ int lua_AudioSource_getState(lua_State* state) AudioSource::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_AudioSourceState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -393,6 +394,41 @@ int lua_AudioSource_isLooped(lua_State* state) return 0; } +int lua_AudioSource_isStreamed(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + AudioSource* instance = getInstance(state); + bool result = instance->isStreamed(); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_AudioSource_isStreamed - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_AudioSource_pause(lua_State* state) { // Get the number of parameters. @@ -749,7 +785,7 @@ int lua_AudioSource_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)AudioSource::create(param1); + void* returnPtr = ((void*)AudioSource::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -777,7 +813,42 @@ int lua_AudioSource_static_create(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)AudioSource::create(param1); + void* returnPtr = ((void*)AudioSource::create(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = true; + luaL_getmetatable(state, "AudioSource"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_AudioSource_static_create - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 2: + { + do + { + if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && + lua_type(state, 2) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(1, false); + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 2); + + void* returnPtr = ((void*)AudioSource::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -801,7 +872,7 @@ int lua_AudioSource_static_create(lua_State* state) } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 1 or 2)."); lua_error(state); break; } diff --git a/gameplay/src/lua/lua_AudioSource.h b/gameplay/src/lua/lua_AudioSource.h index 9c2278b0e5..b646b83b87 100644 --- a/gameplay/src/lua/lua_AudioSource.h +++ b/gameplay/src/lua/lua_AudioSource.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_AUDIOSOURCE_H_ #define LUA_AUDIOSOURCE_H_ @@ -14,6 +15,7 @@ int lua_AudioSource_getRefCount(lua_State* state); int lua_AudioSource_getState(lua_State* state); int lua_AudioSource_getVelocity(lua_State* state); int lua_AudioSource_isLooped(lua_State* state); +int lua_AudioSource_isStreamed(lua_State* state); int lua_AudioSource_pause(lua_State* state); int lua_AudioSource_play(lua_State* state); int lua_AudioSource_release(lua_State* state); diff --git a/gameplay/src/lua/lua_AudioSourceState.cpp b/gameplay/src/lua/lua_AudioSourceState.cpp deleted file mode 100644 index f45d10eb45..0000000000 --- a/gameplay/src/lua/lua_AudioSourceState.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "Base.h" -#include "lua_AudioSourceState.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_AudioSourceState_INITIAL = "INITIAL"; -static const char* luaEnumString_AudioSourceState_PLAYING = "PLAYING"; -static const char* luaEnumString_AudioSourceState_PAUSED = "PAUSED"; -static const char* luaEnumString_AudioSourceState_STOPPED = "STOPPED"; - -AudioSource::State lua_enumFromString_AudioSourceState(const char* s) -{ - if (strcmp(s, luaEnumString_AudioSourceState_INITIAL) == 0) - return AudioSource::INITIAL; - if (strcmp(s, luaEnumString_AudioSourceState_PLAYING) == 0) - return AudioSource::PLAYING; - if (strcmp(s, luaEnumString_AudioSourceState_PAUSED) == 0) - return AudioSource::PAUSED; - if (strcmp(s, luaEnumString_AudioSourceState_STOPPED) == 0) - return AudioSource::STOPPED; - return AudioSource::INITIAL; -} - -const char* lua_stringFromEnum_AudioSourceState(AudioSource::State e) -{ - if (e == AudioSource::INITIAL) - return luaEnumString_AudioSourceState_INITIAL; - if (e == AudioSource::PLAYING) - return luaEnumString_AudioSourceState_PLAYING; - if (e == AudioSource::PAUSED) - return luaEnumString_AudioSourceState_PAUSED; - if (e == AudioSource::STOPPED) - return luaEnumString_AudioSourceState_STOPPED; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_AudioSourceState.h b/gameplay/src/lua/lua_AudioSourceState.h deleted file mode 100644 index 5aa4d9e7cb..0000000000 --- a/gameplay/src/lua/lua_AudioSourceState.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_AUDIOSOURCESTATE_H_ -#define LUA_AUDIOSOURCESTATE_H_ - -#include "AudioSource.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for AudioSource::State. -AudioSource::State lua_enumFromString_AudioSourceState(const char* s); -const char* lua_stringFromEnum_AudioSourceState(AudioSource::State e); - -} - -#endif diff --git a/gameplay/src/lua/lua_BoundingBox.cpp b/gameplay/src/lua/lua_BoundingBox.cpp index 384aff028f..6226a9981f 100644 --- a/gameplay/src/lua/lua_BoundingBox.cpp +++ b/gameplay/src/lua/lua_BoundingBox.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_BoundingBox.h" @@ -89,7 +90,7 @@ int lua_BoundingBox__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new BoundingBox(); + void* returnPtr = ((void*)new BoundingBox()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -118,7 +119,7 @@ int lua_BoundingBox__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new BoundingBox(*param1); + void* returnPtr = ((void*)new BoundingBox(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -159,7 +160,7 @@ int lua_BoundingBox__init(lua_State* state) if (!param2Valid) break; - void* returnPtr = (void*)new BoundingBox(*param1, *param2); + void* returnPtr = ((void*)new BoundingBox(*param1, *param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -210,7 +211,7 @@ int lua_BoundingBox__init(lua_State* state) // Get parameter 6 off the stack. float param6 = (float)luaL_checknumber(state, 6); - void* returnPtr = (void*)new BoundingBox(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)new BoundingBox(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_BoundingBox.h b/gameplay/src/lua/lua_BoundingBox.h index 0a533e4a9f..494ea98a9f 100644 --- a/gameplay/src/lua/lua_BoundingBox.h +++ b/gameplay/src/lua/lua_BoundingBox.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_BOUNDINGBOX_H_ #define LUA_BOUNDINGBOX_H_ diff --git a/gameplay/src/lua/lua_BoundingSphere.cpp b/gameplay/src/lua/lua_BoundingSphere.cpp index 535fff8cdd..172bf2b304 100644 --- a/gameplay/src/lua/lua_BoundingSphere.cpp +++ b/gameplay/src/lua/lua_BoundingSphere.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_BoundingSphere.h" @@ -86,7 +87,7 @@ int lua_BoundingSphere__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new BoundingSphere(); + void* returnPtr = ((void*)new BoundingSphere()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -115,7 +116,7 @@ int lua_BoundingSphere__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new BoundingSphere(*param1); + void* returnPtr = ((void*)new BoundingSphere(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -153,7 +154,7 @@ int lua_BoundingSphere__init(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)new BoundingSphere(*param1, param2); + void* returnPtr = ((void*)new BoundingSphere(*param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_BoundingSphere.h b/gameplay/src/lua/lua_BoundingSphere.h index 038a5df376..413d941e59 100644 --- a/gameplay/src/lua/lua_BoundingSphere.h +++ b/gameplay/src/lua/lua_BoundingSphere.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_BOUNDINGSPHERE_H_ #define LUA_BOUNDINGSPHERE_H_ diff --git a/gameplay/src/lua/lua_Bundle.cpp b/gameplay/src/lua/lua_Bundle.cpp index 09ad7b9c01..ac29335706 100644 --- a/gameplay/src/lua/lua_Bundle.cpp +++ b/gameplay/src/lua/lua_Bundle.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Bundle.h" @@ -353,7 +354,7 @@ int lua_Bundle_loadFont(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Bundle* instance = getInstance(state); - void* returnPtr = (void*)instance->loadFont(param1); + void* returnPtr = ((void*)instance->loadFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -401,7 +402,7 @@ int lua_Bundle_loadMesh(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Bundle* instance = getInstance(state); - void* returnPtr = (void*)instance->loadMesh(param1); + void* returnPtr = ((void*)instance->loadMesh(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -449,7 +450,7 @@ int lua_Bundle_loadNode(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Bundle* instance = getInstance(state); - void* returnPtr = (void*)instance->loadNode(param1); + void* returnPtr = ((void*)instance->loadNode(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -493,7 +494,7 @@ int lua_Bundle_loadScene(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Bundle* instance = getInstance(state); - void* returnPtr = (void*)instance->loadScene(); + void* returnPtr = ((void*)instance->loadScene()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -523,7 +524,7 @@ int lua_Bundle_loadScene(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Bundle* instance = getInstance(state); - void* returnPtr = (void*)instance->loadScene(param1); + void* returnPtr = ((void*)instance->loadScene(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -601,7 +602,7 @@ int lua_Bundle_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Bundle::create(param1); + void* returnPtr = ((void*)Bundle::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Bundle.h b/gameplay/src/lua/lua_Bundle.h index aa05f15467..a97587a8e4 100644 --- a/gameplay/src/lua/lua_Bundle.h +++ b/gameplay/src/lua/lua_Bundle.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_BUNDLE_H_ #define LUA_BUNDLE_H_ diff --git a/gameplay/src/lua/lua_Button.cpp b/gameplay/src/lua/lua_Button.cpp index 8a436f57fb..1c4cb8b46d 100644 --- a/gameplay/src/lua/lua_Button.cpp +++ b/gameplay/src/lua/lua_Button.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Button.h" @@ -10,17 +11,12 @@ #include "Game.h" #include "Gamepad.h" #include "Label.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -31,8 +27,10 @@ void luaRegister_Button() { {"addListener", lua_Button_addListener}, {"addRef", lua_Button_addRef}, + {"addScript", lua_Button_addScript}, {"addScriptCallback", lua_Button_addScriptCallback}, {"canFocus", lua_Button_canFocus}, + {"clearScripts", lua_Button_clearScripts}, {"createAnimation", lua_Button_createAnimation}, {"createAnimationFromBy", lua_Button_createAnimationFromBy}, {"createAnimationFromTo", lua_Button_createAnimationFromTo}, @@ -64,6 +62,7 @@ void luaRegister_Button() {"getPadding", lua_Button_getPadding}, {"getParent", lua_Button_getParent}, {"getRefCount", lua_Button_getRefCount}, + {"getScriptEvent", lua_Button_getScriptEvent}, {"getSkinColor", lua_Button_getSkinColor}, {"getSkinRegion", lua_Button_getSkinRegion}, {"getState", lua_Button_getState}, @@ -79,6 +78,7 @@ void luaRegister_Button() {"getY", lua_Button_getY}, {"getZIndex", lua_Button_getZIndex}, {"hasFocus", lua_Button_hasFocus}, + {"hasScriptListener", lua_Button_hasScriptListener}, {"isChild", lua_Button_isChild}, {"isContainer", lua_Button_isContainer}, {"isEnabled", lua_Button_isEnabled}, @@ -91,6 +91,7 @@ void luaRegister_Button() {"isYPercentage", lua_Button_isYPercentage}, {"release", lua_Button_release}, {"removeListener", lua_Button_removeListener}, + {"removeScript", lua_Button_removeScript}, {"removeScriptCallback", lua_Button_removeScriptCallback}, {"setAlignment", lua_Button_setAlignment}, {"setAnimationPropertyValue", lua_Button_setAnimationPropertyValue}, @@ -269,6 +270,54 @@ int lua_Button_addRef(lua_State* state) return 0; } +int lua_Button_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Button* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Button_addScript - 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; +} + int lua_Button_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -280,14 +329,20 @@ int lua_Button_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Button* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -344,6 +399,38 @@ int lua_Button_canFocus(lua_State* state) return 0; } +int lua_Button_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Button* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Button_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Button_createAnimation(lua_State* state) { // Get the number of parameters. @@ -367,7 +454,7 @@ int lua_Button_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -401,7 +488,7 @@ int lua_Button_createAnimation(lua_State* state) break; Button* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -433,7 +520,7 @@ int lua_Button_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -451,10 +538,10 @@ int lua_Button_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -488,7 +575,7 @@ int lua_Button_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -512,10 +599,10 @@ int lua_Button_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -562,7 +649,7 @@ int lua_Button_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -578,13 +665,13 @@ int lua_Button_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -630,7 +717,7 @@ int lua_Button_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -646,13 +733,13 @@ int lua_Button_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -793,7 +880,7 @@ int lua_Button_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -825,7 +912,7 @@ int lua_Button_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -855,7 +942,7 @@ int lua_Button_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -987,7 +1074,7 @@ int lua_Button_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1043,10 +1130,10 @@ int lua_Button_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1258,10 +1345,10 @@ int lua_Button_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1306,10 +1393,10 @@ int lua_Button_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1354,10 +1441,10 @@ int lua_Button_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1439,7 +1526,7 @@ int lua_Button_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1463,13 +1550,13 @@ int lua_Button_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1528,10 +1615,10 @@ int lua_Button_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1638,13 +1725,13 @@ int lua_Button_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1690,13 +1777,13 @@ int lua_Button_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1742,13 +1829,13 @@ int lua_Button_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1854,10 +1941,10 @@ int lua_Button_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -1939,7 +2026,7 @@ int lua_Button_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2005,6 +2092,54 @@ int lua_Button_getRefCount(lua_State* state) return 0; } +int lua_Button_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Button* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Button_getScriptEvent - 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; +} + int lua_Button_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2042,10 +2177,10 @@ int lua_Button_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2116,10 +2251,10 @@ int lua_Button_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2169,7 +2304,7 @@ int lua_Button_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2201,7 +2336,7 @@ int lua_Button_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2283,7 +2418,7 @@ int lua_Button_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2295,16 +2430,16 @@ int lua_Button_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2360,10 +2495,10 @@ int lua_Button_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2425,10 +2560,10 @@ int lua_Button_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Button* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2466,7 +2601,7 @@ int lua_Button_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2510,7 +2645,7 @@ int lua_Button_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Button* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2716,6 +2851,69 @@ int lua_Button_hasFocus(lua_State* state) return 0; } +int lua_Button_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Button* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Button* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Button_hasScriptListener - 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; +} + int lua_Button_isChild(lua_State* state) { // Get the number of parameters. @@ -3150,6 +3348,45 @@ int lua_Button_removeListener(lua_State* state) return 0; } +int lua_Button_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Button* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Button_removeScript - 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; +} + int lua_Button_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3161,14 +3398,20 @@ int lua_Button_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Button* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3201,10 +3444,10 @@ int lua_Button_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); Button* instance = getInstance(state); instance->setAlignment(param1); @@ -3315,10 +3558,10 @@ int lua_Button_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); Button* instance = getInstance(state); instance->setAutoSize(param1); @@ -4576,10 +4819,10 @@ int lua_Button_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); Button* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4594,11 +4837,11 @@ int lua_Button_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -5131,7 +5374,7 @@ int lua_Button_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Button::create(param1); + void* returnPtr = ((void*)Button::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5169,7 +5412,7 @@ int lua_Button_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Button::create(param1, param2); + void* returnPtr = ((void*)Button::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Button.h b/gameplay/src/lua/lua_Button.h index cea1e5af33..8bcdcfcc27 100644 --- a/gameplay/src/lua/lua_Button.h +++ b/gameplay/src/lua/lua_Button.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_BUTTON_H_ #define LUA_BUTTON_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_Button__gc(lua_State* state); int lua_Button_addListener(lua_State* state); int lua_Button_addRef(lua_State* state); +int lua_Button_addScript(lua_State* state); int lua_Button_addScriptCallback(lua_State* state); int lua_Button_canFocus(lua_State* state); +int lua_Button_clearScripts(lua_State* state); int lua_Button_createAnimation(lua_State* state); int lua_Button_createAnimationFromBy(lua_State* state); int lua_Button_createAnimationFromTo(lua_State* state); @@ -41,6 +44,7 @@ int lua_Button_getOpacity(lua_State* state); int lua_Button_getPadding(lua_State* state); int lua_Button_getParent(lua_State* state); int lua_Button_getRefCount(lua_State* state); +int lua_Button_getScriptEvent(lua_State* state); int lua_Button_getSkinColor(lua_State* state); int lua_Button_getSkinRegion(lua_State* state); int lua_Button_getState(lua_State* state); @@ -56,6 +60,7 @@ int lua_Button_getX(lua_State* state); int lua_Button_getY(lua_State* state); int lua_Button_getZIndex(lua_State* state); int lua_Button_hasFocus(lua_State* state); +int lua_Button_hasScriptListener(lua_State* state); int lua_Button_isChild(lua_State* state); int lua_Button_isContainer(lua_State* state); int lua_Button_isEnabled(lua_State* state); @@ -68,6 +73,7 @@ int lua_Button_isXPercentage(lua_State* state); int lua_Button_isYPercentage(lua_State* state); int lua_Button_release(lua_State* state); int lua_Button_removeListener(lua_State* state); +int lua_Button_removeScript(lua_State* state); int lua_Button_removeScriptCallback(lua_State* state); int lua_Button_setAlignment(lua_State* state); int lua_Button_setAnimationPropertyValue(lua_State* state); diff --git a/gameplay/src/lua/lua_Camera.cpp b/gameplay/src/lua/lua_Camera.cpp index d16eb79ad6..a17fee3d4e 100644 --- a/gameplay/src/lua/lua_Camera.cpp +++ b/gameplay/src/lua/lua_Camera.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Camera.h" @@ -6,14 +7,13 @@ #include "Base.h" #include "Camera.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "PhysicsController.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Transform.h" -#include "lua_CameraType.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { @@ -236,7 +236,7 @@ int lua_Camera_getCameraType(lua_State* state) Camera::Type result = instance->getCameraType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_CameraType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -505,7 +505,7 @@ int lua_Camera_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Camera* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1306,7 +1306,7 @@ int lua_Camera_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Camera::create(param1); + void* returnPtr = ((void*)Camera::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1368,7 +1368,7 @@ int lua_Camera_static_createOrthographic(lua_State* state) // Get parameter 5 off the stack. float param5 = (float)luaL_checknumber(state, 5); - void* returnPtr = (void*)Camera::createOrthographic(param1, param2, param3, param4, param5); + void* returnPtr = ((void*)Camera::createOrthographic(param1, param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1426,7 +1426,7 @@ int lua_Camera_static_createPerspective(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)Camera::createPerspective(param1, param2, param3, param4); + void* returnPtr = ((void*)Camera::createPerspective(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Camera.h b/gameplay/src/lua/lua_Camera.h index 87d742ff4f..5e98607a87 100644 --- a/gameplay/src/lua/lua_Camera.h +++ b/gameplay/src/lua/lua_Camera.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CAMERA_H_ #define LUA_CAMERA_H_ diff --git a/gameplay/src/lua/lua_CameraListener.cpp b/gameplay/src/lua/lua_CameraListener.cpp index 4373bb33b2..e717cb3f23 100644 --- a/gameplay/src/lua/lua_CameraListener.cpp +++ b/gameplay/src/lua/lua_CameraListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_CameraListener.h" @@ -6,14 +7,13 @@ #include "Base.h" #include "Camera.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "PhysicsController.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Transform.h" -#include "lua_CameraType.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { diff --git a/gameplay/src/lua/lua_CameraListener.h b/gameplay/src/lua/lua_CameraListener.h index a8ada23198..bd06ed83d6 100644 --- a/gameplay/src/lua/lua_CameraListener.h +++ b/gameplay/src/lua/lua_CameraListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CAMERALISTENER_H_ #define LUA_CAMERALISTENER_H_ diff --git a/gameplay/src/lua/lua_CameraType.cpp b/gameplay/src/lua/lua_CameraType.cpp deleted file mode 100644 index b9dde6b499..0000000000 --- a/gameplay/src/lua/lua_CameraType.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_CameraType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_CameraType_PERSPECTIVE = "PERSPECTIVE"; -static const char* luaEnumString_CameraType_ORTHOGRAPHIC = "ORTHOGRAPHIC"; - -Camera::Type lua_enumFromString_CameraType(const char* s) -{ - if (strcmp(s, luaEnumString_CameraType_PERSPECTIVE) == 0) - return Camera::PERSPECTIVE; - if (strcmp(s, luaEnumString_CameraType_ORTHOGRAPHIC) == 0) - return Camera::ORTHOGRAPHIC; - return Camera::PERSPECTIVE; -} - -const char* lua_stringFromEnum_CameraType(Camera::Type e) -{ - if (e == Camera::PERSPECTIVE) - return luaEnumString_CameraType_PERSPECTIVE; - if (e == Camera::ORTHOGRAPHIC) - return luaEnumString_CameraType_ORTHOGRAPHIC; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_CameraType.h b/gameplay/src/lua/lua_CameraType.h deleted file mode 100644 index 48550ea1e2..0000000000 --- a/gameplay/src/lua/lua_CameraType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CAMERATYPE_H_ -#define LUA_CAMERATYPE_H_ - -#include "Camera.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Camera::Type. -Camera::Type lua_enumFromString_CameraType(const char* s); -const char* lua_stringFromEnum_CameraType(Camera::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_CheckBox.cpp b/gameplay/src/lua/lua_CheckBox.cpp index 646dfba011..26e80617ca 100644 --- a/gameplay/src/lua/lua_CheckBox.cpp +++ b/gameplay/src/lua/lua_CheckBox.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_CheckBox.h" @@ -11,17 +12,12 @@ #include "Game.h" #include "Gamepad.h" #include "Label.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -32,8 +28,10 @@ void luaRegister_CheckBox() { {"addListener", lua_CheckBox_addListener}, {"addRef", lua_CheckBox_addRef}, + {"addScript", lua_CheckBox_addScript}, {"addScriptCallback", lua_CheckBox_addScriptCallback}, {"canFocus", lua_CheckBox_canFocus}, + {"clearScripts", lua_CheckBox_clearScripts}, {"createAnimation", lua_CheckBox_createAnimation}, {"createAnimationFromBy", lua_CheckBox_createAnimationFromBy}, {"createAnimationFromTo", lua_CheckBox_createAnimationFromTo}, @@ -65,6 +63,7 @@ void luaRegister_CheckBox() {"getPadding", lua_CheckBox_getPadding}, {"getParent", lua_CheckBox_getParent}, {"getRefCount", lua_CheckBox_getRefCount}, + {"getScriptEvent", lua_CheckBox_getScriptEvent}, {"getSkinColor", lua_CheckBox_getSkinColor}, {"getSkinRegion", lua_CheckBox_getSkinRegion}, {"getState", lua_CheckBox_getState}, @@ -75,12 +74,13 @@ void luaRegister_CheckBox() {"getTextRightToLeft", lua_CheckBox_getTextRightToLeft}, {"getTheme", lua_CheckBox_getTheme}, {"getTopLevelForm", lua_CheckBox_getTopLevelForm}, - {"getType", lua_CheckBox_getType}, + {"getTypeName", lua_CheckBox_getTypeName}, {"getWidth", lua_CheckBox_getWidth}, {"getX", lua_CheckBox_getX}, {"getY", lua_CheckBox_getY}, {"getZIndex", lua_CheckBox_getZIndex}, {"hasFocus", lua_CheckBox_hasFocus}, + {"hasScriptListener", lua_CheckBox_hasScriptListener}, {"isChecked", lua_CheckBox_isChecked}, {"isChild", lua_CheckBox_isChild}, {"isContainer", lua_CheckBox_isContainer}, @@ -94,6 +94,7 @@ void luaRegister_CheckBox() {"isYPercentage", lua_CheckBox_isYPercentage}, {"release", lua_CheckBox_release}, {"removeListener", lua_CheckBox_removeListener}, + {"removeScript", lua_CheckBox_removeScript}, {"removeScriptCallback", lua_CheckBox_removeScriptCallback}, {"setAlignment", lua_CheckBox_setAlignment}, {"setAnimationPropertyValue", lua_CheckBox_setAnimationPropertyValue}, @@ -273,6 +274,54 @@ int lua_CheckBox_addRef(lua_State* state) return 0; } +int lua_CheckBox_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + CheckBox* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_CheckBox_addScript - 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; +} + int lua_CheckBox_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -284,14 +333,20 @@ int lua_CheckBox_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); CheckBox* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -348,6 +403,38 @@ int lua_CheckBox_canFocus(lua_State* state) return 0; } +int lua_CheckBox_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + CheckBox* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_CheckBox_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_CheckBox_createAnimation(lua_State* state) { // Get the number of parameters. @@ -371,7 +458,7 @@ int lua_CheckBox_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -405,7 +492,7 @@ int lua_CheckBox_createAnimation(lua_State* state) break; CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -437,7 +524,7 @@ int lua_CheckBox_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -455,10 +542,10 @@ int lua_CheckBox_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -492,7 +579,7 @@ int lua_CheckBox_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -516,10 +603,10 @@ int lua_CheckBox_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -566,7 +653,7 @@ int lua_CheckBox_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -582,13 +669,13 @@ int lua_CheckBox_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -634,7 +721,7 @@ int lua_CheckBox_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -650,13 +737,13 @@ int lua_CheckBox_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -797,7 +884,7 @@ int lua_CheckBox_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -829,7 +916,7 @@ int lua_CheckBox_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -859,7 +946,7 @@ int lua_CheckBox_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -991,7 +1078,7 @@ int lua_CheckBox_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1047,10 +1134,10 @@ int lua_CheckBox_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1262,10 +1349,10 @@ int lua_CheckBox_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1310,10 +1397,10 @@ int lua_CheckBox_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1358,10 +1445,10 @@ int lua_CheckBox_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1443,7 +1530,7 @@ int lua_CheckBox_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1467,13 +1554,13 @@ int lua_CheckBox_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1532,10 +1619,10 @@ int lua_CheckBox_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1642,13 +1729,13 @@ int lua_CheckBox_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1694,13 +1781,13 @@ int lua_CheckBox_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1746,13 +1833,13 @@ int lua_CheckBox_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1858,10 +1945,10 @@ int lua_CheckBox_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -1943,7 +2030,7 @@ int lua_CheckBox_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2009,6 +2096,54 @@ int lua_CheckBox_getRefCount(lua_State* state) return 0; } +int lua_CheckBox_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + CheckBox* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_CheckBox_getScriptEvent - 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; +} + int lua_CheckBox_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2046,10 +2181,10 @@ int lua_CheckBox_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2120,10 +2255,10 @@ int lua_CheckBox_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2173,7 +2308,7 @@ int lua_CheckBox_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2205,7 +2340,7 @@ int lua_CheckBox_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2287,7 +2422,7 @@ int lua_CheckBox_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2299,16 +2434,16 @@ int lua_CheckBox_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2364,10 +2499,10 @@ int lua_CheckBox_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2429,10 +2564,10 @@ int lua_CheckBox_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2470,7 +2605,7 @@ int lua_CheckBox_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2514,7 +2649,7 @@ int lua_CheckBox_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2545,7 +2680,7 @@ int lua_CheckBox_getTopLevelForm(lua_State* state) return 0; } -int lua_CheckBox_getType(lua_State* state) +int lua_CheckBox_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2558,7 +2693,7 @@ int lua_CheckBox_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { CheckBox* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2566,7 +2701,7 @@ int lua_CheckBox_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_CheckBox_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_CheckBox_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2755,6 +2890,69 @@ int lua_CheckBox_hasFocus(lua_State* state) return 0; } +int lua_CheckBox_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + CheckBox* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + CheckBox* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_CheckBox_hasScriptListener - 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; +} + int lua_CheckBox_isChecked(lua_State* state) { // Get the number of parameters. @@ -3224,6 +3422,45 @@ int lua_CheckBox_removeListener(lua_State* state) return 0; } +int lua_CheckBox_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + CheckBox* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_CheckBox_removeScript - 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; +} + int lua_CheckBox_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3235,14 +3472,20 @@ int lua_CheckBox_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); CheckBox* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3275,10 +3518,10 @@ int lua_CheckBox_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); instance->setAlignment(param1); @@ -3389,10 +3632,10 @@ int lua_CheckBox_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); instance->setAutoSize(param1); @@ -4686,10 +4929,10 @@ int lua_CheckBox_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); CheckBox* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4704,11 +4947,11 @@ int lua_CheckBox_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -5241,7 +5484,7 @@ int lua_CheckBox_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)CheckBox::create(param1); + void* returnPtr = ((void*)CheckBox::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5279,7 +5522,7 @@ int lua_CheckBox_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)CheckBox::create(param1, param2); + void* returnPtr = ((void*)CheckBox::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_CheckBox.h b/gameplay/src/lua/lua_CheckBox.h index 2549d89b6b..54d74cf171 100644 --- a/gameplay/src/lua/lua_CheckBox.h +++ b/gameplay/src/lua/lua_CheckBox.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CHECKBOX_H_ #define LUA_CHECKBOX_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_CheckBox__gc(lua_State* state); int lua_CheckBox_addListener(lua_State* state); int lua_CheckBox_addRef(lua_State* state); +int lua_CheckBox_addScript(lua_State* state); int lua_CheckBox_addScriptCallback(lua_State* state); int lua_CheckBox_canFocus(lua_State* state); +int lua_CheckBox_clearScripts(lua_State* state); int lua_CheckBox_createAnimation(lua_State* state); int lua_CheckBox_createAnimationFromBy(lua_State* state); int lua_CheckBox_createAnimationFromTo(lua_State* state); @@ -41,6 +44,7 @@ int lua_CheckBox_getOpacity(lua_State* state); int lua_CheckBox_getPadding(lua_State* state); int lua_CheckBox_getParent(lua_State* state); int lua_CheckBox_getRefCount(lua_State* state); +int lua_CheckBox_getScriptEvent(lua_State* state); int lua_CheckBox_getSkinColor(lua_State* state); int lua_CheckBox_getSkinRegion(lua_State* state); int lua_CheckBox_getState(lua_State* state); @@ -51,12 +55,13 @@ int lua_CheckBox_getTextColor(lua_State* state); int lua_CheckBox_getTextRightToLeft(lua_State* state); int lua_CheckBox_getTheme(lua_State* state); int lua_CheckBox_getTopLevelForm(lua_State* state); -int lua_CheckBox_getType(lua_State* state); +int lua_CheckBox_getTypeName(lua_State* state); int lua_CheckBox_getWidth(lua_State* state); int lua_CheckBox_getX(lua_State* state); int lua_CheckBox_getY(lua_State* state); int lua_CheckBox_getZIndex(lua_State* state); int lua_CheckBox_hasFocus(lua_State* state); +int lua_CheckBox_hasScriptListener(lua_State* state); int lua_CheckBox_isChecked(lua_State* state); int lua_CheckBox_isChild(lua_State* state); int lua_CheckBox_isContainer(lua_State* state); @@ -70,6 +75,7 @@ int lua_CheckBox_isXPercentage(lua_State* state); int lua_CheckBox_isYPercentage(lua_State* state); int lua_CheckBox_release(lua_State* state); int lua_CheckBox_removeListener(lua_State* state); +int lua_CheckBox_removeScript(lua_State* state); int lua_CheckBox_removeScriptCallback(lua_State* state); int lua_CheckBox_setAlignment(lua_State* state); int lua_CheckBox_setAnimationPropertyValue(lua_State* state); diff --git a/gameplay/src/lua/lua_Container.cpp b/gameplay/src/lua/lua_Container.cpp index 056b3b7549..260ed20668 100644 --- a/gameplay/src/lua/lua_Container.cpp +++ b/gameplay/src/lua/lua_Container.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Container.h" @@ -17,6 +18,7 @@ #include "JoystickControl.h" #include "Label.h" #include "Layout.h" +#include "MaterialParameter.h" #include "Node.h" #include "RadioButton.h" #include "Ref.h" @@ -26,14 +28,6 @@ #include "TextBox.h" #include "Theme.h" #include "VerticalLayout.h" -#include "lua_ContainerScroll.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" -#include "lua_LayoutType.h" namespace gameplay { @@ -45,8 +39,10 @@ void luaRegister_Container() {"addControl", lua_Container_addControl}, {"addListener", lua_Container_addListener}, {"addRef", lua_Container_addRef}, + {"addScript", lua_Container_addScript}, {"addScriptCallback", lua_Container_addScriptCallback}, {"canFocus", lua_Container_canFocus}, + {"clearScripts", lua_Container_clearScripts}, {"createAnimation", lua_Container_createAnimation}, {"createAnimationFromBy", lua_Container_createAnimationFromBy}, {"createAnimationFromTo", lua_Container_createAnimationFromTo}, @@ -82,6 +78,7 @@ void luaRegister_Container() {"getPadding", lua_Container_getPadding}, {"getParent", lua_Container_getParent}, {"getRefCount", lua_Container_getRefCount}, + {"getScriptEvent", lua_Container_getScriptEvent}, {"getScroll", lua_Container_getScroll}, {"getScrollPosition", lua_Container_getScrollPosition}, {"getScrollWheelRequiresFocus", lua_Container_getScrollWheelRequiresFocus}, @@ -96,12 +93,13 @@ void luaRegister_Container() {"getTextRightToLeft", lua_Container_getTextRightToLeft}, {"getTheme", lua_Container_getTheme}, {"getTopLevelForm", lua_Container_getTopLevelForm}, - {"getType", lua_Container_getType}, + {"getTypeName", lua_Container_getTypeName}, {"getWidth", lua_Container_getWidth}, {"getX", lua_Container_getX}, {"getY", lua_Container_getY}, {"getZIndex", lua_Container_getZIndex}, {"hasFocus", lua_Container_hasFocus}, + {"hasScriptListener", lua_Container_hasScriptListener}, {"insertControl", lua_Container_insertControl}, {"isChild", lua_Container_isChild}, {"isContainer", lua_Container_isContainer}, @@ -116,9 +114,11 @@ void luaRegister_Container() {"isWidthPercentage", lua_Container_isWidthPercentage}, {"isXPercentage", lua_Container_isXPercentage}, {"isYPercentage", lua_Container_isYPercentage}, + {"moveFocus", lua_Container_moveFocus}, {"release", lua_Container_release}, {"removeControl", lua_Container_removeControl}, {"removeListener", lua_Container_removeListener}, + {"removeScript", lua_Container_removeScript}, {"removeScriptCallback", lua_Container_removeScriptCallback}, {"setActiveControl", lua_Container_setActiveControl}, {"setAlignment", lua_Container_setAlignment}, @@ -351,6 +351,54 @@ int lua_Container_addRef(lua_State* state) return 0; } +int lua_Container_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Container* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Container_addScript - 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; +} + int lua_Container_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -362,14 +410,20 @@ int lua_Container_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Container* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -426,6 +480,38 @@ int lua_Container_canFocus(lua_State* state) return 0; } +int lua_Container_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Container* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Container_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Container_createAnimation(lua_State* state) { // Get the number of parameters. @@ -449,7 +535,7 @@ int lua_Container_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -483,7 +569,7 @@ int lua_Container_createAnimation(lua_State* state) break; Container* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -515,7 +601,7 @@ int lua_Container_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -533,10 +619,10 @@ int lua_Container_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -570,7 +656,7 @@ int lua_Container_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -594,10 +680,10 @@ int lua_Container_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -644,7 +730,7 @@ int lua_Container_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -660,13 +746,13 @@ int lua_Container_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -712,7 +798,7 @@ int lua_Container_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -728,13 +814,13 @@ int lua_Container_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -872,7 +958,7 @@ int lua_Container_getActiveControl(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getActiveControl(); + void* returnPtr = ((void*)instance->getActiveControl()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -919,7 +1005,7 @@ int lua_Container_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -951,7 +1037,7 @@ int lua_Container_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -981,7 +1067,7 @@ int lua_Container_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1113,7 +1199,7 @@ int lua_Container_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1169,10 +1255,10 @@ int lua_Container_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1392,7 +1478,7 @@ int lua_Container_getControl(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getControl(param1); + void* returnPtr = ((void*)instance->getControl(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1419,7 +1505,7 @@ int lua_Container_getControl(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getControl(param1); + void* returnPtr = ((void*)instance->getControl(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1497,10 +1583,10 @@ int lua_Container_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1545,10 +1631,10 @@ int lua_Container_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1593,10 +1679,10 @@ int lua_Container_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1678,7 +1764,7 @@ int lua_Container_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1702,13 +1788,13 @@ int lua_Container_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1767,10 +1853,10 @@ int lua_Container_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1877,13 +1963,13 @@ int lua_Container_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1929,13 +2015,13 @@ int lua_Container_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1981,13 +2067,13 @@ int lua_Container_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -2034,7 +2120,7 @@ int lua_Container_getLayout(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getLayout(); + void* returnPtr = ((void*)instance->getLayout()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2137,10 +2223,10 @@ int lua_Container_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -2222,7 +2308,7 @@ int lua_Container_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2288,6 +2374,54 @@ int lua_Container_getRefCount(lua_State* state) return 0; } +int lua_Container_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Container* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Container_getScriptEvent - 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; +} + int lua_Container_getScroll(lua_State* state) { // Get the number of parameters. @@ -2304,7 +2438,7 @@ int lua_Container_getScroll(lua_State* state) Container::Scroll result = instance->getScroll(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ContainerScroll(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2509,10 +2643,10 @@ int lua_Container_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2583,10 +2717,10 @@ int lua_Container_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2636,7 +2770,7 @@ int lua_Container_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2668,7 +2802,7 @@ int lua_Container_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2715,7 +2849,7 @@ int lua_Container_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2727,16 +2861,16 @@ int lua_Container_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2792,10 +2926,10 @@ int lua_Container_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2857,10 +2991,10 @@ int lua_Container_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Container* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2898,7 +3032,7 @@ int lua_Container_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2942,7 +3076,7 @@ int lua_Container_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2973,7 +3107,7 @@ int lua_Container_getTopLevelForm(lua_State* state) return 0; } -int lua_Container_getType(lua_State* state) +int lua_Container_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2986,7 +3120,7 @@ int lua_Container_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Container* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2994,7 +3128,7 @@ int lua_Container_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_Container_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Container_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3183,6 +3317,69 @@ int lua_Container_hasFocus(lua_State* state) return 0; } +int lua_Container_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Container* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Container* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Container_hasScriptListener - 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; +} + int lua_Container_insertControl(lua_State* state) { // Get the number of parameters. @@ -3694,6 +3891,45 @@ int lua_Container_isYPercentage(lua_State* state) return 0; } +int lua_Container_moveFocus(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_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + Container::Direction param1 = (Container::Direction)luaL_checkint(state, 2); + + Container* instance = getInstance(state); + bool result = instance->moveFocus(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Container_moveFocus - 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; +} + int lua_Container_release(lua_State* state) { // Get the number of parameters. @@ -3840,6 +4076,45 @@ int lua_Container_removeListener(lua_State* state) return 0; } +int lua_Container_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Container* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Container_removeScript - 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; +} + int lua_Container_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3851,14 +4126,20 @@ int lua_Container_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Container* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3933,10 +4214,10 @@ int lua_Container_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); Container* instance = getInstance(state); instance->setAlignment(param1); @@ -4047,10 +4328,10 @@ int lua_Container_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); Container* instance = getInstance(state); instance->setAutoSize(param1); @@ -4856,10 +5137,10 @@ int lua_Container_setLayout(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Layout::Type param1 = (Layout::Type)lua_enumFromString_LayoutType(luaL_checkstring(state, 2)); + Layout::Type param1 = (Layout::Type)luaL_checkint(state, 2); Container* instance = getInstance(state); instance->setLayout(param1); @@ -5086,10 +5367,10 @@ int lua_Container_setScroll(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Container::Scroll param1 = (Container::Scroll)lua_enumFromString_ContainerScroll(luaL_checkstring(state, 2)); + Container::Scroll param1 = (Container::Scroll)luaL_checkint(state, 2); Container* instance = getInstance(state); instance->setScroll(param1); @@ -5530,10 +5811,10 @@ int lua_Container_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); Container* instance = getInstance(state); instance->setTextAlignment(param1); @@ -5548,11 +5829,11 @@ int lua_Container_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -6102,7 +6383,7 @@ int lua_Container_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Container::create(param1); + void* returnPtr = ((void*)Container::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6140,7 +6421,7 @@ int lua_Container_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Container::create(param1, param2); + void* returnPtr = ((void*)Container::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6165,7 +6446,7 @@ int lua_Container_static_create(lua_State* state) { if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); @@ -6180,9 +6461,9 @@ int lua_Container_static_create(lua_State* state) } // Get parameter 3 off the stack. - Layout::Type param3 = (Layout::Type)lua_enumFromString_LayoutType(luaL_checkstring(state, 3)); + Layout::Type param3 = (Layout::Type)luaL_checkint(state, 3); - void* returnPtr = (void*)Container::create(param1, param2, param3); + void* returnPtr = ((void*)Container::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Container.h b/gameplay/src/lua/lua_Container.h index 859a8bdd1a..f7cad33e8f 100644 --- a/gameplay/src/lua/lua_Container.h +++ b/gameplay/src/lua/lua_Container.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CONTAINER_H_ #define LUA_CONTAINER_H_ @@ -9,8 +10,10 @@ int lua_Container__gc(lua_State* state); int lua_Container_addControl(lua_State* state); int lua_Container_addListener(lua_State* state); int lua_Container_addRef(lua_State* state); +int lua_Container_addScript(lua_State* state); int lua_Container_addScriptCallback(lua_State* state); int lua_Container_canFocus(lua_State* state); +int lua_Container_clearScripts(lua_State* state); int lua_Container_createAnimation(lua_State* state); int lua_Container_createAnimationFromBy(lua_State* state); int lua_Container_createAnimationFromTo(lua_State* state); @@ -46,6 +49,7 @@ int lua_Container_getOpacity(lua_State* state); int lua_Container_getPadding(lua_State* state); int lua_Container_getParent(lua_State* state); int lua_Container_getRefCount(lua_State* state); +int lua_Container_getScriptEvent(lua_State* state); int lua_Container_getScroll(lua_State* state); int lua_Container_getScrollPosition(lua_State* state); int lua_Container_getScrollWheelRequiresFocus(lua_State* state); @@ -60,12 +64,13 @@ int lua_Container_getTextColor(lua_State* state); int lua_Container_getTextRightToLeft(lua_State* state); int lua_Container_getTheme(lua_State* state); int lua_Container_getTopLevelForm(lua_State* state); -int lua_Container_getType(lua_State* state); +int lua_Container_getTypeName(lua_State* state); int lua_Container_getWidth(lua_State* state); int lua_Container_getX(lua_State* state); int lua_Container_getY(lua_State* state); int lua_Container_getZIndex(lua_State* state); int lua_Container_hasFocus(lua_State* state); +int lua_Container_hasScriptListener(lua_State* state); int lua_Container_insertControl(lua_State* state); int lua_Container_isChild(lua_State* state); int lua_Container_isContainer(lua_State* state); @@ -80,9 +85,11 @@ int lua_Container_isVisibleInHierarchy(lua_State* state); int lua_Container_isWidthPercentage(lua_State* state); int lua_Container_isXPercentage(lua_State* state); int lua_Container_isYPercentage(lua_State* state); +int lua_Container_moveFocus(lua_State* state); int lua_Container_release(lua_State* state); int lua_Container_removeControl(lua_State* state); int lua_Container_removeListener(lua_State* state); +int lua_Container_removeScript(lua_State* state); int lua_Container_removeScriptCallback(lua_State* state); int lua_Container_setActiveControl(lua_State* state); int lua_Container_setAlignment(lua_State* state); diff --git a/gameplay/src/lua/lua_ContainerScroll.cpp b/gameplay/src/lua/lua_ContainerScroll.cpp deleted file mode 100644 index 6dea28046c..0000000000 --- a/gameplay/src/lua/lua_ContainerScroll.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "Base.h" -#include "lua_ContainerScroll.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ContainerScroll_SCROLL_NONE = "SCROLL_NONE"; -static const char* luaEnumString_ContainerScroll_SCROLL_HORIZONTAL = "SCROLL_HORIZONTAL"; -static const char* luaEnumString_ContainerScroll_SCROLL_VERTICAL = "SCROLL_VERTICAL"; -static const char* luaEnumString_ContainerScroll_SCROLL_BOTH = "SCROLL_BOTH"; - -Container::Scroll lua_enumFromString_ContainerScroll(const char* s) -{ - if (strcmp(s, luaEnumString_ContainerScroll_SCROLL_NONE) == 0) - return Container::SCROLL_NONE; - if (strcmp(s, luaEnumString_ContainerScroll_SCROLL_HORIZONTAL) == 0) - return Container::SCROLL_HORIZONTAL; - if (strcmp(s, luaEnumString_ContainerScroll_SCROLL_VERTICAL) == 0) - return Container::SCROLL_VERTICAL; - if (strcmp(s, luaEnumString_ContainerScroll_SCROLL_BOTH) == 0) - return Container::SCROLL_BOTH; - return Container::SCROLL_NONE; -} - -const char* lua_stringFromEnum_ContainerScroll(Container::Scroll e) -{ - if (e == Container::SCROLL_NONE) - return luaEnumString_ContainerScroll_SCROLL_NONE; - if (e == Container::SCROLL_HORIZONTAL) - return luaEnumString_ContainerScroll_SCROLL_HORIZONTAL; - if (e == Container::SCROLL_VERTICAL) - return luaEnumString_ContainerScroll_SCROLL_VERTICAL; - if (e == Container::SCROLL_BOTH) - return luaEnumString_ContainerScroll_SCROLL_BOTH; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ContainerScroll.h b/gameplay/src/lua/lua_ContainerScroll.h deleted file mode 100644 index 940ab89696..0000000000 --- a/gameplay/src/lua/lua_ContainerScroll.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CONTAINERSCROLL_H_ -#define LUA_CONTAINERSCROLL_H_ - -#include "Container.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Container::Scroll. -Container::Scroll lua_enumFromString_ContainerScroll(const char* s); -const char* lua_stringFromEnum_ContainerScroll(Container::Scroll e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Control.cpp b/gameplay/src/lua/lua_Control.cpp index ff775f848c..b3e8a214ce 100644 --- a/gameplay/src/lua/lua_Control.cpp +++ b/gameplay/src/lua/lua_Control.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Control.h" @@ -7,17 +8,12 @@ #include "Control.h" #include "Form.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -28,8 +24,10 @@ void luaRegister_Control() { {"addListener", lua_Control_addListener}, {"addRef", lua_Control_addRef}, + {"addScript", lua_Control_addScript}, {"addScriptCallback", lua_Control_addScriptCallback}, {"canFocus", lua_Control_canFocus}, + {"clearScripts", lua_Control_clearScripts}, {"createAnimation", lua_Control_createAnimation}, {"createAnimationFromBy", lua_Control_createAnimationFromBy}, {"createAnimationFromTo", lua_Control_createAnimationFromTo}, @@ -61,6 +59,7 @@ void luaRegister_Control() {"getPadding", lua_Control_getPadding}, {"getParent", lua_Control_getParent}, {"getRefCount", lua_Control_getRefCount}, + {"getScriptEvent", lua_Control_getScriptEvent}, {"getSkinColor", lua_Control_getSkinColor}, {"getSkinRegion", lua_Control_getSkinRegion}, {"getState", lua_Control_getState}, @@ -70,12 +69,13 @@ void luaRegister_Control() {"getTextRightToLeft", lua_Control_getTextRightToLeft}, {"getTheme", lua_Control_getTheme}, {"getTopLevelForm", lua_Control_getTopLevelForm}, - {"getType", lua_Control_getType}, + {"getTypeName", lua_Control_getTypeName}, {"getWidth", lua_Control_getWidth}, {"getX", lua_Control_getX}, {"getY", lua_Control_getY}, {"getZIndex", lua_Control_getZIndex}, {"hasFocus", lua_Control_hasFocus}, + {"hasScriptListener", lua_Control_hasScriptListener}, {"isChild", lua_Control_isChild}, {"isContainer", lua_Control_isContainer}, {"isEnabled", lua_Control_isEnabled}, @@ -88,6 +88,7 @@ void luaRegister_Control() {"isYPercentage", lua_Control_isYPercentage}, {"release", lua_Control_release}, {"removeListener", lua_Control_removeListener}, + {"removeScript", lua_Control_removeScript}, {"removeScriptCallback", lua_Control_removeScriptCallback}, {"setAlignment", lua_Control_setAlignment}, {"setAnimationPropertyValue", lua_Control_setAnimationPropertyValue}, @@ -264,6 +265,54 @@ int lua_Control_addRef(lua_State* state) return 0; } +int lua_Control_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Control* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Control_addScript - 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; +} + int lua_Control_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -275,14 +324,20 @@ int lua_Control_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Control* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -339,6 +394,38 @@ int lua_Control_canFocus(lua_State* state) return 0; } +int lua_Control_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Control* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Control_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Control_createAnimation(lua_State* state) { // Get the number of parameters. @@ -362,7 +449,7 @@ int lua_Control_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -396,7 +483,7 @@ int lua_Control_createAnimation(lua_State* state) break; Control* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -428,7 +515,7 @@ int lua_Control_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -446,10 +533,10 @@ int lua_Control_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -483,7 +570,7 @@ int lua_Control_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -507,10 +594,10 @@ int lua_Control_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -557,7 +644,7 @@ int lua_Control_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -573,13 +660,13 @@ int lua_Control_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -625,7 +712,7 @@ int lua_Control_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -641,13 +728,13 @@ int lua_Control_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -788,7 +875,7 @@ int lua_Control_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -820,7 +907,7 @@ int lua_Control_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -850,7 +937,7 @@ int lua_Control_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -982,7 +1069,7 @@ int lua_Control_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1038,10 +1125,10 @@ int lua_Control_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1253,10 +1340,10 @@ int lua_Control_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1301,10 +1388,10 @@ int lua_Control_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1349,10 +1436,10 @@ int lua_Control_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1434,7 +1521,7 @@ int lua_Control_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1458,13 +1545,13 @@ int lua_Control_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1523,10 +1610,10 @@ int lua_Control_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1633,13 +1720,13 @@ int lua_Control_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1685,13 +1772,13 @@ int lua_Control_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1737,13 +1824,13 @@ int lua_Control_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1849,10 +1936,10 @@ int lua_Control_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -1934,7 +2021,7 @@ int lua_Control_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2000,6 +2087,54 @@ int lua_Control_getRefCount(lua_State* state) return 0; } +int lua_Control_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Control* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Control_getScriptEvent - 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; +} + int lua_Control_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2037,10 +2172,10 @@ int lua_Control_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2111,10 +2246,10 @@ int lua_Control_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2164,7 +2299,7 @@ int lua_Control_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2196,7 +2331,7 @@ int lua_Control_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2243,7 +2378,7 @@ int lua_Control_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2255,16 +2390,16 @@ int lua_Control_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2320,10 +2455,10 @@ int lua_Control_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2385,10 +2520,10 @@ int lua_Control_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Control* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2426,7 +2561,7 @@ int lua_Control_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2470,7 +2605,7 @@ int lua_Control_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2501,7 +2636,7 @@ int lua_Control_getTopLevelForm(lua_State* state) return 0; } -int lua_Control_getType(lua_State* state) +int lua_Control_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2514,7 +2649,7 @@ int lua_Control_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Control* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2522,7 +2657,7 @@ int lua_Control_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_Control_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Control_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2711,6 +2846,69 @@ int lua_Control_hasFocus(lua_State* state) return 0; } +int lua_Control_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Control* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Control* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Control_hasScriptListener - 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; +} + int lua_Control_isChild(lua_State* state) { // Get the number of parameters. @@ -3145,6 +3343,45 @@ int lua_Control_removeListener(lua_State* state) return 0; } +int lua_Control_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Control* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Control_removeScript - 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; +} + int lua_Control_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3156,14 +3393,20 @@ int lua_Control_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Control* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3196,10 +3439,10 @@ int lua_Control_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); Control* instance = getInstance(state); instance->setAlignment(param1); @@ -3310,10 +3553,10 @@ int lua_Control_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); Control* instance = getInstance(state); instance->setAutoSize(param1); @@ -4535,10 +4778,10 @@ int lua_Control_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); Control* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4553,11 +4796,11 @@ int lua_Control_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); diff --git a/gameplay/src/lua/lua_Control.h b/gameplay/src/lua/lua_Control.h index 4a8186cebd..3ca800e42a 100644 --- a/gameplay/src/lua/lua_Control.h +++ b/gameplay/src/lua/lua_Control.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CONTROL_H_ #define LUA_CONTROL_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_Control__gc(lua_State* state); int lua_Control_addListener(lua_State* state); int lua_Control_addRef(lua_State* state); +int lua_Control_addScript(lua_State* state); int lua_Control_addScriptCallback(lua_State* state); int lua_Control_canFocus(lua_State* state); +int lua_Control_clearScripts(lua_State* state); int lua_Control_createAnimation(lua_State* state); int lua_Control_createAnimationFromBy(lua_State* state); int lua_Control_createAnimationFromTo(lua_State* state); @@ -41,6 +44,7 @@ int lua_Control_getOpacity(lua_State* state); int lua_Control_getPadding(lua_State* state); int lua_Control_getParent(lua_State* state); int lua_Control_getRefCount(lua_State* state); +int lua_Control_getScriptEvent(lua_State* state); int lua_Control_getSkinColor(lua_State* state); int lua_Control_getSkinRegion(lua_State* state); int lua_Control_getState(lua_State* state); @@ -50,12 +54,13 @@ int lua_Control_getTextColor(lua_State* state); int lua_Control_getTextRightToLeft(lua_State* state); int lua_Control_getTheme(lua_State* state); int lua_Control_getTopLevelForm(lua_State* state); -int lua_Control_getType(lua_State* state); +int lua_Control_getTypeName(lua_State* state); int lua_Control_getWidth(lua_State* state); int lua_Control_getX(lua_State* state); int lua_Control_getY(lua_State* state); int lua_Control_getZIndex(lua_State* state); int lua_Control_hasFocus(lua_State* state); +int lua_Control_hasScriptListener(lua_State* state); int lua_Control_isChild(lua_State* state); int lua_Control_isContainer(lua_State* state); int lua_Control_isEnabled(lua_State* state); @@ -68,6 +73,7 @@ int lua_Control_isXPercentage(lua_State* state); int lua_Control_isYPercentage(lua_State* state); int lua_Control_release(lua_State* state); int lua_Control_removeListener(lua_State* state); +int lua_Control_removeScript(lua_State* state); int lua_Control_removeScriptCallback(lua_State* state); int lua_Control_setAlignment(lua_State* state); int lua_Control_setAnimationPropertyValue(lua_State* state); diff --git a/gameplay/src/lua/lua_ControlAlignment.cpp b/gameplay/src/lua/lua_ControlAlignment.cpp deleted file mode 100644 index e935180b8e..0000000000 --- a/gameplay/src/lua/lua_ControlAlignment.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "Base.h" -#include "lua_ControlAlignment.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ControlAlignment_ALIGN_LEFT = "ALIGN_LEFT"; -static const char* luaEnumString_ControlAlignment_ALIGN_HCENTER = "ALIGN_HCENTER"; -static const char* luaEnumString_ControlAlignment_ALIGN_RIGHT = "ALIGN_RIGHT"; -static const char* luaEnumString_ControlAlignment_ALIGN_TOP = "ALIGN_TOP"; -static const char* luaEnumString_ControlAlignment_ALIGN_VCENTER = "ALIGN_VCENTER"; -static const char* luaEnumString_ControlAlignment_ALIGN_BOTTOM = "ALIGN_BOTTOM"; -static const char* luaEnumString_ControlAlignment_ALIGN_TOP_LEFT = "ALIGN_TOP_LEFT"; -static const char* luaEnumString_ControlAlignment_ALIGN_VCENTER_LEFT = "ALIGN_VCENTER_LEFT"; -static const char* luaEnumString_ControlAlignment_ALIGN_BOTTOM_LEFT = "ALIGN_BOTTOM_LEFT"; -static const char* luaEnumString_ControlAlignment_ALIGN_TOP_HCENTER = "ALIGN_TOP_HCENTER"; -static const char* luaEnumString_ControlAlignment_ALIGN_VCENTER_HCENTER = "ALIGN_VCENTER_HCENTER"; -static const char* luaEnumString_ControlAlignment_ALIGN_BOTTOM_HCENTER = "ALIGN_BOTTOM_HCENTER"; -static const char* luaEnumString_ControlAlignment_ALIGN_TOP_RIGHT = "ALIGN_TOP_RIGHT"; -static const char* luaEnumString_ControlAlignment_ALIGN_VCENTER_RIGHT = "ALIGN_VCENTER_RIGHT"; -static const char* luaEnumString_ControlAlignment_ALIGN_BOTTOM_RIGHT = "ALIGN_BOTTOM_RIGHT"; - -Control::Alignment lua_enumFromString_ControlAlignment(const char* s) -{ - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_LEFT) == 0) - return Control::ALIGN_LEFT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_HCENTER) == 0) - return Control::ALIGN_HCENTER; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_RIGHT) == 0) - return Control::ALIGN_RIGHT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_TOP) == 0) - return Control::ALIGN_TOP; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_VCENTER) == 0) - return Control::ALIGN_VCENTER; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_BOTTOM) == 0) - return Control::ALIGN_BOTTOM; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_TOP_LEFT) == 0) - return Control::ALIGN_TOP_LEFT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_VCENTER_LEFT) == 0) - return Control::ALIGN_VCENTER_LEFT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_BOTTOM_LEFT) == 0) - return Control::ALIGN_BOTTOM_LEFT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_TOP_HCENTER) == 0) - return Control::ALIGN_TOP_HCENTER; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_VCENTER_HCENTER) == 0) - return Control::ALIGN_VCENTER_HCENTER; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_BOTTOM_HCENTER) == 0) - return Control::ALIGN_BOTTOM_HCENTER; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_TOP_RIGHT) == 0) - return Control::ALIGN_TOP_RIGHT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_VCENTER_RIGHT) == 0) - return Control::ALIGN_VCENTER_RIGHT; - if (strcmp(s, luaEnumString_ControlAlignment_ALIGN_BOTTOM_RIGHT) == 0) - return Control::ALIGN_BOTTOM_RIGHT; - return Control::ALIGN_LEFT; -} - -const char* lua_stringFromEnum_ControlAlignment(Control::Alignment e) -{ - if (e == Control::ALIGN_LEFT) - return luaEnumString_ControlAlignment_ALIGN_LEFT; - if (e == Control::ALIGN_HCENTER) - return luaEnumString_ControlAlignment_ALIGN_HCENTER; - if (e == Control::ALIGN_RIGHT) - return luaEnumString_ControlAlignment_ALIGN_RIGHT; - if (e == Control::ALIGN_TOP) - return luaEnumString_ControlAlignment_ALIGN_TOP; - if (e == Control::ALIGN_VCENTER) - return luaEnumString_ControlAlignment_ALIGN_VCENTER; - if (e == Control::ALIGN_BOTTOM) - return luaEnumString_ControlAlignment_ALIGN_BOTTOM; - if (e == Control::ALIGN_TOP_LEFT) - return luaEnumString_ControlAlignment_ALIGN_TOP_LEFT; - if (e == Control::ALIGN_VCENTER_LEFT) - return luaEnumString_ControlAlignment_ALIGN_VCENTER_LEFT; - if (e == Control::ALIGN_BOTTOM_LEFT) - return luaEnumString_ControlAlignment_ALIGN_BOTTOM_LEFT; - if (e == Control::ALIGN_TOP_HCENTER) - return luaEnumString_ControlAlignment_ALIGN_TOP_HCENTER; - if (e == Control::ALIGN_VCENTER_HCENTER) - return luaEnumString_ControlAlignment_ALIGN_VCENTER_HCENTER; - if (e == Control::ALIGN_BOTTOM_HCENTER) - return luaEnumString_ControlAlignment_ALIGN_BOTTOM_HCENTER; - if (e == Control::ALIGN_TOP_RIGHT) - return luaEnumString_ControlAlignment_ALIGN_TOP_RIGHT; - if (e == Control::ALIGN_VCENTER_RIGHT) - return luaEnumString_ControlAlignment_ALIGN_VCENTER_RIGHT; - if (e == Control::ALIGN_BOTTOM_RIGHT) - return luaEnumString_ControlAlignment_ALIGN_BOTTOM_RIGHT; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ControlAlignment.h b/gameplay/src/lua/lua_ControlAlignment.h deleted file mode 100644 index 969f8a4dfb..0000000000 --- a/gameplay/src/lua/lua_ControlAlignment.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CONTROLALIGNMENT_H_ -#define LUA_CONTROLALIGNMENT_H_ - -#include "Control.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Control::Alignment. -Control::Alignment lua_enumFromString_ControlAlignment(const char* s); -const char* lua_stringFromEnum_ControlAlignment(Control::Alignment e); - -} - -#endif diff --git a/gameplay/src/lua/lua_ControlAutoSize.cpp b/gameplay/src/lua/lua_ControlAutoSize.cpp deleted file mode 100644 index cfc750ce99..0000000000 --- a/gameplay/src/lua/lua_ControlAutoSize.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "Base.h" -#include "lua_ControlAutoSize.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_NONE = "AUTO_SIZE_NONE"; -static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_WIDTH = "AUTO_SIZE_WIDTH"; -static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_HEIGHT = "AUTO_SIZE_HEIGHT"; -static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_BOTH = "AUTO_SIZE_BOTH"; - -Control::AutoSize lua_enumFromString_ControlAutoSize(const char* s) -{ - if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_NONE) == 0) - return Control::AUTO_SIZE_NONE; - if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_WIDTH) == 0) - return Control::AUTO_SIZE_WIDTH; - if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_HEIGHT) == 0) - return Control::AUTO_SIZE_HEIGHT; - if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_BOTH) == 0) - return Control::AUTO_SIZE_BOTH; - return Control::AUTO_SIZE_NONE; -} - -const char* lua_stringFromEnum_ControlAutoSize(Control::AutoSize e) -{ - if (e == Control::AUTO_SIZE_NONE) - return luaEnumString_ControlAutoSize_AUTO_SIZE_NONE; - if (e == Control::AUTO_SIZE_WIDTH) - return luaEnumString_ControlAutoSize_AUTO_SIZE_WIDTH; - if (e == Control::AUTO_SIZE_HEIGHT) - return luaEnumString_ControlAutoSize_AUTO_SIZE_HEIGHT; - if (e == Control::AUTO_SIZE_BOTH) - return luaEnumString_ControlAutoSize_AUTO_SIZE_BOTH; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ControlAutoSize.h b/gameplay/src/lua/lua_ControlAutoSize.h deleted file mode 100644 index a152aadd6a..0000000000 --- a/gameplay/src/lua/lua_ControlAutoSize.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CONTROLAUTOSIZE_H_ -#define LUA_CONTROLAUTOSIZE_H_ - -#include "Control.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Control::AutoSize. -Control::AutoSize lua_enumFromString_ControlAutoSize(const char* s); -const char* lua_stringFromEnum_ControlAutoSize(Control::AutoSize e); - -} - -#endif diff --git a/gameplay/src/lua/lua_ControlListener.cpp b/gameplay/src/lua/lua_ControlListener.cpp index 76188738e4..48a68b8f83 100644 --- a/gameplay/src/lua/lua_ControlListener.cpp +++ b/gameplay/src/lua/lua_ControlListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_ControlListener.h" @@ -7,17 +8,12 @@ #include "Control.h" #include "Form.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -93,7 +89,7 @@ int lua_ControlListener_controlEvent(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. bool param1Valid; @@ -105,7 +101,7 @@ int lua_ControlListener_controlEvent(lua_State* state) } // Get parameter 2 off the stack. - Control::Listener::EventType param2 = (Control::Listener::EventType)lua_enumFromString_ControlListenerEventType(luaL_checkstring(state, 3)); + Control::Listener::EventType param2 = (Control::Listener::EventType)luaL_checkint(state, 3); Control::Listener* instance = getInstance(state); instance->controlEvent(param1, param2); diff --git a/gameplay/src/lua/lua_ControlListener.h b/gameplay/src/lua/lua_ControlListener.h index 30ec65d61d..90f34b42ab 100644 --- a/gameplay/src/lua/lua_ControlListener.h +++ b/gameplay/src/lua/lua_ControlListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CONTROLLISTENER_H_ #define LUA_CONTROLLISTENER_H_ diff --git a/gameplay/src/lua/lua_ControlListenerEventType.cpp b/gameplay/src/lua/lua_ControlListenerEventType.cpp deleted file mode 100644 index ea2551c593..0000000000 --- a/gameplay/src/lua/lua_ControlListenerEventType.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "Base.h" -#include "lua_ControlListenerEventType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ControlListenerEventType_PRESS = "PRESS"; -static const char* luaEnumString_ControlListenerEventType_RELEASE = "RELEASE"; -static const char* luaEnumString_ControlListenerEventType_CLICK = "CLICK"; -static const char* luaEnumString_ControlListenerEventType_VALUE_CHANGED = "VALUE_CHANGED"; -static const char* luaEnumString_ControlListenerEventType_TEXT_CHANGED = "TEXT_CHANGED"; -static const char* luaEnumString_ControlListenerEventType_MIDDLE_CLICK = "MIDDLE_CLICK"; -static const char* luaEnumString_ControlListenerEventType_RIGHT_CLICK = "RIGHT_CLICK"; -static const char* luaEnumString_ControlListenerEventType_FOCUS_GAINED = "FOCUS_GAINED"; -static const char* luaEnumString_ControlListenerEventType_FOCUS_LOST = "FOCUS_LOST"; - -Control::Listener::EventType lua_enumFromString_ControlListenerEventType(const char* s) -{ - if (strcmp(s, luaEnumString_ControlListenerEventType_PRESS) == 0) - return Control::Listener::PRESS; - if (strcmp(s, luaEnumString_ControlListenerEventType_RELEASE) == 0) - return Control::Listener::RELEASE; - if (strcmp(s, luaEnumString_ControlListenerEventType_CLICK) == 0) - return Control::Listener::CLICK; - if (strcmp(s, luaEnumString_ControlListenerEventType_VALUE_CHANGED) == 0) - return Control::Listener::VALUE_CHANGED; - if (strcmp(s, luaEnumString_ControlListenerEventType_TEXT_CHANGED) == 0) - return Control::Listener::TEXT_CHANGED; - if (strcmp(s, luaEnumString_ControlListenerEventType_MIDDLE_CLICK) == 0) - return Control::Listener::MIDDLE_CLICK; - if (strcmp(s, luaEnumString_ControlListenerEventType_RIGHT_CLICK) == 0) - return Control::Listener::RIGHT_CLICK; - if (strcmp(s, luaEnumString_ControlListenerEventType_FOCUS_GAINED) == 0) - return Control::Listener::FOCUS_GAINED; - if (strcmp(s, luaEnumString_ControlListenerEventType_FOCUS_LOST) == 0) - return Control::Listener::FOCUS_LOST; - return Control::Listener::PRESS; -} - -const char* lua_stringFromEnum_ControlListenerEventType(Control::Listener::EventType e) -{ - if (e == Control::Listener::PRESS) - return luaEnumString_ControlListenerEventType_PRESS; - if (e == Control::Listener::RELEASE) - return luaEnumString_ControlListenerEventType_RELEASE; - if (e == Control::Listener::CLICK) - return luaEnumString_ControlListenerEventType_CLICK; - if (e == Control::Listener::VALUE_CHANGED) - return luaEnumString_ControlListenerEventType_VALUE_CHANGED; - if (e == Control::Listener::TEXT_CHANGED) - return luaEnumString_ControlListenerEventType_TEXT_CHANGED; - if (e == Control::Listener::MIDDLE_CLICK) - return luaEnumString_ControlListenerEventType_MIDDLE_CLICK; - if (e == Control::Listener::RIGHT_CLICK) - return luaEnumString_ControlListenerEventType_RIGHT_CLICK; - if (e == Control::Listener::FOCUS_GAINED) - return luaEnumString_ControlListenerEventType_FOCUS_GAINED; - if (e == Control::Listener::FOCUS_LOST) - return luaEnumString_ControlListenerEventType_FOCUS_LOST; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ControlListenerEventType.h b/gameplay/src/lua/lua_ControlListenerEventType.h deleted file mode 100644 index 01bced448f..0000000000 --- a/gameplay/src/lua/lua_ControlListenerEventType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CONTROLLISTENEREVENTTYPE_H_ -#define LUA_CONTROLLISTENEREVENTTYPE_H_ - -#include "Control.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Control::Listener::EventType. -Control::Listener::EventType lua_enumFromString_ControlListenerEventType(const char* s); -const char* lua_stringFromEnum_ControlListenerEventType(Control::Listener::EventType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_ControlState.cpp b/gameplay/src/lua/lua_ControlState.cpp deleted file mode 100644 index 68fdc4295e..0000000000 --- a/gameplay/src/lua/lua_ControlState.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "Base.h" -#include "lua_ControlState.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ControlState_NORMAL = "NORMAL"; -static const char* luaEnumString_ControlState_FOCUS = "FOCUS"; -static const char* luaEnumString_ControlState_ACTIVE = "ACTIVE"; -static const char* luaEnumString_ControlState_DISABLED = "DISABLED"; -static const char* luaEnumString_ControlState_HOVER = "HOVER"; - -Control::State lua_enumFromString_ControlState(const char* s) -{ - if (strcmp(s, luaEnumString_ControlState_NORMAL) == 0) - return Control::NORMAL; - if (strcmp(s, luaEnumString_ControlState_FOCUS) == 0) - return Control::FOCUS; - if (strcmp(s, luaEnumString_ControlState_ACTIVE) == 0) - return Control::ACTIVE; - if (strcmp(s, luaEnumString_ControlState_DISABLED) == 0) - return Control::DISABLED; - if (strcmp(s, luaEnumString_ControlState_HOVER) == 0) - return Control::HOVER; - return Control::NORMAL; -} - -const char* lua_stringFromEnum_ControlState(Control::State e) -{ - if (e == Control::NORMAL) - return luaEnumString_ControlState_NORMAL; - if (e == Control::FOCUS) - return luaEnumString_ControlState_FOCUS; - if (e == Control::ACTIVE) - return luaEnumString_ControlState_ACTIVE; - if (e == Control::DISABLED) - return luaEnumString_ControlState_DISABLED; - if (e == Control::HOVER) - return luaEnumString_ControlState_HOVER; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ControlState.h b/gameplay/src/lua/lua_ControlState.h deleted file mode 100644 index eea58bcf3b..0000000000 --- a/gameplay/src/lua/lua_ControlState.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CONTROLSTATE_H_ -#define LUA_CONTROLSTATE_H_ - -#include "Control.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Control::State. -Control::State lua_enumFromString_ControlState(const char* s); -const char* lua_stringFromEnum_ControlState(Control::State e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Curve.cpp b/gameplay/src/lua/lua_Curve.cpp index dcfe31f30f..b79057d29e 100644 --- a/gameplay/src/lua/lua_Curve.cpp +++ b/gameplay/src/lua/lua_Curve.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Curve.h" @@ -6,7 +7,6 @@ #include "Game.h" #include "Quaternion.h" #include "Ref.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { @@ -20,6 +20,9 @@ void luaRegister_Curve() {"getComponentCount", lua_Curve_getComponentCount}, {"getEndTime", lua_Curve_getEndTime}, {"getPointCount", lua_Curve_getPointCount}, + {"getPointInterpolation", lua_Curve_getPointInterpolation}, + {"getPointTime", lua_Curve_getPointTime}, + {"getPointValues", lua_Curve_getPointValues}, {"getRefCount", lua_Curve_getRefCount}, {"getStartTime", lua_Curve_getStartTime}, {"release", lua_Curve_release}, @@ -300,6 +303,132 @@ int lua_Curve_getPointCount(lua_State* state) return 0; } +int lua_Curve_getPointInterpolation(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_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); + + Curve* instance = getInstance(state); + Curve::InterpolationType result = instance->getPointInterpolation(param1); + + // Push the return value onto the stack. + lua_pushnumber(state, (int)result); + + return 1; + } + + lua_pushstring(state, "lua_Curve_getPointInterpolation - 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; +} + +int lua_Curve_getPointTime(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_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); + + Curve* instance = getInstance(state); + float result = instance->getPointTime(param1); + + // Push the return value onto the stack. + lua_pushnumber(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Curve_getPointTime - 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; +} + +int lua_Curve_getPointValues(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 5: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER && + (lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TLIGHTUSERDATA) && + (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && + (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA)) + { + // Get parameter 1 off the stack. + unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); + + // Get parameter 2 off the stack. + gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getFloatPointer(3); + + // Get parameter 3 off the stack. + gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getFloatPointer(4); + + // Get parameter 4 off the stack. + gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); + + Curve* instance = getInstance(state); + instance->getPointValues(param1, param2, param3, param4); + + return 0; + } + + lua_pushstring(state, "lua_Curve_getPointValues - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 5)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Curve_getRefCount(lua_State* state) { // Get the number of parameters. @@ -418,7 +547,7 @@ int lua_Curve_setPoint(lua_State* state) lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 5) == LUA_TSTRING || lua_type(state, 5) == LUA_TNIL)) + lua_type(state, 5) == LUA_TNUMBER) { // Get parameter 1 off the stack. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); @@ -430,7 +559,7 @@ int lua_Curve_setPoint(lua_State* state) gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getFloatPointer(4); // Get parameter 4 off the stack. - Curve::InterpolationType param4 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 5)); + Curve::InterpolationType param4 = (Curve::InterpolationType)luaL_checkint(state, 5); Curve* instance = getInstance(state); instance->setPoint(param1, param2, param3, param4); @@ -451,7 +580,7 @@ int lua_Curve_setPoint(lua_State* state) lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 5) == LUA_TSTRING || lua_type(state, 5) == LUA_TNIL) && + lua_type(state, 5) == LUA_TNUMBER && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA)) { @@ -465,7 +594,7 @@ int lua_Curve_setPoint(lua_State* state) gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getFloatPointer(4); // Get parameter 4 off the stack. - Curve::InterpolationType param4 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 5)); + Curve::InterpolationType param4 = (Curve::InterpolationType)luaL_checkint(state, 5); // Get parameter 5 off the stack. gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); @@ -506,7 +635,7 @@ int lua_Curve_setTangent(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && lua_type(state, 2) == LUA_TNUMBER && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA)) { @@ -514,7 +643,7 @@ int lua_Curve_setTangent(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); // Get parameter 2 off the stack. - Curve::InterpolationType param2 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 3)); + Curve::InterpolationType param2 = (Curve::InterpolationType)luaL_checkint(state, 3); // Get parameter 3 off the stack. gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getFloatPointer(4); @@ -561,7 +690,7 @@ int lua_Curve_static_create(lua_State* state) // Get parameter 2 off the stack. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2); - void* returnPtr = (void*)Curve::create(param1, param2); + void* returnPtr = ((void*)Curve::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Curve.h b/gameplay/src/lua/lua_Curve.h index b5cec09747..110108e60a 100644 --- a/gameplay/src/lua/lua_Curve.h +++ b/gameplay/src/lua/lua_Curve.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_CURVE_H_ #define LUA_CURVE_H_ @@ -11,6 +12,9 @@ int lua_Curve_evaluate(lua_State* state); int lua_Curve_getComponentCount(lua_State* state); int lua_Curve_getEndTime(lua_State* state); int lua_Curve_getPointCount(lua_State* state); +int lua_Curve_getPointInterpolation(lua_State* state); +int lua_Curve_getPointTime(lua_State* state); +int lua_Curve_getPointValues(lua_State* state); int lua_Curve_getRefCount(lua_State* state); int lua_Curve_getStartTime(lua_State* state); int lua_Curve_release(lua_State* state); diff --git a/gameplay/src/lua/lua_CurveInterpolationType.cpp b/gameplay/src/lua/lua_CurveInterpolationType.cpp deleted file mode 100644 index 21dd985e58..0000000000 --- a/gameplay/src/lua/lua_CurveInterpolationType.cpp +++ /dev/null @@ -1,256 +0,0 @@ -#include "Base.h" -#include "lua_CurveInterpolationType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_CurveInterpolationType_BEZIER = "BEZIER"; -static const char* luaEnumString_CurveInterpolationType_BSPLINE = "BSPLINE"; -static const char* luaEnumString_CurveInterpolationType_FLAT = "FLAT"; -static const char* luaEnumString_CurveInterpolationType_HERMITE = "HERMITE"; -static const char* luaEnumString_CurveInterpolationType_LINEAR = "LINEAR"; -static const char* luaEnumString_CurveInterpolationType_SMOOTH = "SMOOTH"; -static const char* luaEnumString_CurveInterpolationType_STEP = "STEP"; -static const char* luaEnumString_CurveInterpolationType_QUADRATIC_IN = "QUADRATIC_IN"; -static const char* luaEnumString_CurveInterpolationType_QUADRATIC_OUT = "QUADRATIC_OUT"; -static const char* luaEnumString_CurveInterpolationType_QUADRATIC_IN_OUT = "QUADRATIC_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_QUADRATIC_OUT_IN = "QUADRATIC_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_CUBIC_IN = "CUBIC_IN"; -static const char* luaEnumString_CurveInterpolationType_CUBIC_OUT = "CUBIC_OUT"; -static const char* luaEnumString_CurveInterpolationType_CUBIC_IN_OUT = "CUBIC_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_CUBIC_OUT_IN = "CUBIC_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_QUARTIC_IN = "QUARTIC_IN"; -static const char* luaEnumString_CurveInterpolationType_QUARTIC_OUT = "QUARTIC_OUT"; -static const char* luaEnumString_CurveInterpolationType_QUARTIC_IN_OUT = "QUARTIC_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_QUARTIC_OUT_IN = "QUARTIC_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_QUINTIC_IN = "QUINTIC_IN"; -static const char* luaEnumString_CurveInterpolationType_QUINTIC_OUT = "QUINTIC_OUT"; -static const char* luaEnumString_CurveInterpolationType_QUINTIC_IN_OUT = "QUINTIC_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_QUINTIC_OUT_IN = "QUINTIC_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_SINE_IN = "SINE_IN"; -static const char* luaEnumString_CurveInterpolationType_SINE_OUT = "SINE_OUT"; -static const char* luaEnumString_CurveInterpolationType_SINE_IN_OUT = "SINE_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_SINE_OUT_IN = "SINE_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_EXPONENTIAL_IN = "EXPONENTIAL_IN"; -static const char* luaEnumString_CurveInterpolationType_EXPONENTIAL_OUT = "EXPONENTIAL_OUT"; -static const char* luaEnumString_CurveInterpolationType_EXPONENTIAL_IN_OUT = "EXPONENTIAL_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_EXPONENTIAL_OUT_IN = "EXPONENTIAL_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_CIRCULAR_IN = "CIRCULAR_IN"; -static const char* luaEnumString_CurveInterpolationType_CIRCULAR_OUT = "CIRCULAR_OUT"; -static const char* luaEnumString_CurveInterpolationType_CIRCULAR_IN_OUT = "CIRCULAR_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_CIRCULAR_OUT_IN = "CIRCULAR_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_ELASTIC_IN = "ELASTIC_IN"; -static const char* luaEnumString_CurveInterpolationType_ELASTIC_OUT = "ELASTIC_OUT"; -static const char* luaEnumString_CurveInterpolationType_ELASTIC_IN_OUT = "ELASTIC_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_ELASTIC_OUT_IN = "ELASTIC_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_OVERSHOOT_IN = "OVERSHOOT_IN"; -static const char* luaEnumString_CurveInterpolationType_OVERSHOOT_OUT = "OVERSHOOT_OUT"; -static const char* luaEnumString_CurveInterpolationType_OVERSHOOT_IN_OUT = "OVERSHOOT_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_OVERSHOOT_OUT_IN = "OVERSHOOT_OUT_IN"; -static const char* luaEnumString_CurveInterpolationType_BOUNCE_IN = "BOUNCE_IN"; -static const char* luaEnumString_CurveInterpolationType_BOUNCE_OUT = "BOUNCE_OUT"; -static const char* luaEnumString_CurveInterpolationType_BOUNCE_IN_OUT = "BOUNCE_IN_OUT"; -static const char* luaEnumString_CurveInterpolationType_BOUNCE_OUT_IN = "BOUNCE_OUT_IN"; - -Curve::InterpolationType lua_enumFromString_CurveInterpolationType(const char* s) -{ - if (strcmp(s, luaEnumString_CurveInterpolationType_BEZIER) == 0) - return Curve::BEZIER; - if (strcmp(s, luaEnumString_CurveInterpolationType_BSPLINE) == 0) - return Curve::BSPLINE; - if (strcmp(s, luaEnumString_CurveInterpolationType_FLAT) == 0) - return Curve::FLAT; - if (strcmp(s, luaEnumString_CurveInterpolationType_HERMITE) == 0) - return Curve::HERMITE; - if (strcmp(s, luaEnumString_CurveInterpolationType_LINEAR) == 0) - return Curve::LINEAR; - if (strcmp(s, luaEnumString_CurveInterpolationType_SMOOTH) == 0) - return Curve::SMOOTH; - if (strcmp(s, luaEnumString_CurveInterpolationType_STEP) == 0) - return Curve::STEP; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUADRATIC_IN) == 0) - return Curve::QUADRATIC_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUADRATIC_OUT) == 0) - return Curve::QUADRATIC_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUADRATIC_IN_OUT) == 0) - return Curve::QUADRATIC_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUADRATIC_OUT_IN) == 0) - return Curve::QUADRATIC_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_CUBIC_IN) == 0) - return Curve::CUBIC_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_CUBIC_OUT) == 0) - return Curve::CUBIC_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_CUBIC_IN_OUT) == 0) - return Curve::CUBIC_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_CUBIC_OUT_IN) == 0) - return Curve::CUBIC_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUARTIC_IN) == 0) - return Curve::QUARTIC_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUARTIC_OUT) == 0) - return Curve::QUARTIC_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUARTIC_IN_OUT) == 0) - return Curve::QUARTIC_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUARTIC_OUT_IN) == 0) - return Curve::QUARTIC_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUINTIC_IN) == 0) - return Curve::QUINTIC_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUINTIC_OUT) == 0) - return Curve::QUINTIC_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUINTIC_IN_OUT) == 0) - return Curve::QUINTIC_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_QUINTIC_OUT_IN) == 0) - return Curve::QUINTIC_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_SINE_IN) == 0) - return Curve::SINE_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_SINE_OUT) == 0) - return Curve::SINE_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_SINE_IN_OUT) == 0) - return Curve::SINE_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_SINE_OUT_IN) == 0) - return Curve::SINE_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_EXPONENTIAL_IN) == 0) - return Curve::EXPONENTIAL_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_EXPONENTIAL_OUT) == 0) - return Curve::EXPONENTIAL_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_EXPONENTIAL_IN_OUT) == 0) - return Curve::EXPONENTIAL_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_EXPONENTIAL_OUT_IN) == 0) - return Curve::EXPONENTIAL_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_CIRCULAR_IN) == 0) - return Curve::CIRCULAR_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_CIRCULAR_OUT) == 0) - return Curve::CIRCULAR_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_CIRCULAR_IN_OUT) == 0) - return Curve::CIRCULAR_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_CIRCULAR_OUT_IN) == 0) - return Curve::CIRCULAR_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_ELASTIC_IN) == 0) - return Curve::ELASTIC_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_ELASTIC_OUT) == 0) - return Curve::ELASTIC_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_ELASTIC_IN_OUT) == 0) - return Curve::ELASTIC_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_ELASTIC_OUT_IN) == 0) - return Curve::ELASTIC_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_OVERSHOOT_IN) == 0) - return Curve::OVERSHOOT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_OVERSHOOT_OUT) == 0) - return Curve::OVERSHOOT_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_OVERSHOOT_IN_OUT) == 0) - return Curve::OVERSHOOT_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_OVERSHOOT_OUT_IN) == 0) - return Curve::OVERSHOOT_OUT_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_BOUNCE_IN) == 0) - return Curve::BOUNCE_IN; - if (strcmp(s, luaEnumString_CurveInterpolationType_BOUNCE_OUT) == 0) - return Curve::BOUNCE_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_BOUNCE_IN_OUT) == 0) - return Curve::BOUNCE_IN_OUT; - if (strcmp(s, luaEnumString_CurveInterpolationType_BOUNCE_OUT_IN) == 0) - return Curve::BOUNCE_OUT_IN; - return Curve::BEZIER; -} - -const char* lua_stringFromEnum_CurveInterpolationType(Curve::InterpolationType e) -{ - if (e == Curve::BEZIER) - return luaEnumString_CurveInterpolationType_BEZIER; - if (e == Curve::BSPLINE) - return luaEnumString_CurveInterpolationType_BSPLINE; - if (e == Curve::FLAT) - return luaEnumString_CurveInterpolationType_FLAT; - if (e == Curve::HERMITE) - return luaEnumString_CurveInterpolationType_HERMITE; - if (e == Curve::LINEAR) - return luaEnumString_CurveInterpolationType_LINEAR; - if (e == Curve::SMOOTH) - return luaEnumString_CurveInterpolationType_SMOOTH; - if (e == Curve::STEP) - return luaEnumString_CurveInterpolationType_STEP; - if (e == Curve::QUADRATIC_IN) - return luaEnumString_CurveInterpolationType_QUADRATIC_IN; - if (e == Curve::QUADRATIC_OUT) - return luaEnumString_CurveInterpolationType_QUADRATIC_OUT; - if (e == Curve::QUADRATIC_IN_OUT) - return luaEnumString_CurveInterpolationType_QUADRATIC_IN_OUT; - if (e == Curve::QUADRATIC_OUT_IN) - return luaEnumString_CurveInterpolationType_QUADRATIC_OUT_IN; - if (e == Curve::CUBIC_IN) - return luaEnumString_CurveInterpolationType_CUBIC_IN; - if (e == Curve::CUBIC_OUT) - return luaEnumString_CurveInterpolationType_CUBIC_OUT; - if (e == Curve::CUBIC_IN_OUT) - return luaEnumString_CurveInterpolationType_CUBIC_IN_OUT; - if (e == Curve::CUBIC_OUT_IN) - return luaEnumString_CurveInterpolationType_CUBIC_OUT_IN; - if (e == Curve::QUARTIC_IN) - return luaEnumString_CurveInterpolationType_QUARTIC_IN; - if (e == Curve::QUARTIC_OUT) - return luaEnumString_CurveInterpolationType_QUARTIC_OUT; - if (e == Curve::QUARTIC_IN_OUT) - return luaEnumString_CurveInterpolationType_QUARTIC_IN_OUT; - if (e == Curve::QUARTIC_OUT_IN) - return luaEnumString_CurveInterpolationType_QUARTIC_OUT_IN; - if (e == Curve::QUINTIC_IN) - return luaEnumString_CurveInterpolationType_QUINTIC_IN; - if (e == Curve::QUINTIC_OUT) - return luaEnumString_CurveInterpolationType_QUINTIC_OUT; - if (e == Curve::QUINTIC_IN_OUT) - return luaEnumString_CurveInterpolationType_QUINTIC_IN_OUT; - if (e == Curve::QUINTIC_OUT_IN) - return luaEnumString_CurveInterpolationType_QUINTIC_OUT_IN; - if (e == Curve::SINE_IN) - return luaEnumString_CurveInterpolationType_SINE_IN; - if (e == Curve::SINE_OUT) - return luaEnumString_CurveInterpolationType_SINE_OUT; - if (e == Curve::SINE_IN_OUT) - return luaEnumString_CurveInterpolationType_SINE_IN_OUT; - if (e == Curve::SINE_OUT_IN) - return luaEnumString_CurveInterpolationType_SINE_OUT_IN; - if (e == Curve::EXPONENTIAL_IN) - return luaEnumString_CurveInterpolationType_EXPONENTIAL_IN; - if (e == Curve::EXPONENTIAL_OUT) - return luaEnumString_CurveInterpolationType_EXPONENTIAL_OUT; - if (e == Curve::EXPONENTIAL_IN_OUT) - return luaEnumString_CurveInterpolationType_EXPONENTIAL_IN_OUT; - if (e == Curve::EXPONENTIAL_OUT_IN) - return luaEnumString_CurveInterpolationType_EXPONENTIAL_OUT_IN; - if (e == Curve::CIRCULAR_IN) - return luaEnumString_CurveInterpolationType_CIRCULAR_IN; - if (e == Curve::CIRCULAR_OUT) - return luaEnumString_CurveInterpolationType_CIRCULAR_OUT; - if (e == Curve::CIRCULAR_IN_OUT) - return luaEnumString_CurveInterpolationType_CIRCULAR_IN_OUT; - if (e == Curve::CIRCULAR_OUT_IN) - return luaEnumString_CurveInterpolationType_CIRCULAR_OUT_IN; - if (e == Curve::ELASTIC_IN) - return luaEnumString_CurveInterpolationType_ELASTIC_IN; - if (e == Curve::ELASTIC_OUT) - return luaEnumString_CurveInterpolationType_ELASTIC_OUT; - if (e == Curve::ELASTIC_IN_OUT) - return luaEnumString_CurveInterpolationType_ELASTIC_IN_OUT; - if (e == Curve::ELASTIC_OUT_IN) - return luaEnumString_CurveInterpolationType_ELASTIC_OUT_IN; - if (e == Curve::OVERSHOOT_IN) - return luaEnumString_CurveInterpolationType_OVERSHOOT_IN; - if (e == Curve::OVERSHOOT_OUT) - return luaEnumString_CurveInterpolationType_OVERSHOOT_OUT; - if (e == Curve::OVERSHOOT_IN_OUT) - return luaEnumString_CurveInterpolationType_OVERSHOOT_IN_OUT; - if (e == Curve::OVERSHOOT_OUT_IN) - return luaEnumString_CurveInterpolationType_OVERSHOOT_OUT_IN; - if (e == Curve::BOUNCE_IN) - return luaEnumString_CurveInterpolationType_BOUNCE_IN; - if (e == Curve::BOUNCE_OUT) - return luaEnumString_CurveInterpolationType_BOUNCE_OUT; - if (e == Curve::BOUNCE_IN_OUT) - return luaEnumString_CurveInterpolationType_BOUNCE_IN_OUT; - if (e == Curve::BOUNCE_OUT_IN) - return luaEnumString_CurveInterpolationType_BOUNCE_OUT_IN; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_CurveInterpolationType.h b/gameplay/src/lua/lua_CurveInterpolationType.h deleted file mode 100644 index 09ba8b330e..0000000000 --- a/gameplay/src/lua/lua_CurveInterpolationType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_CURVEINTERPOLATIONTYPE_H_ -#define LUA_CURVEINTERPOLATIONTYPE_H_ - -#include "Curve.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Curve::InterpolationType. -Curve::InterpolationType lua_enumFromString_CurveInterpolationType(const char* s); -const char* lua_stringFromEnum_CurveInterpolationType(Curve::InterpolationType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_DepthStencilTarget.cpp b/gameplay/src/lua/lua_DepthStencilTarget.cpp index 4a43fa1169..266f96664a 100644 --- a/gameplay/src/lua/lua_DepthStencilTarget.cpp +++ b/gameplay/src/lua/lua_DepthStencilTarget.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_DepthStencilTarget.h" @@ -5,7 +6,6 @@ #include "DepthStencilTarget.h" #include "Game.h" #include "Ref.h" -#include "lua_DepthStencilTargetFormat.h" namespace gameplay { @@ -128,7 +128,7 @@ int lua_DepthStencilTarget_getFormat(lua_State* state) DepthStencilTarget::Format result = instance->getFormat(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_DepthStencilTargetFormat(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -365,7 +365,7 @@ int lua_DepthStencilTarget_static_create(lua_State* state) case 4: { if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER) { @@ -373,7 +373,7 @@ int lua_DepthStencilTarget_static_create(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(1, false); // Get parameter 2 off the stack. - DepthStencilTarget::Format param2 = (DepthStencilTarget::Format)lua_enumFromString_DepthStencilTargetFormat(luaL_checkstring(state, 2)); + DepthStencilTarget::Format param2 = (DepthStencilTarget::Format)luaL_checkint(state, 2); // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 3); @@ -381,7 +381,7 @@ int lua_DepthStencilTarget_static_create(lua_State* state) // Get parameter 4 off the stack. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 4); - void* returnPtr = (void*)DepthStencilTarget::create(param1, param2, param3, param4); + void* returnPtr = ((void*)DepthStencilTarget::create(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -427,7 +427,7 @@ int lua_DepthStencilTarget_static_getDepthStencilTarget(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)DepthStencilTarget::getDepthStencilTarget(param1); + void* returnPtr = ((void*)DepthStencilTarget::getDepthStencilTarget(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_DepthStencilTarget.h b/gameplay/src/lua/lua_DepthStencilTarget.h index 33c7845835..043683a367 100644 --- a/gameplay/src/lua/lua_DepthStencilTarget.h +++ b/gameplay/src/lua/lua_DepthStencilTarget.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_DEPTHSTENCILTARGET_H_ #define LUA_DEPTHSTENCILTARGET_H_ diff --git a/gameplay/src/lua/lua_DepthStencilTargetFormat.cpp b/gameplay/src/lua/lua_DepthStencilTargetFormat.cpp deleted file mode 100644 index 40a2ac36a6..0000000000 --- a/gameplay/src/lua/lua_DepthStencilTargetFormat.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_DepthStencilTargetFormat.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_DepthStencilTargetFormat_DEPTH = "DEPTH"; -static const char* luaEnumString_DepthStencilTargetFormat_DEPTH_STENCIL = "DEPTH_STENCIL"; - -DepthStencilTarget::Format lua_enumFromString_DepthStencilTargetFormat(const char* s) -{ - if (strcmp(s, luaEnumString_DepthStencilTargetFormat_DEPTH) == 0) - return DepthStencilTarget::DEPTH; - if (strcmp(s, luaEnumString_DepthStencilTargetFormat_DEPTH_STENCIL) == 0) - return DepthStencilTarget::DEPTH_STENCIL; - return DepthStencilTarget::DEPTH; -} - -const char* lua_stringFromEnum_DepthStencilTargetFormat(DepthStencilTarget::Format e) -{ - if (e == DepthStencilTarget::DEPTH) - return luaEnumString_DepthStencilTargetFormat_DEPTH; - if (e == DepthStencilTarget::DEPTH_STENCIL) - return luaEnumString_DepthStencilTargetFormat_DEPTH_STENCIL; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_DepthStencilTargetFormat.h b/gameplay/src/lua/lua_DepthStencilTargetFormat.h deleted file mode 100644 index 7f74c332b0..0000000000 --- a/gameplay/src/lua/lua_DepthStencilTargetFormat.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_DEPTHSTENCILTARGETFORMAT_H_ -#define LUA_DEPTHSTENCILTARGETFORMAT_H_ - -#include "DepthStencilTarget.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for DepthStencilTarget::Format. -DepthStencilTarget::Format lua_enumFromString_DepthStencilTargetFormat(const char* s); -const char* lua_stringFromEnum_DepthStencilTargetFormat(DepthStencilTarget::Format e); - -} - -#endif diff --git a/gameplay/src/lua/lua_FontText.cpp b/gameplay/src/lua/lua_Drawable.cpp similarity index 54% rename from gameplay/src/lua/lua_FontText.cpp rename to gameplay/src/lua/lua_Drawable.cpp index 07b18592a9..f128232e5d 100644 --- a/gameplay/src/lua/lua_FontText.cpp +++ b/gameplay/src/lua/lua_Drawable.cpp @@ -1,40 +1,36 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" -#include "lua_FontText.h" +#include "lua_Drawable.h" #include "Base.h" -#include "Bundle.h" -#include "FileSystem.h" -#include "Font.h" -#include "Game.h" -#include "Ref.h" -#include "lua_FontFormat.h" -#include "lua_FontJustify.h" +#include "Drawable.h" +#include "Node.h" namespace gameplay { -void luaRegister_FontText() +void luaRegister_Drawable() { const luaL_Reg lua_members[] = { - {"getText", lua_FontText_getText}, + {"draw", lua_Drawable_draw}, + {"getNode", lua_Drawable_getNode}, {NULL, NULL} }; const luaL_Reg* lua_statics = NULL; std::vector scopePath; - scopePath.push_back("Font"); - gameplay::ScriptUtil::registerClass("FontText", lua_members, lua_FontText__init, lua_FontText__gc, lua_statics, scopePath); + gameplay::ScriptUtil::registerClass("Drawable", lua_members, NULL, lua_Drawable__gc, lua_statics, scopePath); } -static Font::Text* getInstance(lua_State* state) +static Drawable* getInstance(lua_State* state) { - void* userdata = luaL_checkudata(state, 1, "FontText"); - luaL_argcheck(state, userdata != NULL, 1, "'FontText' expected."); - return (Font::Text*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance; + void* userdata = luaL_checkudata(state, 1, "Drawable"); + luaL_argcheck(state, userdata != NULL, 1, "'Drawable' expected."); + return (Drawable*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance; } -int lua_FontText__gc(lua_State* state) +int lua_Drawable__gc(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -46,19 +42,19 @@ int lua_FontText__gc(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA)) { - void* userdata = luaL_checkudata(state, 1, "FontText"); - luaL_argcheck(state, userdata != NULL, 1, "'FontText' expected."); + void* userdata = luaL_checkudata(state, 1, "Drawable"); + luaL_argcheck(state, userdata != NULL, 1, "'Drawable' expected."); gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata; if (object->owns) { - Font::Text* instance = (Font::Text*)object->instance; + Drawable* instance = (Drawable*)object->instance; SAFE_DELETE(instance); } return 0; } - lua_pushstring(state, "lua_FontText__gc - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Drawable__gc - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -72,7 +68,7 @@ int lua_FontText__gc(lua_State* state) return 0; } -int lua_FontText__init(lua_State* state) +int lua_Drawable_draw(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -82,35 +78,45 @@ int lua_FontText__init(lua_State* state) { case 1: { - if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL)) + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Drawable* instance = getInstance(state); + unsigned int result = instance->draw(); + + // Push the return value onto the stack. + lua_pushunsigned(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Drawable_draw - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 2: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + lua_type(state, 2) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(1, false); + bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); - void* returnPtr = (void*)new Font::Text(param1); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = true; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } + Drawable* instance = getInstance(state); + unsigned int result = instance->draw(param1); + + // Push the return value onto the stack. + lua_pushunsigned(state, result); return 1; } - lua_pushstring(state, "lua_FontText__init - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Drawable_draw - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 1 or 2)."); lua_error(state); break; } @@ -118,7 +124,7 @@ int lua_FontText__init(lua_State* state) return 0; } -int lua_FontText_getText(lua_State* state) +int lua_Drawable_getNode(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -130,16 +136,25 @@ int lua_FontText_getText(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA)) { - Font::Text* instance = getInstance(state); - const char* result = instance->getText(); - - // Push the return value onto the stack. - lua_pushstring(state, result); + Drawable* instance = getInstance(state); + void* returnPtr = ((void*)instance->getNode()); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Node"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } return 1; } - lua_pushstring(state, "lua_FontText_getText - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Drawable_getNode - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } diff --git a/gameplay/src/lua/lua_Drawable.h b/gameplay/src/lua/lua_Drawable.h new file mode 100644 index 0000000000..848b5f98b5 --- /dev/null +++ b/gameplay/src/lua/lua_Drawable.h @@ -0,0 +1,17 @@ +// Autogenerated by gameplay-luagen +#ifndef LUA_DRAWABLE_H_ +#define LUA_DRAWABLE_H_ + +namespace gameplay +{ + +// Lua bindings for Drawable. +int lua_Drawable__gc(lua_State* state); +int lua_Drawable_draw(lua_State* state); +int lua_Drawable_getNode(lua_State* state); + +void luaRegister_Drawable(); + +} + +#endif diff --git a/gameplay/src/lua/lua_Effect.cpp b/gameplay/src/lua/lua_Effect.cpp index 88562913b1..caa9003c14 100644 --- a/gameplay/src/lua/lua_Effect.cpp +++ b/gameplay/src/lua/lua_Effect.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Effect.h" @@ -235,7 +236,7 @@ int lua_Effect_getUniform(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Effect* instance = getInstance(state); - void* returnPtr = (void*)instance->getUniform(param1); + void* returnPtr = ((void*)instance->getUniform(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -262,7 +263,7 @@ int lua_Effect_getUniform(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Effect* instance = getInstance(state); - void* returnPtr = (void*)instance->getUniform(param1); + void* returnPtr = ((void*)instance->getUniform(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -939,7 +940,7 @@ int lua_Effect_static_createFromFile(lua_State* state) // Get parameter 2 off the stack. const char* param2 = gameplay::ScriptUtil::getString(2, false); - void* returnPtr = (void*)Effect::createFromFile(param1, param2); + void* returnPtr = ((void*)Effect::createFromFile(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -975,7 +976,7 @@ int lua_Effect_static_createFromFile(lua_State* state) // Get parameter 3 off the stack. const char* param3 = gameplay::ScriptUtil::getString(3, false); - void* returnPtr = (void*)Effect::createFromFile(param1, param2, param3); + void* returnPtr = ((void*)Effect::createFromFile(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1025,7 +1026,7 @@ int lua_Effect_static_createFromSource(lua_State* state) // Get parameter 2 off the stack. const char* param2 = gameplay::ScriptUtil::getString(2, false); - void* returnPtr = (void*)Effect::createFromSource(param1, param2); + void* returnPtr = ((void*)Effect::createFromSource(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1061,7 +1062,7 @@ int lua_Effect_static_createFromSource(lua_State* state) // Get parameter 3 off the stack. const char* param3 = gameplay::ScriptUtil::getString(3, false); - void* returnPtr = (void*)Effect::createFromSource(param1, param2, param3); + void* returnPtr = ((void*)Effect::createFromSource(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1102,7 +1103,7 @@ int lua_Effect_static_getCurrentEffect(lua_State* state) { case 0: { - void* returnPtr = (void*)Effect::getCurrentEffect(); + void* returnPtr = ((void*)Effect::getCurrentEffect()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Effect.h b/gameplay/src/lua/lua_Effect.h index 10781683bf..5208f1bc4a 100644 --- a/gameplay/src/lua/lua_Effect.h +++ b/gameplay/src/lua/lua_Effect.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_EFFECT_H_ #define LUA_EFFECT_H_ diff --git a/gameplay/src/lua/lua_FileSystem.cpp b/gameplay/src/lua/lua_FileSystem.cpp index 26d03c0dfd..908981136a 100644 --- a/gameplay/src/lua/lua_FileSystem.cpp +++ b/gameplay/src/lua/lua_FileSystem.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_FileSystem.h" @@ -20,6 +21,7 @@ void luaRegister_FileSystem() { {"createFileFromAsset", lua_FileSystem_static_createFileFromAsset}, {"fileExists", lua_FileSystem_static_fileExists}, + {"getAssetPath", lua_FileSystem_static_getAssetPath}, {"getDirectoryName", lua_FileSystem_static_getDirectoryName}, {"getExtension", lua_FileSystem_static_getExtension}, {"getResourcePath", lua_FileSystem_static_getResourcePath}, @@ -27,6 +29,7 @@ void luaRegister_FileSystem() {"loadResourceAliases", lua_FileSystem_static_loadResourceAliases}, {"readAll", lua_FileSystem_static_readAll}, {"resolvePath", lua_FileSystem_static_resolvePath}, + {"setAssetPath", lua_FileSystem_static_setAssetPath}, {"setResourcePath", lua_FileSystem_static_setResourcePath}, {NULL, NULL} }; @@ -151,6 +154,34 @@ int lua_FileSystem_static_fileExists(lua_State* state) return 0; } +int lua_FileSystem_static_getAssetPath(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: + { + const char* result = FileSystem::getAssetPath(); + + // Push the return value onto the stack. + lua_pushstring(state, result); + + return 1; + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 0)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_FileSystem_static_getDirectoryName(lua_State* state) { // Get the number of parameters. @@ -440,6 +471,40 @@ int lua_FileSystem_static_resolvePath(lua_State* state) return 0; } +int lua_FileSystem_static_setAssetPath(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 1: + { + if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(1, false); + + FileSystem::setAssetPath(param1); + + return 0; + } + + lua_pushstring(state, "lua_FileSystem_static_setAssetPath - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_FileSystem_static_setResourcePath(lua_State* state) { // Get the number of parameters. diff --git a/gameplay/src/lua/lua_FileSystem.h b/gameplay/src/lua/lua_FileSystem.h index 80f29c9933..e9076b6fc2 100644 --- a/gameplay/src/lua/lua_FileSystem.h +++ b/gameplay/src/lua/lua_FileSystem.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_FILESYSTEM_H_ #define LUA_FILESYSTEM_H_ @@ -8,6 +9,7 @@ namespace gameplay int lua_FileSystem__gc(lua_State* state); int lua_FileSystem_static_createFileFromAsset(lua_State* state); int lua_FileSystem_static_fileExists(lua_State* state); +int lua_FileSystem_static_getAssetPath(lua_State* state); int lua_FileSystem_static_getDirectoryName(lua_State* state); int lua_FileSystem_static_getExtension(lua_State* state); int lua_FileSystem_static_getResourcePath(lua_State* state); @@ -15,6 +17,7 @@ int lua_FileSystem_static_isAbsolutePath(lua_State* state); int lua_FileSystem_static_loadResourceAliases(lua_State* state); int lua_FileSystem_static_readAll(lua_State* state); int lua_FileSystem_static_resolvePath(lua_State* state); +int lua_FileSystem_static_setAssetPath(lua_State* state); int lua_FileSystem_static_setResourcePath(lua_State* state); void luaRegister_FileSystem(); diff --git a/gameplay/src/lua/lua_FlowLayout.cpp b/gameplay/src/lua/lua_FlowLayout.cpp index d0dd09d311..a586609a04 100644 --- a/gameplay/src/lua/lua_FlowLayout.cpp +++ b/gameplay/src/lua/lua_FlowLayout.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_FlowLayout.h" @@ -8,7 +9,6 @@ #include "Game.h" #include "Layout.h" #include "Ref.h" -#include "lua_LayoutType.h" namespace gameplay { @@ -195,7 +195,7 @@ int lua_FlowLayout_getType(lua_State* state) Layout::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_LayoutType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_FlowLayout.h b/gameplay/src/lua/lua_FlowLayout.h index 7d5ae65be3..39052f52c6 100644 --- a/gameplay/src/lua/lua_FlowLayout.h +++ b/gameplay/src/lua/lua_FlowLayout.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_FLOWLAYOUT_H_ #define LUA_FLOWLAYOUT_H_ diff --git a/gameplay/src/lua/lua_Font.cpp b/gameplay/src/lua/lua_Font.cpp index 1699e7f3c6..4653de66db 100644 --- a/gameplay/src/lua/lua_Font.cpp +++ b/gameplay/src/lua/lua_Font.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Font.h" @@ -6,9 +7,9 @@ #include "FileSystem.h" #include "Font.h" #include "Game.h" +#include "Material.h" #include "Ref.h" -#include "lua_FontFormat.h" -#include "lua_FontJustify.h" +#include "Text.h" namespace gameplay { @@ -18,7 +19,6 @@ void luaRegister_Font() const luaL_Reg lua_members[] = { {"addRef", lua_Font_addRef}, - {"createText", lua_Font_createText}, {"drawText", lua_Font_drawText}, {"finish", lua_Font_finish}, {"getCharacterSpacing", lua_Font_getCharacterSpacing}, @@ -124,390 +124,6 @@ int lua_Font_addRef(lua_State* state) return 0; } -int lua_Font_createText(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 4: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - - // Get parameter 2 off the stack. - bool param2Valid; - gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getObjectPointer(3, "Rectangle", true, ¶m2Valid); - if (!param2Valid) - { - lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'."); - lua_error(state); - } - - // Get parameter 3 off the stack. - bool param3Valid; - gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getObjectPointer(4, "Vector4", true, ¶m3Valid); - if (!param3Valid) - { - lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'."); - lua_error(state); - } - - Font* instance = getInstance(state); - void* returnPtr = (void*)instance->createText(param1, *param2, *param3); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - case 5: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && - lua_type(state, 5) == LUA_TNUMBER) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - - // Get parameter 2 off the stack. - bool param2Valid; - gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getObjectPointer(3, "Rectangle", true, ¶m2Valid); - if (!param2Valid) - { - lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'."); - lua_error(state); - } - - // Get parameter 3 off the stack. - bool param3Valid; - gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getObjectPointer(4, "Vector4", true, ¶m3Valid); - if (!param3Valid) - { - lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'."); - lua_error(state); - } - - // Get parameter 4 off the stack. - unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); - - Font* instance = getInstance(state); - void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - case 6: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && - lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - - // Get parameter 2 off the stack. - bool param2Valid; - gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getObjectPointer(3, "Rectangle", true, ¶m2Valid); - if (!param2Valid) - { - lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'."); - lua_error(state); - } - - // Get parameter 3 off the stack. - bool param3Valid; - gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getObjectPointer(4, "Vector4", true, ¶m3Valid); - if (!param3Valid) - { - lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'."); - lua_error(state); - } - - // Get parameter 4 off the stack. - unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); - - // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); - - Font* instance = getInstance(state); - void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - case 7: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && - lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && - lua_type(state, 7) == LUA_TBOOLEAN) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - - // Get parameter 2 off the stack. - bool param2Valid; - gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getObjectPointer(3, "Rectangle", true, ¶m2Valid); - if (!param2Valid) - { - lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'."); - lua_error(state); - } - - // Get parameter 3 off the stack. - bool param3Valid; - gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getObjectPointer(4, "Vector4", true, ¶m3Valid); - if (!param3Valid) - { - lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'."); - lua_error(state); - } - - // Get parameter 4 off the stack. - unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); - - // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); - - // Get parameter 6 off the stack. - bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); - - Font* instance = getInstance(state); - void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - case 8: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && - lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && - lua_type(state, 7) == LUA_TBOOLEAN && - lua_type(state, 8) == LUA_TBOOLEAN) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - - // Get parameter 2 off the stack. - bool param2Valid; - gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getObjectPointer(3, "Rectangle", true, ¶m2Valid); - if (!param2Valid) - { - lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'."); - lua_error(state); - } - - // Get parameter 3 off the stack. - bool param3Valid; - gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getObjectPointer(4, "Vector4", true, ¶m3Valid); - if (!param3Valid) - { - lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'."); - lua_error(state); - } - - // Get parameter 4 off the stack. - unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); - - // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); - - // Get parameter 6 off the stack. - bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); - - // Get parameter 7 off the stack. - bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8); - - Font* instance = getInstance(state); - void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6, param7); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - case 9: - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && - lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && - lua_type(state, 7) == LUA_TBOOLEAN && - lua_type(state, 8) == LUA_TBOOLEAN && - (lua_type(state, 9) == LUA_TUSERDATA || lua_type(state, 9) == LUA_TTABLE || lua_type(state, 9) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); - - // Get parameter 2 off the stack. - bool param2Valid; - gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getObjectPointer(3, "Rectangle", true, ¶m2Valid); - if (!param2Valid) - { - lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'."); - lua_error(state); - } - - // Get parameter 3 off the stack. - bool param3Valid; - gameplay::ScriptUtil::LuaArray param3 = gameplay::ScriptUtil::getObjectPointer(4, "Vector4", true, ¶m3Valid); - if (!param3Valid) - { - lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'."); - lua_error(state); - } - - // Get parameter 4 off the stack. - unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); - - // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); - - // Get parameter 6 off the stack. - bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); - - // Get parameter 7 off the stack. - bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8); - - // Get parameter 8 off the stack. - bool param8Valid; - gameplay::ScriptUtil::LuaArray param8 = gameplay::ScriptUtil::getObjectPointer(9, "Rectangle", false, ¶m8Valid); - if (!param8Valid) - { - lua_pushstring(state, "Failed to convert parameter 8 to type 'Rectangle'."); - lua_error(state); - } - - Font* instance = getInstance(state); - void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6, param7, param8); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "FontText"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 4, 5, 6, 7, 8 or 9)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_Font_drawText(lua_State* state) { // Get the number of parameters. @@ -516,30 +132,6 @@ int lua_Font_drawText(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 2: - { - do - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "FontText", false, ¶m1Valid); - if (!param1Valid) - break; - - Font* instance = getInstance(state); - instance->drawText(param1); - - return 0; - } - } while (0); - - lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } case 4: { do @@ -687,7 +279,7 @@ int lua_Font_drawText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL)) + lua_type(state, 6) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -708,7 +300,7 @@ int lua_Font_drawText(lua_State* state) unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); Font* instance = getInstance(state); instance->drawText(param1, *param2, *param3, param4, param5); @@ -768,7 +360,7 @@ int lua_Font_drawText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. @@ -790,7 +382,7 @@ int lua_Font_drawText(lua_State* state) unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); // Get parameter 6 off the stack. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); @@ -854,7 +446,7 @@ int lua_Font_drawText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TBOOLEAN && lua_type(state, 8) == LUA_TBOOLEAN) { @@ -877,7 +469,7 @@ int lua_Font_drawText(lua_State* state) unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); // Get parameter 6 off the stack. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); @@ -948,10 +540,10 @@ int lua_Font_drawText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TBOOLEAN && lua_type(state, 8) == LUA_TBOOLEAN && - (lua_type(state, 9) == LUA_TUSERDATA || lua_type(state, 9) == LUA_TTABLE || lua_type(state, 9) == LUA_TNIL)) + (lua_type(state, 9) == LUA_TUSERDATA || lua_type(state, 9) == LUA_TNIL)) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -972,7 +564,7 @@ int lua_Font_drawText(lua_State* state) unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5); // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); // Get parameter 6 off the stack. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); @@ -982,12 +574,12 @@ int lua_Font_drawText(lua_State* state) // Get parameter 8 off the stack. bool param8Valid; - gameplay::ScriptUtil::LuaArray param8 = gameplay::ScriptUtil::getObjectPointer(9, "Rectangle", false, ¶m8Valid); + gameplay::ScriptUtil::LuaArray param8 = gameplay::ScriptUtil::getObjectPointer(9, "Rectangle", true, ¶m8Valid); if (!param8Valid) break; Font* instance = getInstance(state); - instance->drawText(param1, *param2, *param3, param4, param5, param6, param7, param8); + instance->drawText(param1, *param2, *param3, param4, param5, param6, param7, *param8); return 0; } @@ -1052,7 +644,7 @@ int lua_Font_drawText(lua_State* state) } default: { - lua_pushstring(state, "Invalid number of parameters (expected 2, 4, 5, 6, 7, 8, 9 or 10)."); + lua_pushstring(state, "Invalid number of parameters (expected 4, 5, 6, 7, 8, 9 or 10)."); lua_error(state); break; } @@ -1143,7 +735,7 @@ int lua_Font_getFormat(lua_State* state) Font::Format result = instance->getFormat(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontFormat(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1233,7 +825,7 @@ int lua_Font_getIndexAtLocation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) && (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -1269,7 +861,7 @@ int lua_Font_getIndexAtLocation(lua_State* state) } // Get parameter 6 off the stack. - Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7)); + Font::Justify param6 = (Font::Justify)luaL_checkint(state, 7); Font* instance = getInstance(state); int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5, param6); @@ -1292,7 +884,7 @@ int lua_Font_getIndexAtLocation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) && (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) && + lua_type(state, 7) == LUA_TNUMBER && lua_type(state, 8) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. @@ -1329,7 +921,7 @@ int lua_Font_getIndexAtLocation(lua_State* state) } // Get parameter 6 off the stack. - Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7)); + Font::Justify param6 = (Font::Justify)luaL_checkint(state, 7); // Get parameter 7 off the stack. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8); @@ -1355,7 +947,7 @@ int lua_Font_getIndexAtLocation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) && (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) && + lua_type(state, 7) == LUA_TNUMBER && lua_type(state, 8) == LUA_TBOOLEAN && lua_type(state, 9) == LUA_TBOOLEAN) { @@ -1393,7 +985,7 @@ int lua_Font_getIndexAtLocation(lua_State* state) } // Get parameter 6 off the stack. - Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7)); + Font::Justify param6 = (Font::Justify)luaL_checkint(state, 7); // Get parameter 7 off the stack. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8); @@ -1486,7 +1078,7 @@ int lua_Font_getLocationAtIndex(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) && lua_type(state, 6) == LUA_TNUMBER && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -1516,7 +1108,7 @@ int lua_Font_getLocationAtIndex(lua_State* state) unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6); // Get parameter 6 off the stack. - Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7)); + Font::Justify param6 = (Font::Justify)luaL_checkint(state, 7); Font* instance = getInstance(state); instance->getLocationAtIndex(param1, *param2, param3, param4, param5, param6); @@ -1536,7 +1128,7 @@ int lua_Font_getLocationAtIndex(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) && lua_type(state, 6) == LUA_TNUMBER && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) && + lua_type(state, 7) == LUA_TNUMBER && lua_type(state, 8) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. @@ -1567,7 +1159,7 @@ int lua_Font_getLocationAtIndex(lua_State* state) unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6); // Get parameter 6 off the stack. - Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7)); + Font::Justify param6 = (Font::Justify)luaL_checkint(state, 7); // Get parameter 7 off the stack. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8); @@ -1590,7 +1182,7 @@ int lua_Font_getLocationAtIndex(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) && lua_type(state, 6) == LUA_TNUMBER && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) && + lua_type(state, 7) == LUA_TNUMBER && lua_type(state, 8) == LUA_TBOOLEAN && lua_type(state, 9) == LUA_TBOOLEAN) { @@ -1622,7 +1214,7 @@ int lua_Font_getLocationAtIndex(lua_State* state) unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6); // Get parameter 6 off the stack. - Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7)); + Font::Justify param6 = (Font::Justify)luaL_checkint(state, 7); // Get parameter 7 off the stack. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8); @@ -1793,7 +1385,7 @@ int lua_Font_getSpriteBatch(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Font* instance = getInstance(state); - void* returnPtr = (void*)instance->getSpriteBatch(param1); + void* returnPtr = ((void*)instance->getSpriteBatch(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1946,7 +1538,7 @@ int lua_Font_measureText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL)) + lua_type(state, 6) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -1967,7 +1559,7 @@ int lua_Font_measureText(lua_State* state) break; // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); Font* instance = getInstance(state); instance->measureText(param1, *param2, param3, param4, param5); @@ -1989,7 +1581,7 @@ int lua_Font_measureText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. @@ -2011,7 +1603,7 @@ int lua_Font_measureText(lua_State* state) break; // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); // Get parameter 6 off the stack. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); @@ -2036,7 +1628,7 @@ int lua_Font_measureText(lua_State* state) (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TBOOLEAN && lua_type(state, 8) == LUA_TBOOLEAN) { @@ -2059,7 +1651,7 @@ int lua_Font_measureText(lua_State* state) break; // Get parameter 5 off the stack. - Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6)); + Font::Justify param5 = (Font::Justify)luaL_checkint(state, 6); // Get parameter 6 off the stack. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7); @@ -2203,7 +1795,7 @@ int lua_Font_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Font::create(param1); + void* returnPtr = ((void*)Font::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2235,7 +1827,7 @@ int lua_Font_static_create(lua_State* state) // Get parameter 2 off the stack. const char* param2 = gameplay::ScriptUtil::getString(2, false); - void* returnPtr = (void*)Font::create(param1, param2); + void* returnPtr = ((void*)Font::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2284,7 +1876,7 @@ int lua_Font_static_getJustify(lua_State* state) Font::Justify result = Font::getJustify(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_Font.h b/gameplay/src/lua/lua_Font.h index 5c1d677c5d..f4ecf026d0 100644 --- a/gameplay/src/lua/lua_Font.h +++ b/gameplay/src/lua/lua_Font.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_FONT_H_ #define LUA_FONT_H_ @@ -7,7 +8,6 @@ namespace gameplay // Lua bindings for Font. int lua_Font__gc(lua_State* state); int lua_Font_addRef(lua_State* state); -int lua_Font_createText(lua_State* state); int lua_Font_drawText(lua_State* state); int lua_Font_finish(lua_State* state); int lua_Font_getCharacterSpacing(lua_State* state); diff --git a/gameplay/src/lua/lua_FontFormat.cpp b/gameplay/src/lua/lua_FontFormat.cpp deleted file mode 100644 index e16eb64204..0000000000 --- a/gameplay/src/lua/lua_FontFormat.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_FontFormat.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_FontFormat_BITMAP = "BITMAP"; -static const char* luaEnumString_FontFormat_DISTANCE_FIELD = "DISTANCE_FIELD"; - -Font::Format lua_enumFromString_FontFormat(const char* s) -{ - if (strcmp(s, luaEnumString_FontFormat_BITMAP) == 0) - return Font::BITMAP; - if (strcmp(s, luaEnumString_FontFormat_DISTANCE_FIELD) == 0) - return Font::DISTANCE_FIELD; - return Font::BITMAP; -} - -const char* lua_stringFromEnum_FontFormat(Font::Format e) -{ - if (e == Font::BITMAP) - return luaEnumString_FontFormat_BITMAP; - if (e == Font::DISTANCE_FIELD) - return luaEnumString_FontFormat_DISTANCE_FIELD; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_FontFormat.h b/gameplay/src/lua/lua_FontFormat.h deleted file mode 100644 index 914329a92a..0000000000 --- a/gameplay/src/lua/lua_FontFormat.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_FONTFORMAT_H_ -#define LUA_FONTFORMAT_H_ - -#include "Font.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Font::Format. -Font::Format lua_enumFromString_FontFormat(const char* s); -const char* lua_stringFromEnum_FontFormat(Font::Format e); - -} - -#endif diff --git a/gameplay/src/lua/lua_FontJustify.cpp b/gameplay/src/lua/lua_FontJustify.cpp deleted file mode 100644 index 46fd1e2532..0000000000 --- a/gameplay/src/lua/lua_FontJustify.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "Base.h" -#include "lua_FontJustify.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_FontJustify_ALIGN_LEFT = "ALIGN_LEFT"; -static const char* luaEnumString_FontJustify_ALIGN_HCENTER = "ALIGN_HCENTER"; -static const char* luaEnumString_FontJustify_ALIGN_RIGHT = "ALIGN_RIGHT"; -static const char* luaEnumString_FontJustify_ALIGN_TOP = "ALIGN_TOP"; -static const char* luaEnumString_FontJustify_ALIGN_VCENTER = "ALIGN_VCENTER"; -static const char* luaEnumString_FontJustify_ALIGN_BOTTOM = "ALIGN_BOTTOM"; -static const char* luaEnumString_FontJustify_ALIGN_TOP_LEFT = "ALIGN_TOP_LEFT"; -static const char* luaEnumString_FontJustify_ALIGN_VCENTER_LEFT = "ALIGN_VCENTER_LEFT"; -static const char* luaEnumString_FontJustify_ALIGN_BOTTOM_LEFT = "ALIGN_BOTTOM_LEFT"; -static const char* luaEnumString_FontJustify_ALIGN_TOP_HCENTER = "ALIGN_TOP_HCENTER"; -static const char* luaEnumString_FontJustify_ALIGN_VCENTER_HCENTER = "ALIGN_VCENTER_HCENTER"; -static const char* luaEnumString_FontJustify_ALIGN_BOTTOM_HCENTER = "ALIGN_BOTTOM_HCENTER"; -static const char* luaEnumString_FontJustify_ALIGN_TOP_RIGHT = "ALIGN_TOP_RIGHT"; -static const char* luaEnumString_FontJustify_ALIGN_VCENTER_RIGHT = "ALIGN_VCENTER_RIGHT"; -static const char* luaEnumString_FontJustify_ALIGN_BOTTOM_RIGHT = "ALIGN_BOTTOM_RIGHT"; - -Font::Justify lua_enumFromString_FontJustify(const char* s) -{ - if (strcmp(s, luaEnumString_FontJustify_ALIGN_LEFT) == 0) - return Font::ALIGN_LEFT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_HCENTER) == 0) - return Font::ALIGN_HCENTER; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_RIGHT) == 0) - return Font::ALIGN_RIGHT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_TOP) == 0) - return Font::ALIGN_TOP; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_VCENTER) == 0) - return Font::ALIGN_VCENTER; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_BOTTOM) == 0) - return Font::ALIGN_BOTTOM; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_TOP_LEFT) == 0) - return Font::ALIGN_TOP_LEFT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_VCENTER_LEFT) == 0) - return Font::ALIGN_VCENTER_LEFT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_BOTTOM_LEFT) == 0) - return Font::ALIGN_BOTTOM_LEFT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_TOP_HCENTER) == 0) - return Font::ALIGN_TOP_HCENTER; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_VCENTER_HCENTER) == 0) - return Font::ALIGN_VCENTER_HCENTER; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_BOTTOM_HCENTER) == 0) - return Font::ALIGN_BOTTOM_HCENTER; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_TOP_RIGHT) == 0) - return Font::ALIGN_TOP_RIGHT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_VCENTER_RIGHT) == 0) - return Font::ALIGN_VCENTER_RIGHT; - if (strcmp(s, luaEnumString_FontJustify_ALIGN_BOTTOM_RIGHT) == 0) - return Font::ALIGN_BOTTOM_RIGHT; - return Font::ALIGN_LEFT; -} - -const char* lua_stringFromEnum_FontJustify(Font::Justify e) -{ - if (e == Font::ALIGN_LEFT) - return luaEnumString_FontJustify_ALIGN_LEFT; - if (e == Font::ALIGN_HCENTER) - return luaEnumString_FontJustify_ALIGN_HCENTER; - if (e == Font::ALIGN_RIGHT) - return luaEnumString_FontJustify_ALIGN_RIGHT; - if (e == Font::ALIGN_TOP) - return luaEnumString_FontJustify_ALIGN_TOP; - if (e == Font::ALIGN_VCENTER) - return luaEnumString_FontJustify_ALIGN_VCENTER; - if (e == Font::ALIGN_BOTTOM) - return luaEnumString_FontJustify_ALIGN_BOTTOM; - if (e == Font::ALIGN_TOP_LEFT) - return luaEnumString_FontJustify_ALIGN_TOP_LEFT; - if (e == Font::ALIGN_VCENTER_LEFT) - return luaEnumString_FontJustify_ALIGN_VCENTER_LEFT; - if (e == Font::ALIGN_BOTTOM_LEFT) - return luaEnumString_FontJustify_ALIGN_BOTTOM_LEFT; - if (e == Font::ALIGN_TOP_HCENTER) - return luaEnumString_FontJustify_ALIGN_TOP_HCENTER; - if (e == Font::ALIGN_VCENTER_HCENTER) - return luaEnumString_FontJustify_ALIGN_VCENTER_HCENTER; - if (e == Font::ALIGN_BOTTOM_HCENTER) - return luaEnumString_FontJustify_ALIGN_BOTTOM_HCENTER; - if (e == Font::ALIGN_TOP_RIGHT) - return luaEnumString_FontJustify_ALIGN_TOP_RIGHT; - if (e == Font::ALIGN_VCENTER_RIGHT) - return luaEnumString_FontJustify_ALIGN_VCENTER_RIGHT; - if (e == Font::ALIGN_BOTTOM_RIGHT) - return luaEnumString_FontJustify_ALIGN_BOTTOM_RIGHT; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_FontJustify.h b/gameplay/src/lua/lua_FontJustify.h deleted file mode 100644 index 19b70d5215..0000000000 --- a/gameplay/src/lua/lua_FontJustify.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_FONTJUSTIFY_H_ -#define LUA_FONTJUSTIFY_H_ - -#include "Font.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Font::Justify. -Font::Justify lua_enumFromString_FontJustify(const char* s); -const char* lua_stringFromEnum_FontJustify(Font::Justify e); - -} - -#endif diff --git a/gameplay/src/lua/lua_FontStyle.cpp b/gameplay/src/lua/lua_FontStyle.cpp deleted file mode 100644 index 3a9a636dae..0000000000 --- a/gameplay/src/lua/lua_FontStyle.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "Base.h" -#include "lua_FontStyle.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_FontStyle_PLAIN = "PLAIN"; -static const char* luaEnumString_FontStyle_BOLD = "BOLD"; -static const char* luaEnumString_FontStyle_ITALIC = "ITALIC"; -static const char* luaEnumString_FontStyle_BOLD_ITALIC = "BOLD_ITALIC"; - -Font::Style lua_enumFromString_FontStyle(const char* s) -{ - if (strcmp(s, luaEnumString_FontStyle_PLAIN) == 0) - return Font::PLAIN; - if (strcmp(s, luaEnumString_FontStyle_BOLD) == 0) - return Font::BOLD; - if (strcmp(s, luaEnumString_FontStyle_ITALIC) == 0) - return Font::ITALIC; - if (strcmp(s, luaEnumString_FontStyle_BOLD_ITALIC) == 0) - return Font::BOLD_ITALIC; - return Font::PLAIN; -} - -const char* lua_stringFromEnum_FontStyle(Font::Style e) -{ - if (e == Font::PLAIN) - return luaEnumString_FontStyle_PLAIN; - if (e == Font::BOLD) - return luaEnumString_FontStyle_BOLD; - if (e == Font::ITALIC) - return luaEnumString_FontStyle_ITALIC; - if (e == Font::BOLD_ITALIC) - return luaEnumString_FontStyle_BOLD_ITALIC; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_FontStyle.h b/gameplay/src/lua/lua_FontStyle.h deleted file mode 100644 index 906cca9d22..0000000000 --- a/gameplay/src/lua/lua_FontStyle.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_FONTSTYLE_H_ -#define LUA_FONTSTYLE_H_ - -#include "Font.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Font::Style. -Font::Style lua_enumFromString_FontStyle(const char* s); -const char* lua_stringFromEnum_FontStyle(Font::Style e); - -} - -#endif diff --git a/gameplay/src/lua/lua_FontText.h b/gameplay/src/lua/lua_FontText.h deleted file mode 100644 index 8e8b4aed2e..0000000000 --- a/gameplay/src/lua/lua_FontText.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef LUA_FONTTEXT_H_ -#define LUA_FONTTEXT_H_ - -namespace gameplay -{ - -// Lua bindings for Font::Text. -int lua_FontText__gc(lua_State* state); -int lua_FontText__init(lua_State* state); -int lua_FontText_getText(lua_State* state); - -void luaRegister_FontText(); - -} - -#endif diff --git a/gameplay/src/lua/lua_Form.cpp b/gameplay/src/lua/lua_Form.cpp index 4f988e9750..15471cc660 100644 --- a/gameplay/src/lua/lua_Form.cpp +++ b/gameplay/src/lua/lua_Form.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Form.h" @@ -10,6 +11,7 @@ #include "Container.h" #include "Control.h" #include "ControlFactory.h" +#include "Drawable.h" #include "FlowLayout.h" #include "Form.h" #include "Game.h" @@ -17,6 +19,7 @@ #include "JoystickControl.h" #include "Label.h" #include "Layout.h" +#include "MaterialParameter.h" #include "Node.h" #include "RadioButton.h" #include "Ref.h" @@ -27,14 +30,6 @@ #include "TextBox.h" #include "Theme.h" #include "VerticalLayout.h" -#include "lua_ContainerScroll.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" -#include "lua_LayoutType.h" namespace gameplay { @@ -46,8 +41,10 @@ void luaRegister_Form() {"addControl", lua_Form_addControl}, {"addListener", lua_Form_addListener}, {"addRef", lua_Form_addRef}, + {"addScript", lua_Form_addScript}, {"addScriptCallback", lua_Form_addScriptCallback}, {"canFocus", lua_Form_canFocus}, + {"clearScripts", lua_Form_clearScripts}, {"createAnimation", lua_Form_createAnimation}, {"createAnimationFromBy", lua_Form_createAnimationFromBy}, {"createAnimationFromTo", lua_Form_createAnimationFromTo}, @@ -80,10 +77,12 @@ void luaRegister_Form() {"getImageUVs", lua_Form_getImageUVs}, {"getLayout", lua_Form_getLayout}, {"getMargin", lua_Form_getMargin}, + {"getNode", lua_Form_getNode}, {"getOpacity", lua_Form_getOpacity}, {"getPadding", lua_Form_getPadding}, {"getParent", lua_Form_getParent}, {"getRefCount", lua_Form_getRefCount}, + {"getScriptEvent", lua_Form_getScriptEvent}, {"getScroll", lua_Form_getScroll}, {"getScrollPosition", lua_Form_getScrollPosition}, {"getScrollWheelRequiresFocus", lua_Form_getScrollWheelRequiresFocus}, @@ -98,12 +97,13 @@ void luaRegister_Form() {"getTextRightToLeft", lua_Form_getTextRightToLeft}, {"getTheme", lua_Form_getTheme}, {"getTopLevelForm", lua_Form_getTopLevelForm}, - {"getType", lua_Form_getType}, + {"getTypeName", lua_Form_getTypeName}, {"getWidth", lua_Form_getWidth}, {"getX", lua_Form_getX}, {"getY", lua_Form_getY}, {"getZIndex", lua_Form_getZIndex}, {"hasFocus", lua_Form_hasFocus}, + {"hasScriptListener", lua_Form_hasScriptListener}, {"insertControl", lua_Form_insertControl}, {"isBatchingEnabled", lua_Form_isBatchingEnabled}, {"isChild", lua_Form_isChild}, @@ -119,9 +119,11 @@ void luaRegister_Form() {"isWidthPercentage", lua_Form_isWidthPercentage}, {"isXPercentage", lua_Form_isXPercentage}, {"isYPercentage", lua_Form_isYPercentage}, + {"moveFocus", lua_Form_moveFocus}, {"release", lua_Form_release}, {"removeControl", lua_Form_removeControl}, {"removeListener", lua_Form_removeListener}, + {"removeScript", lua_Form_removeScript}, {"removeScriptCallback", lua_Form_removeScriptCallback}, {"setActiveControl", lua_Form_setActiveControl}, {"setAlignment", lua_Form_setAlignment}, @@ -145,7 +147,6 @@ void luaRegister_Form() {"setImageRegion", lua_Form_setImageRegion}, {"setLayout", lua_Form_setLayout}, {"setMargin", lua_Form_setMargin}, - {"setNode", lua_Form_setNode}, {"setOpacity", lua_Form_setOpacity}, {"setPadding", lua_Form_setPadding}, {"setPosition", lua_Form_setPosition}, @@ -361,6 +362,54 @@ int lua_Form_addRef(lua_State* state) return 0; } +int lua_Form_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Form* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Form_addScript - 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; +} + int lua_Form_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -372,14 +421,20 @@ int lua_Form_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Form* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -436,6 +491,38 @@ int lua_Form_canFocus(lua_State* state) return 0; } +int lua_Form_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Form* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Form_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Form_createAnimation(lua_State* state) { // Get the number of parameters. @@ -459,7 +546,7 @@ int lua_Form_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -493,7 +580,7 @@ int lua_Form_createAnimation(lua_State* state) break; Form* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -525,7 +612,7 @@ int lua_Form_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -543,10 +630,10 @@ int lua_Form_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -580,7 +667,7 @@ int lua_Form_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -604,10 +691,10 @@ int lua_Form_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -654,7 +741,7 @@ int lua_Form_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -670,13 +757,13 @@ int lua_Form_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -722,7 +809,7 @@ int lua_Form_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -738,13 +825,13 @@ int lua_Form_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -850,9 +937,30 @@ int lua_Form_draw(lua_State* state) lua_error(state); break; } + case 2: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + lua_type(state, 2) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); + + Form* instance = getInstance(state); + unsigned int result = instance->draw(param1); + + // Push the return value onto the stack. + lua_pushunsigned(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Form_draw - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 1 or 2)."); lua_error(state); break; } @@ -917,7 +1025,7 @@ int lua_Form_getActiveControl(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getActiveControl(); + void* returnPtr = ((void*)instance->getActiveControl()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -964,7 +1072,7 @@ int lua_Form_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -996,7 +1104,7 @@ int lua_Form_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1026,7 +1134,7 @@ int lua_Form_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1158,7 +1266,7 @@ int lua_Form_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1214,10 +1322,10 @@ int lua_Form_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1437,7 +1545,7 @@ int lua_Form_getControl(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getControl(param1); + void* returnPtr = ((void*)instance->getControl(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1464,7 +1572,7 @@ int lua_Form_getControl(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getControl(param1); + void* returnPtr = ((void*)instance->getControl(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1542,10 +1650,10 @@ int lua_Form_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1590,10 +1698,10 @@ int lua_Form_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1638,10 +1746,10 @@ int lua_Form_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1723,7 +1831,7 @@ int lua_Form_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1747,13 +1855,13 @@ int lua_Form_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1812,10 +1920,10 @@ int lua_Form_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1922,13 +2030,13 @@ int lua_Form_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1974,13 +2082,13 @@ int lua_Form_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -2026,13 +2134,13 @@ int lua_Form_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -2079,7 +2187,7 @@ int lua_Form_getLayout(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getLayout(); + void* returnPtr = ((void*)instance->getLayout()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2154,6 +2262,50 @@ int lua_Form_getMargin(lua_State* state) return 0; } +int lua_Form_getNode(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Form* instance = getInstance(state); + void* returnPtr = ((void*)instance->getNode()); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Node"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Form_getNode - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Form_getOpacity(lua_State* state) { // Get the number of parameters. @@ -2182,10 +2334,10 @@ int lua_Form_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -2267,7 +2419,7 @@ int lua_Form_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2333,6 +2485,54 @@ int lua_Form_getRefCount(lua_State* state) return 0; } +int lua_Form_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Form* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Form_getScriptEvent - 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; +} + int lua_Form_getScroll(lua_State* state) { // Get the number of parameters. @@ -2349,7 +2549,7 @@ int lua_Form_getScroll(lua_State* state) Container::Scroll result = instance->getScroll(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ContainerScroll(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2554,10 +2754,10 @@ int lua_Form_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2628,10 +2828,10 @@ int lua_Form_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2681,7 +2881,7 @@ int lua_Form_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2713,7 +2913,7 @@ int lua_Form_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2760,7 +2960,7 @@ int lua_Form_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2772,16 +2972,16 @@ int lua_Form_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2837,10 +3037,10 @@ int lua_Form_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2902,10 +3102,10 @@ int lua_Form_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Form* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2943,7 +3143,7 @@ int lua_Form_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2987,7 +3187,7 @@ int lua_Form_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3018,7 +3218,7 @@ int lua_Form_getTopLevelForm(lua_State* state) return 0; } -int lua_Form_getType(lua_State* state) +int lua_Form_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3031,7 +3231,7 @@ int lua_Form_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Form* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -3039,7 +3239,7 @@ int lua_Form_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_Form_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Form_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3228,6 +3428,69 @@ int lua_Form_hasFocus(lua_State* state) return 0; } +int lua_Form_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Form* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Form* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Form_hasScriptListener - 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; +} + int lua_Form_insertControl(lua_State* state) { // Get the number of parameters. @@ -3774,6 +4037,45 @@ int lua_Form_isYPercentage(lua_State* state) return 0; } +int lua_Form_moveFocus(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_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + Container::Direction param1 = (Container::Direction)luaL_checkint(state, 2); + + Form* instance = getInstance(state); + bool result = instance->moveFocus(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Form_moveFocus - 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; +} + int lua_Form_release(lua_State* state) { // Get the number of parameters. @@ -3920,6 +4222,45 @@ int lua_Form_removeListener(lua_State* state) return 0; } +int lua_Form_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Form* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Form_removeScript - 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; +} + int lua_Form_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3931,14 +4272,20 @@ int lua_Form_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Form* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -4013,10 +4360,10 @@ int lua_Form_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); Form* instance = getInstance(state); instance->setAlignment(param1); @@ -4127,10 +4474,10 @@ int lua_Form_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); Form* instance = getInstance(state); instance->setAutoSize(param1); @@ -4972,10 +5319,10 @@ int lua_Form_setLayout(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Layout::Type param1 = (Layout::Type)lua_enumFromString_LayoutType(luaL_checkstring(state, 2)); + Layout::Type param1 = (Layout::Type)luaL_checkint(state, 2); Form* instance = getInstance(state); instance->setLayout(param1); @@ -5045,48 +5392,6 @@ int lua_Form_setMargin(lua_State* state) return 0; } -int lua_Form_setNode(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_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Node", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Node'."); - lua_error(state); - } - - Form* instance = getInstance(state); - instance->setNode(param1); - - return 0; - } - - lua_pushstring(state, "lua_Form_setNode - 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; -} - int lua_Form_setOpacity(lua_State* state) { // Get the number of parameters. @@ -5244,10 +5549,10 @@ int lua_Form_setScroll(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Container::Scroll param1 = (Container::Scroll)lua_enumFromString_ContainerScroll(luaL_checkstring(state, 2)); + Container::Scroll param1 = (Container::Scroll)luaL_checkint(state, 2); Form* instance = getInstance(state); instance->setScroll(param1); @@ -5688,10 +5993,10 @@ int lua_Form_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); Form* instance = getInstance(state); instance->setTextAlignment(param1); @@ -5706,11 +6011,11 @@ int lua_Form_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -6287,7 +6592,7 @@ int lua_Form_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Form::create(param1); + void* returnPtr = ((void*)Form::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6325,7 +6630,7 @@ int lua_Form_static_create(lua_State* state) if (!param2Valid) break; - void* returnPtr = (void*)Form::create(param1, param2); + void* returnPtr = ((void*)Form::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6353,7 +6658,7 @@ int lua_Form_static_create(lua_State* state) { if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); @@ -6365,9 +6670,9 @@ int lua_Form_static_create(lua_State* state) break; // Get parameter 3 off the stack. - Layout::Type param3 = (Layout::Type)lua_enumFromString_LayoutType(luaL_checkstring(state, 3)); + Layout::Type param3 = (Layout::Type)luaL_checkint(state, 3); - void* returnPtr = (void*)Form::create(param1, param2, param3); + void* returnPtr = ((void*)Form::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6409,7 +6714,7 @@ int lua_Form_static_getActiveControl(lua_State* state) { case 0: { - void* returnPtr = (void*)Form::getActiveControl(); + void* returnPtr = ((void*)Form::getActiveControl()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6426,9 +6731,37 @@ int lua_Form_static_getActiveControl(lua_State* state) return 1; break; } + case 1: + { + if (lua_type(state, 1) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1); + + void* returnPtr = ((void*)Form::getActiveControl(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Control"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Form_static_getActiveControl - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } default: { - lua_pushstring(state, "Invalid number of parameters (expected 0)."); + lua_pushstring(state, "Invalid number of parameters (expected 0 or 1)."); lua_error(state); break; } @@ -6446,7 +6779,7 @@ int lua_Form_static_getFocusControl(lua_State* state) { case 0: { - void* returnPtr = (void*)Form::getFocusControl(); + void* returnPtr = ((void*)Form::getFocusControl()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6488,7 +6821,7 @@ int lua_Form_static_getForm(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Form::getForm(param1); + void* returnPtr = ((void*)Form::getForm(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Form.h b/gameplay/src/lua/lua_Form.h index 5820bcd58f..f14958cfce 100644 --- a/gameplay/src/lua/lua_Form.h +++ b/gameplay/src/lua/lua_Form.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_FORM_H_ #define LUA_FORM_H_ @@ -9,8 +10,10 @@ int lua_Form__gc(lua_State* state); int lua_Form_addControl(lua_State* state); int lua_Form_addListener(lua_State* state); int lua_Form_addRef(lua_State* state); +int lua_Form_addScript(lua_State* state); int lua_Form_addScriptCallback(lua_State* state); int lua_Form_canFocus(lua_State* state); +int lua_Form_clearScripts(lua_State* state); int lua_Form_createAnimation(lua_State* state); int lua_Form_createAnimationFromBy(lua_State* state); int lua_Form_createAnimationFromTo(lua_State* state); @@ -43,10 +46,12 @@ int lua_Form_getImageRegion(lua_State* state); int lua_Form_getImageUVs(lua_State* state); int lua_Form_getLayout(lua_State* state); int lua_Form_getMargin(lua_State* state); +int lua_Form_getNode(lua_State* state); int lua_Form_getOpacity(lua_State* state); int lua_Form_getPadding(lua_State* state); int lua_Form_getParent(lua_State* state); int lua_Form_getRefCount(lua_State* state); +int lua_Form_getScriptEvent(lua_State* state); int lua_Form_getScroll(lua_State* state); int lua_Form_getScrollPosition(lua_State* state); int lua_Form_getScrollWheelRequiresFocus(lua_State* state); @@ -61,12 +66,13 @@ int lua_Form_getTextColor(lua_State* state); int lua_Form_getTextRightToLeft(lua_State* state); int lua_Form_getTheme(lua_State* state); int lua_Form_getTopLevelForm(lua_State* state); -int lua_Form_getType(lua_State* state); +int lua_Form_getTypeName(lua_State* state); int lua_Form_getWidth(lua_State* state); int lua_Form_getX(lua_State* state); int lua_Form_getY(lua_State* state); int lua_Form_getZIndex(lua_State* state); int lua_Form_hasFocus(lua_State* state); +int lua_Form_hasScriptListener(lua_State* state); int lua_Form_insertControl(lua_State* state); int lua_Form_isBatchingEnabled(lua_State* state); int lua_Form_isChild(lua_State* state); @@ -82,9 +88,11 @@ int lua_Form_isVisibleInHierarchy(lua_State* state); int lua_Form_isWidthPercentage(lua_State* state); int lua_Form_isXPercentage(lua_State* state); int lua_Form_isYPercentage(lua_State* state); +int lua_Form_moveFocus(lua_State* state); int lua_Form_release(lua_State* state); int lua_Form_removeControl(lua_State* state); int lua_Form_removeListener(lua_State* state); +int lua_Form_removeScript(lua_State* state); int lua_Form_removeScriptCallback(lua_State* state); int lua_Form_setActiveControl(lua_State* state); int lua_Form_setAlignment(lua_State* state); @@ -108,7 +116,6 @@ int lua_Form_setImageColor(lua_State* state); int lua_Form_setImageRegion(lua_State* state); int lua_Form_setLayout(lua_State* state); int lua_Form_setMargin(lua_State* state); -int lua_Form_setNode(lua_State* state); int lua_Form_setOpacity(lua_State* state); int lua_Form_setPadding(lua_State* state); int lua_Form_setPosition(lua_State* state); diff --git a/gameplay/src/lua/lua_FrameBuffer.cpp b/gameplay/src/lua/lua_FrameBuffer.cpp index 2e1e50d08e..38678df2ac 100644 --- a/gameplay/src/lua/lua_FrameBuffer.cpp +++ b/gameplay/src/lua/lua_FrameBuffer.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_FrameBuffer.h" @@ -134,7 +135,7 @@ int lua_FrameBuffer_bind(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { FrameBuffer* instance = getInstance(state); - void* returnPtr = (void*)instance->bind(); + void* returnPtr = ((void*)instance->bind()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -178,7 +179,7 @@ int lua_FrameBuffer_getDepthStencilTarget(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { FrameBuffer* instance = getInstance(state); - void* returnPtr = (void*)instance->getDepthStencilTarget(); + void* returnPtr = ((void*)instance->getDepthStencilTarget()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -327,7 +328,7 @@ int lua_FrameBuffer_getRenderTarget(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { FrameBuffer* instance = getInstance(state); - void* returnPtr = (void*)instance->getRenderTarget(); + void* returnPtr = ((void*)instance->getRenderTarget()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -357,7 +358,7 @@ int lua_FrameBuffer_getRenderTarget(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); FrameBuffer* instance = getInstance(state); - void* returnPtr = (void*)instance->getRenderTarget(param1); + void* returnPtr = ((void*)instance->getRenderTarget(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -577,23 +578,23 @@ int lua_FrameBuffer_setRenderTarget(lua_State* state) { case 2: { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + do { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "RenderTarget", false, ¶m1Valid); - if (!param1Valid) + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) { - lua_pushstring(state, "Failed to convert parameter 1 to type 'RenderTarget'."); - lua_error(state); + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "RenderTarget", false, ¶m1Valid); + if (!param1Valid) + break; + + FrameBuffer* instance = getInstance(state); + instance->setRenderTarget(param1); + + return 0; } - - FrameBuffer* instance = getInstance(state); - instance->setRenderTarget(param1); - - return 0; - } + } while (0); lua_pushstring(state, "lua_FrameBuffer_setRenderTarget - Failed to match the given parameters to a valid function signature."); lua_error(state); @@ -601,27 +602,81 @@ int lua_FrameBuffer_setRenderTarget(lua_State* state) } case 3: { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - lua_type(state, 3) == LUA_TNUMBER) + do { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "RenderTarget", false, ¶m1Valid); - if (!param1Valid) + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER) { - lua_pushstring(state, "Failed to convert parameter 1 to type 'RenderTarget'."); - lua_error(state); + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "RenderTarget", false, ¶m1Valid); + if (!param1Valid) + break; + + // Get parameter 2 off the stack. + unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3); + + FrameBuffer* instance = getInstance(state); + instance->setRenderTarget(param1, param2); + + return 0; } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "RenderTarget", false, ¶m1Valid); + if (!param1Valid) + break; - // Get parameter 2 off the stack. - unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3); + // Get parameter 2 off the stack. + Texture::CubeFace param2 = (Texture::CubeFace)luaL_checkint(state, 3); - FrameBuffer* instance = getInstance(state); - instance->setRenderTarget(param1, param2); - - return 0; - } + FrameBuffer* instance = getInstance(state); + instance->setRenderTarget(param1, param2); + + return 0; + } + } while (0); + + lua_pushstring(state, "lua_FrameBuffer_setRenderTarget - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 4: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER && + lua_type(state, 4) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "RenderTarget", false, ¶m1Valid); + if (!param1Valid) + break; + + // Get parameter 2 off the stack. + Texture::CubeFace param2 = (Texture::CubeFace)luaL_checkint(state, 3); + + // Get parameter 3 off the stack. + unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4); + + FrameBuffer* instance = getInstance(state); + instance->setRenderTarget(param1, param2, param3); + + return 0; + } + } while (0); lua_pushstring(state, "lua_FrameBuffer_setRenderTarget - Failed to match the given parameters to a valid function signature."); lua_error(state); @@ -629,7 +684,7 @@ int lua_FrameBuffer_setRenderTarget(lua_State* state) } default: { - lua_pushstring(state, "Invalid number of parameters (expected 2 or 3)."); + lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 4)."); lua_error(state); break; } @@ -647,7 +702,7 @@ int lua_FrameBuffer_static_bindDefault(lua_State* state) { case 0: { - void* returnPtr = (void*)FrameBuffer::bindDefault(); + void* returnPtr = ((void*)FrameBuffer::bindDefault()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -691,7 +746,7 @@ int lua_FrameBuffer_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)FrameBuffer::create(param1); + void* returnPtr = ((void*)FrameBuffer::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -730,7 +785,7 @@ int lua_FrameBuffer_static_create(lua_State* state) // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 3); - void* returnPtr = (void*)FrameBuffer::create(param1, param2, param3); + void* returnPtr = ((void*)FrameBuffer::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -772,7 +827,7 @@ int lua_FrameBuffer_static_createScreenshot(lua_State* state) { case 0: { - void* returnPtr = (void*)FrameBuffer::createScreenshot(); + void* returnPtr = ((void*)FrameBuffer::createScreenshot()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -789,9 +844,37 @@ int lua_FrameBuffer_static_createScreenshot(lua_State* state) return 1; break; } + case 1: + { + if (lua_type(state, 1) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + Image::Format param1 = (Image::Format)luaL_checkint(state, 1); + + void* returnPtr = ((void*)FrameBuffer::createScreenshot(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Image"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_FrameBuffer_static_createScreenshot - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } default: { - lua_pushstring(state, "Invalid number of parameters (expected 0)."); + lua_pushstring(state, "Invalid number of parameters (expected 0 or 1)."); lua_error(state); break; } @@ -809,7 +892,7 @@ int lua_FrameBuffer_static_getCurrent(lua_State* state) { case 0: { - void* returnPtr = (void*)FrameBuffer::getCurrent(); + void* returnPtr = ((void*)FrameBuffer::getCurrent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -851,7 +934,7 @@ int lua_FrameBuffer_static_getFrameBuffer(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)FrameBuffer::getFrameBuffer(param1); + void* returnPtr = ((void*)FrameBuffer::getFrameBuffer(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_FrameBuffer.h b/gameplay/src/lua/lua_FrameBuffer.h index 24070c496b..ef8da92411 100644 --- a/gameplay/src/lua/lua_FrameBuffer.h +++ b/gameplay/src/lua/lua_FrameBuffer.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_FRAMEBUFFER_H_ #define LUA_FRAMEBUFFER_H_ diff --git a/gameplay/src/lua/lua_Frustum.cpp b/gameplay/src/lua/lua_Frustum.cpp index 5ececd134e..eb27aa5249 100644 --- a/gameplay/src/lua/lua_Frustum.cpp +++ b/gameplay/src/lua/lua_Frustum.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Frustum.h" @@ -88,7 +89,7 @@ int lua_Frustum__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new Frustum(); + void* returnPtr = ((void*)new Frustum()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -117,7 +118,7 @@ int lua_Frustum__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Frustum(*param1); + void* returnPtr = ((void*)new Frustum(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -145,7 +146,7 @@ int lua_Frustum__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Frustum(*param1); + void* returnPtr = ((void*)new Frustum(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Frustum.h b/gameplay/src/lua/lua_Frustum.h index 7cfd8c7fa9..802f4e7bbd 100644 --- a/gameplay/src/lua/lua_Frustum.h +++ b/gameplay/src/lua/lua_Frustum.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_FRUSTUM_H_ #define LUA_FRUSTUM_H_ diff --git a/gameplay/src/lua/lua_Game.cpp b/gameplay/src/lua/lua_Game.cpp index b3223afad7..dee3323be5 100644 --- a/gameplay/src/lua/lua_Game.cpp +++ b/gameplay/src/lua/lua_Game.cpp @@ -1,22 +1,17 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Game.h" #include "Base.h" #include "ControlFactory.h" #include "FileSystem.h" +#include "Form.h" #include "FrameBuffer.h" #include "Game.h" #include "Platform.h" #include "RenderState.h" #include "SceneLoader.h" #include "Theme.h" -#include "lua_GameClearFlags.h" -#include "lua_GameState.h" -#include "lua_GamepadGamepadEvent.h" -#include "lua_GestureGestureEvent.h" -#include "lua_KeyboardKeyEvent.h" -#include "lua_MouseMouseEvent.h" -#include "lua_TouchTouchEvent.h" namespace gameplay { @@ -27,6 +22,7 @@ void luaRegister_Game() { {"canExit", lua_Game_canExit}, {"clear", lua_Game_clear}, + {"clearSchedule", lua_Game_clearSchedule}, {"displayKeyboard", lua_Game_displayKeyboard}, {"exit", lua_Game_exit}, {"frame", lua_Game_frame}, @@ -92,7 +88,7 @@ void luaRegister_Game() }; std::vector scopePath; - gameplay::ScriptUtil::registerClass("Game", lua_members, NULL, lua_Game__gc, lua_statics, scopePath); + gameplay::ScriptUtil::registerClass("Game", lua_members, lua_Game__init, lua_Game__gc, lua_statics, scopePath); } static Game* getInstance(lua_State* state) @@ -140,6 +136,43 @@ int lua_Game__gc(lua_State* state) return 0; } +int lua_Game__init(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: + { + void* returnPtr = ((void*)new Game()); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = true; + luaL_getmetatable(state, "Game"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 0)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Game_canExit(lua_State* state) { // Get the number of parameters. @@ -188,13 +221,13 @@ int lua_Game_clear(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TNUMBER && lua_type(state, 5) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Game::ClearFlags param1 = (Game::ClearFlags)lua_enumFromString_GameClearFlags(luaL_checkstring(state, 2)); + Game::ClearFlags param1 = (Game::ClearFlags)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -224,7 +257,7 @@ int lua_Game_clear(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER && lua_type(state, 5) == LUA_TNUMBER && @@ -233,7 +266,7 @@ int lua_Game_clear(lua_State* state) lua_type(state, 8) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Game::ClearFlags param1 = (Game::ClearFlags)lua_enumFromString_GameClearFlags(luaL_checkstring(state, 2)); + Game::ClearFlags param1 = (Game::ClearFlags)luaL_checkint(state, 2); // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 3); @@ -274,6 +307,38 @@ int lua_Game_clear(lua_State* state) return 0; } +int lua_Game_clearSchedule(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Game* instance = getInstance(state); + instance->clearSchedule(); + + return 0; + } + + lua_pushstring(state, "lua_Game_clearSchedule - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Game_displayKeyboard(lua_State* state) { // Get the number of parameters. @@ -385,11 +450,11 @@ int lua_Game_gamepadEvent(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - Gamepad::GamepadEvent param1 = (Gamepad::GamepadEvent)lua_enumFromString_GamepadGamepadEvent(luaL_checkstring(state, 2)); + Gamepad::GamepadEvent param1 = (Gamepad::GamepadEvent)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -685,7 +750,7 @@ int lua_Game_getAIController(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getAIController(); + void* returnPtr = ((void*)instance->getAIController()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -769,7 +834,7 @@ int lua_Game_getAnimationController(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimationController(); + void* returnPtr = ((void*)instance->getAnimationController()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -848,7 +913,7 @@ int lua_Game_getAudioController(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getAudioController(); + void* returnPtr = ((void*)instance->getAudioController()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -892,7 +957,7 @@ int lua_Game_getAudioListener(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getAudioListener(); + void* returnPtr = ((void*)instance->getAudioListener()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -936,7 +1001,7 @@ int lua_Game_getConfig(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getConfig(); + void* returnPtr = ((void*)instance->getConfig()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1019,7 +1084,7 @@ int lua_Game_getGamepad(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getGamepad(param1); + void* returnPtr = ((void*)instance->getGamepad(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1053,7 +1118,7 @@ int lua_Game_getGamepad(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getGamepad(param1, param2); + void* returnPtr = ((void*)instance->getGamepad(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1167,7 +1232,7 @@ int lua_Game_getPhysicsController(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getPhysicsController(); + void* returnPtr = ((void*)instance->getPhysicsController()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1211,7 +1276,7 @@ int lua_Game_getScriptController(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Game* instance = getInstance(state); - void* returnPtr = (void*)instance->getScriptController(); + void* returnPtr = ((void*)instance->getScriptController()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1314,7 +1379,7 @@ int lua_Game_getState(lua_State* state) Game::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_GameState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1528,10 +1593,10 @@ int lua_Game_isGestureRegistered(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2)); + Gesture::GestureEvent param1 = (Gesture::GestureEvent)luaL_checkint(state, 2); Game* instance = getInstance(state); bool result = instance->isGestureRegistered(param1); @@ -1567,10 +1632,10 @@ int lua_Game_isGestureSupported(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2)); + Gesture::GestureEvent param1 = (Gesture::GestureEvent)luaL_checkint(state, 2); Game* instance = getInstance(state); bool result = instance->isGestureSupported(param1); @@ -1746,11 +1811,11 @@ int lua_Game_keyEvent(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Keyboard::KeyEvent param1 = (Keyboard::KeyEvent)lua_enumFromString_KeyboardKeyEvent(luaL_checkstring(state, 2)); + Keyboard::KeyEvent param1 = (Keyboard::KeyEvent)luaL_checkint(state, 2); // Get parameter 2 off the stack. int param2 = (int)luaL_checkint(state, 3); @@ -1825,13 +1890,13 @@ int lua_Game_mouseEvent(lua_State* state) case 5: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER && lua_type(state, 5) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Mouse::MouseEvent param1 = (Mouse::MouseEvent)lua_enumFromString_MouseMouseEvent(luaL_checkstring(state, 2)); + Mouse::MouseEvent param1 = (Mouse::MouseEvent)luaL_checkint(state, 2); // Get parameter 2 off the stack. int param2 = (int)luaL_checkint(state, 3); @@ -1908,10 +1973,10 @@ int lua_Game_registerGesture(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2)); + Gesture::GestureEvent param1 = (Gesture::GestureEvent)luaL_checkint(state, 2); Game* instance = getInstance(state); instance->registerGesture(param1); @@ -2332,7 +2397,7 @@ int lua_Game_static_getInstance(lua_State* state) { case 0: { - void* returnPtr = (void*)Game::getInstance(); + void* returnPtr = ((void*)Game::getInstance()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2432,13 +2497,13 @@ int lua_Game_touchEvent(lua_State* state) case 5: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER && lua_type(state, 5) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Touch::TouchEvent param1 = (Touch::TouchEvent)lua_enumFromString_TouchTouchEvent(luaL_checkstring(state, 2)); + Touch::TouchEvent param1 = (Touch::TouchEvent)luaL_checkint(state, 2); // Get parameter 2 off the stack. int param2 = (int)luaL_checkint(state, 3); @@ -2480,10 +2545,10 @@ int lua_Game_unregisterGesture(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2)); + Gesture::GestureEvent param1 = (Gesture::GestureEvent)luaL_checkint(state, 2); Game* instance = getInstance(state); instance->unregisterGesture(param1); diff --git a/gameplay/src/lua/lua_Game.h b/gameplay/src/lua/lua_Game.h index e48833354b..03776659a0 100644 --- a/gameplay/src/lua/lua_Game.h +++ b/gameplay/src/lua/lua_Game.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_GAME_H_ #define LUA_GAME_H_ @@ -6,8 +7,10 @@ namespace gameplay // Lua bindings for Game. int lua_Game__gc(lua_State* state); +int lua_Game__init(lua_State* state); int lua_Game_canExit(lua_State* state); int lua_Game_clear(lua_State* state); +int lua_Game_clearSchedule(lua_State* state); int lua_Game_displayKeyboard(lua_State* state); int lua_Game_exit(lua_State* state); int lua_Game_frame(lua_State* state); diff --git a/gameplay/src/lua/lua_GameClearFlags.cpp b/gameplay/src/lua/lua_GameClearFlags.cpp deleted file mode 100644 index 280ad0b625..0000000000 --- a/gameplay/src/lua/lua_GameClearFlags.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "Base.h" -#include "lua_GameClearFlags.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_GameClearFlags_CLEAR_COLOR = "CLEAR_COLOR"; -static const char* luaEnumString_GameClearFlags_CLEAR_DEPTH = "CLEAR_DEPTH"; -static const char* luaEnumString_GameClearFlags_CLEAR_STENCIL = "CLEAR_STENCIL"; -static const char* luaEnumString_GameClearFlags_CLEAR_COLOR_DEPTH = "CLEAR_COLOR_DEPTH"; -static const char* luaEnumString_GameClearFlags_CLEAR_COLOR_STENCIL = "CLEAR_COLOR_STENCIL"; -static const char* luaEnumString_GameClearFlags_CLEAR_DEPTH_STENCIL = "CLEAR_DEPTH_STENCIL"; -static const char* luaEnumString_GameClearFlags_CLEAR_COLOR_DEPTH_STENCIL = "CLEAR_COLOR_DEPTH_STENCIL"; - -Game::ClearFlags lua_enumFromString_GameClearFlags(const char* s) -{ - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_COLOR) == 0) - return Game::CLEAR_COLOR; - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_DEPTH) == 0) - return Game::CLEAR_DEPTH; - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_STENCIL) == 0) - return Game::CLEAR_STENCIL; - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_COLOR_DEPTH) == 0) - return Game::CLEAR_COLOR_DEPTH; - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_COLOR_STENCIL) == 0) - return Game::CLEAR_COLOR_STENCIL; - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_DEPTH_STENCIL) == 0) - return Game::CLEAR_DEPTH_STENCIL; - if (strcmp(s, luaEnumString_GameClearFlags_CLEAR_COLOR_DEPTH_STENCIL) == 0) - return Game::CLEAR_COLOR_DEPTH_STENCIL; - return Game::CLEAR_COLOR; -} - -const char* lua_stringFromEnum_GameClearFlags(Game::ClearFlags e) -{ - if (e == Game::CLEAR_COLOR) - return luaEnumString_GameClearFlags_CLEAR_COLOR; - if (e == Game::CLEAR_DEPTH) - return luaEnumString_GameClearFlags_CLEAR_DEPTH; - if (e == Game::CLEAR_STENCIL) - return luaEnumString_GameClearFlags_CLEAR_STENCIL; - if (e == Game::CLEAR_COLOR_DEPTH) - return luaEnumString_GameClearFlags_CLEAR_COLOR_DEPTH; - if (e == Game::CLEAR_COLOR_STENCIL) - return luaEnumString_GameClearFlags_CLEAR_COLOR_STENCIL; - if (e == Game::CLEAR_DEPTH_STENCIL) - return luaEnumString_GameClearFlags_CLEAR_DEPTH_STENCIL; - if (e == Game::CLEAR_COLOR_DEPTH_STENCIL) - return luaEnumString_GameClearFlags_CLEAR_COLOR_DEPTH_STENCIL; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_GameClearFlags.h b/gameplay/src/lua/lua_GameClearFlags.h deleted file mode 100644 index 0bedf7f919..0000000000 --- a/gameplay/src/lua/lua_GameClearFlags.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_GAMECLEARFLAGS_H_ -#define LUA_GAMECLEARFLAGS_H_ - -#include "Game.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Game::ClearFlags. -Game::ClearFlags lua_enumFromString_GameClearFlags(const char* s); -const char* lua_stringFromEnum_GameClearFlags(Game::ClearFlags e); - -} - -#endif diff --git a/gameplay/src/lua/lua_GameState.cpp b/gameplay/src/lua/lua_GameState.cpp deleted file mode 100644 index 60748e2d40..0000000000 --- a/gameplay/src/lua/lua_GameState.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_GameState.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_GameState_UNINITIALIZED = "UNINITIALIZED"; -static const char* luaEnumString_GameState_RUNNING = "RUNNING"; -static const char* luaEnumString_GameState_PAUSED = "PAUSED"; - -Game::State lua_enumFromString_GameState(const char* s) -{ - if (strcmp(s, luaEnumString_GameState_UNINITIALIZED) == 0) - return Game::UNINITIALIZED; - if (strcmp(s, luaEnumString_GameState_RUNNING) == 0) - return Game::RUNNING; - if (strcmp(s, luaEnumString_GameState_PAUSED) == 0) - return Game::PAUSED; - return Game::UNINITIALIZED; -} - -const char* lua_stringFromEnum_GameState(Game::State e) -{ - if (e == Game::UNINITIALIZED) - return luaEnumString_GameState_UNINITIALIZED; - if (e == Game::RUNNING) - return luaEnumString_GameState_RUNNING; - if (e == Game::PAUSED) - return luaEnumString_GameState_PAUSED; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_GameState.h b/gameplay/src/lua/lua_GameState.h deleted file mode 100644 index 34206188c3..0000000000 --- a/gameplay/src/lua/lua_GameState.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_GAMESTATE_H_ -#define LUA_GAMESTATE_H_ - -#include "Game.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Game::State. -Game::State lua_enumFromString_GameState(const char* s); -const char* lua_stringFromEnum_GameState(Game::State e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Gamepad.cpp b/gameplay/src/lua/lua_Gamepad.cpp index c9e0831544..3ac9160624 100644 --- a/gameplay/src/lua/lua_Gamepad.cpp +++ b/gameplay/src/lua/lua_Gamepad.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Gamepad.h" @@ -8,7 +9,6 @@ #include "Gamepad.h" #include "JoystickControl.h" #include "Platform.h" -#include "lua_GamepadButtonMapping.h" namespace gameplay { @@ -22,12 +22,9 @@ void luaRegister_Gamepad() {"getForm", lua_Gamepad_getForm}, {"getJoystickCount", lua_Gamepad_getJoystickCount}, {"getJoystickValues", lua_Gamepad_getJoystickValues}, - {"getProductId", lua_Gamepad_getProductId}, - {"getProductString", lua_Gamepad_getProductString}, + {"getName", lua_Gamepad_getName}, {"getTriggerCount", lua_Gamepad_getTriggerCount}, {"getTriggerValue", lua_Gamepad_getTriggerValue}, - {"getVendorId", lua_Gamepad_getVendorId}, - {"getVendorString", lua_Gamepad_getVendorString}, {"isButtonDown", lua_Gamepad_isButtonDown}, {"isVirtual", lua_Gamepad_isVirtual}, {"update", lua_Gamepad_update}, @@ -126,7 +123,7 @@ int lua_Gamepad_getForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Gamepad* instance = getInstance(state); - void* returnPtr = (void*)instance->getForm(); + void* returnPtr = ((void*)instance->getForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -238,7 +235,7 @@ int lua_Gamepad_getJoystickValues(lua_State* state) return 0; } -int lua_Gamepad_getProductId(lua_State* state) +int lua_Gamepad_getName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -251,42 +248,7 @@ int lua_Gamepad_getProductId(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Gamepad* instance = getInstance(state); - unsigned int result = instance->getProductId(); - - // Push the return value onto the stack. - lua_pushunsigned(state, result); - - return 1; - } - - lua_pushstring(state, "lua_Gamepad_getProductId - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_Gamepad_getProductString(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Gamepad* instance = getInstance(state); - const char* result = instance->getProductString(); + const char* result = instance->getName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -294,7 +256,7 @@ int lua_Gamepad_getProductString(lua_State* state) return 1; } - lua_pushstring(state, "lua_Gamepad_getProductString - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Gamepad_getName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -382,76 +344,6 @@ int lua_Gamepad_getTriggerValue(lua_State* state) return 0; } -int lua_Gamepad_getVendorId(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Gamepad* instance = getInstance(state); - unsigned int result = instance->getVendorId(); - - // Push the return value onto the stack. - lua_pushunsigned(state, result); - - return 1; - } - - lua_pushstring(state, "lua_Gamepad_getVendorId - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_Gamepad_getVendorString(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Gamepad* instance = getInstance(state); - const char* result = instance->getVendorString(); - - // Push the return value onto the stack. - lua_pushstring(state, result); - - return 1; - } - - lua_pushstring(state, "lua_Gamepad_getVendorString - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_Gamepad_isButtonDown(lua_State* state) { // Get the number of parameters. @@ -463,10 +355,10 @@ int lua_Gamepad_isButtonDown(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Gamepad::ButtonMapping param1 = (Gamepad::ButtonMapping)lua_enumFromString_GamepadButtonMapping(luaL_checkstring(state, 2)); + Gamepad::ButtonMapping param1 = (Gamepad::ButtonMapping)luaL_checkint(state, 2); Gamepad* instance = getInstance(state); bool result = instance->isButtonDown(param1); diff --git a/gameplay/src/lua/lua_Gamepad.h b/gameplay/src/lua/lua_Gamepad.h index 8f3d7b545f..e1a86242be 100644 --- a/gameplay/src/lua/lua_Gamepad.h +++ b/gameplay/src/lua/lua_Gamepad.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_GAMEPAD_H_ #define LUA_GAMEPAD_H_ @@ -10,12 +11,9 @@ int lua_Gamepad_getButtonCount(lua_State* state); int lua_Gamepad_getForm(lua_State* state); int lua_Gamepad_getJoystickCount(lua_State* state); int lua_Gamepad_getJoystickValues(lua_State* state); -int lua_Gamepad_getProductId(lua_State* state); -int lua_Gamepad_getProductString(lua_State* state); +int lua_Gamepad_getName(lua_State* state); int lua_Gamepad_getTriggerCount(lua_State* state); int lua_Gamepad_getTriggerValue(lua_State* state); -int lua_Gamepad_getVendorId(lua_State* state); -int lua_Gamepad_getVendorString(lua_State* state); int lua_Gamepad_isButtonDown(lua_State* state); int lua_Gamepad_isVirtual(lua_State* state); int lua_Gamepad_update(lua_State* state); diff --git a/gameplay/src/lua/lua_GamepadButtonMapping.cpp b/gameplay/src/lua/lua_GamepadButtonMapping.cpp deleted file mode 100644 index 40f4cddf39..0000000000 --- a/gameplay/src/lua/lua_GamepadButtonMapping.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include "Base.h" -#include "lua_GamepadButtonMapping.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_GamepadButtonMapping_BUTTON_A = "BUTTON_A"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_B = "BUTTON_B"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_C = "BUTTON_C"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_X = "BUTTON_X"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_Y = "BUTTON_Y"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_Z = "BUTTON_Z"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_MENU1 = "BUTTON_MENU1"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_MENU2 = "BUTTON_MENU2"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_MENU3 = "BUTTON_MENU3"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_MENU4 = "BUTTON_MENU4"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_L1 = "BUTTON_L1"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_L2 = "BUTTON_L2"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_L3 = "BUTTON_L3"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_R1 = "BUTTON_R1"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_R2 = "BUTTON_R2"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_R3 = "BUTTON_R3"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_UP = "BUTTON_UP"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_DOWN = "BUTTON_DOWN"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_LEFT = "BUTTON_LEFT"; -static const char* luaEnumString_GamepadButtonMapping_BUTTON_RIGHT = "BUTTON_RIGHT"; - -Gamepad::ButtonMapping lua_enumFromString_GamepadButtonMapping(const char* s) -{ - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_A) == 0) - return Gamepad::BUTTON_A; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_B) == 0) - return Gamepad::BUTTON_B; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_C) == 0) - return Gamepad::BUTTON_C; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_X) == 0) - return Gamepad::BUTTON_X; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_Y) == 0) - return Gamepad::BUTTON_Y; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_Z) == 0) - return Gamepad::BUTTON_Z; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_MENU1) == 0) - return Gamepad::BUTTON_MENU1; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_MENU2) == 0) - return Gamepad::BUTTON_MENU2; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_MENU3) == 0) - return Gamepad::BUTTON_MENU3; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_MENU4) == 0) - return Gamepad::BUTTON_MENU4; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_L1) == 0) - return Gamepad::BUTTON_L1; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_L2) == 0) - return Gamepad::BUTTON_L2; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_L3) == 0) - return Gamepad::BUTTON_L3; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_R1) == 0) - return Gamepad::BUTTON_R1; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_R2) == 0) - return Gamepad::BUTTON_R2; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_R3) == 0) - return Gamepad::BUTTON_R3; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_UP) == 0) - return Gamepad::BUTTON_UP; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_DOWN) == 0) - return Gamepad::BUTTON_DOWN; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_LEFT) == 0) - return Gamepad::BUTTON_LEFT; - if (strcmp(s, luaEnumString_GamepadButtonMapping_BUTTON_RIGHT) == 0) - return Gamepad::BUTTON_RIGHT; - return Gamepad::BUTTON_A; -} - -const char* lua_stringFromEnum_GamepadButtonMapping(Gamepad::ButtonMapping e) -{ - if (e == Gamepad::BUTTON_A) - return luaEnumString_GamepadButtonMapping_BUTTON_A; - if (e == Gamepad::BUTTON_B) - return luaEnumString_GamepadButtonMapping_BUTTON_B; - if (e == Gamepad::BUTTON_C) - return luaEnumString_GamepadButtonMapping_BUTTON_C; - if (e == Gamepad::BUTTON_X) - return luaEnumString_GamepadButtonMapping_BUTTON_X; - if (e == Gamepad::BUTTON_Y) - return luaEnumString_GamepadButtonMapping_BUTTON_Y; - if (e == Gamepad::BUTTON_Z) - return luaEnumString_GamepadButtonMapping_BUTTON_Z; - if (e == Gamepad::BUTTON_MENU1) - return luaEnumString_GamepadButtonMapping_BUTTON_MENU1; - if (e == Gamepad::BUTTON_MENU2) - return luaEnumString_GamepadButtonMapping_BUTTON_MENU2; - if (e == Gamepad::BUTTON_MENU3) - return luaEnumString_GamepadButtonMapping_BUTTON_MENU3; - if (e == Gamepad::BUTTON_MENU4) - return luaEnumString_GamepadButtonMapping_BUTTON_MENU4; - if (e == Gamepad::BUTTON_L1) - return luaEnumString_GamepadButtonMapping_BUTTON_L1; - if (e == Gamepad::BUTTON_L2) - return luaEnumString_GamepadButtonMapping_BUTTON_L2; - if (e == Gamepad::BUTTON_L3) - return luaEnumString_GamepadButtonMapping_BUTTON_L3; - if (e == Gamepad::BUTTON_R1) - return luaEnumString_GamepadButtonMapping_BUTTON_R1; - if (e == Gamepad::BUTTON_R2) - return luaEnumString_GamepadButtonMapping_BUTTON_R2; - if (e == Gamepad::BUTTON_R3) - return luaEnumString_GamepadButtonMapping_BUTTON_R3; - if (e == Gamepad::BUTTON_UP) - return luaEnumString_GamepadButtonMapping_BUTTON_UP; - if (e == Gamepad::BUTTON_DOWN) - return luaEnumString_GamepadButtonMapping_BUTTON_DOWN; - if (e == Gamepad::BUTTON_LEFT) - return luaEnumString_GamepadButtonMapping_BUTTON_LEFT; - if (e == Gamepad::BUTTON_RIGHT) - return luaEnumString_GamepadButtonMapping_BUTTON_RIGHT; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_GamepadButtonMapping.h b/gameplay/src/lua/lua_GamepadButtonMapping.h deleted file mode 100644 index 6b53c7d810..0000000000 --- a/gameplay/src/lua/lua_GamepadButtonMapping.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_GAMEPADBUTTONMAPPING_H_ -#define LUA_GAMEPADBUTTONMAPPING_H_ - -#include "Gamepad.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Gamepad::ButtonMapping. -Gamepad::ButtonMapping lua_enumFromString_GamepadButtonMapping(const char* s); -const char* lua_stringFromEnum_GamepadButtonMapping(Gamepad::ButtonMapping e); - -} - -#endif diff --git a/gameplay/src/lua/lua_GamepadGamepadEvent.cpp b/gameplay/src/lua/lua_GamepadGamepadEvent.cpp deleted file mode 100644 index 72579d2941..0000000000 --- a/gameplay/src/lua/lua_GamepadGamepadEvent.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "Base.h" -#include "lua_GamepadGamepadEvent.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_GamepadGamepadEvent_CONNECTED_EVENT = "CONNECTED_EVENT"; -static const char* luaEnumString_GamepadGamepadEvent_DISCONNECTED_EVENT = "DISCONNECTED_EVENT"; -static const char* luaEnumString_GamepadGamepadEvent_BUTTON_EVENT = "BUTTON_EVENT"; -static const char* luaEnumString_GamepadGamepadEvent_JOYSTICK_EVENT = "JOYSTICK_EVENT"; -static const char* luaEnumString_GamepadGamepadEvent_TRIGGER_EVENT = "TRIGGER_EVENT"; - -Gamepad::GamepadEvent lua_enumFromString_GamepadGamepadEvent(const char* s) -{ - if (strcmp(s, luaEnumString_GamepadGamepadEvent_CONNECTED_EVENT) == 0) - return Gamepad::CONNECTED_EVENT; - if (strcmp(s, luaEnumString_GamepadGamepadEvent_DISCONNECTED_EVENT) == 0) - return Gamepad::DISCONNECTED_EVENT; - if (strcmp(s, luaEnumString_GamepadGamepadEvent_BUTTON_EVENT) == 0) - return Gamepad::BUTTON_EVENT; - if (strcmp(s, luaEnumString_GamepadGamepadEvent_JOYSTICK_EVENT) == 0) - return Gamepad::JOYSTICK_EVENT; - if (strcmp(s, luaEnumString_GamepadGamepadEvent_TRIGGER_EVENT) == 0) - return Gamepad::TRIGGER_EVENT; - return Gamepad::CONNECTED_EVENT; -} - -const char* lua_stringFromEnum_GamepadGamepadEvent(Gamepad::GamepadEvent e) -{ - if (e == Gamepad::CONNECTED_EVENT) - return luaEnumString_GamepadGamepadEvent_CONNECTED_EVENT; - if (e == Gamepad::DISCONNECTED_EVENT) - return luaEnumString_GamepadGamepadEvent_DISCONNECTED_EVENT; - if (e == Gamepad::BUTTON_EVENT) - return luaEnumString_GamepadGamepadEvent_BUTTON_EVENT; - if (e == Gamepad::JOYSTICK_EVENT) - return luaEnumString_GamepadGamepadEvent_JOYSTICK_EVENT; - if (e == Gamepad::TRIGGER_EVENT) - return luaEnumString_GamepadGamepadEvent_TRIGGER_EVENT; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_GamepadGamepadEvent.h b/gameplay/src/lua/lua_GamepadGamepadEvent.h deleted file mode 100644 index f7dee74119..0000000000 --- a/gameplay/src/lua/lua_GamepadGamepadEvent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_GAMEPADGAMEPADEVENT_H_ -#define LUA_GAMEPADGAMEPADEVENT_H_ - -#include "Gamepad.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Gamepad::GamepadEvent. -Gamepad::GamepadEvent lua_enumFromString_GamepadGamepadEvent(const char* s); -const char* lua_stringFromEnum_GamepadGamepadEvent(Gamepad::GamepadEvent e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Gesture.cpp b/gameplay/src/lua/lua_Gesture.cpp index df40a79fb9..4dbccf5406 100644 --- a/gameplay/src/lua/lua_Gesture.cpp +++ b/gameplay/src/lua/lua_Gesture.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Gesture.h" diff --git a/gameplay/src/lua/lua_Gesture.h b/gameplay/src/lua/lua_Gesture.h index 4cee71aa50..6e819b07c7 100644 --- a/gameplay/src/lua/lua_Gesture.h +++ b/gameplay/src/lua/lua_Gesture.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_GESTURE_H_ #define LUA_GESTURE_H_ diff --git a/gameplay/src/lua/lua_GestureGestureEvent.cpp b/gameplay/src/lua/lua_GestureGestureEvent.cpp deleted file mode 100644 index af7b5f90bd..0000000000 --- a/gameplay/src/lua/lua_GestureGestureEvent.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "Base.h" -#include "lua_GestureGestureEvent.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_GestureGestureEvent_GESTURE_TAP = "GESTURE_TAP"; -static const char* luaEnumString_GestureGestureEvent_GESTURE_SWIPE = "GESTURE_SWIPE"; -static const char* luaEnumString_GestureGestureEvent_GESTURE_PINCH = "GESTURE_PINCH"; -static const char* luaEnumString_GestureGestureEvent_GESTURE_LONG_TAP = "GESTURE_LONG_TAP"; -static const char* luaEnumString_GestureGestureEvent_GESTURE_DRAG = "GESTURE_DRAG"; -static const char* luaEnumString_GestureGestureEvent_GESTURE_DROP = "GESTURE_DROP"; -static const char* luaEnumString_GestureGestureEvent_GESTURE_ANY_SUPPORTED = "GESTURE_ANY_SUPPORTED"; - -Gesture::GestureEvent lua_enumFromString_GestureGestureEvent(const char* s) -{ - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_TAP) == 0) - return Gesture::GESTURE_TAP; - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_SWIPE) == 0) - return Gesture::GESTURE_SWIPE; - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_PINCH) == 0) - return Gesture::GESTURE_PINCH; - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_LONG_TAP) == 0) - return Gesture::GESTURE_LONG_TAP; - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_DRAG) == 0) - return Gesture::GESTURE_DRAG; - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_DROP) == 0) - return Gesture::GESTURE_DROP; - if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_ANY_SUPPORTED) == 0) - return Gesture::GESTURE_ANY_SUPPORTED; - return Gesture::GESTURE_TAP; -} - -const char* lua_stringFromEnum_GestureGestureEvent(Gesture::GestureEvent e) -{ - if (e == Gesture::GESTURE_TAP) - return luaEnumString_GestureGestureEvent_GESTURE_TAP; - if (e == Gesture::GESTURE_SWIPE) - return luaEnumString_GestureGestureEvent_GESTURE_SWIPE; - if (e == Gesture::GESTURE_PINCH) - return luaEnumString_GestureGestureEvent_GESTURE_PINCH; - if (e == Gesture::GESTURE_LONG_TAP) - return luaEnumString_GestureGestureEvent_GESTURE_LONG_TAP; - if (e == Gesture::GESTURE_DRAG) - return luaEnumString_GestureGestureEvent_GESTURE_DRAG; - if (e == Gesture::GESTURE_DROP) - return luaEnumString_GestureGestureEvent_GESTURE_DROP; - if (e == Gesture::GESTURE_ANY_SUPPORTED) - return luaEnumString_GestureGestureEvent_GESTURE_ANY_SUPPORTED; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_GestureGestureEvent.h b/gameplay/src/lua/lua_GestureGestureEvent.h deleted file mode 100644 index 51cf241cad..0000000000 --- a/gameplay/src/lua/lua_GestureGestureEvent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_GESTUREGESTUREEVENT_H_ -#define LUA_GESTUREGESTUREEVENT_H_ - -#include "Gesture.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Gesture::GestureEvent. -Gesture::GestureEvent lua_enumFromString_GestureGestureEvent(const char* s); -const char* lua_stringFromEnum_GestureGestureEvent(Gesture::GestureEvent e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Global.cpp b/gameplay/src/lua/lua_Global.cpp index 62e0318968..10859dce29 100644 --- a/gameplay/src/lua/lua_Global.cpp +++ b/gameplay/src/lua/lua_Global.cpp @@ -1,5 +1,39 @@ +// Autogenerated by gameplay-luagen #include "ScriptController.h" #include "lua_Global.h" +#include "AIMessage.h" +#include "AnimationClip.h" +#include "AudioSource.h" +#include "Camera.h" +#include "Container.h" +#include "Control.h" +#include "Curve.h" +#include "DepthStencilTarget.h" +#include "Font.h" +#include "Game.h" +#include "Gamepad.h" +#include "Gesture.h" +#include "Image.h" +#include "Keyboard.h" +#include "Layout.h" +#include "Light.h" +#include "Logger.h" +#include "Mesh.h" +#include "Mouse.h" +#include "Node.h" +#include "ParticleEmitter.h" +#include "PhysicsCollisionObject.h" +#include "PhysicsCollisionShape.h" +#include "PhysicsController.h" +#include "Properties.h" +#include "RenderState.h" +#include "Script.h" +#include "Sprite.h" +#include "Terrain.h" +#include "TextBox.h" +#include "Texture.h" +#include "Touch.h" +#include "VertexFormat.h" namespace gameplay { @@ -20,6 +54,8 @@ void luaRegister_lua_Global() gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Node"); gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "RadioButton"); gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Slider"); + gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Sprite"); + gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Text"); gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "TextBox"); gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Transform"); gameplay::ScriptUtil::setGlobalHierarchyPair("Button", "CheckBox"); @@ -37,6 +73,13 @@ void luaRegister_lua_Global() gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "RadioButton"); gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "Slider"); gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "TextBox"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "Form"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "Model"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "ParticleEmitter"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "Sprite"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "Terrain"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "Text"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Drawable", "TileSet"); gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "Button"); gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "CheckBox"); gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "RadioButton"); @@ -100,26 +143,30 @@ void luaRegister_lua_Global() gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "RenderState::StateBlock"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "RenderTarget"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Scene"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Script"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Slider"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Sprite"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Technique"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Terrain"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Text"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "TextBox"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Texture"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Texture::Sampler"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Theme"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Theme::ThemeImage"); + gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "TileSet"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "VertexAttributeBinding"); gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "VerticalLayout"); gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Material"); gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Pass"); gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Technique"); - gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIAgent"); - gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIState"); + gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AnimationClip"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Button"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "CheckBox"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Container"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Control"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Form"); + gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "GameScriptTarget"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "ImageControl"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Joint"); gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "JoystickControl"); @@ -139,19 +186,18 @@ void luaRegister_lua_Global() gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsGhostObject"); gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsRigidBody"); gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "Terrain"); - gameplay::ScriptUtil::addStringFromEnumConversionFunction(&gameplay::lua_stringFromEnumGlobal); // Register enumeration AIMessage::ParameterType. { std::vector scopePath; scopePath.push_back("AIMessage"); - gameplay::ScriptUtil::registerConstantString("UNDEFINED", "UNDEFINED", scopePath); - gameplay::ScriptUtil::registerConstantString("INTEGER", "INTEGER", scopePath); - gameplay::ScriptUtil::registerConstantString("LONG", "LONG", scopePath); - gameplay::ScriptUtil::registerConstantString("FLOAT", "FLOAT", scopePath); - gameplay::ScriptUtil::registerConstantString("DOUBLE", "DOUBLE", scopePath); - gameplay::ScriptUtil::registerConstantString("BOOLEAN", "BOOLEAN", scopePath); - gameplay::ScriptUtil::registerConstantString("STRING", "STRING", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::UNDEFINED, "UNDEFINED", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::INTEGER, "INTEGER", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::LONG, "LONG", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::FLOAT, "FLOAT", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::DOUBLE, "DOUBLE", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::BOOLEAN, "BOOLEAN", scopePath); + gameplay::ScriptUtil::registerEnumValue(AIMessage::STRING, "STRING", scopePath); } // Register enumeration AnimationClip::Listener::EventType. @@ -159,68 +205,80 @@ void luaRegister_lua_Global() std::vector scopePath; scopePath.push_back("AnimationClip"); scopePath.push_back("Listener"); - gameplay::ScriptUtil::registerConstantString("BEGIN", "BEGIN", scopePath); - gameplay::ScriptUtil::registerConstantString("END", "END", scopePath); - gameplay::ScriptUtil::registerConstantString("TIME", "TIME", scopePath); + gameplay::ScriptUtil::registerEnumValue(AnimationClip::Listener::BEGIN, "BEGIN", scopePath); + gameplay::ScriptUtil::registerEnumValue(AnimationClip::Listener::END, "END", scopePath); + gameplay::ScriptUtil::registerEnumValue(AnimationClip::Listener::TIME, "TIME", scopePath); } // Register enumeration AudioSource::State. { std::vector scopePath; scopePath.push_back("AudioSource"); - gameplay::ScriptUtil::registerConstantString("INITIAL", "INITIAL", scopePath); - gameplay::ScriptUtil::registerConstantString("PLAYING", "PLAYING", scopePath); - gameplay::ScriptUtil::registerConstantString("PAUSED", "PAUSED", scopePath); - gameplay::ScriptUtil::registerConstantString("STOPPED", "STOPPED", scopePath); + gameplay::ScriptUtil::registerEnumValue(AudioSource::INITIAL, "INITIAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(AudioSource::PLAYING, "PLAYING", scopePath); + gameplay::ScriptUtil::registerEnumValue(AudioSource::PAUSED, "PAUSED", scopePath); + gameplay::ScriptUtil::registerEnumValue(AudioSource::STOPPED, "STOPPED", scopePath); } // Register enumeration Camera::Type. { std::vector scopePath; scopePath.push_back("Camera"); - gameplay::ScriptUtil::registerConstantString("PERSPECTIVE", "PERSPECTIVE", scopePath); - gameplay::ScriptUtil::registerConstantString("ORTHOGRAPHIC", "ORTHOGRAPHIC", scopePath); + gameplay::ScriptUtil::registerEnumValue(Camera::PERSPECTIVE, "PERSPECTIVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Camera::ORTHOGRAPHIC, "ORTHOGRAPHIC", scopePath); + } + + // Register enumeration Container::Direction. + { + std::vector scopePath; + scopePath.push_back("Container"); + gameplay::ScriptUtil::registerEnumValue(Container::UP, "UP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::DOWN, "DOWN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::LEFT, "LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::RIGHT, "RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::NEXT, "NEXT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::PREVIOUS, "PREVIOUS", scopePath); } // Register enumeration Container::Scroll. { std::vector scopePath; scopePath.push_back("Container"); - gameplay::ScriptUtil::registerConstantString("SCROLL_NONE", "SCROLL_NONE", scopePath); - gameplay::ScriptUtil::registerConstantString("SCROLL_HORIZONTAL", "SCROLL_HORIZONTAL", scopePath); - gameplay::ScriptUtil::registerConstantString("SCROLL_VERTICAL", "SCROLL_VERTICAL", scopePath); - gameplay::ScriptUtil::registerConstantString("SCROLL_BOTH", "SCROLL_BOTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::SCROLL_NONE, "SCROLL_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::SCROLL_HORIZONTAL, "SCROLL_HORIZONTAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::SCROLL_VERTICAL, "SCROLL_VERTICAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Container::SCROLL_BOTH, "SCROLL_BOTH", scopePath); } // Register enumeration Control::Alignment. { std::vector scopePath; scopePath.push_back("Control"); - gameplay::ScriptUtil::registerConstantString("ALIGN_LEFT", "ALIGN_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_HCENTER", "ALIGN_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_RIGHT", "ALIGN_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP", "ALIGN_TOP", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER", "ALIGN_VCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM", "ALIGN_BOTTOM", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_LEFT", "ALIGN_TOP_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_LEFT", "ALIGN_VCENTER_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_LEFT", "ALIGN_BOTTOM_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_HCENTER", "ALIGN_TOP_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_HCENTER", "ALIGN_VCENTER_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_HCENTER", "ALIGN_BOTTOM_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_RIGHT", "ALIGN_TOP_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_RIGHT", "ALIGN_VCENTER_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_RIGHT", "ALIGN_BOTTOM_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_LEFT, "ALIGN_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_HCENTER, "ALIGN_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_RIGHT, "ALIGN_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_TOP, "ALIGN_TOP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_VCENTER, "ALIGN_VCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_BOTTOM, "ALIGN_BOTTOM", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_TOP_LEFT, "ALIGN_TOP_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_VCENTER_LEFT, "ALIGN_VCENTER_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_BOTTOM_LEFT, "ALIGN_BOTTOM_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_TOP_HCENTER, "ALIGN_TOP_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_VCENTER_HCENTER, "ALIGN_VCENTER_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_BOTTOM_HCENTER, "ALIGN_BOTTOM_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_TOP_RIGHT, "ALIGN_TOP_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_VCENTER_RIGHT, "ALIGN_VCENTER_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ALIGN_BOTTOM_RIGHT, "ALIGN_BOTTOM_RIGHT", scopePath); } // Register enumeration Control::AutoSize. { std::vector scopePath; scopePath.push_back("Control"); - gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_NONE", "AUTO_SIZE_NONE", scopePath); - gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_WIDTH", "AUTO_SIZE_WIDTH", scopePath); - gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_HEIGHT", "AUTO_SIZE_HEIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_BOTH", "AUTO_SIZE_BOTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::AUTO_SIZE_NONE, "AUTO_SIZE_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::AUTO_SIZE_WIDTH, "AUTO_SIZE_WIDTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::AUTO_SIZE_HEIGHT, "AUTO_SIZE_HEIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::AUTO_SIZE_BOTH, "AUTO_SIZE_BOTH", scopePath); } // Register enumeration Control::Listener::EventType. @@ -228,456 +286,450 @@ void luaRegister_lua_Global() std::vector scopePath; scopePath.push_back("Control"); scopePath.push_back("Listener"); - gameplay::ScriptUtil::registerConstantString("PRESS", "PRESS", scopePath); - gameplay::ScriptUtil::registerConstantString("RELEASE", "RELEASE", scopePath); - gameplay::ScriptUtil::registerConstantString("CLICK", "CLICK", scopePath); - gameplay::ScriptUtil::registerConstantString("VALUE_CHANGED", "VALUE_CHANGED", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXT_CHANGED", "TEXT_CHANGED", scopePath); - gameplay::ScriptUtil::registerConstantString("MIDDLE_CLICK", "MIDDLE_CLICK", scopePath); - gameplay::ScriptUtil::registerConstantString("RIGHT_CLICK", "RIGHT_CLICK", scopePath); - gameplay::ScriptUtil::registerConstantString("FOCUS_GAINED", "FOCUS_GAINED", scopePath); - gameplay::ScriptUtil::registerConstantString("FOCUS_LOST", "FOCUS_LOST", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::PRESS, "PRESS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::RELEASE, "RELEASE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::CLICK, "CLICK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::VALUE_CHANGED, "VALUE_CHANGED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::TEXT_CHANGED, "TEXT_CHANGED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::MIDDLE_CLICK, "MIDDLE_CLICK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::RIGHT_CLICK, "RIGHT_CLICK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::FOCUS_GAINED, "FOCUS_GAINED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::Listener::FOCUS_LOST, "FOCUS_LOST", scopePath); } // Register enumeration Control::State. { std::vector scopePath; scopePath.push_back("Control"); - gameplay::ScriptUtil::registerConstantString("NORMAL", "NORMAL", scopePath); - gameplay::ScriptUtil::registerConstantString("FOCUS", "FOCUS", scopePath); - gameplay::ScriptUtil::registerConstantString("ACTIVE", "ACTIVE", scopePath); - gameplay::ScriptUtil::registerConstantString("DISABLED", "DISABLED", scopePath); - gameplay::ScriptUtil::registerConstantString("HOVER", "HOVER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::NORMAL, "NORMAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::FOCUS, "FOCUS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::ACTIVE, "ACTIVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::DISABLED, "DISABLED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Control::HOVER, "HOVER", scopePath); } // Register enumeration Curve::InterpolationType. { std::vector scopePath; scopePath.push_back("Curve"); - gameplay::ScriptUtil::registerConstantString("BEZIER", "BEZIER", scopePath); - gameplay::ScriptUtil::registerConstantString("BSPLINE", "BSPLINE", scopePath); - gameplay::ScriptUtil::registerConstantString("FLAT", "FLAT", scopePath); - gameplay::ScriptUtil::registerConstantString("HERMITE", "HERMITE", scopePath); - gameplay::ScriptUtil::registerConstantString("LINEAR", "LINEAR", scopePath); - gameplay::ScriptUtil::registerConstantString("SMOOTH", "SMOOTH", scopePath); - gameplay::ScriptUtil::registerConstantString("STEP", "STEP", scopePath); - gameplay::ScriptUtil::registerConstantString("QUADRATIC_IN", "QUADRATIC_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("QUADRATIC_OUT", "QUADRATIC_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("QUADRATIC_IN_OUT", "QUADRATIC_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("QUADRATIC_OUT_IN", "QUADRATIC_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("CUBIC_IN", "CUBIC_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("CUBIC_OUT", "CUBIC_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("CUBIC_IN_OUT", "CUBIC_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("CUBIC_OUT_IN", "CUBIC_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("QUARTIC_IN", "QUARTIC_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("QUARTIC_OUT", "QUARTIC_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("QUARTIC_IN_OUT", "QUARTIC_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("QUARTIC_OUT_IN", "QUARTIC_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("QUINTIC_IN", "QUINTIC_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("QUINTIC_OUT", "QUINTIC_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("QUINTIC_IN_OUT", "QUINTIC_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("QUINTIC_OUT_IN", "QUINTIC_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("SINE_IN", "SINE_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("SINE_OUT", "SINE_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("SINE_IN_OUT", "SINE_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("SINE_OUT_IN", "SINE_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_IN", "EXPONENTIAL_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_OUT", "EXPONENTIAL_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_IN_OUT", "EXPONENTIAL_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_OUT_IN", "EXPONENTIAL_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("CIRCULAR_IN", "CIRCULAR_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("CIRCULAR_OUT", "CIRCULAR_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("CIRCULAR_IN_OUT", "CIRCULAR_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("CIRCULAR_OUT_IN", "CIRCULAR_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("ELASTIC_IN", "ELASTIC_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("ELASTIC_OUT", "ELASTIC_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("ELASTIC_IN_OUT", "ELASTIC_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("ELASTIC_OUT_IN", "ELASTIC_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("OVERSHOOT_IN", "OVERSHOOT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("OVERSHOOT_OUT", "OVERSHOOT_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("OVERSHOOT_IN_OUT", "OVERSHOOT_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("OVERSHOOT_OUT_IN", "OVERSHOOT_OUT_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("BOUNCE_IN", "BOUNCE_IN", scopePath); - gameplay::ScriptUtil::registerConstantString("BOUNCE_OUT", "BOUNCE_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("BOUNCE_IN_OUT", "BOUNCE_IN_OUT", scopePath); - gameplay::ScriptUtil::registerConstantString("BOUNCE_OUT_IN", "BOUNCE_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::BEZIER, "BEZIER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::BSPLINE, "BSPLINE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::FLAT, "FLAT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::HERMITE, "HERMITE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::LINEAR, "LINEAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::SMOOTH, "SMOOTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::STEP, "STEP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUADRATIC_IN, "QUADRATIC_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUADRATIC_OUT, "QUADRATIC_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUADRATIC_IN_OUT, "QUADRATIC_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUADRATIC_OUT_IN, "QUADRATIC_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CUBIC_IN, "CUBIC_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CUBIC_OUT, "CUBIC_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CUBIC_IN_OUT, "CUBIC_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CUBIC_OUT_IN, "CUBIC_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUARTIC_IN, "QUARTIC_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUARTIC_OUT, "QUARTIC_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUARTIC_IN_OUT, "QUARTIC_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUARTIC_OUT_IN, "QUARTIC_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUINTIC_IN, "QUINTIC_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUINTIC_OUT, "QUINTIC_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUINTIC_IN_OUT, "QUINTIC_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::QUINTIC_OUT_IN, "QUINTIC_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::SINE_IN, "SINE_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::SINE_OUT, "SINE_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::SINE_IN_OUT, "SINE_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::SINE_OUT_IN, "SINE_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::EXPONENTIAL_IN, "EXPONENTIAL_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::EXPONENTIAL_OUT, "EXPONENTIAL_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::EXPONENTIAL_IN_OUT, "EXPONENTIAL_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::EXPONENTIAL_OUT_IN, "EXPONENTIAL_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CIRCULAR_IN, "CIRCULAR_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CIRCULAR_OUT, "CIRCULAR_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CIRCULAR_IN_OUT, "CIRCULAR_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::CIRCULAR_OUT_IN, "CIRCULAR_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::ELASTIC_IN, "ELASTIC_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::ELASTIC_OUT, "ELASTIC_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::ELASTIC_IN_OUT, "ELASTIC_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::ELASTIC_OUT_IN, "ELASTIC_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::OVERSHOOT_IN, "OVERSHOOT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::OVERSHOOT_OUT, "OVERSHOOT_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::OVERSHOOT_IN_OUT, "OVERSHOOT_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::OVERSHOOT_OUT_IN, "OVERSHOOT_OUT_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::BOUNCE_IN, "BOUNCE_IN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::BOUNCE_OUT, "BOUNCE_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::BOUNCE_IN_OUT, "BOUNCE_IN_OUT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Curve::BOUNCE_OUT_IN, "BOUNCE_OUT_IN", scopePath); } // Register enumeration DepthStencilTarget::Format. { std::vector scopePath; scopePath.push_back("DepthStencilTarget"); - gameplay::ScriptUtil::registerConstantString("DEPTH", "DEPTH", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_STENCIL", "DEPTH_STENCIL", scopePath); + gameplay::ScriptUtil::registerEnumValue(DepthStencilTarget::DEPTH, "DEPTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(DepthStencilTarget::DEPTH_STENCIL, "DEPTH_STENCIL", scopePath); } // Register enumeration Font::Format. { std::vector scopePath; scopePath.push_back("Font"); - gameplay::ScriptUtil::registerConstantString("BITMAP", "BITMAP", scopePath); - gameplay::ScriptUtil::registerConstantString("DISTANCE_FIELD", "DISTANCE_FIELD", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::BITMAP, "BITMAP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::DISTANCE_FIELD, "DISTANCE_FIELD", scopePath); } // Register enumeration Font::Justify. { std::vector scopePath; scopePath.push_back("Font"); - gameplay::ScriptUtil::registerConstantString("ALIGN_LEFT", "ALIGN_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_HCENTER", "ALIGN_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_RIGHT", "ALIGN_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP", "ALIGN_TOP", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER", "ALIGN_VCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM", "ALIGN_BOTTOM", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_LEFT", "ALIGN_TOP_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_LEFT", "ALIGN_VCENTER_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_LEFT", "ALIGN_BOTTOM_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_HCENTER", "ALIGN_TOP_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_HCENTER", "ALIGN_VCENTER_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_HCENTER", "ALIGN_BOTTOM_HCENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_RIGHT", "ALIGN_TOP_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_RIGHT", "ALIGN_VCENTER_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_RIGHT", "ALIGN_BOTTOM_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_LEFT, "ALIGN_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_HCENTER, "ALIGN_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_RIGHT, "ALIGN_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_TOP, "ALIGN_TOP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_VCENTER, "ALIGN_VCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_BOTTOM, "ALIGN_BOTTOM", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_TOP_LEFT, "ALIGN_TOP_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_VCENTER_LEFT, "ALIGN_VCENTER_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_BOTTOM_LEFT, "ALIGN_BOTTOM_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_TOP_HCENTER, "ALIGN_TOP_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_VCENTER_HCENTER, "ALIGN_VCENTER_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_BOTTOM_HCENTER, "ALIGN_BOTTOM_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_TOP_RIGHT, "ALIGN_TOP_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_VCENTER_RIGHT, "ALIGN_VCENTER_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ALIGN_BOTTOM_RIGHT, "ALIGN_BOTTOM_RIGHT", scopePath); } // Register enumeration Font::Style. { std::vector scopePath; scopePath.push_back("Font"); - gameplay::ScriptUtil::registerConstantString("PLAIN", "PLAIN", scopePath); - gameplay::ScriptUtil::registerConstantString("BOLD", "BOLD", scopePath); - gameplay::ScriptUtil::registerConstantString("ITALIC", "ITALIC", scopePath); - gameplay::ScriptUtil::registerConstantString("BOLD_ITALIC", "BOLD_ITALIC", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::PLAIN, "PLAIN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::BOLD, "BOLD", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::ITALIC, "ITALIC", scopePath); + gameplay::ScriptUtil::registerEnumValue(Font::BOLD_ITALIC, "BOLD_ITALIC", scopePath); } // Register enumeration Game::ClearFlags. { std::vector scopePath; scopePath.push_back("Game"); - gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR", "CLEAR_COLOR", scopePath); - gameplay::ScriptUtil::registerConstantString("CLEAR_DEPTH", "CLEAR_DEPTH", scopePath); - gameplay::ScriptUtil::registerConstantString("CLEAR_STENCIL", "CLEAR_STENCIL", scopePath); - gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR_DEPTH", "CLEAR_COLOR_DEPTH", scopePath); - gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR_STENCIL", "CLEAR_COLOR_STENCIL", scopePath); - gameplay::ScriptUtil::registerConstantString("CLEAR_DEPTH_STENCIL", "CLEAR_DEPTH_STENCIL", scopePath); - gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR_DEPTH_STENCIL", "CLEAR_COLOR_DEPTH_STENCIL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_COLOR, "CLEAR_COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_DEPTH, "CLEAR_DEPTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_STENCIL, "CLEAR_STENCIL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_COLOR_DEPTH, "CLEAR_COLOR_DEPTH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_COLOR_STENCIL, "CLEAR_COLOR_STENCIL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_DEPTH_STENCIL, "CLEAR_DEPTH_STENCIL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::CLEAR_COLOR_DEPTH_STENCIL, "CLEAR_COLOR_DEPTH_STENCIL", scopePath); } // Register enumeration Game::State. { std::vector scopePath; scopePath.push_back("Game"); - gameplay::ScriptUtil::registerConstantString("UNINITIALIZED", "UNINITIALIZED", scopePath); - gameplay::ScriptUtil::registerConstantString("RUNNING", "RUNNING", scopePath); - gameplay::ScriptUtil::registerConstantString("PAUSED", "PAUSED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::UNINITIALIZED, "UNINITIALIZED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::RUNNING, "RUNNING", scopePath); + gameplay::ScriptUtil::registerEnumValue(Game::PAUSED, "PAUSED", scopePath); } // Register enumeration Gamepad::ButtonMapping. { std::vector scopePath; scopePath.push_back("Gamepad"); - gameplay::ScriptUtil::registerConstantString("BUTTON_A", "BUTTON_A", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_B", "BUTTON_B", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_C", "BUTTON_C", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_X", "BUTTON_X", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_Y", "BUTTON_Y", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_Z", "BUTTON_Z", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_MENU1", "BUTTON_MENU1", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_MENU2", "BUTTON_MENU2", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_MENU3", "BUTTON_MENU3", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_MENU4", "BUTTON_MENU4", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_L1", "BUTTON_L1", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_L2", "BUTTON_L2", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_L3", "BUTTON_L3", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_R1", "BUTTON_R1", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_R2", "BUTTON_R2", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_R3", "BUTTON_R3", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_UP", "BUTTON_UP", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_DOWN", "BUTTON_DOWN", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_LEFT", "BUTTON_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_RIGHT", "BUTTON_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_A, "BUTTON_A", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_B, "BUTTON_B", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_X, "BUTTON_X", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_Y, "BUTTON_Y", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_L1, "BUTTON_L1", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_L2, "BUTTON_L2", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_L3, "BUTTON_L3", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_R1, "BUTTON_R1", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_R2, "BUTTON_R2", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_R3, "BUTTON_R3", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_UP, "BUTTON_UP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_DOWN, "BUTTON_DOWN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_LEFT, "BUTTON_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_RIGHT, "BUTTON_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_MENU1, "BUTTON_MENU1", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_MENU2, "BUTTON_MENU2", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::BUTTON_MENU3, "BUTTON_MENU3", scopePath); } // Register enumeration Gamepad::GamepadEvent. { std::vector scopePath; scopePath.push_back("Gamepad"); - gameplay::ScriptUtil::registerConstantString("CONNECTED_EVENT", "CONNECTED_EVENT", scopePath); - gameplay::ScriptUtil::registerConstantString("DISCONNECTED_EVENT", "DISCONNECTED_EVENT", scopePath); - gameplay::ScriptUtil::registerConstantString("BUTTON_EVENT", "BUTTON_EVENT", scopePath); - gameplay::ScriptUtil::registerConstantString("JOYSTICK_EVENT", "JOYSTICK_EVENT", scopePath); - gameplay::ScriptUtil::registerConstantString("TRIGGER_EVENT", "TRIGGER_EVENT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::CONNECTED_EVENT, "CONNECTED_EVENT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gamepad::DISCONNECTED_EVENT, "DISCONNECTED_EVENT", scopePath); } // Register enumeration Gesture::GestureEvent. { std::vector scopePath; scopePath.push_back("Gesture"); - gameplay::ScriptUtil::registerConstantString("GESTURE_TAP", "GESTURE_TAP", scopePath); - gameplay::ScriptUtil::registerConstantString("GESTURE_SWIPE", "GESTURE_SWIPE", scopePath); - gameplay::ScriptUtil::registerConstantString("GESTURE_PINCH", "GESTURE_PINCH", scopePath); - gameplay::ScriptUtil::registerConstantString("GESTURE_LONG_TAP", "GESTURE_LONG_TAP", scopePath); - gameplay::ScriptUtil::registerConstantString("GESTURE_DRAG", "GESTURE_DRAG", scopePath); - gameplay::ScriptUtil::registerConstantString("GESTURE_DROP", "GESTURE_DROP", scopePath); - gameplay::ScriptUtil::registerConstantString("GESTURE_ANY_SUPPORTED", "GESTURE_ANY_SUPPORTED", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_TAP, "GESTURE_TAP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_SWIPE, "GESTURE_SWIPE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_PINCH, "GESTURE_PINCH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_LONG_TAP, "GESTURE_LONG_TAP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_DRAG, "GESTURE_DRAG", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_DROP, "GESTURE_DROP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Gesture::GESTURE_ANY_SUPPORTED, "GESTURE_ANY_SUPPORTED", scopePath); } // Register enumeration Image::Format. { std::vector scopePath; scopePath.push_back("Image"); - gameplay::ScriptUtil::registerConstantString("RGB", "RGB", scopePath); - gameplay::ScriptUtil::registerConstantString("RGBA", "RGBA", scopePath); + gameplay::ScriptUtil::registerEnumValue(Image::RGB, "RGB", scopePath); + gameplay::ScriptUtil::registerEnumValue(Image::RGBA, "RGBA", scopePath); } // Register enumeration Keyboard::Key. { std::vector scopePath; scopePath.push_back("Keyboard"); - gameplay::ScriptUtil::registerConstantString("KEY_NONE", "KEY_NONE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PAUSE", "KEY_PAUSE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SCROLL_LOCK", "KEY_SCROLL_LOCK", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PRINT", "KEY_PRINT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SYSREQ", "KEY_SYSREQ", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_BREAK", "KEY_BREAK", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_ESCAPE", "KEY_ESCAPE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_BACKSPACE", "KEY_BACKSPACE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_TAB", "KEY_TAB", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_BACK_TAB", "KEY_BACK_TAB", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_RETURN", "KEY_RETURN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPS_LOCK", "KEY_CAPS_LOCK", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SHIFT", "KEY_SHIFT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CTRL", "KEY_CTRL", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_ALT", "KEY_ALT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_MENU", "KEY_MENU", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_HYPER", "KEY_HYPER", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_INSERT", "KEY_INSERT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_HOME", "KEY_HOME", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PG_UP", "KEY_PG_UP", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_DELETE", "KEY_DELETE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_END", "KEY_END", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PG_DOWN", "KEY_PG_DOWN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_LEFT_ARROW", "KEY_LEFT_ARROW", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_ARROW", "KEY_RIGHT_ARROW", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_UP_ARROW", "KEY_UP_ARROW", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_DOWN_ARROW", "KEY_DOWN_ARROW", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_NUM_LOCK", "KEY_NUM_LOCK", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_PLUS", "KEY_KP_PLUS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_MINUS", "KEY_KP_MINUS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_MULTIPLY", "KEY_KP_MULTIPLY", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_DIVIDE", "KEY_KP_DIVIDE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_ENTER", "KEY_KP_ENTER", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_HOME", "KEY_KP_HOME", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_UP", "KEY_KP_UP", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_PG_UP", "KEY_KP_PG_UP", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_LEFT", "KEY_KP_LEFT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_FIVE", "KEY_KP_FIVE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_RIGHT", "KEY_KP_RIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_END", "KEY_KP_END", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_DOWN", "KEY_KP_DOWN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_PG_DOWN", "KEY_KP_PG_DOWN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_INSERT", "KEY_KP_INSERT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_KP_DELETE", "KEY_KP_DELETE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F1", "KEY_F1", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F2", "KEY_F2", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F3", "KEY_F3", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F4", "KEY_F4", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F5", "KEY_F5", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F6", "KEY_F6", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F7", "KEY_F7", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F8", "KEY_F8", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F9", "KEY_F9", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F10", "KEY_F10", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F11", "KEY_F11", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F12", "KEY_F12", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SPACE", "KEY_SPACE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_EXCLAM", "KEY_EXCLAM", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_QUOTE", "KEY_QUOTE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_NUMBER", "KEY_NUMBER", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_DOLLAR", "KEY_DOLLAR", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PERCENT", "KEY_PERCENT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CIRCUMFLEX", "KEY_CIRCUMFLEX", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_AMPERSAND", "KEY_AMPERSAND", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_APOSTROPHE", "KEY_APOSTROPHE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_LEFT_PARENTHESIS", "KEY_LEFT_PARENTHESIS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_PARENTHESIS", "KEY_RIGHT_PARENTHESIS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_ASTERISK", "KEY_ASTERISK", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PLUS", "KEY_PLUS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_COMMA", "KEY_COMMA", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_MINUS", "KEY_MINUS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_PERIOD", "KEY_PERIOD", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SLASH", "KEY_SLASH", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_ZERO", "KEY_ZERO", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_ONE", "KEY_ONE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_TWO", "KEY_TWO", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_THREE", "KEY_THREE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_FOUR", "KEY_FOUR", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_FIVE", "KEY_FIVE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SIX", "KEY_SIX", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SEVEN", "KEY_SEVEN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_EIGHT", "KEY_EIGHT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_NINE", "KEY_NINE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_COLON", "KEY_COLON", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SEMICOLON", "KEY_SEMICOLON", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_LESS_THAN", "KEY_LESS_THAN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_EQUAL", "KEY_EQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_GREATER_THAN", "KEY_GREATER_THAN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_QUESTION", "KEY_QUESTION", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_AT", "KEY_AT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_A", "KEY_CAPITAL_A", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_B", "KEY_CAPITAL_B", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_C", "KEY_CAPITAL_C", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_D", "KEY_CAPITAL_D", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_E", "KEY_CAPITAL_E", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_F", "KEY_CAPITAL_F", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_G", "KEY_CAPITAL_G", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_H", "KEY_CAPITAL_H", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_I", "KEY_CAPITAL_I", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_J", "KEY_CAPITAL_J", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_K", "KEY_CAPITAL_K", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_L", "KEY_CAPITAL_L", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_M", "KEY_CAPITAL_M", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_N", "KEY_CAPITAL_N", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_O", "KEY_CAPITAL_O", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_P", "KEY_CAPITAL_P", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_Q", "KEY_CAPITAL_Q", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_R", "KEY_CAPITAL_R", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_S", "KEY_CAPITAL_S", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_T", "KEY_CAPITAL_T", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_U", "KEY_CAPITAL_U", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_V", "KEY_CAPITAL_V", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_W", "KEY_CAPITAL_W", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_X", "KEY_CAPITAL_X", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_Y", "KEY_CAPITAL_Y", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_Z", "KEY_CAPITAL_Z", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_LEFT_BRACKET", "KEY_LEFT_BRACKET", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_BACK_SLASH", "KEY_BACK_SLASH", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_BRACKET", "KEY_RIGHT_BRACKET", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_UNDERSCORE", "KEY_UNDERSCORE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_GRAVE", "KEY_GRAVE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_A", "KEY_A", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_B", "KEY_B", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_C", "KEY_C", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_D", "KEY_D", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_E", "KEY_E", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_F", "KEY_F", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_G", "KEY_G", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_H", "KEY_H", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_I", "KEY_I", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_J", "KEY_J", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_K", "KEY_K", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_L", "KEY_L", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_M", "KEY_M", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_N", "KEY_N", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_O", "KEY_O", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_P", "KEY_P", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_Q", "KEY_Q", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_R", "KEY_R", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_S", "KEY_S", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_T", "KEY_T", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_U", "KEY_U", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_V", "KEY_V", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_W", "KEY_W", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_X", "KEY_X", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_Y", "KEY_Y", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_Z", "KEY_Z", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_LEFT_BRACE", "KEY_LEFT_BRACE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_BAR", "KEY_BAR", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_BRACE", "KEY_RIGHT_BRACE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_TILDE", "KEY_TILDE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_EURO", "KEY_EURO", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_POUND", "KEY_POUND", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_YEN", "KEY_YEN", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_MIDDLE_DOT", "KEY_MIDDLE_DOT", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_SEARCH", "KEY_SEARCH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_NONE, "KEY_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PAUSE, "KEY_PAUSE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SCROLL_LOCK, "KEY_SCROLL_LOCK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PRINT, "KEY_PRINT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SYSREQ, "KEY_SYSREQ", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_BREAK, "KEY_BREAK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_ESCAPE, "KEY_ESCAPE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_BACKSPACE, "KEY_BACKSPACE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_TAB, "KEY_TAB", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_BACK_TAB, "KEY_BACK_TAB", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_RETURN, "KEY_RETURN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPS_LOCK, "KEY_CAPS_LOCK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SHIFT, "KEY_SHIFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CTRL, "KEY_CTRL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_ALT, "KEY_ALT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_MENU, "KEY_MENU", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_HYPER, "KEY_HYPER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_INSERT, "KEY_INSERT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_HOME, "KEY_HOME", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PG_UP, "KEY_PG_UP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_DELETE, "KEY_DELETE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_END, "KEY_END", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PG_DOWN, "KEY_PG_DOWN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_LEFT_ARROW, "KEY_LEFT_ARROW", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_RIGHT_ARROW, "KEY_RIGHT_ARROW", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_UP_ARROW, "KEY_UP_ARROW", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_DOWN_ARROW, "KEY_DOWN_ARROW", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_NUM_LOCK, "KEY_NUM_LOCK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_PLUS, "KEY_KP_PLUS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_MINUS, "KEY_KP_MINUS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_MULTIPLY, "KEY_KP_MULTIPLY", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_DIVIDE, "KEY_KP_DIVIDE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_ENTER, "KEY_KP_ENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_HOME, "KEY_KP_HOME", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_UP, "KEY_KP_UP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_PG_UP, "KEY_KP_PG_UP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_LEFT, "KEY_KP_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_FIVE, "KEY_KP_FIVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_RIGHT, "KEY_KP_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_END, "KEY_KP_END", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_DOWN, "KEY_KP_DOWN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_PG_DOWN, "KEY_KP_PG_DOWN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_INSERT, "KEY_KP_INSERT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_KP_DELETE, "KEY_KP_DELETE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F1, "KEY_F1", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F2, "KEY_F2", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F3, "KEY_F3", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F4, "KEY_F4", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F5, "KEY_F5", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F6, "KEY_F6", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F7, "KEY_F7", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F8, "KEY_F8", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F9, "KEY_F9", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F10, "KEY_F10", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F11, "KEY_F11", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F12, "KEY_F12", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SPACE, "KEY_SPACE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_EXCLAM, "KEY_EXCLAM", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_QUOTE, "KEY_QUOTE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_NUMBER, "KEY_NUMBER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_DOLLAR, "KEY_DOLLAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PERCENT, "KEY_PERCENT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CIRCUMFLEX, "KEY_CIRCUMFLEX", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_AMPERSAND, "KEY_AMPERSAND", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_APOSTROPHE, "KEY_APOSTROPHE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_LEFT_PARENTHESIS, "KEY_LEFT_PARENTHESIS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_RIGHT_PARENTHESIS, "KEY_RIGHT_PARENTHESIS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_ASTERISK, "KEY_ASTERISK", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PLUS, "KEY_PLUS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_COMMA, "KEY_COMMA", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_MINUS, "KEY_MINUS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PERIOD, "KEY_PERIOD", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SLASH, "KEY_SLASH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_ZERO, "KEY_ZERO", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_ONE, "KEY_ONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_TWO, "KEY_TWO", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_THREE, "KEY_THREE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_FOUR, "KEY_FOUR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_FIVE, "KEY_FIVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SIX, "KEY_SIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SEVEN, "KEY_SEVEN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_EIGHT, "KEY_EIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_NINE, "KEY_NINE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_COLON, "KEY_COLON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SEMICOLON, "KEY_SEMICOLON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_LESS_THAN, "KEY_LESS_THAN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_EQUAL, "KEY_EQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_GREATER_THAN, "KEY_GREATER_THAN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_QUESTION, "KEY_QUESTION", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_AT, "KEY_AT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_A, "KEY_CAPITAL_A", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_B, "KEY_CAPITAL_B", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_C, "KEY_CAPITAL_C", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_D, "KEY_CAPITAL_D", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_E, "KEY_CAPITAL_E", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_F, "KEY_CAPITAL_F", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_G, "KEY_CAPITAL_G", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_H, "KEY_CAPITAL_H", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_I, "KEY_CAPITAL_I", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_J, "KEY_CAPITAL_J", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_K, "KEY_CAPITAL_K", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_L, "KEY_CAPITAL_L", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_M, "KEY_CAPITAL_M", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_N, "KEY_CAPITAL_N", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_O, "KEY_CAPITAL_O", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_P, "KEY_CAPITAL_P", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_Q, "KEY_CAPITAL_Q", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_R, "KEY_CAPITAL_R", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_S, "KEY_CAPITAL_S", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_T, "KEY_CAPITAL_T", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_U, "KEY_CAPITAL_U", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_V, "KEY_CAPITAL_V", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_W, "KEY_CAPITAL_W", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_X, "KEY_CAPITAL_X", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_Y, "KEY_CAPITAL_Y", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CAPITAL_Z, "KEY_CAPITAL_Z", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_LEFT_BRACKET, "KEY_LEFT_BRACKET", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_BACK_SLASH, "KEY_BACK_SLASH", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_RIGHT_BRACKET, "KEY_RIGHT_BRACKET", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_UNDERSCORE, "KEY_UNDERSCORE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_GRAVE, "KEY_GRAVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_A, "KEY_A", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_B, "KEY_B", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_C, "KEY_C", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_D, "KEY_D", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_E, "KEY_E", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_F, "KEY_F", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_G, "KEY_G", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_H, "KEY_H", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_I, "KEY_I", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_J, "KEY_J", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_K, "KEY_K", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_L, "KEY_L", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_M, "KEY_M", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_N, "KEY_N", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_O, "KEY_O", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_P, "KEY_P", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_Q, "KEY_Q", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_R, "KEY_R", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_S, "KEY_S", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_T, "KEY_T", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_U, "KEY_U", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_V, "KEY_V", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_W, "KEY_W", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_X, "KEY_X", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_Y, "KEY_Y", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_Z, "KEY_Z", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_LEFT_BRACE, "KEY_LEFT_BRACE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_BAR, "KEY_BAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_RIGHT_BRACE, "KEY_RIGHT_BRACE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_TILDE, "KEY_TILDE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_EURO, "KEY_EURO", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_POUND, "KEY_POUND", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_YEN, "KEY_YEN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_MIDDLE_DOT, "KEY_MIDDLE_DOT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_SEARCH, "KEY_SEARCH", scopePath); } // Register enumeration Keyboard::KeyEvent. { std::vector scopePath; scopePath.push_back("Keyboard"); - gameplay::ScriptUtil::registerConstantString("KEY_PRESS", "KEY_PRESS", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_RELEASE", "KEY_RELEASE", scopePath); - gameplay::ScriptUtil::registerConstantString("KEY_CHAR", "KEY_CHAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_PRESS, "KEY_PRESS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_RELEASE, "KEY_RELEASE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Keyboard::KEY_CHAR, "KEY_CHAR", scopePath); } // Register enumeration Layout::Type. { std::vector scopePath; scopePath.push_back("Layout"); - gameplay::ScriptUtil::registerConstantString("LAYOUT_FLOW", "LAYOUT_FLOW", scopePath); - gameplay::ScriptUtil::registerConstantString("LAYOUT_VERTICAL", "LAYOUT_VERTICAL", scopePath); - gameplay::ScriptUtil::registerConstantString("LAYOUT_ABSOLUTE", "LAYOUT_ABSOLUTE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Layout::LAYOUT_FLOW, "LAYOUT_FLOW", scopePath); + gameplay::ScriptUtil::registerEnumValue(Layout::LAYOUT_VERTICAL, "LAYOUT_VERTICAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Layout::LAYOUT_ABSOLUTE, "LAYOUT_ABSOLUTE", scopePath); } // Register enumeration Light::Type. { std::vector scopePath; scopePath.push_back("Light"); - gameplay::ScriptUtil::registerConstantString("DIRECTIONAL", "DIRECTIONAL", scopePath); - gameplay::ScriptUtil::registerConstantString("POINT", "POINT", scopePath); - gameplay::ScriptUtil::registerConstantString("SPOT", "SPOT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Light::DIRECTIONAL, "DIRECTIONAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Light::POINT, "POINT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Light::SPOT, "SPOT", scopePath); } // Register enumeration Logger::Level. { std::vector scopePath; scopePath.push_back("Logger"); - gameplay::ScriptUtil::registerConstantString("LEVEL_INFO", "LEVEL_INFO", scopePath); - gameplay::ScriptUtil::registerConstantString("LEVEL_WARN", "LEVEL_WARN", scopePath); - gameplay::ScriptUtil::registerConstantString("LEVEL_ERROR", "LEVEL_ERROR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Logger::LEVEL_INFO, "LEVEL_INFO", scopePath); + gameplay::ScriptUtil::registerEnumValue(Logger::LEVEL_WARN, "LEVEL_WARN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Logger::LEVEL_ERROR, "LEVEL_ERROR", scopePath); } // Register enumeration Mesh::IndexFormat. { std::vector scopePath; scopePath.push_back("Mesh"); - gameplay::ScriptUtil::registerConstantString("INDEX8", "INDEX8", scopePath); - gameplay::ScriptUtil::registerConstantString("INDEX16", "INDEX16", scopePath); - gameplay::ScriptUtil::registerConstantString("INDEX32", "INDEX32", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::INDEX8, "INDEX8", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::INDEX16, "INDEX16", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::INDEX32, "INDEX32", scopePath); } // Register enumeration Mesh::PrimitiveType. { std::vector scopePath; scopePath.push_back("Mesh"); - gameplay::ScriptUtil::registerConstantString("TRIANGLES", "TRIANGLES", scopePath); - gameplay::ScriptUtil::registerConstantString("TRIANGLE_STRIP", "TRIANGLE_STRIP", scopePath); - gameplay::ScriptUtil::registerConstantString("LINES", "LINES", scopePath); - gameplay::ScriptUtil::registerConstantString("LINE_STRIP", "LINE_STRIP", scopePath); - gameplay::ScriptUtil::registerConstantString("POINTS", "POINTS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::TRIANGLES, "TRIANGLES", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::TRIANGLE_STRIP, "TRIANGLE_STRIP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::LINES, "LINES", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::LINE_STRIP, "LINE_STRIP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mesh::POINTS, "POINTS", scopePath); } // Register enumeration Mouse::MouseEvent. { std::vector scopePath; scopePath.push_back("Mouse"); - gameplay::ScriptUtil::registerConstantString("MOUSE_PRESS_LEFT_BUTTON", "MOUSE_PRESS_LEFT_BUTTON", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_RELEASE_LEFT_BUTTON", "MOUSE_RELEASE_LEFT_BUTTON", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_PRESS_MIDDLE_BUTTON", "MOUSE_PRESS_MIDDLE_BUTTON", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_RELEASE_MIDDLE_BUTTON", "MOUSE_RELEASE_MIDDLE_BUTTON", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_PRESS_RIGHT_BUTTON", "MOUSE_PRESS_RIGHT_BUTTON", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_RELEASE_RIGHT_BUTTON", "MOUSE_RELEASE_RIGHT_BUTTON", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_MOVE", "MOUSE_MOVE", scopePath); - gameplay::ScriptUtil::registerConstantString("MOUSE_WHEEL", "MOUSE_WHEEL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_PRESS_LEFT_BUTTON, "MOUSE_PRESS_LEFT_BUTTON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_RELEASE_LEFT_BUTTON, "MOUSE_RELEASE_LEFT_BUTTON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_PRESS_MIDDLE_BUTTON, "MOUSE_PRESS_MIDDLE_BUTTON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_RELEASE_MIDDLE_BUTTON, "MOUSE_RELEASE_MIDDLE_BUTTON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_PRESS_RIGHT_BUTTON, "MOUSE_PRESS_RIGHT_BUTTON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_RELEASE_RIGHT_BUTTON, "MOUSE_RELEASE_RIGHT_BUTTON", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_MOVE, "MOUSE_MOVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Mouse::MOUSE_WHEEL, "MOUSE_WHEEL", scopePath); } // Register enumeration Node::Type. { std::vector scopePath; scopePath.push_back("Node"); - gameplay::ScriptUtil::registerConstantString("NODE", "NODE", scopePath); - gameplay::ScriptUtil::registerConstantString("JOINT", "JOINT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Node::NODE, "NODE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Node::JOINT, "JOINT", scopePath); } - // Register enumeration ParticleEmitter::TextureBlending. + // Register enumeration ParticleEmitter::BlendMode. { std::vector scopePath; scopePath.push_back("ParticleEmitter"); - gameplay::ScriptUtil::registerConstantString("BLEND_OPAQUE", "BLEND_OPAQUE", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_TRANSPARENT", "BLEND_TRANSPARENT", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ADDITIVE", "BLEND_ADDITIVE", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_MULTIPLIED", "BLEND_MULTIPLIED", scopePath); + gameplay::ScriptUtil::registerEnumValue(ParticleEmitter::BLEND_NONE, "BLEND_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(ParticleEmitter::BLEND_ALPHA, "BLEND_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(ParticleEmitter::BLEND_ADDITIVE, "BLEND_ADDITIVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(ParticleEmitter::BLEND_MULTIPLIED, "BLEND_MULTIPLIED", scopePath); } // Register enumeration PhysicsCollisionObject::CollisionListener::EventType. @@ -685,32 +737,32 @@ void luaRegister_lua_Global() std::vector scopePath; scopePath.push_back("PhysicsCollisionObject"); scopePath.push_back("CollisionListener"); - gameplay::ScriptUtil::registerConstantString("COLLIDING", "COLLIDING", scopePath); - gameplay::ScriptUtil::registerConstantString("NOT_COLLIDING", "NOT_COLLIDING", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::CollisionListener::COLLIDING, "COLLIDING", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::CollisionListener::NOT_COLLIDING, "NOT_COLLIDING", scopePath); } // Register enumeration PhysicsCollisionObject::Type. { std::vector scopePath; scopePath.push_back("PhysicsCollisionObject"); - gameplay::ScriptUtil::registerConstantString("RIGID_BODY", "RIGID_BODY", scopePath); - gameplay::ScriptUtil::registerConstantString("CHARACTER", "CHARACTER", scopePath); - gameplay::ScriptUtil::registerConstantString("GHOST_OBJECT", "GHOST_OBJECT", scopePath); - gameplay::ScriptUtil::registerConstantString("VEHICLE", "VEHICLE", scopePath); - gameplay::ScriptUtil::registerConstantString("VEHICLE_WHEEL", "VEHICLE_WHEEL", scopePath); - gameplay::ScriptUtil::registerConstantString("NONE", "NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::RIGID_BODY, "RIGID_BODY", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::CHARACTER, "CHARACTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::GHOST_OBJECT, "GHOST_OBJECT", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::VEHICLE, "VEHICLE", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::VEHICLE_WHEEL, "VEHICLE_WHEEL", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionObject::NONE, "NONE", scopePath); } // Register enumeration PhysicsCollisionShape::Type. { std::vector scopePath; scopePath.push_back("PhysicsCollisionShape"); - gameplay::ScriptUtil::registerConstantString("SHAPE_NONE", "SHAPE_NONE", scopePath); - gameplay::ScriptUtil::registerConstantString("SHAPE_BOX", "SHAPE_BOX", scopePath); - gameplay::ScriptUtil::registerConstantString("SHAPE_SPHERE", "SHAPE_SPHERE", scopePath); - gameplay::ScriptUtil::registerConstantString("SHAPE_CAPSULE", "SHAPE_CAPSULE", scopePath); - gameplay::ScriptUtil::registerConstantString("SHAPE_MESH", "SHAPE_MESH", scopePath); - gameplay::ScriptUtil::registerConstantString("SHAPE_HEIGHTFIELD", "SHAPE_HEIGHTFIELD", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionShape::SHAPE_NONE, "SHAPE_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionShape::SHAPE_BOX, "SHAPE_BOX", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionShape::SHAPE_SPHERE, "SHAPE_SPHERE", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionShape::SHAPE_CAPSULE, "SHAPE_CAPSULE", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionShape::SHAPE_MESH, "SHAPE_MESH", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsCollisionShape::SHAPE_HEIGHTFIELD, "SHAPE_HEIGHTFIELD", scopePath); } // Register enumeration PhysicsController::Listener::EventType. @@ -718,195 +770,264 @@ void luaRegister_lua_Global() std::vector scopePath; scopePath.push_back("PhysicsController"); scopePath.push_back("Listener"); - gameplay::ScriptUtil::registerConstantString("ACTIVATED", "ACTIVATED", scopePath); - gameplay::ScriptUtil::registerConstantString("DEACTIVATED", "DEACTIVATED", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsController::Listener::ACTIVATED, "ACTIVATED", scopePath); + gameplay::ScriptUtil::registerEnumValue(PhysicsController::Listener::DEACTIVATED, "DEACTIVATED", scopePath); } // Register enumeration Properties::Type. { std::vector scopePath; scopePath.push_back("Properties"); - gameplay::ScriptUtil::registerConstantString("NONE", "NONE", scopePath); - gameplay::ScriptUtil::registerConstantString("STRING", "STRING", scopePath); - gameplay::ScriptUtil::registerConstantString("NUMBER", "NUMBER", scopePath); - gameplay::ScriptUtil::registerConstantString("VECTOR2", "VECTOR2", scopePath); - gameplay::ScriptUtil::registerConstantString("VECTOR3", "VECTOR3", scopePath); - gameplay::ScriptUtil::registerConstantString("VECTOR4", "VECTOR4", scopePath); - gameplay::ScriptUtil::registerConstantString("MATRIX", "MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::NONE, "NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::STRING, "STRING", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::NUMBER, "NUMBER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::VECTOR2, "VECTOR2", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::VECTOR3, "VECTOR3", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::VECTOR4, "VECTOR4", scopePath); + gameplay::ScriptUtil::registerEnumValue(Properties::MATRIX, "MATRIX", scopePath); } // Register enumeration RenderState::AutoBinding. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("NONE", "NONE", scopePath); - gameplay::ScriptUtil::registerConstantString("WORLD_MATRIX", "WORLD_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("VIEW_MATRIX", "VIEW_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("PROJECTION_MATRIX", "PROJECTION_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("WORLD_VIEW_MATRIX", "WORLD_VIEW_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("VIEW_PROJECTION_MATRIX", "VIEW_PROJECTION_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("WORLD_VIEW_PROJECTION_MATRIX", "WORLD_VIEW_PROJECTION_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("INVERSE_TRANSPOSE_WORLD_MATRIX", "INVERSE_TRANSPOSE_WORLD_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX", "INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX", scopePath); - gameplay::ScriptUtil::registerConstantString("CAMERA_WORLD_POSITION", "CAMERA_WORLD_POSITION", scopePath); - gameplay::ScriptUtil::registerConstantString("CAMERA_VIEW_POSITION", "CAMERA_VIEW_POSITION", scopePath); - gameplay::ScriptUtil::registerConstantString("MATRIX_PALETTE", "MATRIX_PALETTE", scopePath); - gameplay::ScriptUtil::registerConstantString("SCENE_AMBIENT_COLOR", "SCENE_AMBIENT_COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::NONE, "NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::WORLD_MATRIX, "WORLD_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::VIEW_MATRIX, "VIEW_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::PROJECTION_MATRIX, "PROJECTION_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::WORLD_VIEW_MATRIX, "WORLD_VIEW_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::VIEW_PROJECTION_MATRIX, "VIEW_PROJECTION_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::WORLD_VIEW_PROJECTION_MATRIX, "WORLD_VIEW_PROJECTION_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::INVERSE_TRANSPOSE_WORLD_MATRIX, "INVERSE_TRANSPOSE_WORLD_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX, "INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::CAMERA_WORLD_POSITION, "CAMERA_WORLD_POSITION", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::CAMERA_VIEW_POSITION, "CAMERA_VIEW_POSITION", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::MATRIX_PALETTE, "MATRIX_PALETTE", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::SCENE_AMBIENT_COLOR, "SCENE_AMBIENT_COLOR", scopePath); } // Register enumeration RenderState::Blend. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("BLEND_ZERO", "BLEND_ZERO", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ONE", "BLEND_ONE", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_SRC_COLOR", "BLEND_SRC_COLOR", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_SRC_COLOR", "BLEND_ONE_MINUS_SRC_COLOR", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_DST_COLOR", "BLEND_DST_COLOR", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_DST_COLOR", "BLEND_ONE_MINUS_DST_COLOR", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_SRC_ALPHA", "BLEND_SRC_ALPHA", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_SRC_ALPHA", "BLEND_ONE_MINUS_SRC_ALPHA", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_DST_ALPHA", "BLEND_DST_ALPHA", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_DST_ALPHA", "BLEND_ONE_MINUS_DST_ALPHA", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_CONSTANT_ALPHA", "BLEND_CONSTANT_ALPHA", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_CONSTANT_ALPHA", "BLEND_ONE_MINUS_CONSTANT_ALPHA", scopePath); - gameplay::ScriptUtil::registerConstantString("BLEND_SRC_ALPHA_SATURATE", "BLEND_SRC_ALPHA_SATURATE", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ZERO, "BLEND_ZERO", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ONE, "BLEND_ONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_SRC_COLOR, "BLEND_SRC_COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ONE_MINUS_SRC_COLOR, "BLEND_ONE_MINUS_SRC_COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_DST_COLOR, "BLEND_DST_COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ONE_MINUS_DST_COLOR, "BLEND_ONE_MINUS_DST_COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_SRC_ALPHA, "BLEND_SRC_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ONE_MINUS_SRC_ALPHA, "BLEND_ONE_MINUS_SRC_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_DST_ALPHA, "BLEND_DST_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ONE_MINUS_DST_ALPHA, "BLEND_ONE_MINUS_DST_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_CONSTANT_ALPHA, "BLEND_CONSTANT_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_ONE_MINUS_CONSTANT_ALPHA, "BLEND_ONE_MINUS_CONSTANT_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::BLEND_SRC_ALPHA_SATURATE, "BLEND_SRC_ALPHA_SATURATE", scopePath); } // Register enumeration RenderState::CullFaceSide. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("CULL_FACE_SIDE_BACK", "CULL_FACE_SIDE_BACK", scopePath); - gameplay::ScriptUtil::registerConstantString("CULL_FACE_SIDE_FRONT", "CULL_FACE_SIDE_FRONT", scopePath); - gameplay::ScriptUtil::registerConstantString("CULL_FACE_SIDE_FRONT_AND_BACK", "CULL_FACE_SIDE_FRONT_AND_BACK", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::CULL_FACE_SIDE_BACK, "CULL_FACE_SIDE_BACK", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::CULL_FACE_SIDE_FRONT, "CULL_FACE_SIDE_FRONT", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::CULL_FACE_SIDE_FRONT_AND_BACK, "CULL_FACE_SIDE_FRONT_AND_BACK", scopePath); } // Register enumeration RenderState::DepthFunction. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("DEPTH_NEVER", "DEPTH_NEVER", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_LESS", "DEPTH_LESS", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_EQUAL", "DEPTH_EQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_LEQUAL", "DEPTH_LEQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_GREATER", "DEPTH_GREATER", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_NOTEQUAL", "DEPTH_NOTEQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_GEQUAL", "DEPTH_GEQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("DEPTH_ALWAYS", "DEPTH_ALWAYS", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_NEVER, "DEPTH_NEVER", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_LESS, "DEPTH_LESS", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_EQUAL, "DEPTH_EQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_LEQUAL, "DEPTH_LEQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_GREATER, "DEPTH_GREATER", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_NOTEQUAL, "DEPTH_NOTEQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_GEQUAL, "DEPTH_GEQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::DEPTH_ALWAYS, "DEPTH_ALWAYS", scopePath); } // Register enumeration RenderState::FrontFace. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("FRONT_FACE_CW", "FRONT_FACE_CW", scopePath); - gameplay::ScriptUtil::registerConstantString("FRONT_FACE_CCW", "FRONT_FACE_CCW", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::FRONT_FACE_CW, "FRONT_FACE_CW", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::FRONT_FACE_CCW, "FRONT_FACE_CCW", scopePath); } // Register enumeration RenderState::StencilFunction. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("STENCIL_NEVER", "STENCIL_NEVER", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_ALWAYS", "STENCIL_ALWAYS", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_LESS", "STENCIL_LESS", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_LEQUAL", "STENCIL_LEQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_EQUAL", "STENCIL_EQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_GREATER", "STENCIL_GREATER", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_GEQUAL", "STENCIL_GEQUAL", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_NOTEQUAL", "STENCIL_NOTEQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_NEVER, "STENCIL_NEVER", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_ALWAYS, "STENCIL_ALWAYS", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_LESS, "STENCIL_LESS", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_LEQUAL, "STENCIL_LEQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_EQUAL, "STENCIL_EQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_GREATER, "STENCIL_GREATER", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_GEQUAL, "STENCIL_GEQUAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_NOTEQUAL, "STENCIL_NOTEQUAL", scopePath); } // Register enumeration RenderState::StencilOperation. { std::vector scopePath; scopePath.push_back("RenderState"); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_KEEP", "STENCIL_OP_KEEP", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_ZERO", "STENCIL_OP_ZERO", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_REPLACE", "STENCIL_OP_REPLACE", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INCR", "STENCIL_OP_INCR", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_DECR", "STENCIL_OP_DECR", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INVERT", "STENCIL_OP_INVERT", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INCR_WRAP", "STENCIL_OP_INCR_WRAP", scopePath); - gameplay::ScriptUtil::registerConstantString("STENCIL_OP_DECR_WRAP", "STENCIL_OP_DECR_WRAP", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_KEEP, "STENCIL_OP_KEEP", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_ZERO, "STENCIL_OP_ZERO", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_REPLACE, "STENCIL_OP_REPLACE", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_INCR, "STENCIL_OP_INCR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_DECR, "STENCIL_OP_DECR", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_INVERT, "STENCIL_OP_INVERT", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_INCR_WRAP, "STENCIL_OP_INCR_WRAP", scopePath); + gameplay::ScriptUtil::registerEnumValue(RenderState::STENCIL_OP_DECR_WRAP, "STENCIL_OP_DECR_WRAP", scopePath); + } + + // Register enumeration Script::Scope. + { + std::vector scopePath; + scopePath.push_back("Script"); + gameplay::ScriptUtil::registerEnumValue(Script::GLOBAL, "GLOBAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Script::PROTECTED, "PROTECTED", scopePath); + } + + // Register enumeration Sprite::BlendMode. + { + std::vector scopePath; + scopePath.push_back("Sprite"); + gameplay::ScriptUtil::registerEnumValue(Sprite::BLEND_NONE, "BLEND_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::BLEND_ALPHA, "BLEND_ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::BLEND_ADDITIVE, "BLEND_ADDITIVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::BLEND_MULTIPLIED, "BLEND_MULTIPLIED", scopePath); + } + + // Register enumeration Sprite::FlipFlags. + { + std::vector scopePath; + scopePath.push_back("Sprite"); + gameplay::ScriptUtil::registerEnumValue(Sprite::FLIP_NONE, "FLIP_NONE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::FLIP_VERTICAL, "FLIP_VERTICAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::FLIP_HORIZONTAL, "FLIP_HORIZONTAL", scopePath); + } + + // Register enumeration Sprite::Offset. + { + std::vector scopePath; + scopePath.push_back("Sprite"); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_LEFT, "OFFSET_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_HCENTER, "OFFSET_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_RIGHT, "OFFSET_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_TOP, "OFFSET_TOP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_VCENTER, "OFFSET_VCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_BOTTOM, "OFFSET_BOTTOM", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_ANCHOR, "OFFSET_ANCHOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_TOP_LEFT, "OFFSET_TOP_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_VCENTER_LEFT, "OFFSET_VCENTER_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_BOTTOM_LEFT, "OFFSET_BOTTOM_LEFT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_TOP_HCENTER, "OFFSET_TOP_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_VCENTER_HCENTER, "OFFSET_VCENTER_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_BOTTOM_HCENTER, "OFFSET_BOTTOM_HCENTER", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_TOP_RIGHT, "OFFSET_TOP_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_VCENTER_RIGHT, "OFFSET_VCENTER_RIGHT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Sprite::OFFSET_BOTTOM_RIGHT, "OFFSET_BOTTOM_RIGHT", scopePath); } // Register enumeration Terrain::Flags. { std::vector scopePath; scopePath.push_back("Terrain"); - gameplay::ScriptUtil::registerConstantString("DEBUG_PATCHES", "DEBUG_PATCHES", scopePath); - gameplay::ScriptUtil::registerConstantString("FRUSTUM_CULLING", "FRUSTUM_CULLING", scopePath); - gameplay::ScriptUtil::registerConstantString("LEVEL_OF_DETAIL", "LEVEL_OF_DETAIL", scopePath); + gameplay::ScriptUtil::registerEnumValue(Terrain::DEBUG_PATCHES, "DEBUG_PATCHES", scopePath); + gameplay::ScriptUtil::registerEnumValue(Terrain::FRUSTUM_CULLING, "FRUSTUM_CULLING", scopePath); + gameplay::ScriptUtil::registerEnumValue(Terrain::LEVEL_OF_DETAIL, "LEVEL_OF_DETAIL", scopePath); } // Register enumeration TextBox::InputMode. { std::vector scopePath; scopePath.push_back("TextBox"); - gameplay::ScriptUtil::registerConstantString("TEXT", "TEXT", scopePath); - gameplay::ScriptUtil::registerConstantString("PASSWORD", "PASSWORD", scopePath); + gameplay::ScriptUtil::registerEnumValue(TextBox::TEXT, "TEXT", scopePath); + gameplay::ScriptUtil::registerEnumValue(TextBox::PASSWORD, "PASSWORD", scopePath); + } + + // Register enumeration Texture::CubeFace. + { + std::vector scopePath; + scopePath.push_back("Texture"); + gameplay::ScriptUtil::registerEnumValue(Texture::POSITIVE_X, "POSITIVE_X", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::NEGATIVE_X, "NEGATIVE_X", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::POSITIVE_Y, "POSITIVE_Y", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::NEGATIVE_Y, "NEGATIVE_Y", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::POSITIVE_Z, "POSITIVE_Z", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::NEGATIVE_Z, "NEGATIVE_Z", scopePath); } // Register enumeration Texture::Filter. { std::vector scopePath; scopePath.push_back("Texture"); - gameplay::ScriptUtil::registerConstantString("NEAREST", "NEAREST", scopePath); - gameplay::ScriptUtil::registerConstantString("LINEAR", "LINEAR", scopePath); - gameplay::ScriptUtil::registerConstantString("NEAREST_MIPMAP_NEAREST", "NEAREST_MIPMAP_NEAREST", scopePath); - gameplay::ScriptUtil::registerConstantString("LINEAR_MIPMAP_NEAREST", "LINEAR_MIPMAP_NEAREST", scopePath); - gameplay::ScriptUtil::registerConstantString("NEAREST_MIPMAP_LINEAR", "NEAREST_MIPMAP_LINEAR", scopePath); - gameplay::ScriptUtil::registerConstantString("LINEAR_MIPMAP_LINEAR", "LINEAR_MIPMAP_LINEAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::NEAREST, "NEAREST", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::LINEAR, "LINEAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::NEAREST_MIPMAP_NEAREST, "NEAREST_MIPMAP_NEAREST", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::LINEAR_MIPMAP_NEAREST, "LINEAR_MIPMAP_NEAREST", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::NEAREST_MIPMAP_LINEAR, "NEAREST_MIPMAP_LINEAR", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::LINEAR_MIPMAP_LINEAR, "LINEAR_MIPMAP_LINEAR", scopePath); } // Register enumeration Texture::Format. { std::vector scopePath; scopePath.push_back("Texture"); - gameplay::ScriptUtil::registerConstantString("UNKNOWN", "UNKNOWN", scopePath); - gameplay::ScriptUtil::registerConstantString("RGB", "RGB", scopePath); - gameplay::ScriptUtil::registerConstantString("RGBA", "RGBA", scopePath); - gameplay::ScriptUtil::registerConstantString("ALPHA", "ALPHA", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::UNKNOWN, "UNKNOWN", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::RGB, "RGB", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::RGBA, "RGBA", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::ALPHA, "ALPHA", scopePath); + } + + // Register enumeration Texture::Type. + { + std::vector scopePath; + scopePath.push_back("Texture"); + gameplay::ScriptUtil::registerEnumValue(Texture::TEXTURE_2D, "TEXTURE_2D", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::TEXTURE_CUBE, "TEXTURE_CUBE", scopePath); } // Register enumeration Texture::Wrap. { std::vector scopePath; scopePath.push_back("Texture"); - gameplay::ScriptUtil::registerConstantString("REPEAT", "REPEAT", scopePath); - gameplay::ScriptUtil::registerConstantString("CLAMP", "CLAMP", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::REPEAT, "REPEAT", scopePath); + gameplay::ScriptUtil::registerEnumValue(Texture::CLAMP, "CLAMP", scopePath); } // Register enumeration Touch::TouchEvent. { std::vector scopePath; scopePath.push_back("Touch"); - gameplay::ScriptUtil::registerConstantString("TOUCH_PRESS", "TOUCH_PRESS", scopePath); - gameplay::ScriptUtil::registerConstantString("TOUCH_RELEASE", "TOUCH_RELEASE", scopePath); - gameplay::ScriptUtil::registerConstantString("TOUCH_MOVE", "TOUCH_MOVE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Touch::TOUCH_PRESS, "TOUCH_PRESS", scopePath); + gameplay::ScriptUtil::registerEnumValue(Touch::TOUCH_RELEASE, "TOUCH_RELEASE", scopePath); + gameplay::ScriptUtil::registerEnumValue(Touch::TOUCH_MOVE, "TOUCH_MOVE", scopePath); } // Register enumeration VertexFormat::Usage. { std::vector scopePath; scopePath.push_back("VertexFormat"); - gameplay::ScriptUtil::registerConstantString("POSITION", "POSITION", scopePath); - gameplay::ScriptUtil::registerConstantString("NORMAL", "NORMAL", scopePath); - gameplay::ScriptUtil::registerConstantString("COLOR", "COLOR", scopePath); - gameplay::ScriptUtil::registerConstantString("TANGENT", "TANGENT", scopePath); - gameplay::ScriptUtil::registerConstantString("BINORMAL", "BINORMAL", scopePath); - gameplay::ScriptUtil::registerConstantString("BLENDWEIGHTS", "BLENDWEIGHTS", scopePath); - gameplay::ScriptUtil::registerConstantString("BLENDINDICES", "BLENDINDICES", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD0", "TEXCOORD0", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD1", "TEXCOORD1", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD2", "TEXCOORD2", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD3", "TEXCOORD3", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD4", "TEXCOORD4", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD5", "TEXCOORD5", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD6", "TEXCOORD6", scopePath); - gameplay::ScriptUtil::registerConstantString("TEXCOORD7", "TEXCOORD7", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::POSITION, "POSITION", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::NORMAL, "NORMAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::COLOR, "COLOR", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TANGENT, "TANGENT", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::BINORMAL, "BINORMAL", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::BLENDWEIGHTS, "BLENDWEIGHTS", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::BLENDINDICES, "BLENDINDICES", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD0, "TEXCOORD0", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD1, "TEXCOORD1", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD2, "TEXCOORD2", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD3, "TEXCOORD3", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD4, "TEXCOORD4", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD5, "TEXCOORD5", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD6, "TEXCOORD6", scopePath); + gameplay::ScriptUtil::registerEnumValue(VertexFormat::TEXCOORD7, "TEXCOORD7", scopePath); } } @@ -951,111 +1072,4 @@ int lua__strcmpnocase(lua_State* state) return 0; } -static const char* enumStringEmpty = ""; - -const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value) -{ - if (enumname == "AIMessage::ParameterType") - return lua_stringFromEnum_AIMessageParameterType((AIMessage::ParameterType)value); - if (enumname == "AnimationClip::Listener::EventType") - return lua_stringFromEnum_AnimationClipListenerEventType((AnimationClip::Listener::EventType)value); - if (enumname == "AudioSource::State") - return lua_stringFromEnum_AudioSourceState((AudioSource::State)value); - if (enumname == "Camera::Type") - return lua_stringFromEnum_CameraType((Camera::Type)value); - if (enumname == "Container::Scroll") - return lua_stringFromEnum_ContainerScroll((Container::Scroll)value); - if (enumname == "Control::Alignment") - return lua_stringFromEnum_ControlAlignment((Control::Alignment)value); - if (enumname == "Control::AutoSize") - return lua_stringFromEnum_ControlAutoSize((Control::AutoSize)value); - if (enumname == "Control::Listener::EventType") - return lua_stringFromEnum_ControlListenerEventType((Control::Listener::EventType)value); - if (enumname == "Control::State") - return lua_stringFromEnum_ControlState((Control::State)value); - if (enumname == "Curve::InterpolationType") - return lua_stringFromEnum_CurveInterpolationType((Curve::InterpolationType)value); - if (enumname == "DepthStencilTarget::Format") - return lua_stringFromEnum_DepthStencilTargetFormat((DepthStencilTarget::Format)value); - if (enumname == "Font::Format") - return lua_stringFromEnum_FontFormat((Font::Format)value); - if (enumname == "Font::Justify") - return lua_stringFromEnum_FontJustify((Font::Justify)value); - if (enumname == "Font::Style") - return lua_stringFromEnum_FontStyle((Font::Style)value); - if (enumname == "Game::ClearFlags") - return lua_stringFromEnum_GameClearFlags((Game::ClearFlags)value); - if (enumname == "Game::State") - return lua_stringFromEnum_GameState((Game::State)value); - if (enumname == "Gamepad::ButtonMapping") - return lua_stringFromEnum_GamepadButtonMapping((Gamepad::ButtonMapping)value); - if (enumname == "Gamepad::GamepadEvent") - return lua_stringFromEnum_GamepadGamepadEvent((Gamepad::GamepadEvent)value); - if (enumname == "Gesture::GestureEvent") - return lua_stringFromEnum_GestureGestureEvent((Gesture::GestureEvent)value); - if (enumname == "Image::Format") - return lua_stringFromEnum_ImageFormat((Image::Format)value); - if (enumname == "Keyboard::Key") - return lua_stringFromEnum_KeyboardKey((Keyboard::Key)value); - if (enumname == "Keyboard::KeyEvent") - return lua_stringFromEnum_KeyboardKeyEvent((Keyboard::KeyEvent)value); - if (enumname == "Layout::Type") - return lua_stringFromEnum_LayoutType((Layout::Type)value); - if (enumname == "Light::Type") - return lua_stringFromEnum_LightType((Light::Type)value); - if (enumname == "Logger::Level") - return lua_stringFromEnum_LoggerLevel((Logger::Level)value); - if (enumname == "Mesh::IndexFormat") - return lua_stringFromEnum_MeshIndexFormat((Mesh::IndexFormat)value); - if (enumname == "Mesh::PrimitiveType") - return lua_stringFromEnum_MeshPrimitiveType((Mesh::PrimitiveType)value); - if (enumname == "Mouse::MouseEvent") - return lua_stringFromEnum_MouseMouseEvent((Mouse::MouseEvent)value); - if (enumname == "Node::Type") - return lua_stringFromEnum_NodeType((Node::Type)value); - if (enumname == "ParticleEmitter::TextureBlending") - return lua_stringFromEnum_ParticleEmitterTextureBlending((ParticleEmitter::TextureBlending)value); - if (enumname == "PhysicsCollisionObject::CollisionListener::EventType") - return lua_stringFromEnum_PhysicsCollisionObjectCollisionListenerEventType((PhysicsCollisionObject::CollisionListener::EventType)value); - if (enumname == "PhysicsCollisionObject::Type") - return lua_stringFromEnum_PhysicsCollisionObjectType((PhysicsCollisionObject::Type)value); - if (enumname == "PhysicsCollisionShape::Type") - return lua_stringFromEnum_PhysicsCollisionShapeType((PhysicsCollisionShape::Type)value); - if (enumname == "PhysicsController::Listener::EventType") - return lua_stringFromEnum_PhysicsControllerListenerEventType((PhysicsController::Listener::EventType)value); - if (enumname == "Properties::Type") - return lua_stringFromEnum_PropertiesType((Properties::Type)value); - if (enumname == "RenderState::AutoBinding") - return lua_stringFromEnum_RenderStateAutoBinding((RenderState::AutoBinding)value); - if (enumname == "RenderState::Blend") - return lua_stringFromEnum_RenderStateBlend((RenderState::Blend)value); - if (enumname == "RenderState::CullFaceSide") - return lua_stringFromEnum_RenderStateCullFaceSide((RenderState::CullFaceSide)value); - if (enumname == "RenderState::DepthFunction") - return lua_stringFromEnum_RenderStateDepthFunction((RenderState::DepthFunction)value); - if (enumname == "RenderState::FrontFace") - return lua_stringFromEnum_RenderStateFrontFace((RenderState::FrontFace)value); - if (enumname == "RenderState::StencilFunction") - return lua_stringFromEnum_RenderStateStencilFunction((RenderState::StencilFunction)value); - if (enumname == "RenderState::StencilOperation") - return lua_stringFromEnum_RenderStateStencilOperation((RenderState::StencilOperation)value); - if (enumname == "Terrain::Flags") - return lua_stringFromEnum_TerrainFlags((Terrain::Flags)value); - if (enumname == "TextBox::InputMode") - return lua_stringFromEnum_TextBoxInputMode((TextBox::InputMode)value); - if (enumname == "Texture::Filter") - return lua_stringFromEnum_TextureFilter((Texture::Filter)value); - if (enumname == "Texture::Format") - return lua_stringFromEnum_TextureFormat((Texture::Format)value); - if (enumname == "Texture::Wrap") - return lua_stringFromEnum_TextureWrap((Texture::Wrap)value); - if (enumname == "Touch::TouchEvent") - return lua_stringFromEnum_TouchTouchEvent((Touch::TouchEvent)value); - if (enumname == "VertexFormat::Usage") - return lua_stringFromEnum_VertexFormatUsage((VertexFormat::Usage)value); - - GP_ERROR("Unrecognized enumeration type '%s'.", enumname.c_str()); - return enumStringEmpty; -} - } diff --git a/gameplay/src/lua/lua_Global.h b/gameplay/src/lua/lua_Global.h index 3553890f8e..05731dd1aa 100644 --- a/gameplay/src/lua/lua_Global.h +++ b/gameplay/src/lua/lua_Global.h @@ -1,65 +1,13 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_GLOBAL_H_ #define LUA_GLOBAL_H_ -#include "lua_AIMessageParameterType.h" -#include "lua_AnimationClipListenerEventType.h" -#include "lua_AudioSourceState.h" -#include "lua_CameraType.h" -#include "lua_ContainerScroll.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_DepthStencilTargetFormat.h" -#include "lua_FontFormat.h" -#include "lua_FontJustify.h" -#include "lua_FontStyle.h" -#include "lua_GameClearFlags.h" -#include "lua_GameState.h" -#include "lua_GamepadButtonMapping.h" -#include "lua_GamepadGamepadEvent.h" -#include "lua_GestureGestureEvent.h" -#include "lua_ImageFormat.h" -#include "lua_KeyboardKey.h" -#include "lua_KeyboardKeyEvent.h" -#include "lua_LayoutType.h" -#include "lua_LightType.h" -#include "lua_LoggerLevel.h" -#include "lua_MeshIndexFormat.h" -#include "lua_MeshPrimitiveType.h" -#include "lua_MouseMouseEvent.h" -#include "lua_NodeType.h" -#include "lua_ParticleEmitterTextureBlending.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" -#include "lua_PhysicsControllerListenerEventType.h" -#include "lua_PropertiesType.h" -#include "lua_RenderStateAutoBinding.h" -#include "lua_RenderStateBlend.h" -#include "lua_RenderStateCullFaceSide.h" -#include "lua_RenderStateDepthFunction.h" -#include "lua_RenderStateFrontFace.h" -#include "lua_RenderStateStencilFunction.h" -#include "lua_RenderStateStencilOperation.h" -#include "lua_TerrainFlags.h" -#include "lua_TextBoxInputMode.h" -#include "lua_TextureFilter.h" -#include "lua_TextureFormat.h" -#include "lua_TextureWrap.h" -#include "lua_TouchTouchEvent.h" -#include "lua_VertexFormatUsage.h" - namespace gameplay { // Lua bindings for global functions. int lua__strcmpnocase(lua_State* state); -// Global enum to string conversion function (used to pass enums to Lua from C++). -const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value); - void luaRegister_lua_Global(); } diff --git a/gameplay/src/lua/lua_HeightField.cpp b/gameplay/src/lua/lua_HeightField.cpp index d31f7b0cf6..105aa6a936 100644 --- a/gameplay/src/lua/lua_HeightField.cpp +++ b/gameplay/src/lua/lua_HeightField.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_HeightField.h" @@ -346,7 +347,7 @@ int lua_HeightField_static_create(lua_State* state) // Get parameter 2 off the stack. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2); - void* returnPtr = (void*)HeightField::create(param1, param2); + void* returnPtr = ((void*)HeightField::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -392,7 +393,7 @@ int lua_HeightField_static_createFromImage(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)HeightField::createFromImage(param1); + void* returnPtr = ((void*)HeightField::createFromImage(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -424,7 +425,7 @@ int lua_HeightField_static_createFromImage(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)HeightField::createFromImage(param1, param2); + void* returnPtr = ((void*)HeightField::createFromImage(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -460,7 +461,7 @@ int lua_HeightField_static_createFromImage(lua_State* state) // Get parameter 3 off the stack. float param3 = (float)luaL_checknumber(state, 3); - void* returnPtr = (void*)HeightField::createFromImage(param1, param2, param3); + void* returnPtr = ((void*)HeightField::createFromImage(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -514,7 +515,7 @@ int lua_HeightField_static_createFromRAW(lua_State* state) // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 3); - void* returnPtr = (void*)HeightField::createFromRAW(param1, param2, param3); + void* returnPtr = ((void*)HeightField::createFromRAW(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -554,7 +555,7 @@ int lua_HeightField_static_createFromRAW(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)HeightField::createFromRAW(param1, param2, param3, param4); + void* returnPtr = ((void*)HeightField::createFromRAW(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -598,7 +599,7 @@ int lua_HeightField_static_createFromRAW(lua_State* state) // Get parameter 5 off the stack. float param5 = (float)luaL_checknumber(state, 5); - void* returnPtr = (void*)HeightField::createFromRAW(param1, param2, param3, param4, param5); + void* returnPtr = ((void*)HeightField::createFromRAW(param1, param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_HeightField.h b/gameplay/src/lua/lua_HeightField.h index 33eca5e903..ad66509553 100644 --- a/gameplay/src/lua/lua_HeightField.h +++ b/gameplay/src/lua/lua_HeightField.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_HEIGHTFIELD_H_ #define LUA_HEIGHTFIELD_H_ diff --git a/gameplay/src/lua/lua_Image.cpp b/gameplay/src/lua/lua_Image.cpp index 46bfa74d6f..4a5edbb420 100644 --- a/gameplay/src/lua/lua_Image.cpp +++ b/gameplay/src/lua/lua_Image.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Image.h" @@ -6,7 +7,6 @@ #include "Game.h" #include "Image.h" #include "Ref.h" -#include "lua_ImageFormat.h" namespace gameplay { @@ -126,7 +126,7 @@ int lua_Image_getFormat(lua_State* state) Image::Format result = instance->getFormat(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ImageFormat(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -299,7 +299,7 @@ int lua_Image_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Image::create(param1); + void* returnPtr = ((void*)Image::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -327,7 +327,7 @@ int lua_Image_static_create(lua_State* state) { if (lua_type(state, 1) == LUA_TNUMBER && lua_type(state, 2) == LUA_TNUMBER && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1); @@ -336,9 +336,9 @@ int lua_Image_static_create(lua_State* state) unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2); // Get parameter 3 off the stack. - Image::Format param3 = (Image::Format)lua_enumFromString_ImageFormat(luaL_checkstring(state, 3)); + Image::Format param3 = (Image::Format)luaL_checkint(state, 3); - void* returnPtr = (void*)Image::create(param1, param2, param3); + void* returnPtr = ((void*)Image::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -366,7 +366,7 @@ int lua_Image_static_create(lua_State* state) { if (lua_type(state, 1) == LUA_TNUMBER && lua_type(state, 2) == LUA_TNUMBER && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && + lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA)) { // Get parameter 1 off the stack. @@ -376,12 +376,12 @@ int lua_Image_static_create(lua_State* state) unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2); // Get parameter 3 off the stack. - Image::Format param3 = (Image::Format)lua_enumFromString_ImageFormat(luaL_checkstring(state, 3)); + Image::Format param3 = (Image::Format)luaL_checkint(state, 3); // Get parameter 4 off the stack. gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getUnsignedCharPointer(4); - void* returnPtr = (void*)Image::create(param1, param2, param3, param4); + void* returnPtr = ((void*)Image::create(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Image.h b/gameplay/src/lua/lua_Image.h index f53d66fb32..8f592d0a38 100644 --- a/gameplay/src/lua/lua_Image.h +++ b/gameplay/src/lua/lua_Image.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_IMAGE_H_ #define LUA_IMAGE_H_ diff --git a/gameplay/src/lua/lua_ImageControl.cpp b/gameplay/src/lua/lua_ImageControl.cpp index 91655e9d75..df2ec03293 100644 --- a/gameplay/src/lua/lua_ImageControl.cpp +++ b/gameplay/src/lua/lua_ImageControl.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_ImageControl.h" @@ -8,17 +9,12 @@ #include "Form.h" #include "Game.h" #include "ImageControl.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -29,8 +25,10 @@ void luaRegister_ImageControl() { {"addListener", lua_ImageControl_addListener}, {"addRef", lua_ImageControl_addRef}, + {"addScript", lua_ImageControl_addScript}, {"addScriptCallback", lua_ImageControl_addScriptCallback}, {"canFocus", lua_ImageControl_canFocus}, + {"clearScripts", lua_ImageControl_clearScripts}, {"createAnimation", lua_ImageControl_createAnimation}, {"createAnimationFromBy", lua_ImageControl_createAnimationFromBy}, {"createAnimationFromTo", lua_ImageControl_createAnimationFromTo}, @@ -64,6 +62,7 @@ void luaRegister_ImageControl() {"getRefCount", lua_ImageControl_getRefCount}, {"getRegionDst", lua_ImageControl_getRegionDst}, {"getRegionSrc", lua_ImageControl_getRegionSrc}, + {"getScriptEvent", lua_ImageControl_getScriptEvent}, {"getSkinColor", lua_ImageControl_getSkinColor}, {"getSkinRegion", lua_ImageControl_getSkinRegion}, {"getState", lua_ImageControl_getState}, @@ -73,12 +72,13 @@ void luaRegister_ImageControl() {"getTextRightToLeft", lua_ImageControl_getTextRightToLeft}, {"getTheme", lua_ImageControl_getTheme}, {"getTopLevelForm", lua_ImageControl_getTopLevelForm}, - {"getType", lua_ImageControl_getType}, + {"getTypeName", lua_ImageControl_getTypeName}, {"getWidth", lua_ImageControl_getWidth}, {"getX", lua_ImageControl_getX}, {"getY", lua_ImageControl_getY}, {"getZIndex", lua_ImageControl_getZIndex}, {"hasFocus", lua_ImageControl_hasFocus}, + {"hasScriptListener", lua_ImageControl_hasScriptListener}, {"isChild", lua_ImageControl_isChild}, {"isContainer", lua_ImageControl_isContainer}, {"isEnabled", lua_ImageControl_isEnabled}, @@ -91,6 +91,7 @@ void luaRegister_ImageControl() {"isYPercentage", lua_ImageControl_isYPercentage}, {"release", lua_ImageControl_release}, {"removeListener", lua_ImageControl_removeListener}, + {"removeScript", lua_ImageControl_removeScript}, {"removeScriptCallback", lua_ImageControl_removeScriptCallback}, {"setAlignment", lua_ImageControl_setAlignment}, {"setAnimationPropertyValue", lua_ImageControl_setAnimationPropertyValue}, @@ -271,6 +272,54 @@ int lua_ImageControl_addRef(lua_State* state) return 0; } +int lua_ImageControl_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + ImageControl* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_ImageControl_addScript - 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; +} + int lua_ImageControl_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -282,14 +331,20 @@ int lua_ImageControl_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); ImageControl* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -346,6 +401,38 @@ int lua_ImageControl_canFocus(lua_State* state) return 0; } +int lua_ImageControl_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + ImageControl* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_ImageControl_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_ImageControl_createAnimation(lua_State* state) { // Get the number of parameters. @@ -369,7 +456,7 @@ int lua_ImageControl_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -403,7 +490,7 @@ int lua_ImageControl_createAnimation(lua_State* state) break; ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -435,7 +522,7 @@ int lua_ImageControl_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -453,10 +540,10 @@ int lua_ImageControl_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -490,7 +577,7 @@ int lua_ImageControl_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -514,10 +601,10 @@ int lua_ImageControl_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -564,7 +651,7 @@ int lua_ImageControl_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -580,13 +667,13 @@ int lua_ImageControl_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -632,7 +719,7 @@ int lua_ImageControl_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -648,13 +735,13 @@ int lua_ImageControl_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -795,7 +882,7 @@ int lua_ImageControl_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -827,7 +914,7 @@ int lua_ImageControl_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -857,7 +944,7 @@ int lua_ImageControl_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -989,7 +1076,7 @@ int lua_ImageControl_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1045,10 +1132,10 @@ int lua_ImageControl_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1260,10 +1347,10 @@ int lua_ImageControl_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1308,10 +1395,10 @@ int lua_ImageControl_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1356,10 +1443,10 @@ int lua_ImageControl_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1441,7 +1528,7 @@ int lua_ImageControl_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1465,13 +1552,13 @@ int lua_ImageControl_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1530,10 +1617,10 @@ int lua_ImageControl_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1640,13 +1727,13 @@ int lua_ImageControl_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1692,13 +1779,13 @@ int lua_ImageControl_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1744,13 +1831,13 @@ int lua_ImageControl_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1856,10 +1943,10 @@ int lua_ImageControl_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -1941,7 +2028,7 @@ int lua_ImageControl_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2095,6 +2182,54 @@ int lua_ImageControl_getRegionSrc(lua_State* state) return 0; } +int lua_ImageControl_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + ImageControl* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_ImageControl_getScriptEvent - 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; +} + int lua_ImageControl_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2132,10 +2267,10 @@ int lua_ImageControl_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2206,10 +2341,10 @@ int lua_ImageControl_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2259,7 +2394,7 @@ int lua_ImageControl_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2291,7 +2426,7 @@ int lua_ImageControl_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2338,7 +2473,7 @@ int lua_ImageControl_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2350,16 +2485,16 @@ int lua_ImageControl_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2415,10 +2550,10 @@ int lua_ImageControl_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2480,10 +2615,10 @@ int lua_ImageControl_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2521,7 +2656,7 @@ int lua_ImageControl_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2565,7 +2700,7 @@ int lua_ImageControl_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2596,7 +2731,7 @@ int lua_ImageControl_getTopLevelForm(lua_State* state) return 0; } -int lua_ImageControl_getType(lua_State* state) +int lua_ImageControl_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2609,7 +2744,7 @@ int lua_ImageControl_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ImageControl* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2617,7 +2752,7 @@ int lua_ImageControl_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_ImageControl_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_ImageControl_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2806,6 +2941,69 @@ int lua_ImageControl_hasFocus(lua_State* state) return 0; } +int lua_ImageControl_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + ImageControl* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + ImageControl* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_ImageControl_hasScriptListener - 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; +} + int lua_ImageControl_isChild(lua_State* state) { // Get the number of parameters. @@ -3240,6 +3438,45 @@ int lua_ImageControl_removeListener(lua_State* state) return 0; } +int lua_ImageControl_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + ImageControl* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_ImageControl_removeScript - 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; +} + int lua_ImageControl_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3251,14 +3488,20 @@ int lua_ImageControl_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); ImageControl* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3291,10 +3534,10 @@ int lua_ImageControl_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); instance->setAlignment(param1); @@ -3405,10 +3648,10 @@ int lua_ImageControl_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); instance->setAutoSize(param1); @@ -4816,10 +5059,10 @@ int lua_ImageControl_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); ImageControl* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4834,11 +5077,11 @@ int lua_ImageControl_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -5371,7 +5614,7 @@ int lua_ImageControl_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)ImageControl::create(param1); + void* returnPtr = ((void*)ImageControl::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5409,7 +5652,7 @@ int lua_ImageControl_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)ImageControl::create(param1, param2); + void* returnPtr = ((void*)ImageControl::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_ImageControl.h b/gameplay/src/lua/lua_ImageControl.h index e434eaeb49..9723c76a44 100644 --- a/gameplay/src/lua/lua_ImageControl.h +++ b/gameplay/src/lua/lua_ImageControl.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_IMAGECONTROL_H_ #define LUA_IMAGECONTROL_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_ImageControl__gc(lua_State* state); int lua_ImageControl_addListener(lua_State* state); int lua_ImageControl_addRef(lua_State* state); +int lua_ImageControl_addScript(lua_State* state); int lua_ImageControl_addScriptCallback(lua_State* state); int lua_ImageControl_canFocus(lua_State* state); +int lua_ImageControl_clearScripts(lua_State* state); int lua_ImageControl_createAnimation(lua_State* state); int lua_ImageControl_createAnimationFromBy(lua_State* state); int lua_ImageControl_createAnimationFromTo(lua_State* state); @@ -43,6 +46,7 @@ int lua_ImageControl_getParent(lua_State* state); int lua_ImageControl_getRefCount(lua_State* state); int lua_ImageControl_getRegionDst(lua_State* state); int lua_ImageControl_getRegionSrc(lua_State* state); +int lua_ImageControl_getScriptEvent(lua_State* state); int lua_ImageControl_getSkinColor(lua_State* state); int lua_ImageControl_getSkinRegion(lua_State* state); int lua_ImageControl_getState(lua_State* state); @@ -52,12 +56,13 @@ int lua_ImageControl_getTextColor(lua_State* state); int lua_ImageControl_getTextRightToLeft(lua_State* state); int lua_ImageControl_getTheme(lua_State* state); int lua_ImageControl_getTopLevelForm(lua_State* state); -int lua_ImageControl_getType(lua_State* state); +int lua_ImageControl_getTypeName(lua_State* state); int lua_ImageControl_getWidth(lua_State* state); int lua_ImageControl_getX(lua_State* state); int lua_ImageControl_getY(lua_State* state); int lua_ImageControl_getZIndex(lua_State* state); int lua_ImageControl_hasFocus(lua_State* state); +int lua_ImageControl_hasScriptListener(lua_State* state); int lua_ImageControl_isChild(lua_State* state); int lua_ImageControl_isContainer(lua_State* state); int lua_ImageControl_isEnabled(lua_State* state); @@ -70,6 +75,7 @@ int lua_ImageControl_isXPercentage(lua_State* state); int lua_ImageControl_isYPercentage(lua_State* state); int lua_ImageControl_release(lua_State* state); int lua_ImageControl_removeListener(lua_State* state); +int lua_ImageControl_removeScript(lua_State* state); int lua_ImageControl_removeScriptCallback(lua_State* state); int lua_ImageControl_setAlignment(lua_State* state); int lua_ImageControl_setAnimationPropertyValue(lua_State* state); diff --git a/gameplay/src/lua/lua_ImageFormat.cpp b/gameplay/src/lua/lua_ImageFormat.cpp deleted file mode 100644 index 71f831e9c2..0000000000 --- a/gameplay/src/lua/lua_ImageFormat.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_ImageFormat.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ImageFormat_RGB = "RGB"; -static const char* luaEnumString_ImageFormat_RGBA = "RGBA"; - -Image::Format lua_enumFromString_ImageFormat(const char* s) -{ - if (strcmp(s, luaEnumString_ImageFormat_RGB) == 0) - return Image::RGB; - if (strcmp(s, luaEnumString_ImageFormat_RGBA) == 0) - return Image::RGBA; - return Image::RGB; -} - -const char* lua_stringFromEnum_ImageFormat(Image::Format e) -{ - if (e == Image::RGB) - return luaEnumString_ImageFormat_RGB; - if (e == Image::RGBA) - return luaEnumString_ImageFormat_RGBA; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ImageFormat.h b/gameplay/src/lua/lua_ImageFormat.h deleted file mode 100644 index 4c9fdd0c65..0000000000 --- a/gameplay/src/lua/lua_ImageFormat.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_IMAGEFORMAT_H_ -#define LUA_IMAGEFORMAT_H_ - -#include "Image.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Image::Format. -Image::Format lua_enumFromString_ImageFormat(const char* s); -const char* lua_stringFromEnum_ImageFormat(Image::Format e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Joint.cpp b/gameplay/src/lua/lua_Joint.cpp index 252f43b214..c9ba934f4d 100644 --- a/gameplay/src/lua/lua_Joint.cpp +++ b/gameplay/src/lua/lua_Joint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Joint.h" @@ -5,9 +6,13 @@ #include "AnimationTarget.h" #include "AudioSource.h" #include "Base.h" +#include "Drawable.h" +#include "Form.h" #include "Game.h" #include "Joint.h" +#include "MaterialParameter.h" #include "MeshSkin.h" +#include "Model.h" #include "Node.h" #include "PhysicsCharacter.h" #include "PhysicsGhostObject.h" @@ -20,9 +25,6 @@ #include "ScriptTarget.h" #include "Terrain.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_NodeType.h" -#include "lua_PhysicsCollisionObjectType.h" namespace gameplay { @@ -34,7 +36,9 @@ void luaRegister_Joint() {"addChild", lua_Joint_addChild}, {"addListener", lua_Joint_addListener}, {"addRef", lua_Joint_addRef}, + {"addScript", lua_Joint_addScript}, {"addScriptCallback", lua_Joint_addScriptCallback}, + {"clearScripts", lua_Joint_clearScripts}, {"clone", lua_Joint_clone}, {"createAnimation", lua_Joint_createAnimation}, {"createAnimationFromBy", lua_Joint_createAnimationFromBy}, @@ -54,8 +58,8 @@ void luaRegister_Joint() {"getChildCount", lua_Joint_getChildCount}, {"getCollisionObject", lua_Joint_getCollisionObject}, {"getDownVector", lua_Joint_getDownVector}, + {"getDrawable", lua_Joint_getDrawable}, {"getFirstChild", lua_Joint_getFirstChild}, - {"getForm", lua_Joint_getForm}, {"getForwardVector", lua_Joint_getForwardVector}, {"getForwardVectorView", lua_Joint_getForwardVectorView}, {"getForwardVectorWorld", lua_Joint_getForwardVectorWorld}, @@ -68,10 +72,8 @@ void luaRegister_Joint() {"getLeftVector", lua_Joint_getLeftVector}, {"getLight", lua_Joint_getLight}, {"getMatrix", lua_Joint_getMatrix}, - {"getModel", lua_Joint_getModel}, {"getNextSibling", lua_Joint_getNextSibling}, {"getParent", lua_Joint_getParent}, - {"getParticleEmitter", lua_Joint_getParticleEmitter}, {"getPreviousSibling", lua_Joint_getPreviousSibling}, {"getProjectionMatrix", lua_Joint_getProjectionMatrix}, {"getRefCount", lua_Joint_getRefCount}, @@ -84,8 +86,8 @@ void luaRegister_Joint() {"getScaleY", lua_Joint_getScaleY}, {"getScaleZ", lua_Joint_getScaleZ}, {"getScene", lua_Joint_getScene}, + {"getScriptEvent", lua_Joint_getScriptEvent}, {"getTag", lua_Joint_getTag}, - {"getTerrain", lua_Joint_getTerrain}, {"getTranslation", lua_Joint_getTranslation}, {"getTranslationView", lua_Joint_getTranslationView}, {"getTranslationWorld", lua_Joint_getTranslationWorld}, @@ -93,21 +95,25 @@ void luaRegister_Joint() {"getTranslationY", lua_Joint_getTranslationY}, {"getTranslationZ", lua_Joint_getTranslationZ}, {"getType", lua_Joint_getType}, + {"getTypeName", lua_Joint_getTypeName}, {"getUpVector", lua_Joint_getUpVector}, {"getUpVectorWorld", lua_Joint_getUpVectorWorld}, + {"getUserObject", lua_Joint_getUserObject}, {"getViewMatrix", lua_Joint_getViewMatrix}, {"getViewProjectionMatrix", lua_Joint_getViewProjectionMatrix}, {"getWorldMatrix", lua_Joint_getWorldMatrix}, {"getWorldViewMatrix", lua_Joint_getWorldViewMatrix}, {"getWorldViewProjectionMatrix", lua_Joint_getWorldViewProjectionMatrix}, + {"hasScriptListener", lua_Joint_hasScriptListener}, {"hasTag", lua_Joint_hasTag}, - {"isActive", lua_Joint_isActive}, - {"isActiveInHierarchy", lua_Joint_isActiveInHierarchy}, + {"isEnabled", lua_Joint_isEnabled}, + {"isEnabledInHierarchy", lua_Joint_isEnabledInHierarchy}, {"isStatic", lua_Joint_isStatic}, {"release", lua_Joint_release}, {"removeAllChildren", lua_Joint_removeAllChildren}, {"removeChild", lua_Joint_removeChild}, {"removeListener", lua_Joint_removeListener}, + {"removeScript", lua_Joint_removeScript}, {"removeScriptCallback", lua_Joint_removeScriptCallback}, {"rotate", lua_Joint_rotate}, {"rotateX", lua_Joint_rotateX}, @@ -118,29 +124,27 @@ void luaRegister_Joint() {"scaleY", lua_Joint_scaleY}, {"scaleZ", lua_Joint_scaleZ}, {"set", lua_Joint_set}, - {"setActive", lua_Joint_setActive}, {"setAgent", lua_Joint_setAgent}, {"setAnimationPropertyValue", lua_Joint_setAnimationPropertyValue}, {"setAudioSource", lua_Joint_setAudioSource}, {"setCamera", lua_Joint_setCamera}, {"setCollisionObject", lua_Joint_setCollisionObject}, - {"setForm", lua_Joint_setForm}, + {"setDrawable", lua_Joint_setDrawable}, + {"setEnabled", lua_Joint_setEnabled}, {"setId", lua_Joint_setId}, {"setIdentity", lua_Joint_setIdentity}, {"setLight", lua_Joint_setLight}, - {"setModel", lua_Joint_setModel}, - {"setParticleEmitter", lua_Joint_setParticleEmitter}, {"setRotation", lua_Joint_setRotation}, {"setScale", lua_Joint_setScale}, {"setScaleX", lua_Joint_setScaleX}, {"setScaleY", lua_Joint_setScaleY}, {"setScaleZ", lua_Joint_setScaleZ}, {"setTag", lua_Joint_setTag}, - {"setTerrain", lua_Joint_setTerrain}, {"setTranslation", lua_Joint_setTranslation}, {"setTranslationX", lua_Joint_setTranslationX}, {"setTranslationY", lua_Joint_setTranslationY}, {"setTranslationZ", lua_Joint_setTranslationZ}, + {"setUserObject", lua_Joint_setUserObject}, {"transformPoint", lua_Joint_transformPoint}, {"transformVector", lua_Joint_transformVector}, {"translate", lua_Joint_translate}, @@ -369,6 +373,54 @@ int lua_Joint_addRef(lua_State* state) return 0; } +int lua_Joint_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Joint* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Joint_addScript - 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; +} + int lua_Joint_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -380,14 +432,20 @@ int lua_Joint_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Joint* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -409,6 +467,38 @@ int lua_Joint_addScriptCallback(lua_State* state) return 0; } +int lua_Joint_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Joint* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Joint_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Joint_clone(lua_State* state) { // Get the number of parameters. @@ -422,7 +512,7 @@ int lua_Joint_clone(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->clone(); + void* returnPtr = ((void*)instance->clone()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -476,7 +566,7 @@ int lua_Joint_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -510,7 +600,7 @@ int lua_Joint_createAnimation(lua_State* state) break; Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -542,7 +632,7 @@ int lua_Joint_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -560,10 +650,10 @@ int lua_Joint_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -597,7 +687,7 @@ int lua_Joint_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -621,10 +711,10 @@ int lua_Joint_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -671,7 +761,7 @@ int lua_Joint_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -687,13 +777,13 @@ int lua_Joint_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -739,7 +829,7 @@ int lua_Joint_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -755,13 +845,13 @@ int lua_Joint_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -859,7 +949,7 @@ int lua_Joint_findNode(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1); + void* returnPtr = ((void*)instance->findNode(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -893,7 +983,7 @@ int lua_Joint_findNode(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1, param2); + void* returnPtr = ((void*)instance->findNode(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -931,7 +1021,7 @@ int lua_Joint_findNode(lua_State* state) bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1, param2, param3); + void* returnPtr = ((void*)instance->findNode(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1063,7 +1153,7 @@ int lua_Joint_getAgent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getAgent(); + void* returnPtr = ((void*)instance->getAgent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1107,7 +1197,7 @@ int lua_Joint_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1137,7 +1227,7 @@ int lua_Joint_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1266,7 +1356,7 @@ int lua_Joint_getAudioSource(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getAudioSource(); + void* returnPtr = ((void*)instance->getAudioSource()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1425,7 +1515,7 @@ int lua_Joint_getCamera(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getCamera(); + void* returnPtr = ((void*)instance->getCamera()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1504,7 +1594,7 @@ int lua_Joint_getCollisionObject(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionObject(); + void* returnPtr = ((void*)instance->getCollisionObject()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1606,7 +1696,7 @@ int lua_Joint_getDownVector(lua_State* state) return 0; } -int lua_Joint_getFirstChild(lua_State* state) +int lua_Joint_getDrawable(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -1619,13 +1709,13 @@ int lua_Joint_getFirstChild(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getFirstChild(); + void* returnPtr = ((void*)instance->getDrawable()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); object->instance = returnPtr; object->owns = false; - luaL_getmetatable(state, "Node"); + luaL_getmetatable(state, "Drawable"); lua_setmetatable(state, -2); } else @@ -1636,7 +1726,7 @@ int lua_Joint_getFirstChild(lua_State* state) return 1; } - lua_pushstring(state, "lua_Joint_getFirstChild - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_getDrawable - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -1650,7 +1740,7 @@ int lua_Joint_getFirstChild(lua_State* state) return 0; } -int lua_Joint_getForm(lua_State* state) +int lua_Joint_getFirstChild(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -1663,13 +1753,13 @@ int lua_Joint_getForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getForm(); + void* returnPtr = ((void*)instance->getFirstChild()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); object->instance = returnPtr; object->owns = false; - luaL_getmetatable(state, "Form"); + luaL_getmetatable(state, "Node"); lua_setmetatable(state, -2); } else @@ -1680,7 +1770,7 @@ int lua_Joint_getForm(lua_State* state) return 1; } - lua_pushstring(state, "lua_Joint_getForm - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_getFirstChild - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2192,7 +2282,7 @@ int lua_Joint_getLight(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getLight(); + void* returnPtr = ((void*)instance->getLight()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2267,50 +2357,6 @@ int lua_Joint_getMatrix(lua_State* state) return 0; } -int lua_Joint_getModel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getModel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "Model"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Joint_getModel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_Joint_getNextSibling(lua_State* state) { // Get the number of parameters. @@ -2324,7 +2370,7 @@ int lua_Joint_getNextSibling(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getNextSibling(); + void* returnPtr = ((void*)instance->getNextSibling()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2368,7 +2414,7 @@ int lua_Joint_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2399,50 +2445,6 @@ int lua_Joint_getParent(lua_State* state) return 0; } -int lua_Joint_getParticleEmitter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getParticleEmitter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "ParticleEmitter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Joint_getParticleEmitter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_Joint_getPreviousSibling(lua_State* state) { // Get the number of parameters. @@ -2456,7 +2458,7 @@ int lua_Joint_getPreviousSibling(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getPreviousSibling(); + void* returnPtr = ((void*)instance->getPreviousSibling()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2694,7 +2696,7 @@ int lua_Joint_getRootNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getRootNode(); + void* returnPtr = ((void*)instance->getRootNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3024,7 +3026,7 @@ int lua_Joint_getScene(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getScene(); + void* returnPtr = ((void*)instance->getScene()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3055,7 +3057,7 @@ int lua_Joint_getScene(lua_State* state) return 0; } -int lua_Joint_getTag(lua_State* state) +int lua_Joint_getScriptEvent(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3072,15 +3074,24 @@ int lua_Joint_getTag(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Joint* instance = getInstance(state); - const char* result = instance->getTag(param1); - - // Push the return value onto the stack. - lua_pushstring(state, result); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } return 1; } - lua_pushstring(state, "lua_Joint_getTag - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_getScriptEvent - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3094,7 +3105,7 @@ int lua_Joint_getTag(lua_State* state) return 0; } -int lua_Joint_getTerrain(lua_State* state) +int lua_Joint_getTag(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3102,35 +3113,30 @@ int lua_Joint_getTerrain(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 1: + case 2: { - if ((lua_type(state, 1) == LUA_TUSERDATA)) + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->getTerrain(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "Terrain"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } + const char* result = instance->getTag(param1); + + // Push the return value onto the stack. + lua_pushstring(state, result); return 1; } - lua_pushstring(state, "lua_Joint_getTerrain - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_getTag - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 2)."); lua_error(state); break; } @@ -3418,7 +3424,7 @@ int lua_Joint_getType(lua_State* state) Node::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_NodeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -3437,6 +3443,41 @@ int lua_Joint_getType(lua_State* state) return 0; } +int lua_Joint_getTypeName(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Joint* instance = getInstance(state); + const char* result = instance->getTypeName(); + + // Push the return value onto the stack. + lua_pushstring(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Joint_getTypeName - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Joint_getUpVector(lua_State* state) { // Get the number of parameters. @@ -3552,7 +3593,7 @@ int lua_Joint_getUpVectorWorld(lua_State* state) return 0; } -int lua_Joint_getViewMatrix(lua_State* state) +int lua_Joint_getUserObject(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3565,13 +3606,13 @@ int lua_Joint_getViewMatrix(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)&(instance->getViewMatrix()); + void* returnPtr = ((void*)instance->getUserObject()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); object->instance = returnPtr; object->owns = false; - luaL_getmetatable(state, "Matrix"); + luaL_getmetatable(state, "Ref"); lua_setmetatable(state, -2); } else @@ -3582,7 +3623,7 @@ int lua_Joint_getViewMatrix(lua_State* state) return 1; } - lua_pushstring(state, "lua_Joint_getViewMatrix - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_getUserObject - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3596,7 +3637,7 @@ int lua_Joint_getViewMatrix(lua_State* state) return 0; } -int lua_Joint_getViewProjectionMatrix(lua_State* state) +int lua_Joint_getViewMatrix(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3609,7 +3650,7 @@ int lua_Joint_getViewProjectionMatrix(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)&(instance->getViewProjectionMatrix()); + void* returnPtr = (void*)&(instance->getViewMatrix()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3626,7 +3667,7 @@ int lua_Joint_getViewProjectionMatrix(lua_State* state) return 1; } - lua_pushstring(state, "lua_Joint_getViewProjectionMatrix - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_getViewMatrix - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3640,7 +3681,7 @@ int lua_Joint_getViewProjectionMatrix(lua_State* state) return 0; } -int lua_Joint_getWorldMatrix(lua_State* state) +int lua_Joint_getViewProjectionMatrix(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3653,7 +3694,51 @@ int lua_Joint_getWorldMatrix(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - void* returnPtr = (void*)&(instance->getWorldMatrix()); + void* returnPtr = (void*)&(instance->getViewProjectionMatrix()); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Matrix"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Joint_getViewProjectionMatrix - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Joint_getWorldMatrix(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Joint* instance = getInstance(state); + void* returnPtr = (void*)&(instance->getWorldMatrix()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3772,6 +3857,69 @@ int lua_Joint_getWorldViewProjectionMatrix(lua_State* state) return 0; } +int lua_Joint_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Joint* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Joint* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Joint_hasScriptListener - 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; +} + int lua_Joint_hasTag(lua_State* state) { // Get the number of parameters. @@ -3811,7 +3959,7 @@ int lua_Joint_hasTag(lua_State* state) return 0; } -int lua_Joint_isActive(lua_State* state) +int lua_Joint_isEnabled(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3824,7 +3972,7 @@ int lua_Joint_isActive(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - bool result = instance->isActive(); + bool result = instance->isEnabled(); // Push the return value onto the stack. lua_pushboolean(state, result); @@ -3832,7 +3980,7 @@ int lua_Joint_isActive(lua_State* state) return 1; } - lua_pushstring(state, "lua_Joint_isActive - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_isEnabled - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3846,7 +3994,7 @@ int lua_Joint_isActive(lua_State* state) return 0; } -int lua_Joint_isActiveInHierarchy(lua_State* state) +int lua_Joint_isEnabledInHierarchy(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3859,7 +4007,7 @@ int lua_Joint_isActiveInHierarchy(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Joint* instance = getInstance(state); - bool result = instance->isActiveInHierarchy(); + bool result = instance->isEnabledInHierarchy(); // Push the return value onto the stack. lua_pushboolean(state, result); @@ -3867,7 +4015,7 @@ int lua_Joint_isActiveInHierarchy(lua_State* state) return 1; } - lua_pushstring(state, "lua_Joint_isActiveInHierarchy - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_isEnabledInHierarchy - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -4064,6 +4212,45 @@ int lua_Joint_removeListener(lua_State* state) return 0; } +int lua_Joint_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Joint* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Joint_removeScript - 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; +} + int lua_Joint_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -4075,14 +4262,20 @@ int lua_Joint_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Joint* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -4681,42 +4874,6 @@ int lua_Joint_set(lua_State* state) return 0; } -int lua_Joint_setActive(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_TUSERDATA) && - lua_type(state, 2) == LUA_TBOOLEAN) - { - // Get parameter 1 off the stack. - bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); - - Joint* instance = getInstance(state); - instance->setActive(param1); - - return 0; - } - - lua_pushstring(state, "lua_Joint_setActive - 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; -} - int lua_Joint_setAgent(lua_State* state) { // Get the number of parameters. @@ -4934,13 +5091,13 @@ int lua_Joint_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1); + void* returnPtr = ((void*)instance->setCollisionObject(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -4967,37 +5124,7 @@ int lua_Joint_setCollisionObject(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCollisionObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - } while (0); - - do - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Properties", false, ¶m1Valid); - if (!param1Valid) - break; - - Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1); + void* returnPtr = ((void*)instance->setCollisionObject(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5024,11 +5151,11 @@ int lua_Joint_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5037,7 +5164,7 @@ int lua_Joint_setCollisionObject(lua_State* state) break; Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5064,12 +5191,12 @@ int lua_Joint_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5084,7 +5211,7 @@ int lua_Joint_setCollisionObject(lua_State* state) break; Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5111,13 +5238,13 @@ int lua_Joint_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5135,7 +5262,7 @@ int lua_Joint_setCollisionObject(lua_State* state) int param4 = (int)luaL_checkint(state, 5); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3, param4); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5162,14 +5289,14 @@ int lua_Joint_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER && lua_type(state, 6) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5190,7 +5317,7 @@ int lua_Joint_setCollisionObject(lua_State* state) int param5 = (int)luaL_checkint(state, 6); Joint* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3, param4, param5); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5222,7 +5349,7 @@ int lua_Joint_setCollisionObject(lua_State* state) return 0; } -int lua_Joint_setForm(lua_State* state) +int lua_Joint_setDrawable(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5237,20 +5364,20 @@ int lua_Joint_setForm(lua_State* state) { // Get parameter 1 off the stack. bool param1Valid; - gameplay::ScriptUtil::LuaArray
param1 = gameplay::ScriptUtil::getObjectPointer(2, "Form", false, ¶m1Valid); + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Drawable", false, ¶m1Valid); if (!param1Valid) { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Form'."); + lua_pushstring(state, "Failed to convert parameter 1 to type 'Drawable'."); lua_error(state); } Joint* instance = getInstance(state); - instance->setForm(param1); + instance->setDrawable(param1); return 0; } - lua_pushstring(state, "lua_Joint_setForm - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_setDrawable - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5264,7 +5391,7 @@ int lua_Joint_setForm(lua_State* state) return 0; } -int lua_Joint_setId(lua_State* state) +int lua_Joint_setEnabled(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5275,18 +5402,18 @@ int lua_Joint_setId(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); + bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); Joint* instance = getInstance(state); - instance->setId(param1); + instance->setEnabled(param1); return 0; } - lua_pushstring(state, "lua_Joint_setId - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_setEnabled - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5300,39 +5427,7 @@ int lua_Joint_setId(lua_State* state) return 0; } -int lua_Joint_setIdentity(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Joint* instance = getInstance(state); - instance->setIdentity(); - - return 0; - } - - lua_pushstring(state, "lua_Joint_setIdentity - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_Joint_setLight(lua_State* state) +int lua_Joint_setId(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5343,24 +5438,18 @@ int lua_Joint_setLight(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Light", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Light'."); - lua_error(state); - } + const char* param1 = gameplay::ScriptUtil::getString(2, false); Joint* instance = getInstance(state); - instance->setLight(param1); + instance->setId(param1); return 0; } - lua_pushstring(state, "lua_Joint_setLight - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_setId - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5374,7 +5463,7 @@ int lua_Joint_setLight(lua_State* state) return 0; } -int lua_Joint_setModel(lua_State* state) +int lua_Joint_setIdentity(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5382,33 +5471,23 @@ int lua_Joint_setModel(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 2: + case 1: { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + if ((lua_type(state, 1) == LUA_TUSERDATA)) { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Model", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Model'."); - lua_error(state); - } - Joint* instance = getInstance(state); - instance->setModel(param1); + instance->setIdentity(); return 0; } - lua_pushstring(state, "lua_Joint_setModel - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_setIdentity - 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_pushstring(state, "Invalid number of parameters (expected 1)."); lua_error(state); break; } @@ -5416,7 +5495,7 @@ int lua_Joint_setModel(lua_State* state) return 0; } -int lua_Joint_setParticleEmitter(lua_State* state) +int lua_Joint_setLight(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5431,20 +5510,20 @@ int lua_Joint_setParticleEmitter(lua_State* state) { // Get parameter 1 off the stack. bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ParticleEmitter", false, ¶m1Valid); + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Light", false, ¶m1Valid); if (!param1Valid) { - lua_pushstring(state, "Failed to convert parameter 1 to type 'ParticleEmitter'."); + lua_pushstring(state, "Failed to convert parameter 1 to type 'Light'."); lua_error(state); } Joint* instance = getInstance(state); - instance->setParticleEmitter(param1); + instance->setLight(param1); return 0; } - lua_pushstring(state, "lua_Joint_setParticleEmitter - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Joint_setLight - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5831,48 +5910,6 @@ int lua_Joint_setTag(lua_State* state) return 0; } -int lua_Joint_setTerrain(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_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Terrain", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Terrain'."); - lua_error(state); - } - - Joint* instance = getInstance(state); - instance->setTerrain(param1); - - return 0; - } - - lua_pushstring(state, "lua_Joint_setTerrain - 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; -} - int lua_Joint_setTranslation(lua_State* state) { // Get the number of parameters. @@ -6052,6 +6089,48 @@ int lua_Joint_setTranslationZ(lua_State* state) return 0; } +int lua_Joint_setUserObject(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Ref", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'Ref'."); + lua_error(state); + } + + Joint* instance = getInstance(state); + instance->setUserObject(param1); + + return 0; + } + + lua_pushstring(state, "lua_Joint_setUserObject - 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; +} + int lua_Joint_static_ANIMATE_ROTATE(lua_State* state) { // Validate the number of parameters. diff --git a/gameplay/src/lua/lua_Joint.h b/gameplay/src/lua/lua_Joint.h index f4deff9c04..dd63102d1c 100644 --- a/gameplay/src/lua/lua_Joint.h +++ b/gameplay/src/lua/lua_Joint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_JOINT_H_ #define LUA_JOINT_H_ @@ -9,7 +10,9 @@ int lua_Joint__gc(lua_State* state); int lua_Joint_addChild(lua_State* state); int lua_Joint_addListener(lua_State* state); int lua_Joint_addRef(lua_State* state); +int lua_Joint_addScript(lua_State* state); int lua_Joint_addScriptCallback(lua_State* state); +int lua_Joint_clearScripts(lua_State* state); int lua_Joint_clone(lua_State* state); int lua_Joint_createAnimation(lua_State* state); int lua_Joint_createAnimationFromBy(lua_State* state); @@ -29,8 +32,8 @@ int lua_Joint_getCamera(lua_State* state); int lua_Joint_getChildCount(lua_State* state); int lua_Joint_getCollisionObject(lua_State* state); int lua_Joint_getDownVector(lua_State* state); +int lua_Joint_getDrawable(lua_State* state); int lua_Joint_getFirstChild(lua_State* state); -int lua_Joint_getForm(lua_State* state); int lua_Joint_getForwardVector(lua_State* state); int lua_Joint_getForwardVectorView(lua_State* state); int lua_Joint_getForwardVectorWorld(lua_State* state); @@ -43,10 +46,8 @@ int lua_Joint_getInverseViewProjectionMatrix(lua_State* state); int lua_Joint_getLeftVector(lua_State* state); int lua_Joint_getLight(lua_State* state); int lua_Joint_getMatrix(lua_State* state); -int lua_Joint_getModel(lua_State* state); int lua_Joint_getNextSibling(lua_State* state); int lua_Joint_getParent(lua_State* state); -int lua_Joint_getParticleEmitter(lua_State* state); int lua_Joint_getPreviousSibling(lua_State* state); int lua_Joint_getProjectionMatrix(lua_State* state); int lua_Joint_getRefCount(lua_State* state); @@ -59,8 +60,8 @@ int lua_Joint_getScaleX(lua_State* state); int lua_Joint_getScaleY(lua_State* state); int lua_Joint_getScaleZ(lua_State* state); int lua_Joint_getScene(lua_State* state); +int lua_Joint_getScriptEvent(lua_State* state); int lua_Joint_getTag(lua_State* state); -int lua_Joint_getTerrain(lua_State* state); int lua_Joint_getTranslation(lua_State* state); int lua_Joint_getTranslationView(lua_State* state); int lua_Joint_getTranslationWorld(lua_State* state); @@ -68,21 +69,25 @@ int lua_Joint_getTranslationX(lua_State* state); int lua_Joint_getTranslationY(lua_State* state); int lua_Joint_getTranslationZ(lua_State* state); int lua_Joint_getType(lua_State* state); +int lua_Joint_getTypeName(lua_State* state); int lua_Joint_getUpVector(lua_State* state); int lua_Joint_getUpVectorWorld(lua_State* state); +int lua_Joint_getUserObject(lua_State* state); int lua_Joint_getViewMatrix(lua_State* state); int lua_Joint_getViewProjectionMatrix(lua_State* state); int lua_Joint_getWorldMatrix(lua_State* state); int lua_Joint_getWorldViewMatrix(lua_State* state); int lua_Joint_getWorldViewProjectionMatrix(lua_State* state); +int lua_Joint_hasScriptListener(lua_State* state); int lua_Joint_hasTag(lua_State* state); -int lua_Joint_isActive(lua_State* state); -int lua_Joint_isActiveInHierarchy(lua_State* state); +int lua_Joint_isEnabled(lua_State* state); +int lua_Joint_isEnabledInHierarchy(lua_State* state); int lua_Joint_isStatic(lua_State* state); int lua_Joint_release(lua_State* state); int lua_Joint_removeAllChildren(lua_State* state); int lua_Joint_removeChild(lua_State* state); int lua_Joint_removeListener(lua_State* state); +int lua_Joint_removeScript(lua_State* state); int lua_Joint_removeScriptCallback(lua_State* state); int lua_Joint_rotate(lua_State* state); int lua_Joint_rotateX(lua_State* state); @@ -93,29 +98,27 @@ int lua_Joint_scaleX(lua_State* state); int lua_Joint_scaleY(lua_State* state); int lua_Joint_scaleZ(lua_State* state); int lua_Joint_set(lua_State* state); -int lua_Joint_setActive(lua_State* state); int lua_Joint_setAgent(lua_State* state); int lua_Joint_setAnimationPropertyValue(lua_State* state); int lua_Joint_setAudioSource(lua_State* state); int lua_Joint_setCamera(lua_State* state); int lua_Joint_setCollisionObject(lua_State* state); -int lua_Joint_setForm(lua_State* state); +int lua_Joint_setDrawable(lua_State* state); +int lua_Joint_setEnabled(lua_State* state); int lua_Joint_setId(lua_State* state); int lua_Joint_setIdentity(lua_State* state); int lua_Joint_setLight(lua_State* state); -int lua_Joint_setModel(lua_State* state); -int lua_Joint_setParticleEmitter(lua_State* state); int lua_Joint_setRotation(lua_State* state); int lua_Joint_setScale(lua_State* state); int lua_Joint_setScaleX(lua_State* state); int lua_Joint_setScaleY(lua_State* state); int lua_Joint_setScaleZ(lua_State* state); int lua_Joint_setTag(lua_State* state); -int lua_Joint_setTerrain(lua_State* state); int lua_Joint_setTranslation(lua_State* state); int lua_Joint_setTranslationX(lua_State* state); int lua_Joint_setTranslationY(lua_State* state); int lua_Joint_setTranslationZ(lua_State* state); +int lua_Joint_setUserObject(lua_State* state); int lua_Joint_static_ANIMATE_ROTATE(lua_State* state); int lua_Joint_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state); int lua_Joint_static_ANIMATE_SCALE(lua_State* state); diff --git a/gameplay/src/lua/lua_JoystickControl.cpp b/gameplay/src/lua/lua_JoystickControl.cpp index 34ae66547e..a6b06daaeb 100644 --- a/gameplay/src/lua/lua_JoystickControl.cpp +++ b/gameplay/src/lua/lua_JoystickControl.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_JoystickControl.h" @@ -8,17 +9,12 @@ #include "Form.h" #include "Game.h" #include "JoystickControl.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -29,8 +25,10 @@ void luaRegister_JoystickControl() { {"addListener", lua_JoystickControl_addListener}, {"addRef", lua_JoystickControl_addRef}, + {"addScript", lua_JoystickControl_addScript}, {"addScriptCallback", lua_JoystickControl_addScriptCallback}, {"canFocus", lua_JoystickControl_canFocus}, + {"clearScripts", lua_JoystickControl_clearScripts}, {"createAnimation", lua_JoystickControl_createAnimation}, {"createAnimationFromBy", lua_JoystickControl_createAnimationFromBy}, {"createAnimationFromTo", lua_JoystickControl_createAnimationFromTo}, @@ -64,7 +62,9 @@ void luaRegister_JoystickControl() {"getOuterRegionSize", lua_JoystickControl_getOuterRegionSize}, {"getPadding", lua_JoystickControl_getPadding}, {"getParent", lua_JoystickControl_getParent}, + {"getRadius", lua_JoystickControl_getRadius}, {"getRefCount", lua_JoystickControl_getRefCount}, + {"getScriptEvent", lua_JoystickControl_getScriptEvent}, {"getSkinColor", lua_JoystickControl_getSkinColor}, {"getSkinRegion", lua_JoystickControl_getSkinRegion}, {"getState", lua_JoystickControl_getState}, @@ -74,18 +74,20 @@ void luaRegister_JoystickControl() {"getTextRightToLeft", lua_JoystickControl_getTextRightToLeft}, {"getTheme", lua_JoystickControl_getTheme}, {"getTopLevelForm", lua_JoystickControl_getTopLevelForm}, - {"getType", lua_JoystickControl_getType}, + {"getTypeName", lua_JoystickControl_getTypeName}, {"getValue", lua_JoystickControl_getValue}, {"getWidth", lua_JoystickControl_getWidth}, {"getX", lua_JoystickControl_getX}, {"getY", lua_JoystickControl_getY}, {"getZIndex", lua_JoystickControl_getZIndex}, {"hasFocus", lua_JoystickControl_hasFocus}, + {"hasScriptListener", lua_JoystickControl_hasScriptListener}, {"isChild", lua_JoystickControl_isChild}, {"isContainer", lua_JoystickControl_isContainer}, {"isEnabled", lua_JoystickControl_isEnabled}, {"isEnabledInHierarchy", lua_JoystickControl_isEnabledInHierarchy}, {"isHeightPercentage", lua_JoystickControl_isHeightPercentage}, + {"isRadiusPercentage", lua_JoystickControl_isRadiusPercentage}, {"isRelative", lua_JoystickControl_isRelative}, {"isVisible", lua_JoystickControl_isVisible}, {"isVisibleInHierarchy", lua_JoystickControl_isVisibleInHierarchy}, @@ -94,6 +96,7 @@ void luaRegister_JoystickControl() {"isYPercentage", lua_JoystickControl_isYPercentage}, {"release", lua_JoystickControl_release}, {"removeListener", lua_JoystickControl_removeListener}, + {"removeScript", lua_JoystickControl_removeScript}, {"removeScriptCallback", lua_JoystickControl_removeScriptCallback}, {"setAlignment", lua_JoystickControl_setAlignment}, {"setAnimationPropertyValue", lua_JoystickControl_setAnimationPropertyValue}, @@ -119,6 +122,7 @@ void luaRegister_JoystickControl() {"setOuterRegionSize", lua_JoystickControl_setOuterRegionSize}, {"setPadding", lua_JoystickControl_setPadding}, {"setPosition", lua_JoystickControl_setPosition}, + {"setRadius", lua_JoystickControl_setRadius}, {"setRelative", lua_JoystickControl_setRelative}, {"setSize", lua_JoystickControl_setSize}, {"setSkinColor", lua_JoystickControl_setSkinColor}, @@ -274,6 +278,54 @@ int lua_JoystickControl_addRef(lua_State* state) return 0; } +int lua_JoystickControl_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + JoystickControl* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_addScript - 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; +} + int lua_JoystickControl_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -285,14 +337,20 @@ int lua_JoystickControl_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); JoystickControl* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -349,6 +407,38 @@ int lua_JoystickControl_canFocus(lua_State* state) return 0; } +int lua_JoystickControl_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + JoystickControl* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_JoystickControl_createAnimation(lua_State* state) { // Get the number of parameters. @@ -372,7 +462,7 @@ int lua_JoystickControl_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -406,7 +496,7 @@ int lua_JoystickControl_createAnimation(lua_State* state) break; JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -438,7 +528,7 @@ int lua_JoystickControl_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -456,10 +546,10 @@ int lua_JoystickControl_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -493,7 +583,7 @@ int lua_JoystickControl_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -517,10 +607,10 @@ int lua_JoystickControl_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -567,7 +657,7 @@ int lua_JoystickControl_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -583,13 +673,13 @@ int lua_JoystickControl_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -635,7 +725,7 @@ int lua_JoystickControl_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -651,13 +741,13 @@ int lua_JoystickControl_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -798,7 +888,7 @@ int lua_JoystickControl_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -830,7 +920,7 @@ int lua_JoystickControl_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -860,7 +950,7 @@ int lua_JoystickControl_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -992,7 +1082,7 @@ int lua_JoystickControl_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1048,10 +1138,10 @@ int lua_JoystickControl_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1263,10 +1353,10 @@ int lua_JoystickControl_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1311,10 +1401,10 @@ int lua_JoystickControl_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1359,10 +1449,10 @@ int lua_JoystickControl_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1444,7 +1534,7 @@ int lua_JoystickControl_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1468,13 +1558,13 @@ int lua_JoystickControl_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1533,10 +1623,10 @@ int lua_JoystickControl_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1643,13 +1733,13 @@ int lua_JoystickControl_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1695,13 +1785,13 @@ int lua_JoystickControl_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1747,13 +1837,13 @@ int lua_JoystickControl_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1856,9 +1946,73 @@ int lua_JoystickControl_getInnerRegionSize(lua_State* state) lua_error(state); break; } + case 2: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA)) + { + // Get parameter 1 off the stack. + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getBoolPointer(2); + + JoystickControl* instance = getInstance(state); + void* returnPtr = (void*)&(instance->getInnerRegionSize(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Vector2"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_getInnerRegionSize - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) && + (lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TLIGHTUSERDATA)) + { + // Get parameter 1 off the stack. + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getBoolPointer(2); + + // Get parameter 2 off the stack. + gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getBoolPointer(3); + + JoystickControl* instance = getInstance(state); + void* returnPtr = (void*)&(instance->getInnerRegionSize(param1, param2)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Vector2"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_getInnerRegionSize - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 1, 2 or 3)."); lua_error(state); break; } @@ -1938,10 +2092,10 @@ int lua_JoystickControl_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -2000,9 +2154,73 @@ int lua_JoystickControl_getOuterRegionSize(lua_State* state) lua_error(state); break; } + case 2: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA)) + { + // Get parameter 1 off the stack. + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getBoolPointer(2); + + JoystickControl* instance = getInstance(state); + void* returnPtr = (void*)&(instance->getOuterRegionSize(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Vector2"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_getOuterRegionSize - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) && + (lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TLIGHTUSERDATA)) + { + // Get parameter 1 off the stack. + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getBoolPointer(2); + + // Get parameter 2 off the stack. + gameplay::ScriptUtil::LuaArray param2 = gameplay::ScriptUtil::getBoolPointer(3); + + JoystickControl* instance = getInstance(state); + void* returnPtr = (void*)&(instance->getOuterRegionSize(param1, param2)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Vector2"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_getOuterRegionSize - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 1, 2 or 3)."); lua_error(state); break; } @@ -2067,7 +2285,7 @@ int lua_JoystickControl_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2098,6 +2316,41 @@ int lua_JoystickControl_getParent(lua_State* state) return 0; } +int lua_JoystickControl_getRadius(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + JoystickControl* instance = getInstance(state); + float result = instance->getRadius(); + + // Push the return value onto the stack. + lua_pushnumber(state, result); + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_getRadius - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_JoystickControl_getRefCount(lua_State* state) { // Get the number of parameters. @@ -2133,6 +2386,54 @@ int lua_JoystickControl_getRefCount(lua_State* state) return 0; } +int lua_JoystickControl_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + JoystickControl* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_getScriptEvent - 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; +} + int lua_JoystickControl_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2170,10 +2471,10 @@ int lua_JoystickControl_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2244,10 +2545,10 @@ int lua_JoystickControl_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2297,7 +2598,7 @@ int lua_JoystickControl_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2329,7 +2630,7 @@ int lua_JoystickControl_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2376,7 +2677,7 @@ int lua_JoystickControl_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2388,16 +2689,16 @@ int lua_JoystickControl_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2453,10 +2754,10 @@ int lua_JoystickControl_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2518,10 +2819,10 @@ int lua_JoystickControl_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2559,7 +2860,7 @@ int lua_JoystickControl_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2603,7 +2904,7 @@ int lua_JoystickControl_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2634,7 +2935,7 @@ int lua_JoystickControl_getTopLevelForm(lua_State* state) return 0; } -int lua_JoystickControl_getType(lua_State* state) +int lua_JoystickControl_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2647,7 +2948,7 @@ int lua_JoystickControl_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { JoystickControl* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2655,7 +2956,7 @@ int lua_JoystickControl_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_JoystickControl_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_JoystickControl_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2871,16 +3172,79 @@ int lua_JoystickControl_hasFocus(lua_State* state) // Push the return value onto the stack. lua_pushboolean(state, result); - return 1; - } + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_hasFocus - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_JoystickControl_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + JoystickControl* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + JoystickControl* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); - lua_pushstring(state, "lua_JoystickControl_hasFocus - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_JoystickControl_hasScriptListener - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 2)."); lua_error(state); break; } @@ -3073,6 +3437,41 @@ int lua_JoystickControl_isHeightPercentage(lua_State* state) return 0; } +int lua_JoystickControl_isRadiusPercentage(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + JoystickControl* instance = getInstance(state); + bool result = instance->isRadiusPercentage(); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_isRadiusPercentage - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_JoystickControl_isRelative(lua_State* state) { // Get the number of parameters. @@ -3357,6 +3756,45 @@ int lua_JoystickControl_removeListener(lua_State* state) return 0; } +int lua_JoystickControl_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + JoystickControl* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_JoystickControl_removeScript - 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; +} + int lua_JoystickControl_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3368,14 +3806,20 @@ int lua_JoystickControl_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); JoystickControl* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3408,10 +3852,10 @@ int lua_JoystickControl_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); instance->setAlignment(param1); @@ -3522,10 +3966,10 @@ int lua_JoystickControl_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); instance->setAutoSize(param1); @@ -4352,9 +4796,69 @@ int lua_JoystickControl_setInnerRegionSize(lua_State* state) lua_error(state); break; } + case 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Vector2", true, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'."); + lua_error(state); + } + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + + JoystickControl* instance = getInstance(state); + instance->setInnerRegionSize(*param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_setInnerRegionSize - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 4: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TBOOLEAN && + lua_type(state, 4) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Vector2", true, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'."); + lua_error(state); + } + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + + // Get parameter 3 off the stack. + bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4); + + JoystickControl* instance = getInstance(state); + instance->setInnerRegionSize(*param1, param2, param3); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_setInnerRegionSize - 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_pushstring(state, "Invalid number of parameters (expected 2, 3 or 4)."); lua_error(state); break; } @@ -4500,9 +5004,69 @@ int lua_JoystickControl_setOuterRegionSize(lua_State* state) lua_error(state); break; } + case 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Vector2", true, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'."); + lua_error(state); + } + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + + JoystickControl* instance = getInstance(state); + instance->setOuterRegionSize(*param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_setOuterRegionSize - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 4: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 3) == LUA_TBOOLEAN && + lua_type(state, 4) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Vector2", true, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'."); + lua_error(state); + } + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + + // Get parameter 3 off the stack. + bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4); + + JoystickControl* instance = getInstance(state); + instance->setOuterRegionSize(*param1, param2, param3); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_setOuterRegionSize - 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_pushstring(state, "Invalid number of parameters (expected 2, 3 or 4)."); lua_error(state); break; } @@ -4598,6 +5162,64 @@ int lua_JoystickControl_setPosition(lua_State* state) return 0; } +int lua_JoystickControl_setRadius(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_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + float param1 = (float)luaL_checknumber(state, 2); + + JoystickControl* instance = getInstance(state); + instance->setRadius(param1); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_setRadius - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + case 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER && + lua_type(state, 3) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + float param1 = (float)luaL_checknumber(state, 2); + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + + JoystickControl* instance = getInstance(state); + instance->setRadius(param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_JoystickControl_setRadius - 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 or 3)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_JoystickControl_setRelative(lua_State* state) { // Get the number of parameters. @@ -4867,10 +5489,10 @@ int lua_JoystickControl_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); JoystickControl* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4885,11 +5507,11 @@ int lua_JoystickControl_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -5422,7 +6044,7 @@ int lua_JoystickControl_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)JoystickControl::create(param1); + void* returnPtr = ((void*)JoystickControl::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5460,7 +6082,7 @@ int lua_JoystickControl_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)JoystickControl::create(param1, param2); + void* returnPtr = ((void*)JoystickControl::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_JoystickControl.h b/gameplay/src/lua/lua_JoystickControl.h index 3873b2616d..4e3153cf19 100644 --- a/gameplay/src/lua/lua_JoystickControl.h +++ b/gameplay/src/lua/lua_JoystickControl.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_JOYSTICKCONTROL_H_ #define LUA_JOYSTICKCONTROL_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_JoystickControl__gc(lua_State* state); int lua_JoystickControl_addListener(lua_State* state); int lua_JoystickControl_addRef(lua_State* state); +int lua_JoystickControl_addScript(lua_State* state); int lua_JoystickControl_addScriptCallback(lua_State* state); int lua_JoystickControl_canFocus(lua_State* state); +int lua_JoystickControl_clearScripts(lua_State* state); int lua_JoystickControl_createAnimation(lua_State* state); int lua_JoystickControl_createAnimationFromBy(lua_State* state); int lua_JoystickControl_createAnimationFromTo(lua_State* state); @@ -43,7 +46,9 @@ int lua_JoystickControl_getOpacity(lua_State* state); int lua_JoystickControl_getOuterRegionSize(lua_State* state); int lua_JoystickControl_getPadding(lua_State* state); int lua_JoystickControl_getParent(lua_State* state); +int lua_JoystickControl_getRadius(lua_State* state); int lua_JoystickControl_getRefCount(lua_State* state); +int lua_JoystickControl_getScriptEvent(lua_State* state); int lua_JoystickControl_getSkinColor(lua_State* state); int lua_JoystickControl_getSkinRegion(lua_State* state); int lua_JoystickControl_getState(lua_State* state); @@ -53,18 +58,20 @@ int lua_JoystickControl_getTextColor(lua_State* state); int lua_JoystickControl_getTextRightToLeft(lua_State* state); int lua_JoystickControl_getTheme(lua_State* state); int lua_JoystickControl_getTopLevelForm(lua_State* state); -int lua_JoystickControl_getType(lua_State* state); +int lua_JoystickControl_getTypeName(lua_State* state); int lua_JoystickControl_getValue(lua_State* state); int lua_JoystickControl_getWidth(lua_State* state); int lua_JoystickControl_getX(lua_State* state); int lua_JoystickControl_getY(lua_State* state); int lua_JoystickControl_getZIndex(lua_State* state); int lua_JoystickControl_hasFocus(lua_State* state); +int lua_JoystickControl_hasScriptListener(lua_State* state); int lua_JoystickControl_isChild(lua_State* state); int lua_JoystickControl_isContainer(lua_State* state); int lua_JoystickControl_isEnabled(lua_State* state); int lua_JoystickControl_isEnabledInHierarchy(lua_State* state); int lua_JoystickControl_isHeightPercentage(lua_State* state); +int lua_JoystickControl_isRadiusPercentage(lua_State* state); int lua_JoystickControl_isRelative(lua_State* state); int lua_JoystickControl_isVisible(lua_State* state); int lua_JoystickControl_isVisibleInHierarchy(lua_State* state); @@ -73,6 +80,7 @@ int lua_JoystickControl_isXPercentage(lua_State* state); int lua_JoystickControl_isYPercentage(lua_State* state); int lua_JoystickControl_release(lua_State* state); int lua_JoystickControl_removeListener(lua_State* state); +int lua_JoystickControl_removeScript(lua_State* state); int lua_JoystickControl_removeScriptCallback(lua_State* state); int lua_JoystickControl_setAlignment(lua_State* state); int lua_JoystickControl_setAnimationPropertyValue(lua_State* state); @@ -98,6 +106,7 @@ int lua_JoystickControl_setOpacity(lua_State* state); int lua_JoystickControl_setOuterRegionSize(lua_State* state); int lua_JoystickControl_setPadding(lua_State* state); int lua_JoystickControl_setPosition(lua_State* state); +int lua_JoystickControl_setRadius(lua_State* state); int lua_JoystickControl_setRelative(lua_State* state); int lua_JoystickControl_setSize(lua_State* state); int lua_JoystickControl_setSkinColor(lua_State* state); diff --git a/gameplay/src/lua/lua_Keyboard.cpp b/gameplay/src/lua/lua_Keyboard.cpp index d4fcbd6220..bac5674b93 100644 --- a/gameplay/src/lua/lua_Keyboard.cpp +++ b/gameplay/src/lua/lua_Keyboard.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Keyboard.h" diff --git a/gameplay/src/lua/lua_Keyboard.h b/gameplay/src/lua/lua_Keyboard.h index 560c4fcdad..3ff55c541b 100644 --- a/gameplay/src/lua/lua_Keyboard.h +++ b/gameplay/src/lua/lua_Keyboard.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_KEYBOARD_H_ #define LUA_KEYBOARD_H_ diff --git a/gameplay/src/lua/lua_KeyboardKey.cpp b/gameplay/src/lua/lua_KeyboardKey.cpp deleted file mode 100644 index 50249de6cb..0000000000 --- a/gameplay/src/lua/lua_KeyboardKey.cpp +++ /dev/null @@ -1,801 +0,0 @@ -#include "Base.h" -#include "lua_KeyboardKey.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_KeyboardKey_KEY_NONE = "KEY_NONE"; -static const char* luaEnumString_KeyboardKey_KEY_PAUSE = "KEY_PAUSE"; -static const char* luaEnumString_KeyboardKey_KEY_SCROLL_LOCK = "KEY_SCROLL_LOCK"; -static const char* luaEnumString_KeyboardKey_KEY_PRINT = "KEY_PRINT"; -static const char* luaEnumString_KeyboardKey_KEY_SYSREQ = "KEY_SYSREQ"; -static const char* luaEnumString_KeyboardKey_KEY_BREAK = "KEY_BREAK"; -static const char* luaEnumString_KeyboardKey_KEY_ESCAPE = "KEY_ESCAPE"; -static const char* luaEnumString_KeyboardKey_KEY_BACKSPACE = "KEY_BACKSPACE"; -static const char* luaEnumString_KeyboardKey_KEY_TAB = "KEY_TAB"; -static const char* luaEnumString_KeyboardKey_KEY_BACK_TAB = "KEY_BACK_TAB"; -static const char* luaEnumString_KeyboardKey_KEY_RETURN = "KEY_RETURN"; -static const char* luaEnumString_KeyboardKey_KEY_CAPS_LOCK = "KEY_CAPS_LOCK"; -static const char* luaEnumString_KeyboardKey_KEY_SHIFT = "KEY_SHIFT"; -static const char* luaEnumString_KeyboardKey_KEY_CTRL = "KEY_CTRL"; -static const char* luaEnumString_KeyboardKey_KEY_ALT = "KEY_ALT"; -static const char* luaEnumString_KeyboardKey_KEY_MENU = "KEY_MENU"; -static const char* luaEnumString_KeyboardKey_KEY_HYPER = "KEY_HYPER"; -static const char* luaEnumString_KeyboardKey_KEY_INSERT = "KEY_INSERT"; -static const char* luaEnumString_KeyboardKey_KEY_HOME = "KEY_HOME"; -static const char* luaEnumString_KeyboardKey_KEY_PG_UP = "KEY_PG_UP"; -static const char* luaEnumString_KeyboardKey_KEY_DELETE = "KEY_DELETE"; -static const char* luaEnumString_KeyboardKey_KEY_END = "KEY_END"; -static const char* luaEnumString_KeyboardKey_KEY_PG_DOWN = "KEY_PG_DOWN"; -static const char* luaEnumString_KeyboardKey_KEY_LEFT_ARROW = "KEY_LEFT_ARROW"; -static const char* luaEnumString_KeyboardKey_KEY_RIGHT_ARROW = "KEY_RIGHT_ARROW"; -static const char* luaEnumString_KeyboardKey_KEY_UP_ARROW = "KEY_UP_ARROW"; -static const char* luaEnumString_KeyboardKey_KEY_DOWN_ARROW = "KEY_DOWN_ARROW"; -static const char* luaEnumString_KeyboardKey_KEY_NUM_LOCK = "KEY_NUM_LOCK"; -static const char* luaEnumString_KeyboardKey_KEY_KP_PLUS = "KEY_KP_PLUS"; -static const char* luaEnumString_KeyboardKey_KEY_KP_MINUS = "KEY_KP_MINUS"; -static const char* luaEnumString_KeyboardKey_KEY_KP_MULTIPLY = "KEY_KP_MULTIPLY"; -static const char* luaEnumString_KeyboardKey_KEY_KP_DIVIDE = "KEY_KP_DIVIDE"; -static const char* luaEnumString_KeyboardKey_KEY_KP_ENTER = "KEY_KP_ENTER"; -static const char* luaEnumString_KeyboardKey_KEY_KP_HOME = "KEY_KP_HOME"; -static const char* luaEnumString_KeyboardKey_KEY_KP_UP = "KEY_KP_UP"; -static const char* luaEnumString_KeyboardKey_KEY_KP_PG_UP = "KEY_KP_PG_UP"; -static const char* luaEnumString_KeyboardKey_KEY_KP_LEFT = "KEY_KP_LEFT"; -static const char* luaEnumString_KeyboardKey_KEY_KP_FIVE = "KEY_KP_FIVE"; -static const char* luaEnumString_KeyboardKey_KEY_KP_RIGHT = "KEY_KP_RIGHT"; -static const char* luaEnumString_KeyboardKey_KEY_KP_END = "KEY_KP_END"; -static const char* luaEnumString_KeyboardKey_KEY_KP_DOWN = "KEY_KP_DOWN"; -static const char* luaEnumString_KeyboardKey_KEY_KP_PG_DOWN = "KEY_KP_PG_DOWN"; -static const char* luaEnumString_KeyboardKey_KEY_KP_INSERT = "KEY_KP_INSERT"; -static const char* luaEnumString_KeyboardKey_KEY_KP_DELETE = "KEY_KP_DELETE"; -static const char* luaEnumString_KeyboardKey_KEY_F1 = "KEY_F1"; -static const char* luaEnumString_KeyboardKey_KEY_F2 = "KEY_F2"; -static const char* luaEnumString_KeyboardKey_KEY_F3 = "KEY_F3"; -static const char* luaEnumString_KeyboardKey_KEY_F4 = "KEY_F4"; -static const char* luaEnumString_KeyboardKey_KEY_F5 = "KEY_F5"; -static const char* luaEnumString_KeyboardKey_KEY_F6 = "KEY_F6"; -static const char* luaEnumString_KeyboardKey_KEY_F7 = "KEY_F7"; -static const char* luaEnumString_KeyboardKey_KEY_F8 = "KEY_F8"; -static const char* luaEnumString_KeyboardKey_KEY_F9 = "KEY_F9"; -static const char* luaEnumString_KeyboardKey_KEY_F10 = "KEY_F10"; -static const char* luaEnumString_KeyboardKey_KEY_F11 = "KEY_F11"; -static const char* luaEnumString_KeyboardKey_KEY_F12 = "KEY_F12"; -static const char* luaEnumString_KeyboardKey_KEY_SPACE = "KEY_SPACE"; -static const char* luaEnumString_KeyboardKey_KEY_EXCLAM = "KEY_EXCLAM"; -static const char* luaEnumString_KeyboardKey_KEY_QUOTE = "KEY_QUOTE"; -static const char* luaEnumString_KeyboardKey_KEY_NUMBER = "KEY_NUMBER"; -static const char* luaEnumString_KeyboardKey_KEY_DOLLAR = "KEY_DOLLAR"; -static const char* luaEnumString_KeyboardKey_KEY_PERCENT = "KEY_PERCENT"; -static const char* luaEnumString_KeyboardKey_KEY_CIRCUMFLEX = "KEY_CIRCUMFLEX"; -static const char* luaEnumString_KeyboardKey_KEY_AMPERSAND = "KEY_AMPERSAND"; -static const char* luaEnumString_KeyboardKey_KEY_APOSTROPHE = "KEY_APOSTROPHE"; -static const char* luaEnumString_KeyboardKey_KEY_LEFT_PARENTHESIS = "KEY_LEFT_PARENTHESIS"; -static const char* luaEnumString_KeyboardKey_KEY_RIGHT_PARENTHESIS = "KEY_RIGHT_PARENTHESIS"; -static const char* luaEnumString_KeyboardKey_KEY_ASTERISK = "KEY_ASTERISK"; -static const char* luaEnumString_KeyboardKey_KEY_PLUS = "KEY_PLUS"; -static const char* luaEnumString_KeyboardKey_KEY_COMMA = "KEY_COMMA"; -static const char* luaEnumString_KeyboardKey_KEY_MINUS = "KEY_MINUS"; -static const char* luaEnumString_KeyboardKey_KEY_PERIOD = "KEY_PERIOD"; -static const char* luaEnumString_KeyboardKey_KEY_SLASH = "KEY_SLASH"; -static const char* luaEnumString_KeyboardKey_KEY_ZERO = "KEY_ZERO"; -static const char* luaEnumString_KeyboardKey_KEY_ONE = "KEY_ONE"; -static const char* luaEnumString_KeyboardKey_KEY_TWO = "KEY_TWO"; -static const char* luaEnumString_KeyboardKey_KEY_THREE = "KEY_THREE"; -static const char* luaEnumString_KeyboardKey_KEY_FOUR = "KEY_FOUR"; -static const char* luaEnumString_KeyboardKey_KEY_FIVE = "KEY_FIVE"; -static const char* luaEnumString_KeyboardKey_KEY_SIX = "KEY_SIX"; -static const char* luaEnumString_KeyboardKey_KEY_SEVEN = "KEY_SEVEN"; -static const char* luaEnumString_KeyboardKey_KEY_EIGHT = "KEY_EIGHT"; -static const char* luaEnumString_KeyboardKey_KEY_NINE = "KEY_NINE"; -static const char* luaEnumString_KeyboardKey_KEY_COLON = "KEY_COLON"; -static const char* luaEnumString_KeyboardKey_KEY_SEMICOLON = "KEY_SEMICOLON"; -static const char* luaEnumString_KeyboardKey_KEY_LESS_THAN = "KEY_LESS_THAN"; -static const char* luaEnumString_KeyboardKey_KEY_EQUAL = "KEY_EQUAL"; -static const char* luaEnumString_KeyboardKey_KEY_GREATER_THAN = "KEY_GREATER_THAN"; -static const char* luaEnumString_KeyboardKey_KEY_QUESTION = "KEY_QUESTION"; -static const char* luaEnumString_KeyboardKey_KEY_AT = "KEY_AT"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_A = "KEY_CAPITAL_A"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_B = "KEY_CAPITAL_B"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_C = "KEY_CAPITAL_C"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_D = "KEY_CAPITAL_D"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_E = "KEY_CAPITAL_E"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_F = "KEY_CAPITAL_F"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_G = "KEY_CAPITAL_G"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_H = "KEY_CAPITAL_H"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_I = "KEY_CAPITAL_I"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_J = "KEY_CAPITAL_J"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_K = "KEY_CAPITAL_K"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_L = "KEY_CAPITAL_L"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_M = "KEY_CAPITAL_M"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_N = "KEY_CAPITAL_N"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_O = "KEY_CAPITAL_O"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_P = "KEY_CAPITAL_P"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_Q = "KEY_CAPITAL_Q"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_R = "KEY_CAPITAL_R"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_S = "KEY_CAPITAL_S"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_T = "KEY_CAPITAL_T"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_U = "KEY_CAPITAL_U"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_V = "KEY_CAPITAL_V"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_W = "KEY_CAPITAL_W"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_X = "KEY_CAPITAL_X"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_Y = "KEY_CAPITAL_Y"; -static const char* luaEnumString_KeyboardKey_KEY_CAPITAL_Z = "KEY_CAPITAL_Z"; -static const char* luaEnumString_KeyboardKey_KEY_LEFT_BRACKET = "KEY_LEFT_BRACKET"; -static const char* luaEnumString_KeyboardKey_KEY_BACK_SLASH = "KEY_BACK_SLASH"; -static const char* luaEnumString_KeyboardKey_KEY_RIGHT_BRACKET = "KEY_RIGHT_BRACKET"; -static const char* luaEnumString_KeyboardKey_KEY_UNDERSCORE = "KEY_UNDERSCORE"; -static const char* luaEnumString_KeyboardKey_KEY_GRAVE = "KEY_GRAVE"; -static const char* luaEnumString_KeyboardKey_KEY_A = "KEY_A"; -static const char* luaEnumString_KeyboardKey_KEY_B = "KEY_B"; -static const char* luaEnumString_KeyboardKey_KEY_C = "KEY_C"; -static const char* luaEnumString_KeyboardKey_KEY_D = "KEY_D"; -static const char* luaEnumString_KeyboardKey_KEY_E = "KEY_E"; -static const char* luaEnumString_KeyboardKey_KEY_F = "KEY_F"; -static const char* luaEnumString_KeyboardKey_KEY_G = "KEY_G"; -static const char* luaEnumString_KeyboardKey_KEY_H = "KEY_H"; -static const char* luaEnumString_KeyboardKey_KEY_I = "KEY_I"; -static const char* luaEnumString_KeyboardKey_KEY_J = "KEY_J"; -static const char* luaEnumString_KeyboardKey_KEY_K = "KEY_K"; -static const char* luaEnumString_KeyboardKey_KEY_L = "KEY_L"; -static const char* luaEnumString_KeyboardKey_KEY_M = "KEY_M"; -static const char* luaEnumString_KeyboardKey_KEY_N = "KEY_N"; -static const char* luaEnumString_KeyboardKey_KEY_O = "KEY_O"; -static const char* luaEnumString_KeyboardKey_KEY_P = "KEY_P"; -static const char* luaEnumString_KeyboardKey_KEY_Q = "KEY_Q"; -static const char* luaEnumString_KeyboardKey_KEY_R = "KEY_R"; -static const char* luaEnumString_KeyboardKey_KEY_S = "KEY_S"; -static const char* luaEnumString_KeyboardKey_KEY_T = "KEY_T"; -static const char* luaEnumString_KeyboardKey_KEY_U = "KEY_U"; -static const char* luaEnumString_KeyboardKey_KEY_V = "KEY_V"; -static const char* luaEnumString_KeyboardKey_KEY_W = "KEY_W"; -static const char* luaEnumString_KeyboardKey_KEY_X = "KEY_X"; -static const char* luaEnumString_KeyboardKey_KEY_Y = "KEY_Y"; -static const char* luaEnumString_KeyboardKey_KEY_Z = "KEY_Z"; -static const char* luaEnumString_KeyboardKey_KEY_LEFT_BRACE = "KEY_LEFT_BRACE"; -static const char* luaEnumString_KeyboardKey_KEY_BAR = "KEY_BAR"; -static const char* luaEnumString_KeyboardKey_KEY_RIGHT_BRACE = "KEY_RIGHT_BRACE"; -static const char* luaEnumString_KeyboardKey_KEY_TILDE = "KEY_TILDE"; -static const char* luaEnumString_KeyboardKey_KEY_EURO = "KEY_EURO"; -static const char* luaEnumString_KeyboardKey_KEY_POUND = "KEY_POUND"; -static const char* luaEnumString_KeyboardKey_KEY_YEN = "KEY_YEN"; -static const char* luaEnumString_KeyboardKey_KEY_MIDDLE_DOT = "KEY_MIDDLE_DOT"; -static const char* luaEnumString_KeyboardKey_KEY_SEARCH = "KEY_SEARCH"; - -Keyboard::Key lua_enumFromString_KeyboardKey(const char* s) -{ - if (strcmp(s, luaEnumString_KeyboardKey_KEY_NONE) == 0) - return Keyboard::KEY_NONE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PAUSE) == 0) - return Keyboard::KEY_PAUSE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SCROLL_LOCK) == 0) - return Keyboard::KEY_SCROLL_LOCK; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PRINT) == 0) - return Keyboard::KEY_PRINT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SYSREQ) == 0) - return Keyboard::KEY_SYSREQ; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_BREAK) == 0) - return Keyboard::KEY_BREAK; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_ESCAPE) == 0) - return Keyboard::KEY_ESCAPE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_BACKSPACE) == 0) - return Keyboard::KEY_BACKSPACE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_TAB) == 0) - return Keyboard::KEY_TAB; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_BACK_TAB) == 0) - return Keyboard::KEY_BACK_TAB; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_RETURN) == 0) - return Keyboard::KEY_RETURN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPS_LOCK) == 0) - return Keyboard::KEY_CAPS_LOCK; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SHIFT) == 0) - return Keyboard::KEY_SHIFT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CTRL) == 0) - return Keyboard::KEY_CTRL; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_ALT) == 0) - return Keyboard::KEY_ALT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_MENU) == 0) - return Keyboard::KEY_MENU; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_HYPER) == 0) - return Keyboard::KEY_HYPER; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_INSERT) == 0) - return Keyboard::KEY_INSERT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_HOME) == 0) - return Keyboard::KEY_HOME; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PG_UP) == 0) - return Keyboard::KEY_PG_UP; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_DELETE) == 0) - return Keyboard::KEY_DELETE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_END) == 0) - return Keyboard::KEY_END; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PG_DOWN) == 0) - return Keyboard::KEY_PG_DOWN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_LEFT_ARROW) == 0) - return Keyboard::KEY_LEFT_ARROW; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_RIGHT_ARROW) == 0) - return Keyboard::KEY_RIGHT_ARROW; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_UP_ARROW) == 0) - return Keyboard::KEY_UP_ARROW; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_DOWN_ARROW) == 0) - return Keyboard::KEY_DOWN_ARROW; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_NUM_LOCK) == 0) - return Keyboard::KEY_NUM_LOCK; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_PLUS) == 0) - return Keyboard::KEY_KP_PLUS; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_MINUS) == 0) - return Keyboard::KEY_KP_MINUS; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_MULTIPLY) == 0) - return Keyboard::KEY_KP_MULTIPLY; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_DIVIDE) == 0) - return Keyboard::KEY_KP_DIVIDE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_ENTER) == 0) - return Keyboard::KEY_KP_ENTER; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_HOME) == 0) - return Keyboard::KEY_KP_HOME; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_UP) == 0) - return Keyboard::KEY_KP_UP; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_PG_UP) == 0) - return Keyboard::KEY_KP_PG_UP; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_LEFT) == 0) - return Keyboard::KEY_KP_LEFT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_FIVE) == 0) - return Keyboard::KEY_KP_FIVE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_RIGHT) == 0) - return Keyboard::KEY_KP_RIGHT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_END) == 0) - return Keyboard::KEY_KP_END; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_DOWN) == 0) - return Keyboard::KEY_KP_DOWN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_PG_DOWN) == 0) - return Keyboard::KEY_KP_PG_DOWN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_INSERT) == 0) - return Keyboard::KEY_KP_INSERT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_KP_DELETE) == 0) - return Keyboard::KEY_KP_DELETE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F1) == 0) - return Keyboard::KEY_F1; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F2) == 0) - return Keyboard::KEY_F2; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F3) == 0) - return Keyboard::KEY_F3; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F4) == 0) - return Keyboard::KEY_F4; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F5) == 0) - return Keyboard::KEY_F5; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F6) == 0) - return Keyboard::KEY_F6; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F7) == 0) - return Keyboard::KEY_F7; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F8) == 0) - return Keyboard::KEY_F8; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F9) == 0) - return Keyboard::KEY_F9; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F10) == 0) - return Keyboard::KEY_F10; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F11) == 0) - return Keyboard::KEY_F11; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F12) == 0) - return Keyboard::KEY_F12; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SPACE) == 0) - return Keyboard::KEY_SPACE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_EXCLAM) == 0) - return Keyboard::KEY_EXCLAM; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_QUOTE) == 0) - return Keyboard::KEY_QUOTE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_NUMBER) == 0) - return Keyboard::KEY_NUMBER; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_DOLLAR) == 0) - return Keyboard::KEY_DOLLAR; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PERCENT) == 0) - return Keyboard::KEY_PERCENT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CIRCUMFLEX) == 0) - return Keyboard::KEY_CIRCUMFLEX; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_AMPERSAND) == 0) - return Keyboard::KEY_AMPERSAND; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_APOSTROPHE) == 0) - return Keyboard::KEY_APOSTROPHE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_LEFT_PARENTHESIS) == 0) - return Keyboard::KEY_LEFT_PARENTHESIS; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_RIGHT_PARENTHESIS) == 0) - return Keyboard::KEY_RIGHT_PARENTHESIS; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_ASTERISK) == 0) - return Keyboard::KEY_ASTERISK; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PLUS) == 0) - return Keyboard::KEY_PLUS; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_COMMA) == 0) - return Keyboard::KEY_COMMA; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_MINUS) == 0) - return Keyboard::KEY_MINUS; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_PERIOD) == 0) - return Keyboard::KEY_PERIOD; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SLASH) == 0) - return Keyboard::KEY_SLASH; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_ZERO) == 0) - return Keyboard::KEY_ZERO; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_ONE) == 0) - return Keyboard::KEY_ONE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_TWO) == 0) - return Keyboard::KEY_TWO; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_THREE) == 0) - return Keyboard::KEY_THREE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_FOUR) == 0) - return Keyboard::KEY_FOUR; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_FIVE) == 0) - return Keyboard::KEY_FIVE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SIX) == 0) - return Keyboard::KEY_SIX; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SEVEN) == 0) - return Keyboard::KEY_SEVEN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_EIGHT) == 0) - return Keyboard::KEY_EIGHT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_NINE) == 0) - return Keyboard::KEY_NINE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_COLON) == 0) - return Keyboard::KEY_COLON; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SEMICOLON) == 0) - return Keyboard::KEY_SEMICOLON; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_LESS_THAN) == 0) - return Keyboard::KEY_LESS_THAN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_EQUAL) == 0) - return Keyboard::KEY_EQUAL; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_GREATER_THAN) == 0) - return Keyboard::KEY_GREATER_THAN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_QUESTION) == 0) - return Keyboard::KEY_QUESTION; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_AT) == 0) - return Keyboard::KEY_AT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_A) == 0) - return Keyboard::KEY_CAPITAL_A; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_B) == 0) - return Keyboard::KEY_CAPITAL_B; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_C) == 0) - return Keyboard::KEY_CAPITAL_C; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_D) == 0) - return Keyboard::KEY_CAPITAL_D; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_E) == 0) - return Keyboard::KEY_CAPITAL_E; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_F) == 0) - return Keyboard::KEY_CAPITAL_F; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_G) == 0) - return Keyboard::KEY_CAPITAL_G; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_H) == 0) - return Keyboard::KEY_CAPITAL_H; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_I) == 0) - return Keyboard::KEY_CAPITAL_I; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_J) == 0) - return Keyboard::KEY_CAPITAL_J; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_K) == 0) - return Keyboard::KEY_CAPITAL_K; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_L) == 0) - return Keyboard::KEY_CAPITAL_L; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_M) == 0) - return Keyboard::KEY_CAPITAL_M; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_N) == 0) - return Keyboard::KEY_CAPITAL_N; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_O) == 0) - return Keyboard::KEY_CAPITAL_O; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_P) == 0) - return Keyboard::KEY_CAPITAL_P; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_Q) == 0) - return Keyboard::KEY_CAPITAL_Q; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_R) == 0) - return Keyboard::KEY_CAPITAL_R; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_S) == 0) - return Keyboard::KEY_CAPITAL_S; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_T) == 0) - return Keyboard::KEY_CAPITAL_T; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_U) == 0) - return Keyboard::KEY_CAPITAL_U; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_V) == 0) - return Keyboard::KEY_CAPITAL_V; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_W) == 0) - return Keyboard::KEY_CAPITAL_W; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_X) == 0) - return Keyboard::KEY_CAPITAL_X; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_Y) == 0) - return Keyboard::KEY_CAPITAL_Y; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_CAPITAL_Z) == 0) - return Keyboard::KEY_CAPITAL_Z; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_LEFT_BRACKET) == 0) - return Keyboard::KEY_LEFT_BRACKET; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_BACK_SLASH) == 0) - return Keyboard::KEY_BACK_SLASH; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_RIGHT_BRACKET) == 0) - return Keyboard::KEY_RIGHT_BRACKET; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_UNDERSCORE) == 0) - return Keyboard::KEY_UNDERSCORE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_GRAVE) == 0) - return Keyboard::KEY_GRAVE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_A) == 0) - return Keyboard::KEY_A; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_B) == 0) - return Keyboard::KEY_B; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_C) == 0) - return Keyboard::KEY_C; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_D) == 0) - return Keyboard::KEY_D; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_E) == 0) - return Keyboard::KEY_E; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_F) == 0) - return Keyboard::KEY_F; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_G) == 0) - return Keyboard::KEY_G; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_H) == 0) - return Keyboard::KEY_H; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_I) == 0) - return Keyboard::KEY_I; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_J) == 0) - return Keyboard::KEY_J; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_K) == 0) - return Keyboard::KEY_K; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_L) == 0) - return Keyboard::KEY_L; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_M) == 0) - return Keyboard::KEY_M; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_N) == 0) - return Keyboard::KEY_N; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_O) == 0) - return Keyboard::KEY_O; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_P) == 0) - return Keyboard::KEY_P; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_Q) == 0) - return Keyboard::KEY_Q; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_R) == 0) - return Keyboard::KEY_R; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_S) == 0) - return Keyboard::KEY_S; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_T) == 0) - return Keyboard::KEY_T; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_U) == 0) - return Keyboard::KEY_U; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_V) == 0) - return Keyboard::KEY_V; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_W) == 0) - return Keyboard::KEY_W; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_X) == 0) - return Keyboard::KEY_X; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_Y) == 0) - return Keyboard::KEY_Y; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_Z) == 0) - return Keyboard::KEY_Z; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_LEFT_BRACE) == 0) - return Keyboard::KEY_LEFT_BRACE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_BAR) == 0) - return Keyboard::KEY_BAR; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_RIGHT_BRACE) == 0) - return Keyboard::KEY_RIGHT_BRACE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_TILDE) == 0) - return Keyboard::KEY_TILDE; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_EURO) == 0) - return Keyboard::KEY_EURO; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_POUND) == 0) - return Keyboard::KEY_POUND; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_YEN) == 0) - return Keyboard::KEY_YEN; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_MIDDLE_DOT) == 0) - return Keyboard::KEY_MIDDLE_DOT; - if (strcmp(s, luaEnumString_KeyboardKey_KEY_SEARCH) == 0) - return Keyboard::KEY_SEARCH; - return Keyboard::KEY_NONE; -} - -const char* lua_stringFromEnum_KeyboardKey(Keyboard::Key e) -{ - if (e == Keyboard::KEY_NONE) - return luaEnumString_KeyboardKey_KEY_NONE; - if (e == Keyboard::KEY_PAUSE) - return luaEnumString_KeyboardKey_KEY_PAUSE; - if (e == Keyboard::KEY_SCROLL_LOCK) - return luaEnumString_KeyboardKey_KEY_SCROLL_LOCK; - if (e == Keyboard::KEY_PRINT) - return luaEnumString_KeyboardKey_KEY_PRINT; - if (e == Keyboard::KEY_SYSREQ) - return luaEnumString_KeyboardKey_KEY_SYSREQ; - if (e == Keyboard::KEY_BREAK) - return luaEnumString_KeyboardKey_KEY_BREAK; - if (e == Keyboard::KEY_ESCAPE) - return luaEnumString_KeyboardKey_KEY_ESCAPE; - if (e == Keyboard::KEY_BACKSPACE) - return luaEnumString_KeyboardKey_KEY_BACKSPACE; - if (e == Keyboard::KEY_TAB) - return luaEnumString_KeyboardKey_KEY_TAB; - if (e == Keyboard::KEY_BACK_TAB) - return luaEnumString_KeyboardKey_KEY_BACK_TAB; - if (e == Keyboard::KEY_RETURN) - return luaEnumString_KeyboardKey_KEY_RETURN; - if (e == Keyboard::KEY_CAPS_LOCK) - return luaEnumString_KeyboardKey_KEY_CAPS_LOCK; - if (e == Keyboard::KEY_SHIFT) - return luaEnumString_KeyboardKey_KEY_SHIFT; - if (e == Keyboard::KEY_CTRL) - return luaEnumString_KeyboardKey_KEY_CTRL; - if (e == Keyboard::KEY_ALT) - return luaEnumString_KeyboardKey_KEY_ALT; - if (e == Keyboard::KEY_MENU) - return luaEnumString_KeyboardKey_KEY_MENU; - if (e == Keyboard::KEY_HYPER) - return luaEnumString_KeyboardKey_KEY_HYPER; - if (e == Keyboard::KEY_INSERT) - return luaEnumString_KeyboardKey_KEY_INSERT; - if (e == Keyboard::KEY_HOME) - return luaEnumString_KeyboardKey_KEY_HOME; - if (e == Keyboard::KEY_PG_UP) - return luaEnumString_KeyboardKey_KEY_PG_UP; - if (e == Keyboard::KEY_DELETE) - return luaEnumString_KeyboardKey_KEY_DELETE; - if (e == Keyboard::KEY_END) - return luaEnumString_KeyboardKey_KEY_END; - if (e == Keyboard::KEY_PG_DOWN) - return luaEnumString_KeyboardKey_KEY_PG_DOWN; - if (e == Keyboard::KEY_LEFT_ARROW) - return luaEnumString_KeyboardKey_KEY_LEFT_ARROW; - if (e == Keyboard::KEY_RIGHT_ARROW) - return luaEnumString_KeyboardKey_KEY_RIGHT_ARROW; - if (e == Keyboard::KEY_UP_ARROW) - return luaEnumString_KeyboardKey_KEY_UP_ARROW; - if (e == Keyboard::KEY_DOWN_ARROW) - return luaEnumString_KeyboardKey_KEY_DOWN_ARROW; - if (e == Keyboard::KEY_NUM_LOCK) - return luaEnumString_KeyboardKey_KEY_NUM_LOCK; - if (e == Keyboard::KEY_KP_PLUS) - return luaEnumString_KeyboardKey_KEY_KP_PLUS; - if (e == Keyboard::KEY_KP_MINUS) - return luaEnumString_KeyboardKey_KEY_KP_MINUS; - if (e == Keyboard::KEY_KP_MULTIPLY) - return luaEnumString_KeyboardKey_KEY_KP_MULTIPLY; - if (e == Keyboard::KEY_KP_DIVIDE) - return luaEnumString_KeyboardKey_KEY_KP_DIVIDE; - if (e == Keyboard::KEY_KP_ENTER) - return luaEnumString_KeyboardKey_KEY_KP_ENTER; - if (e == Keyboard::KEY_KP_HOME) - return luaEnumString_KeyboardKey_KEY_KP_HOME; - if (e == Keyboard::KEY_KP_UP) - return luaEnumString_KeyboardKey_KEY_KP_UP; - if (e == Keyboard::KEY_KP_PG_UP) - return luaEnumString_KeyboardKey_KEY_KP_PG_UP; - if (e == Keyboard::KEY_KP_LEFT) - return luaEnumString_KeyboardKey_KEY_KP_LEFT; - if (e == Keyboard::KEY_KP_FIVE) - return luaEnumString_KeyboardKey_KEY_KP_FIVE; - if (e == Keyboard::KEY_KP_RIGHT) - return luaEnumString_KeyboardKey_KEY_KP_RIGHT; - if (e == Keyboard::KEY_KP_END) - return luaEnumString_KeyboardKey_KEY_KP_END; - if (e == Keyboard::KEY_KP_DOWN) - return luaEnumString_KeyboardKey_KEY_KP_DOWN; - if (e == Keyboard::KEY_KP_PG_DOWN) - return luaEnumString_KeyboardKey_KEY_KP_PG_DOWN; - if (e == Keyboard::KEY_KP_INSERT) - return luaEnumString_KeyboardKey_KEY_KP_INSERT; - if (e == Keyboard::KEY_KP_DELETE) - return luaEnumString_KeyboardKey_KEY_KP_DELETE; - if (e == Keyboard::KEY_F1) - return luaEnumString_KeyboardKey_KEY_F1; - if (e == Keyboard::KEY_F2) - return luaEnumString_KeyboardKey_KEY_F2; - if (e == Keyboard::KEY_F3) - return luaEnumString_KeyboardKey_KEY_F3; - if (e == Keyboard::KEY_F4) - return luaEnumString_KeyboardKey_KEY_F4; - if (e == Keyboard::KEY_F5) - return luaEnumString_KeyboardKey_KEY_F5; - if (e == Keyboard::KEY_F6) - return luaEnumString_KeyboardKey_KEY_F6; - if (e == Keyboard::KEY_F7) - return luaEnumString_KeyboardKey_KEY_F7; - if (e == Keyboard::KEY_F8) - return luaEnumString_KeyboardKey_KEY_F8; - if (e == Keyboard::KEY_F9) - return luaEnumString_KeyboardKey_KEY_F9; - if (e == Keyboard::KEY_F10) - return luaEnumString_KeyboardKey_KEY_F10; - if (e == Keyboard::KEY_F11) - return luaEnumString_KeyboardKey_KEY_F11; - if (e == Keyboard::KEY_F12) - return luaEnumString_KeyboardKey_KEY_F12; - if (e == Keyboard::KEY_SPACE) - return luaEnumString_KeyboardKey_KEY_SPACE; - if (e == Keyboard::KEY_EXCLAM) - return luaEnumString_KeyboardKey_KEY_EXCLAM; - if (e == Keyboard::KEY_QUOTE) - return luaEnumString_KeyboardKey_KEY_QUOTE; - if (e == Keyboard::KEY_NUMBER) - return luaEnumString_KeyboardKey_KEY_NUMBER; - if (e == Keyboard::KEY_DOLLAR) - return luaEnumString_KeyboardKey_KEY_DOLLAR; - if (e == Keyboard::KEY_PERCENT) - return luaEnumString_KeyboardKey_KEY_PERCENT; - if (e == Keyboard::KEY_CIRCUMFLEX) - return luaEnumString_KeyboardKey_KEY_CIRCUMFLEX; - if (e == Keyboard::KEY_AMPERSAND) - return luaEnumString_KeyboardKey_KEY_AMPERSAND; - if (e == Keyboard::KEY_APOSTROPHE) - return luaEnumString_KeyboardKey_KEY_APOSTROPHE; - if (e == Keyboard::KEY_LEFT_PARENTHESIS) - return luaEnumString_KeyboardKey_KEY_LEFT_PARENTHESIS; - if (e == Keyboard::KEY_RIGHT_PARENTHESIS) - return luaEnumString_KeyboardKey_KEY_RIGHT_PARENTHESIS; - if (e == Keyboard::KEY_ASTERISK) - return luaEnumString_KeyboardKey_KEY_ASTERISK; - if (e == Keyboard::KEY_PLUS) - return luaEnumString_KeyboardKey_KEY_PLUS; - if (e == Keyboard::KEY_COMMA) - return luaEnumString_KeyboardKey_KEY_COMMA; - if (e == Keyboard::KEY_MINUS) - return luaEnumString_KeyboardKey_KEY_MINUS; - if (e == Keyboard::KEY_PERIOD) - return luaEnumString_KeyboardKey_KEY_PERIOD; - if (e == Keyboard::KEY_SLASH) - return luaEnumString_KeyboardKey_KEY_SLASH; - if (e == Keyboard::KEY_ZERO) - return luaEnumString_KeyboardKey_KEY_ZERO; - if (e == Keyboard::KEY_ONE) - return luaEnumString_KeyboardKey_KEY_ONE; - if (e == Keyboard::KEY_TWO) - return luaEnumString_KeyboardKey_KEY_TWO; - if (e == Keyboard::KEY_THREE) - return luaEnumString_KeyboardKey_KEY_THREE; - if (e == Keyboard::KEY_FOUR) - return luaEnumString_KeyboardKey_KEY_FOUR; - if (e == Keyboard::KEY_FIVE) - return luaEnumString_KeyboardKey_KEY_FIVE; - if (e == Keyboard::KEY_SIX) - return luaEnumString_KeyboardKey_KEY_SIX; - if (e == Keyboard::KEY_SEVEN) - return luaEnumString_KeyboardKey_KEY_SEVEN; - if (e == Keyboard::KEY_EIGHT) - return luaEnumString_KeyboardKey_KEY_EIGHT; - if (e == Keyboard::KEY_NINE) - return luaEnumString_KeyboardKey_KEY_NINE; - if (e == Keyboard::KEY_COLON) - return luaEnumString_KeyboardKey_KEY_COLON; - if (e == Keyboard::KEY_SEMICOLON) - return luaEnumString_KeyboardKey_KEY_SEMICOLON; - if (e == Keyboard::KEY_LESS_THAN) - return luaEnumString_KeyboardKey_KEY_LESS_THAN; - if (e == Keyboard::KEY_EQUAL) - return luaEnumString_KeyboardKey_KEY_EQUAL; - if (e == Keyboard::KEY_GREATER_THAN) - return luaEnumString_KeyboardKey_KEY_GREATER_THAN; - if (e == Keyboard::KEY_QUESTION) - return luaEnumString_KeyboardKey_KEY_QUESTION; - if (e == Keyboard::KEY_AT) - return luaEnumString_KeyboardKey_KEY_AT; - if (e == Keyboard::KEY_CAPITAL_A) - return luaEnumString_KeyboardKey_KEY_CAPITAL_A; - if (e == Keyboard::KEY_CAPITAL_B) - return luaEnumString_KeyboardKey_KEY_CAPITAL_B; - if (e == Keyboard::KEY_CAPITAL_C) - return luaEnumString_KeyboardKey_KEY_CAPITAL_C; - if (e == Keyboard::KEY_CAPITAL_D) - return luaEnumString_KeyboardKey_KEY_CAPITAL_D; - if (e == Keyboard::KEY_CAPITAL_E) - return luaEnumString_KeyboardKey_KEY_CAPITAL_E; - if (e == Keyboard::KEY_CAPITAL_F) - return luaEnumString_KeyboardKey_KEY_CAPITAL_F; - if (e == Keyboard::KEY_CAPITAL_G) - return luaEnumString_KeyboardKey_KEY_CAPITAL_G; - if (e == Keyboard::KEY_CAPITAL_H) - return luaEnumString_KeyboardKey_KEY_CAPITAL_H; - if (e == Keyboard::KEY_CAPITAL_I) - return luaEnumString_KeyboardKey_KEY_CAPITAL_I; - if (e == Keyboard::KEY_CAPITAL_J) - return luaEnumString_KeyboardKey_KEY_CAPITAL_J; - if (e == Keyboard::KEY_CAPITAL_K) - return luaEnumString_KeyboardKey_KEY_CAPITAL_K; - if (e == Keyboard::KEY_CAPITAL_L) - return luaEnumString_KeyboardKey_KEY_CAPITAL_L; - if (e == Keyboard::KEY_CAPITAL_M) - return luaEnumString_KeyboardKey_KEY_CAPITAL_M; - if (e == Keyboard::KEY_CAPITAL_N) - return luaEnumString_KeyboardKey_KEY_CAPITAL_N; - if (e == Keyboard::KEY_CAPITAL_O) - return luaEnumString_KeyboardKey_KEY_CAPITAL_O; - if (e == Keyboard::KEY_CAPITAL_P) - return luaEnumString_KeyboardKey_KEY_CAPITAL_P; - if (e == Keyboard::KEY_CAPITAL_Q) - return luaEnumString_KeyboardKey_KEY_CAPITAL_Q; - if (e == Keyboard::KEY_CAPITAL_R) - return luaEnumString_KeyboardKey_KEY_CAPITAL_R; - if (e == Keyboard::KEY_CAPITAL_S) - return luaEnumString_KeyboardKey_KEY_CAPITAL_S; - if (e == Keyboard::KEY_CAPITAL_T) - return luaEnumString_KeyboardKey_KEY_CAPITAL_T; - if (e == Keyboard::KEY_CAPITAL_U) - return luaEnumString_KeyboardKey_KEY_CAPITAL_U; - if (e == Keyboard::KEY_CAPITAL_V) - return luaEnumString_KeyboardKey_KEY_CAPITAL_V; - if (e == Keyboard::KEY_CAPITAL_W) - return luaEnumString_KeyboardKey_KEY_CAPITAL_W; - if (e == Keyboard::KEY_CAPITAL_X) - return luaEnumString_KeyboardKey_KEY_CAPITAL_X; - if (e == Keyboard::KEY_CAPITAL_Y) - return luaEnumString_KeyboardKey_KEY_CAPITAL_Y; - if (e == Keyboard::KEY_CAPITAL_Z) - return luaEnumString_KeyboardKey_KEY_CAPITAL_Z; - if (e == Keyboard::KEY_LEFT_BRACKET) - return luaEnumString_KeyboardKey_KEY_LEFT_BRACKET; - if (e == Keyboard::KEY_BACK_SLASH) - return luaEnumString_KeyboardKey_KEY_BACK_SLASH; - if (e == Keyboard::KEY_RIGHT_BRACKET) - return luaEnumString_KeyboardKey_KEY_RIGHT_BRACKET; - if (e == Keyboard::KEY_UNDERSCORE) - return luaEnumString_KeyboardKey_KEY_UNDERSCORE; - if (e == Keyboard::KEY_GRAVE) - return luaEnumString_KeyboardKey_KEY_GRAVE; - if (e == Keyboard::KEY_A) - return luaEnumString_KeyboardKey_KEY_A; - if (e == Keyboard::KEY_B) - return luaEnumString_KeyboardKey_KEY_B; - if (e == Keyboard::KEY_C) - return luaEnumString_KeyboardKey_KEY_C; - if (e == Keyboard::KEY_D) - return luaEnumString_KeyboardKey_KEY_D; - if (e == Keyboard::KEY_E) - return luaEnumString_KeyboardKey_KEY_E; - if (e == Keyboard::KEY_F) - return luaEnumString_KeyboardKey_KEY_F; - if (e == Keyboard::KEY_G) - return luaEnumString_KeyboardKey_KEY_G; - if (e == Keyboard::KEY_H) - return luaEnumString_KeyboardKey_KEY_H; - if (e == Keyboard::KEY_I) - return luaEnumString_KeyboardKey_KEY_I; - if (e == Keyboard::KEY_J) - return luaEnumString_KeyboardKey_KEY_J; - if (e == Keyboard::KEY_K) - return luaEnumString_KeyboardKey_KEY_K; - if (e == Keyboard::KEY_L) - return luaEnumString_KeyboardKey_KEY_L; - if (e == Keyboard::KEY_M) - return luaEnumString_KeyboardKey_KEY_M; - if (e == Keyboard::KEY_N) - return luaEnumString_KeyboardKey_KEY_N; - if (e == Keyboard::KEY_O) - return luaEnumString_KeyboardKey_KEY_O; - if (e == Keyboard::KEY_P) - return luaEnumString_KeyboardKey_KEY_P; - if (e == Keyboard::KEY_Q) - return luaEnumString_KeyboardKey_KEY_Q; - if (e == Keyboard::KEY_R) - return luaEnumString_KeyboardKey_KEY_R; - if (e == Keyboard::KEY_S) - return luaEnumString_KeyboardKey_KEY_S; - if (e == Keyboard::KEY_T) - return luaEnumString_KeyboardKey_KEY_T; - if (e == Keyboard::KEY_U) - return luaEnumString_KeyboardKey_KEY_U; - if (e == Keyboard::KEY_V) - return luaEnumString_KeyboardKey_KEY_V; - if (e == Keyboard::KEY_W) - return luaEnumString_KeyboardKey_KEY_W; - if (e == Keyboard::KEY_X) - return luaEnumString_KeyboardKey_KEY_X; - if (e == Keyboard::KEY_Y) - return luaEnumString_KeyboardKey_KEY_Y; - if (e == Keyboard::KEY_Z) - return luaEnumString_KeyboardKey_KEY_Z; - if (e == Keyboard::KEY_LEFT_BRACE) - return luaEnumString_KeyboardKey_KEY_LEFT_BRACE; - if (e == Keyboard::KEY_BAR) - return luaEnumString_KeyboardKey_KEY_BAR; - if (e == Keyboard::KEY_RIGHT_BRACE) - return luaEnumString_KeyboardKey_KEY_RIGHT_BRACE; - if (e == Keyboard::KEY_TILDE) - return luaEnumString_KeyboardKey_KEY_TILDE; - if (e == Keyboard::KEY_EURO) - return luaEnumString_KeyboardKey_KEY_EURO; - if (e == Keyboard::KEY_POUND) - return luaEnumString_KeyboardKey_KEY_POUND; - if (e == Keyboard::KEY_YEN) - return luaEnumString_KeyboardKey_KEY_YEN; - if (e == Keyboard::KEY_MIDDLE_DOT) - return luaEnumString_KeyboardKey_KEY_MIDDLE_DOT; - if (e == Keyboard::KEY_SEARCH) - return luaEnumString_KeyboardKey_KEY_SEARCH; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_KeyboardKey.h b/gameplay/src/lua/lua_KeyboardKey.h deleted file mode 100644 index a8e1a33ce8..0000000000 --- a/gameplay/src/lua/lua_KeyboardKey.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_KEYBOARDKEY_H_ -#define LUA_KEYBOARDKEY_H_ - -#include "Keyboard.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Keyboard::Key. -Keyboard::Key lua_enumFromString_KeyboardKey(const char* s); -const char* lua_stringFromEnum_KeyboardKey(Keyboard::Key e); - -} - -#endif diff --git a/gameplay/src/lua/lua_KeyboardKeyEvent.cpp b/gameplay/src/lua/lua_KeyboardKeyEvent.cpp deleted file mode 100644 index 0bac499bd7..0000000000 --- a/gameplay/src/lua/lua_KeyboardKeyEvent.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_KeyboardKeyEvent.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_KeyboardKeyEvent_KEY_PRESS = "KEY_PRESS"; -static const char* luaEnumString_KeyboardKeyEvent_KEY_RELEASE = "KEY_RELEASE"; -static const char* luaEnumString_KeyboardKeyEvent_KEY_CHAR = "KEY_CHAR"; - -Keyboard::KeyEvent lua_enumFromString_KeyboardKeyEvent(const char* s) -{ - if (strcmp(s, luaEnumString_KeyboardKeyEvent_KEY_PRESS) == 0) - return Keyboard::KEY_PRESS; - if (strcmp(s, luaEnumString_KeyboardKeyEvent_KEY_RELEASE) == 0) - return Keyboard::KEY_RELEASE; - if (strcmp(s, luaEnumString_KeyboardKeyEvent_KEY_CHAR) == 0) - return Keyboard::KEY_CHAR; - return Keyboard::KEY_PRESS; -} - -const char* lua_stringFromEnum_KeyboardKeyEvent(Keyboard::KeyEvent e) -{ - if (e == Keyboard::KEY_PRESS) - return luaEnumString_KeyboardKeyEvent_KEY_PRESS; - if (e == Keyboard::KEY_RELEASE) - return luaEnumString_KeyboardKeyEvent_KEY_RELEASE; - if (e == Keyboard::KEY_CHAR) - return luaEnumString_KeyboardKeyEvent_KEY_CHAR; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_KeyboardKeyEvent.h b/gameplay/src/lua/lua_KeyboardKeyEvent.h deleted file mode 100644 index bbcb5cf87c..0000000000 --- a/gameplay/src/lua/lua_KeyboardKeyEvent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_KEYBOARDKEYEVENT_H_ -#define LUA_KEYBOARDKEYEVENT_H_ - -#include "Keyboard.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Keyboard::KeyEvent. -Keyboard::KeyEvent lua_enumFromString_KeyboardKeyEvent(const char* s); -const char* lua_stringFromEnum_KeyboardKeyEvent(Keyboard::KeyEvent e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Label.cpp b/gameplay/src/lua/lua_Label.cpp index 30579b58ce..d1aa6167aa 100644 --- a/gameplay/src/lua/lua_Label.cpp +++ b/gameplay/src/lua/lua_Label.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Label.h" @@ -8,17 +9,12 @@ #include "Form.h" #include "Game.h" #include "Label.h" +#include "MaterialParameter.h" #include "Node.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -29,8 +25,10 @@ void luaRegister_Label() { {"addListener", lua_Label_addListener}, {"addRef", lua_Label_addRef}, + {"addScript", lua_Label_addScript}, {"addScriptCallback", lua_Label_addScriptCallback}, {"canFocus", lua_Label_canFocus}, + {"clearScripts", lua_Label_clearScripts}, {"createAnimation", lua_Label_createAnimation}, {"createAnimationFromBy", lua_Label_createAnimationFromBy}, {"createAnimationFromTo", lua_Label_createAnimationFromTo}, @@ -62,6 +60,7 @@ void luaRegister_Label() {"getPadding", lua_Label_getPadding}, {"getParent", lua_Label_getParent}, {"getRefCount", lua_Label_getRefCount}, + {"getScriptEvent", lua_Label_getScriptEvent}, {"getSkinColor", lua_Label_getSkinColor}, {"getSkinRegion", lua_Label_getSkinRegion}, {"getState", lua_Label_getState}, @@ -72,12 +71,13 @@ void luaRegister_Label() {"getTextRightToLeft", lua_Label_getTextRightToLeft}, {"getTheme", lua_Label_getTheme}, {"getTopLevelForm", lua_Label_getTopLevelForm}, - {"getType", lua_Label_getType}, + {"getTypeName", lua_Label_getTypeName}, {"getWidth", lua_Label_getWidth}, {"getX", lua_Label_getX}, {"getY", lua_Label_getY}, {"getZIndex", lua_Label_getZIndex}, {"hasFocus", lua_Label_hasFocus}, + {"hasScriptListener", lua_Label_hasScriptListener}, {"isChild", lua_Label_isChild}, {"isContainer", lua_Label_isContainer}, {"isEnabled", lua_Label_isEnabled}, @@ -90,6 +90,7 @@ void luaRegister_Label() {"isYPercentage", lua_Label_isYPercentage}, {"release", lua_Label_release}, {"removeListener", lua_Label_removeListener}, + {"removeScript", lua_Label_removeScript}, {"removeScriptCallback", lua_Label_removeScriptCallback}, {"setAlignment", lua_Label_setAlignment}, {"setAnimationPropertyValue", lua_Label_setAnimationPropertyValue}, @@ -268,6 +269,54 @@ int lua_Label_addRef(lua_State* state) return 0; } +int lua_Label_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Label* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Label_addScript - 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; +} + int lua_Label_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -279,14 +328,20 @@ int lua_Label_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Label* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -343,6 +398,38 @@ int lua_Label_canFocus(lua_State* state) return 0; } +int lua_Label_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Label* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Label_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Label_createAnimation(lua_State* state) { // Get the number of parameters. @@ -366,7 +453,7 @@ int lua_Label_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -400,7 +487,7 @@ int lua_Label_createAnimation(lua_State* state) break; Label* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -432,7 +519,7 @@ int lua_Label_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -450,10 +537,10 @@ int lua_Label_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -487,7 +574,7 @@ int lua_Label_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -511,10 +598,10 @@ int lua_Label_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -561,7 +648,7 @@ int lua_Label_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -577,13 +664,13 @@ int lua_Label_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -629,7 +716,7 @@ int lua_Label_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -645,13 +732,13 @@ int lua_Label_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -792,7 +879,7 @@ int lua_Label_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -824,7 +911,7 @@ int lua_Label_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -854,7 +941,7 @@ int lua_Label_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -986,7 +1073,7 @@ int lua_Label_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1042,10 +1129,10 @@ int lua_Label_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1257,10 +1344,10 @@ int lua_Label_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1305,10 +1392,10 @@ int lua_Label_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1353,10 +1440,10 @@ int lua_Label_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1438,7 +1525,7 @@ int lua_Label_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1462,13 +1549,13 @@ int lua_Label_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1527,10 +1614,10 @@ int lua_Label_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1637,13 +1724,13 @@ int lua_Label_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1689,13 +1776,13 @@ int lua_Label_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1741,13 +1828,13 @@ int lua_Label_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1853,10 +1940,10 @@ int lua_Label_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -1938,7 +2025,7 @@ int lua_Label_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2004,6 +2091,54 @@ int lua_Label_getRefCount(lua_State* state) return 0; } +int lua_Label_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Label* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Label_getScriptEvent - 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; +} + int lua_Label_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2041,10 +2176,10 @@ int lua_Label_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2115,10 +2250,10 @@ int lua_Label_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2168,7 +2303,7 @@ int lua_Label_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2200,7 +2335,7 @@ int lua_Label_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2282,7 +2417,7 @@ int lua_Label_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2294,16 +2429,16 @@ int lua_Label_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2359,10 +2494,10 @@ int lua_Label_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2424,10 +2559,10 @@ int lua_Label_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); Label* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2465,7 +2600,7 @@ int lua_Label_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2509,7 +2644,7 @@ int lua_Label_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2540,7 +2675,7 @@ int lua_Label_getTopLevelForm(lua_State* state) return 0; } -int lua_Label_getType(lua_State* state) +int lua_Label_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2553,7 +2688,7 @@ int lua_Label_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Label* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2561,7 +2696,7 @@ int lua_Label_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_Label_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Label_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2750,6 +2885,69 @@ int lua_Label_hasFocus(lua_State* state) return 0; } +int lua_Label_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Label* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Label* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Label_hasScriptListener - 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; +} + int lua_Label_isChild(lua_State* state) { // Get the number of parameters. @@ -3184,6 +3382,45 @@ int lua_Label_removeListener(lua_State* state) return 0; } +int lua_Label_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Label* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Label_removeScript - 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; +} + int lua_Label_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3195,14 +3432,20 @@ int lua_Label_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Label* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3235,10 +3478,10 @@ int lua_Label_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); Label* instance = getInstance(state); instance->setAlignment(param1); @@ -3349,10 +3592,10 @@ int lua_Label_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); Label* instance = getInstance(state); instance->setAutoSize(param1); @@ -4610,10 +4853,10 @@ int lua_Label_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); Label* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4628,11 +4871,11 @@ int lua_Label_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -5165,7 +5408,7 @@ int lua_Label_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Label::create(param1); + void* returnPtr = ((void*)Label::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5203,7 +5446,7 @@ int lua_Label_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Label::create(param1, param2); + void* returnPtr = ((void*)Label::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Label.h b/gameplay/src/lua/lua_Label.h index 4f6f8319f2..42da2229a1 100644 --- a/gameplay/src/lua/lua_Label.h +++ b/gameplay/src/lua/lua_Label.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_LABEL_H_ #define LUA_LABEL_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_Label__gc(lua_State* state); int lua_Label_addListener(lua_State* state); int lua_Label_addRef(lua_State* state); +int lua_Label_addScript(lua_State* state); int lua_Label_addScriptCallback(lua_State* state); int lua_Label_canFocus(lua_State* state); +int lua_Label_clearScripts(lua_State* state); int lua_Label_createAnimation(lua_State* state); int lua_Label_createAnimationFromBy(lua_State* state); int lua_Label_createAnimationFromTo(lua_State* state); @@ -41,6 +44,7 @@ int lua_Label_getOpacity(lua_State* state); int lua_Label_getPadding(lua_State* state); int lua_Label_getParent(lua_State* state); int lua_Label_getRefCount(lua_State* state); +int lua_Label_getScriptEvent(lua_State* state); int lua_Label_getSkinColor(lua_State* state); int lua_Label_getSkinRegion(lua_State* state); int lua_Label_getState(lua_State* state); @@ -51,12 +55,13 @@ int lua_Label_getTextColor(lua_State* state); int lua_Label_getTextRightToLeft(lua_State* state); int lua_Label_getTheme(lua_State* state); int lua_Label_getTopLevelForm(lua_State* state); -int lua_Label_getType(lua_State* state); +int lua_Label_getTypeName(lua_State* state); int lua_Label_getWidth(lua_State* state); int lua_Label_getX(lua_State* state); int lua_Label_getY(lua_State* state); int lua_Label_getZIndex(lua_State* state); int lua_Label_hasFocus(lua_State* state); +int lua_Label_hasScriptListener(lua_State* state); int lua_Label_isChild(lua_State* state); int lua_Label_isContainer(lua_State* state); int lua_Label_isEnabled(lua_State* state); @@ -69,6 +74,7 @@ int lua_Label_isXPercentage(lua_State* state); int lua_Label_isYPercentage(lua_State* state); int lua_Label_release(lua_State* state); int lua_Label_removeListener(lua_State* state); +int lua_Label_removeScript(lua_State* state); int lua_Label_removeScriptCallback(lua_State* state); int lua_Label_setAlignment(lua_State* state); int lua_Label_setAnimationPropertyValue(lua_State* state); diff --git a/gameplay/src/lua/lua_Layout.cpp b/gameplay/src/lua/lua_Layout.cpp index 7667948dec..ad3e405b17 100644 --- a/gameplay/src/lua/lua_Layout.cpp +++ b/gameplay/src/lua/lua_Layout.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Layout.h" @@ -7,7 +8,6 @@ #include "Game.h" #include "Layout.h" #include "Ref.h" -#include "lua_LayoutType.h" namespace gameplay { @@ -156,7 +156,7 @@ int lua_Layout_getType(lua_State* state) Layout::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_LayoutType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_Layout.h b/gameplay/src/lua/lua_Layout.h index 9d8a4048d2..3191d0494a 100644 --- a/gameplay/src/lua/lua_Layout.h +++ b/gameplay/src/lua/lua_Layout.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_LAYOUT_H_ #define LUA_LAYOUT_H_ diff --git a/gameplay/src/lua/lua_LayoutType.cpp b/gameplay/src/lua/lua_LayoutType.cpp deleted file mode 100644 index 4594ab09ee..0000000000 --- a/gameplay/src/lua/lua_LayoutType.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_LayoutType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_LayoutType_LAYOUT_FLOW = "LAYOUT_FLOW"; -static const char* luaEnumString_LayoutType_LAYOUT_VERTICAL = "LAYOUT_VERTICAL"; -static const char* luaEnumString_LayoutType_LAYOUT_ABSOLUTE = "LAYOUT_ABSOLUTE"; - -Layout::Type lua_enumFromString_LayoutType(const char* s) -{ - if (strcmp(s, luaEnumString_LayoutType_LAYOUT_FLOW) == 0) - return Layout::LAYOUT_FLOW; - if (strcmp(s, luaEnumString_LayoutType_LAYOUT_VERTICAL) == 0) - return Layout::LAYOUT_VERTICAL; - if (strcmp(s, luaEnumString_LayoutType_LAYOUT_ABSOLUTE) == 0) - return Layout::LAYOUT_ABSOLUTE; - return Layout::LAYOUT_FLOW; -} - -const char* lua_stringFromEnum_LayoutType(Layout::Type e) -{ - if (e == Layout::LAYOUT_FLOW) - return luaEnumString_LayoutType_LAYOUT_FLOW; - if (e == Layout::LAYOUT_VERTICAL) - return luaEnumString_LayoutType_LAYOUT_VERTICAL; - if (e == Layout::LAYOUT_ABSOLUTE) - return luaEnumString_LayoutType_LAYOUT_ABSOLUTE; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_LayoutType.h b/gameplay/src/lua/lua_LayoutType.h deleted file mode 100644 index 3134c42f2c..0000000000 --- a/gameplay/src/lua/lua_LayoutType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_LAYOUTTYPE_H_ -#define LUA_LAYOUTTYPE_H_ - -#include "Layout.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Layout::Type. -Layout::Type lua_enumFromString_LayoutType(const char* s); -const char* lua_stringFromEnum_LayoutType(Layout::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Light.cpp b/gameplay/src/lua/lua_Light.cpp index 5b4723fcee..f45ae1e0fc 100644 --- a/gameplay/src/lua/lua_Light.cpp +++ b/gameplay/src/lua/lua_Light.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Light.h" @@ -6,7 +7,6 @@ #include "Light.h" #include "Node.h" #include "Ref.h" -#include "lua_LightType.h" namespace gameplay { @@ -253,7 +253,7 @@ int lua_Light_getLightType(lua_State* state) Light::Type result = instance->getLightType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_LightType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -285,7 +285,7 @@ int lua_Light_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Light* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -723,7 +723,7 @@ int lua_Light_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Light::create(param1); + void* returnPtr = ((void*)Light::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -774,7 +774,7 @@ int lua_Light_static_createDirectional(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)Light::createDirectional(*param1); + void* returnPtr = ((void*)Light::createDirectional(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -813,7 +813,7 @@ int lua_Light_static_createDirectional(lua_State* state) // Get parameter 3 off the stack. float param3 = (float)luaL_checknumber(state, 3); - void* returnPtr = (void*)Light::createDirectional(param1, param2, param3); + void* returnPtr = ((void*)Light::createDirectional(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -869,7 +869,7 @@ int lua_Light_static_createPoint(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)Light::createPoint(*param1, param2); + void* returnPtr = ((void*)Light::createPoint(*param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -912,7 +912,7 @@ int lua_Light_static_createPoint(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)Light::createPoint(param1, param2, param3, param4); + void* returnPtr = ((void*)Light::createPoint(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -976,7 +976,7 @@ int lua_Light_static_createSpot(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)Light::createSpot(*param1, param2, param3, param4); + void* returnPtr = ((void*)Light::createSpot(*param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1027,7 +1027,7 @@ int lua_Light_static_createSpot(lua_State* state) // Get parameter 6 off the stack. float param6 = (float)luaL_checknumber(state, 6); - void* returnPtr = (void*)Light::createSpot(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)Light::createSpot(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Light.h b/gameplay/src/lua/lua_Light.h index a65f5c902a..4031aaf563 100644 --- a/gameplay/src/lua/lua_Light.h +++ b/gameplay/src/lua/lua_Light.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_LIGHT_H_ #define LUA_LIGHT_H_ diff --git a/gameplay/src/lua/lua_LightType.cpp b/gameplay/src/lua/lua_LightType.cpp deleted file mode 100644 index dc79debcd7..0000000000 --- a/gameplay/src/lua/lua_LightType.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_LightType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_LightType_DIRECTIONAL = "DIRECTIONAL"; -static const char* luaEnumString_LightType_POINT = "POINT"; -static const char* luaEnumString_LightType_SPOT = "SPOT"; - -Light::Type lua_enumFromString_LightType(const char* s) -{ - if (strcmp(s, luaEnumString_LightType_DIRECTIONAL) == 0) - return Light::DIRECTIONAL; - if (strcmp(s, luaEnumString_LightType_POINT) == 0) - return Light::POINT; - if (strcmp(s, luaEnumString_LightType_SPOT) == 0) - return Light::SPOT; - return Light::DIRECTIONAL; -} - -const char* lua_stringFromEnum_LightType(Light::Type e) -{ - if (e == Light::DIRECTIONAL) - return luaEnumString_LightType_DIRECTIONAL; - if (e == Light::POINT) - return luaEnumString_LightType_POINT; - if (e == Light::SPOT) - return luaEnumString_LightType_SPOT; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_LightType.h b/gameplay/src/lua/lua_LightType.h deleted file mode 100644 index cc21a7a7de..0000000000 --- a/gameplay/src/lua/lua_LightType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_LIGHTTYPE_H_ -#define LUA_LIGHTTYPE_H_ - -#include "Light.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Light::Type. -Light::Type lua_enumFromString_LightType(const char* s); -const char* lua_stringFromEnum_LightType(Light::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Logger.cpp b/gameplay/src/lua/lua_Logger.cpp index 0a29c9bdba..438b383696 100644 --- a/gameplay/src/lua/lua_Logger.cpp +++ b/gameplay/src/lua/lua_Logger.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Logger.h" @@ -5,7 +6,6 @@ #include "Base.h" #include "Game.h" #include "ScriptController.h" -#include "lua_LoggerLevel.h" namespace gameplay { @@ -43,10 +43,10 @@ int lua_Logger_static_isEnabled(lua_State* state) { case 1: { - if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL)) + if (lua_type(state, 1) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1)); + Logger::Level param1 = (Logger::Level)luaL_checkint(state, 1); bool result = Logger::isEnabled(param1); @@ -80,11 +80,11 @@ int lua_Logger_static_log(lua_State* state) { case 2: { - if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && + if (lua_type(state, 1) == LUA_TNUMBER && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { // Get parameter 1 off the stack. - Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1)); + Logger::Level param1 = (Logger::Level)luaL_checkint(state, 1); // Get parameter 2 off the stack. const char* param2 = gameplay::ScriptUtil::getString(2, false); @@ -118,11 +118,11 @@ int lua_Logger_static_set(lua_State* state) { case 2: { - if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && + if (lua_type(state, 1) == LUA_TNUMBER && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { // Get parameter 1 off the stack. - Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1)); + Logger::Level param1 = (Logger::Level)luaL_checkint(state, 1); // Get parameter 2 off the stack. const char* param2 = gameplay::ScriptUtil::getString(2, false); @@ -156,11 +156,11 @@ int lua_Logger_static_setEnabled(lua_State* state) { case 2: { - if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && + if (lua_type(state, 1) == LUA_TNUMBER && lua_type(state, 2) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. - Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1)); + Logger::Level param1 = (Logger::Level)luaL_checkint(state, 1); // Get parameter 2 off the stack. bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 2); diff --git a/gameplay/src/lua/lua_Logger.h b/gameplay/src/lua/lua_Logger.h index b1cf133dd6..8551190659 100644 --- a/gameplay/src/lua/lua_Logger.h +++ b/gameplay/src/lua/lua_Logger.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_LOGGER_H_ #define LUA_LOGGER_H_ diff --git a/gameplay/src/lua/lua_LoggerLevel.cpp b/gameplay/src/lua/lua_LoggerLevel.cpp deleted file mode 100644 index b694e30115..0000000000 --- a/gameplay/src/lua/lua_LoggerLevel.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_LoggerLevel.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_LoggerLevel_LEVEL_INFO = "LEVEL_INFO"; -static const char* luaEnumString_LoggerLevel_LEVEL_WARN = "LEVEL_WARN"; -static const char* luaEnumString_LoggerLevel_LEVEL_ERROR = "LEVEL_ERROR"; - -Logger::Level lua_enumFromString_LoggerLevel(const char* s) -{ - if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_INFO) == 0) - return Logger::LEVEL_INFO; - if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_WARN) == 0) - return Logger::LEVEL_WARN; - if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_ERROR) == 0) - return Logger::LEVEL_ERROR; - return Logger::LEVEL_INFO; -} - -const char* lua_stringFromEnum_LoggerLevel(Logger::Level e) -{ - if (e == Logger::LEVEL_INFO) - return luaEnumString_LoggerLevel_LEVEL_INFO; - if (e == Logger::LEVEL_WARN) - return luaEnumString_LoggerLevel_LEVEL_WARN; - if (e == Logger::LEVEL_ERROR) - return luaEnumString_LoggerLevel_LEVEL_ERROR; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_LoggerLevel.h b/gameplay/src/lua/lua_LoggerLevel.h deleted file mode 100644 index 4f8eac4a39..0000000000 --- a/gameplay/src/lua/lua_LoggerLevel.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_LOGGERLEVEL_H_ -#define LUA_LOGGERLEVEL_H_ - -#include "Logger.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Logger::Level. -Logger::Level lua_enumFromString_LoggerLevel(const char* s); -const char* lua_stringFromEnum_LoggerLevel(Logger::Level e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Material.cpp b/gameplay/src/lua/lua_Material.cpp index b78f62fa49..054f098d2e 100644 --- a/gameplay/src/lua/lua_Material.cpp +++ b/gameplay/src/lua/lua_Material.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Material.h" @@ -13,13 +14,6 @@ #include "RenderState.h" #include "Scene.h" #include "Technique.h" -#include "lua_RenderStateAutoBinding.h" -#include "lua_RenderStateBlend.h" -#include "lua_RenderStateCullFaceSide.h" -#include "lua_RenderStateDepthFunction.h" -#include "lua_RenderStateFrontFace.h" -#include "lua_RenderStateStencilFunction.h" -#include "lua_RenderStateStencilOperation.h" namespace gameplay { @@ -192,7 +186,7 @@ int lua_Material_getParameter(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Material* instance = getInstance(state); - void* returnPtr = (void*)instance->getParameter(param1); + void* returnPtr = ((void*)instance->getParameter(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -240,7 +234,7 @@ int lua_Material_getParameterByIndex(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Material* instance = getInstance(state); - void* returnPtr = (void*)instance->getParameterByIndex(param1); + void* returnPtr = ((void*)instance->getParameterByIndex(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -354,7 +348,7 @@ int lua_Material_getStateBlock(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Material* instance = getInstance(state); - void* returnPtr = (void*)instance->getStateBlock(); + void* returnPtr = ((void*)instance->getStateBlock()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -400,7 +394,7 @@ int lua_Material_getTechnique(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Material* instance = getInstance(state); - void* returnPtr = (void*)instance->getTechnique(); + void* returnPtr = ((void*)instance->getTechnique()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -433,7 +427,7 @@ int lua_Material_getTechnique(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Material* instance = getInstance(state); - void* returnPtr = (void*)instance->getTechnique(param1); + void* returnPtr = ((void*)instance->getTechnique(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -482,7 +476,7 @@ int lua_Material_getTechniqueByIndex(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Material* instance = getInstance(state); - void* returnPtr = (void*)instance->getTechniqueByIndex(param1); + void* returnPtr = ((void*)instance->getTechniqueByIndex(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -672,13 +666,13 @@ int lua_Material_setParameterAutoBinding(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - RenderState::AutoBinding param2 = (RenderState::AutoBinding)lua_enumFromString_RenderStateAutoBinding(luaL_checkstring(state, 3)); + RenderState::AutoBinding param2 = (RenderState::AutoBinding)luaL_checkint(state, 3); Material* instance = getInstance(state); instance->setParameterAutoBinding(param1, param2); @@ -815,7 +809,7 @@ int lua_Material_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Material::create(param1); + void* returnPtr = ((void*)Material::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -843,7 +837,7 @@ int lua_Material_static_create(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)Material::create(param1); + void* returnPtr = ((void*)Material::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -871,7 +865,7 @@ int lua_Material_static_create(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)Material::create(param1); + void* returnPtr = ((void*)Material::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -906,7 +900,7 @@ int lua_Material_static_create(lua_State* state) // Get parameter 2 off the stack. const char* param2 = gameplay::ScriptUtil::getString(2, false); - void* returnPtr = (void*)Material::create(param1, param2); + void* returnPtr = ((void*)Material::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -945,7 +939,7 @@ int lua_Material_static_create(lua_State* state) // Get parameter 3 off the stack. const char* param3 = gameplay::ScriptUtil::getString(3, false); - void* returnPtr = (void*)Material::create(param1, param2, param3); + void* returnPtr = ((void*)Material::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Material.h b/gameplay/src/lua/lua_Material.h index 8959ca75a9..a47287466e 100644 --- a/gameplay/src/lua/lua_Material.h +++ b/gameplay/src/lua/lua_Material.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MATERIAL_H_ #define LUA_MATERIAL_H_ diff --git a/gameplay/src/lua/lua_MaterialParameter.cpp b/gameplay/src/lua/lua_MaterialParameter.cpp index 936e979d78..100d082a36 100644 --- a/gameplay/src/lua/lua_MaterialParameter.cpp +++ b/gameplay/src/lua/lua_MaterialParameter.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_MaterialParameter.h" @@ -8,7 +9,6 @@ #include "MaterialParameter.h" #include "Node.h" #include "Ref.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { @@ -203,7 +203,7 @@ int lua_MaterialParameter_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -237,7 +237,7 @@ int lua_MaterialParameter_createAnimation(lua_State* state) break; MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -269,7 +269,7 @@ int lua_MaterialParameter_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -287,10 +287,10 @@ int lua_MaterialParameter_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -324,7 +324,7 @@ int lua_MaterialParameter_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -348,10 +348,10 @@ int lua_MaterialParameter_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -398,7 +398,7 @@ int lua_MaterialParameter_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -414,13 +414,13 @@ int lua_MaterialParameter_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -466,7 +466,7 @@ int lua_MaterialParameter_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -482,13 +482,13 @@ int lua_MaterialParameter_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -582,7 +582,7 @@ int lua_MaterialParameter_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -612,7 +612,7 @@ int lua_MaterialParameter_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -811,7 +811,7 @@ int lua_MaterialParameter_getSampler(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->getSampler(); + void* returnPtr = ((void*)instance->getSampler()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -841,7 +841,7 @@ int lua_MaterialParameter_getSampler(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->getSampler(param1); + void* returnPtr = ((void*)instance->getSampler(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1353,7 +1353,7 @@ int lua_MaterialParameter_setSampler(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->setSampler(param1, param2); + void* returnPtr = ((void*)instance->setSampler(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1762,7 +1762,7 @@ int lua_MaterialParameter_setValue(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); MaterialParameter* instance = getInstance(state); - void* returnPtr = (void*)instance->setValue(param1, param2); + void* returnPtr = ((void*)instance->setValue(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_MaterialParameter.h b/gameplay/src/lua/lua_MaterialParameter.h index f0391941d6..fac88b9647 100644 --- a/gameplay/src/lua/lua_MaterialParameter.h +++ b/gameplay/src/lua/lua_MaterialParameter.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MATERIALPARAMETER_H_ #define LUA_MATERIALPARAMETER_H_ diff --git a/gameplay/src/lua/lua_MathUtil.cpp b/gameplay/src/lua/lua_MathUtil.cpp index 9235f8a7f5..1e46ff80e4 100644 --- a/gameplay/src/lua/lua_MathUtil.cpp +++ b/gameplay/src/lua/lua_MathUtil.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_MathUtil.h" diff --git a/gameplay/src/lua/lua_MathUtil.h b/gameplay/src/lua/lua_MathUtil.h index 2718beda80..70f551c5bc 100644 --- a/gameplay/src/lua/lua_MathUtil.h +++ b/gameplay/src/lua/lua_MathUtil.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MATHUTIL_H_ #define LUA_MATHUTIL_H_ diff --git a/gameplay/src/lua/lua_Matrix.cpp b/gameplay/src/lua/lua_Matrix.cpp index f3e148927a..5744aa189f 100644 --- a/gameplay/src/lua/lua_Matrix.cpp +++ b/gameplay/src/lua/lua_Matrix.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Matrix.h" @@ -127,7 +128,7 @@ int lua_Matrix__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new Matrix(); + void* returnPtr = ((void*)new Matrix()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -153,7 +154,7 @@ int lua_Matrix__init(lua_State* state) // Get parameter 1 off the stack. gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getFloatPointer(1); - void* returnPtr = (void*)new Matrix(param1); + void* returnPtr = ((void*)new Matrix(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -181,7 +182,7 @@ int lua_Matrix__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Matrix(*param1); + void* returnPtr = ((void*)new Matrix(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -272,7 +273,7 @@ int lua_Matrix__init(lua_State* state) // Get parameter 16 off the stack. float param16 = (float)luaL_checknumber(state, 16); - void* returnPtr = (void*)new Matrix(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16); + void* returnPtr = ((void*)new Matrix(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Matrix.h b/gameplay/src/lua/lua_Matrix.h index 94d839233d..c9b5f49f2f 100644 --- a/gameplay/src/lua/lua_Matrix.h +++ b/gameplay/src/lua/lua_Matrix.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MATRIX_H_ #define LUA_MATRIX_H_ diff --git a/gameplay/src/lua/lua_Mesh.cpp b/gameplay/src/lua/lua_Mesh.cpp index 92648b8f82..2683d60a67 100644 --- a/gameplay/src/lua/lua_Mesh.cpp +++ b/gameplay/src/lua/lua_Mesh.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Mesh.h" @@ -9,8 +10,6 @@ #include "MeshPart.h" #include "Model.h" #include "Ref.h" -#include "lua_MeshIndexFormat.h" -#include "lua_MeshPrimitiveType.h" namespace gameplay { @@ -110,21 +109,21 @@ int lua_Mesh_addPart(lua_State* state) case 4: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && + lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Mesh::PrimitiveType param1 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param1 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 2 off the stack. - Mesh::IndexFormat param2 = (Mesh::IndexFormat)lua_enumFromString_MeshIndexFormat(luaL_checkstring(state, 3)); + Mesh::IndexFormat param2 = (Mesh::IndexFormat)luaL_checkint(state, 3); // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4); Mesh* instance = getInstance(state); - void* returnPtr = (void*)instance->addPart(param1, param2, param3); + void* returnPtr = ((void*)instance->addPart(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -148,16 +147,16 @@ int lua_Mesh_addPart(lua_State* state) case 5: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && + lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER && lua_type(state, 5) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. - Mesh::PrimitiveType param1 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param1 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 2 off the stack. - Mesh::IndexFormat param2 = (Mesh::IndexFormat)lua_enumFromString_MeshIndexFormat(luaL_checkstring(state, 3)); + Mesh::IndexFormat param2 = (Mesh::IndexFormat)luaL_checkint(state, 3); // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4); @@ -166,7 +165,7 @@ int lua_Mesh_addPart(lua_State* state) bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 5); Mesh* instance = getInstance(state); - void* returnPtr = (void*)instance->addPart(param1, param2, param3, param4); + void* returnPtr = ((void*)instance->addPart(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -334,7 +333,7 @@ int lua_Mesh_getPart(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Mesh* instance = getInstance(state); - void* returnPtr = (void*)instance->getPart(param1); + void* returnPtr = ((void*)instance->getPart(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -416,7 +415,7 @@ int lua_Mesh_getPrimitiveType(lua_State* state) Mesh::PrimitiveType result = instance->getPrimitiveType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_MeshPrimitiveType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -825,10 +824,10 @@ int lua_Mesh_setPrimitiveType(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Mesh::PrimitiveType param1 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param1 = (Mesh::PrimitiveType)luaL_checkint(state, 2); Mesh* instance = getInstance(state); instance->setPrimitiveType(param1); @@ -955,7 +954,7 @@ int lua_Mesh_static_createBoundingBox(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Mesh::createBoundingBox(*param1); + void* returnPtr = ((void*)Mesh::createBoundingBox(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1011,7 +1010,7 @@ int lua_Mesh_static_createLines(lua_State* state) // Get parameter 2 off the stack. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2); - void* returnPtr = (void*)Mesh::createLines(param1, param2); + void* returnPtr = ((void*)Mesh::createLines(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1067,7 +1066,7 @@ int lua_Mesh_static_createMesh(lua_State* state) // Get parameter 2 off the stack. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2); - void* returnPtr = (void*)Mesh::createMesh(*param1, param2); + void* returnPtr = ((void*)Mesh::createMesh(*param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1109,7 +1108,7 @@ int lua_Mesh_static_createMesh(lua_State* state) // Get parameter 3 off the stack. bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 3); - void* returnPtr = (void*)Mesh::createMesh(*param1, param2, param3); + void* returnPtr = ((void*)Mesh::createMesh(*param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1181,7 +1180,7 @@ int lua_Mesh_static_createQuad(lua_State* state) if (!param4Valid) break; - void* returnPtr = (void*)Mesh::createQuad(*param1, *param2, *param3, *param4); + void* returnPtr = ((void*)Mesh::createQuad(*param1, *param2, *param3, *param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1218,7 +1217,7 @@ int lua_Mesh_static_createQuad(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4); + void* returnPtr = ((void*)Mesh::createQuad(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1265,7 +1264,7 @@ int lua_Mesh_static_createQuad(lua_State* state) // Get parameter 5 off the stack. float param5 = (float)luaL_checknumber(state, 5); - void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5); + void* returnPtr = ((void*)Mesh::createQuad(param1, param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1316,7 +1315,7 @@ int lua_Mesh_static_createQuad(lua_State* state) // Get parameter 6 off the stack. float param6 = (float)luaL_checknumber(state, 6); - void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1371,7 +1370,7 @@ int lua_Mesh_static_createQuad(lua_State* state) // Get parameter 7 off the stack. float param7 = (float)luaL_checknumber(state, 7); - void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6, param7); + void* returnPtr = ((void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6, param7)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1430,7 +1429,7 @@ int lua_Mesh_static_createQuad(lua_State* state) // Get parameter 8 off the stack. float param8 = (float)luaL_checknumber(state, 8); - void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1472,7 +1471,7 @@ int lua_Mesh_static_createQuadFullscreen(lua_State* state) { case 0: { - void* returnPtr = (void*)Mesh::createQuadFullscreen(); + void* returnPtr = ((void*)Mesh::createQuadFullscreen()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Mesh.h b/gameplay/src/lua/lua_Mesh.h index b87b16a787..4fdcfcdf4a 100644 --- a/gameplay/src/lua/lua_Mesh.h +++ b/gameplay/src/lua/lua_Mesh.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MESH_H_ #define LUA_MESH_H_ diff --git a/gameplay/src/lua/lua_MeshBatch.cpp b/gameplay/src/lua/lua_MeshBatch.cpp index 74c7b77d62..b86fd8e4c2 100644 --- a/gameplay/src/lua/lua_MeshBatch.cpp +++ b/gameplay/src/lua/lua_MeshBatch.cpp @@ -1,10 +1,10 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_MeshBatch.h" #include "Base.h" #include "Material.h" #include "MeshBatch.h" -#include "lua_MeshPrimitiveType.h" namespace gameplay { @@ -286,7 +286,7 @@ int lua_MeshBatch_getMaterial(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { MeshBatch* instance = getInstance(state); - void* returnPtr = (void*)instance->getMaterial(); + void* returnPtr = ((void*)instance->getMaterial()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -433,7 +433,7 @@ int lua_MeshBatch_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TBOOLEAN) { @@ -444,7 +444,7 @@ int lua_MeshBatch_static_create(lua_State* state) break; // Get parameter 2 off the stack. - Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 3 off the stack. const char* param3 = gameplay::ScriptUtil::getString(3, false); @@ -452,7 +452,7 @@ int lua_MeshBatch_static_create(lua_State* state) // Get parameter 4 off the stack. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4); - void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4); + void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -473,7 +473,7 @@ int lua_MeshBatch_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TBOOLEAN) { @@ -484,7 +484,7 @@ int lua_MeshBatch_static_create(lua_State* state) break; // Get parameter 2 off the stack. - Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 3 off the stack. bool param3Valid; @@ -495,7 +495,7 @@ int lua_MeshBatch_static_create(lua_State* state) // Get parameter 4 off the stack. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4); - void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4); + void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -522,7 +522,7 @@ int lua_MeshBatch_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TBOOLEAN && lua_type(state, 5) == LUA_TNUMBER) @@ -534,7 +534,7 @@ int lua_MeshBatch_static_create(lua_State* state) break; // Get parameter 2 off the stack. - Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 3 off the stack. const char* param3 = gameplay::ScriptUtil::getString(3, false); @@ -545,7 +545,7 @@ int lua_MeshBatch_static_create(lua_State* state) // Get parameter 5 off the stack. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5); - void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4, param5); + void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -566,7 +566,7 @@ int lua_MeshBatch_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TBOOLEAN && lua_type(state, 5) == LUA_TNUMBER) @@ -578,7 +578,7 @@ int lua_MeshBatch_static_create(lua_State* state) break; // Get parameter 2 off the stack. - Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 3 off the stack. bool param3Valid; @@ -592,7 +592,7 @@ int lua_MeshBatch_static_create(lua_State* state) // Get parameter 5 off the stack. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5); - void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4, param5); + void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -619,7 +619,7 @@ int lua_MeshBatch_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TBOOLEAN && lua_type(state, 5) == LUA_TNUMBER && @@ -632,7 +632,7 @@ int lua_MeshBatch_static_create(lua_State* state) break; // Get parameter 2 off the stack. - Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 3 off the stack. const char* param3 = gameplay::ScriptUtil::getString(3, false); @@ -646,7 +646,7 @@ int lua_MeshBatch_static_create(lua_State* state) // Get parameter 6 off the stack. unsigned int param6 = (unsigned int)luaL_checkunsigned(state, 6); - void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -667,7 +667,7 @@ int lua_MeshBatch_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) && lua_type(state, 4) == LUA_TBOOLEAN && lua_type(state, 5) == LUA_TNUMBER && @@ -680,7 +680,7 @@ int lua_MeshBatch_static_create(lua_State* state) break; // Get parameter 2 off the stack. - Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)lua_enumFromString_MeshPrimitiveType(luaL_checkstring(state, 2)); + Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2); // Get parameter 3 off the stack. bool param3Valid; @@ -697,7 +697,7 @@ int lua_MeshBatch_static_create(lua_State* state) // Get parameter 6 off the stack. unsigned int param6 = (unsigned int)luaL_checkunsigned(state, 6); - void* returnPtr = (void*)MeshBatch::create(*param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_MeshBatch.h b/gameplay/src/lua/lua_MeshBatch.h index cb2f36aabe..42221721d1 100644 --- a/gameplay/src/lua/lua_MeshBatch.h +++ b/gameplay/src/lua/lua_MeshBatch.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MESHBATCH_H_ #define LUA_MESHBATCH_H_ diff --git a/gameplay/src/lua/lua_MeshIndexFormat.cpp b/gameplay/src/lua/lua_MeshIndexFormat.cpp deleted file mode 100644 index c8cc667127..0000000000 --- a/gameplay/src/lua/lua_MeshIndexFormat.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_MeshIndexFormat.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_MeshIndexFormat_INDEX8 = "INDEX8"; -static const char* luaEnumString_MeshIndexFormat_INDEX16 = "INDEX16"; -static const char* luaEnumString_MeshIndexFormat_INDEX32 = "INDEX32"; - -Mesh::IndexFormat lua_enumFromString_MeshIndexFormat(const char* s) -{ - if (strcmp(s, luaEnumString_MeshIndexFormat_INDEX8) == 0) - return Mesh::INDEX8; - if (strcmp(s, luaEnumString_MeshIndexFormat_INDEX16) == 0) - return Mesh::INDEX16; - if (strcmp(s, luaEnumString_MeshIndexFormat_INDEX32) == 0) - return Mesh::INDEX32; - return Mesh::INDEX8; -} - -const char* lua_stringFromEnum_MeshIndexFormat(Mesh::IndexFormat e) -{ - if (e == Mesh::INDEX8) - return luaEnumString_MeshIndexFormat_INDEX8; - if (e == Mesh::INDEX16) - return luaEnumString_MeshIndexFormat_INDEX16; - if (e == Mesh::INDEX32) - return luaEnumString_MeshIndexFormat_INDEX32; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_MeshIndexFormat.h b/gameplay/src/lua/lua_MeshIndexFormat.h deleted file mode 100644 index 858ab40cd5..0000000000 --- a/gameplay/src/lua/lua_MeshIndexFormat.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_MESHINDEXFORMAT_H_ -#define LUA_MESHINDEXFORMAT_H_ - -#include "Mesh.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Mesh::IndexFormat. -Mesh::IndexFormat lua_enumFromString_MeshIndexFormat(const char* s); -const char* lua_stringFromEnum_MeshIndexFormat(Mesh::IndexFormat e); - -} - -#endif diff --git a/gameplay/src/lua/lua_MeshPart.cpp b/gameplay/src/lua/lua_MeshPart.cpp index bbe6d0cc3e..81f3e09f5e 100644 --- a/gameplay/src/lua/lua_MeshPart.cpp +++ b/gameplay/src/lua/lua_MeshPart.cpp @@ -1,10 +1,9 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_MeshPart.h" #include "Base.h" #include "MeshPart.h" -#include "lua_MeshIndexFormat.h" -#include "lua_MeshPrimitiveType.h" namespace gameplay { @@ -167,7 +166,7 @@ int lua_MeshPart_getIndexFormat(lua_State* state) Mesh::IndexFormat result = instance->getIndexFormat(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_MeshIndexFormat(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -237,7 +236,7 @@ int lua_MeshPart_getPrimitiveType(lua_State* state) Mesh::PrimitiveType result = instance->getPrimitiveType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_MeshPrimitiveType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_MeshPart.h b/gameplay/src/lua/lua_MeshPart.h index 50a175fa8b..6921ee26d6 100644 --- a/gameplay/src/lua/lua_MeshPart.h +++ b/gameplay/src/lua/lua_MeshPart.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MESHPART_H_ #define LUA_MESHPART_H_ diff --git a/gameplay/src/lua/lua_MeshPrimitiveType.cpp b/gameplay/src/lua/lua_MeshPrimitiveType.cpp deleted file mode 100644 index 72143285fb..0000000000 --- a/gameplay/src/lua/lua_MeshPrimitiveType.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "Base.h" -#include "lua_MeshPrimitiveType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_MeshPrimitiveType_TRIANGLES = "TRIANGLES"; -static const char* luaEnumString_MeshPrimitiveType_TRIANGLE_STRIP = "TRIANGLE_STRIP"; -static const char* luaEnumString_MeshPrimitiveType_LINES = "LINES"; -static const char* luaEnumString_MeshPrimitiveType_LINE_STRIP = "LINE_STRIP"; -static const char* luaEnumString_MeshPrimitiveType_POINTS = "POINTS"; - -Mesh::PrimitiveType lua_enumFromString_MeshPrimitiveType(const char* s) -{ - if (strcmp(s, luaEnumString_MeshPrimitiveType_TRIANGLES) == 0) - return Mesh::TRIANGLES; - if (strcmp(s, luaEnumString_MeshPrimitiveType_TRIANGLE_STRIP) == 0) - return Mesh::TRIANGLE_STRIP; - if (strcmp(s, luaEnumString_MeshPrimitiveType_LINES) == 0) - return Mesh::LINES; - if (strcmp(s, luaEnumString_MeshPrimitiveType_LINE_STRIP) == 0) - return Mesh::LINE_STRIP; - if (strcmp(s, luaEnumString_MeshPrimitiveType_POINTS) == 0) - return Mesh::POINTS; - return Mesh::TRIANGLES; -} - -const char* lua_stringFromEnum_MeshPrimitiveType(Mesh::PrimitiveType e) -{ - if (e == Mesh::TRIANGLES) - return luaEnumString_MeshPrimitiveType_TRIANGLES; - if (e == Mesh::TRIANGLE_STRIP) - return luaEnumString_MeshPrimitiveType_TRIANGLE_STRIP; - if (e == Mesh::LINES) - return luaEnumString_MeshPrimitiveType_LINES; - if (e == Mesh::LINE_STRIP) - return luaEnumString_MeshPrimitiveType_LINE_STRIP; - if (e == Mesh::POINTS) - return luaEnumString_MeshPrimitiveType_POINTS; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_MeshPrimitiveType.h b/gameplay/src/lua/lua_MeshPrimitiveType.h deleted file mode 100644 index f0011a9d38..0000000000 --- a/gameplay/src/lua/lua_MeshPrimitiveType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_MESHPRIMITIVETYPE_H_ -#define LUA_MESHPRIMITIVETYPE_H_ - -#include "Mesh.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Mesh::PrimitiveType. -Mesh::PrimitiveType lua_enumFromString_MeshPrimitiveType(const char* s); -const char* lua_stringFromEnum_MeshPrimitiveType(Mesh::PrimitiveType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_MeshSkin.cpp b/gameplay/src/lua/lua_MeshSkin.cpp index b141db902c..1cc1d42a5b 100644 --- a/gameplay/src/lua/lua_MeshSkin.cpp +++ b/gameplay/src/lua/lua_MeshSkin.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_MeshSkin.h" @@ -6,12 +7,13 @@ #include "Base.h" #include "Game.h" #include "Joint.h" +#include "MaterialParameter.h" #include "MeshSkin.h" +#include "Model.h" #include "Node.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" namespace gameplay { @@ -109,7 +111,7 @@ int lua_MeshSkin_getJoint(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); MeshSkin* instance = getInstance(state); - void* returnPtr = (void*)instance->getJoint(param1); + void* returnPtr = ((void*)instance->getJoint(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -136,7 +138,7 @@ int lua_MeshSkin_getJoint(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); MeshSkin* instance = getInstance(state); - void* returnPtr = (void*)instance->getJoint(param1); + void* returnPtr = ((void*)instance->getJoint(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -261,7 +263,7 @@ int lua_MeshSkin_getMatrixPalette(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { MeshSkin* instance = getInstance(state); - void* returnPtr = (void*)instance->getMatrixPalette(); + void* returnPtr = ((void*)instance->getMatrixPalette()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -340,7 +342,7 @@ int lua_MeshSkin_getModel(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { MeshSkin* instance = getInstance(state); - void* returnPtr = (void*)instance->getModel(); + void* returnPtr = ((void*)instance->getModel()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -384,7 +386,7 @@ int lua_MeshSkin_getRootJoint(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { MeshSkin* instance = getInstance(state); - void* returnPtr = (void*)instance->getRootJoint(); + void* returnPtr = ((void*)instance->getRootJoint()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_MeshSkin.h b/gameplay/src/lua/lua_MeshSkin.h index 0a8332dab5..656d69781b 100644 --- a/gameplay/src/lua/lua_MeshSkin.h +++ b/gameplay/src/lua/lua_MeshSkin.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MESHSKIN_H_ #define LUA_MESHSKIN_H_ diff --git a/gameplay/src/lua/lua_Model.cpp b/gameplay/src/lua/lua_Model.cpp index fba0690b48..a1afbecb8f 100644 --- a/gameplay/src/lua/lua_Model.cpp +++ b/gameplay/src/lua/lua_Model.cpp @@ -1,7 +1,9 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Model.h" #include "Base.h" +#include "Drawable.h" #include "Game.h" #include "MeshPart.h" #include "Model.h" @@ -29,7 +31,6 @@ void luaRegister_Model() {"hasMaterial", lua_Model_hasMaterial}, {"release", lua_Model_release}, {"setMaterial", lua_Model_setMaterial}, - {"setNode", lua_Model_setNode}, {NULL, NULL} }; const luaL_Reg lua_statics[] = @@ -188,7 +189,7 @@ int lua_Model_getMaterial(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Model* instance = getInstance(state); - void* returnPtr = (void*)instance->getMaterial(); + void* returnPtr = ((void*)instance->getMaterial()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -218,7 +219,7 @@ int lua_Model_getMaterial(lua_State* state) int param1 = (int)luaL_checkint(state, 2); Model* instance = getInstance(state); - void* returnPtr = (void*)instance->getMaterial(param1); + void* returnPtr = ((void*)instance->getMaterial(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -262,7 +263,7 @@ int lua_Model_getMesh(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Model* instance = getInstance(state); - void* returnPtr = (void*)instance->getMesh(); + void* returnPtr = ((void*)instance->getMesh()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -341,7 +342,7 @@ int lua_Model_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Model* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -420,7 +421,7 @@ int lua_Model_getSkin(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Model* instance = getInstance(state); - void* returnPtr = (void*)instance->getSkin(); + void* returnPtr = ((void*)instance->getSkin()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -559,7 +560,7 @@ int lua_Model_setMaterial(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Model* instance = getInstance(state); - void* returnPtr = (void*)instance->setMaterial(param1); + void* returnPtr = ((void*)instance->setMaterial(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -618,7 +619,7 @@ int lua_Model_setMaterial(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Model* instance = getInstance(state); - void* returnPtr = (void*)instance->setMaterial(param1, param2); + void* returnPtr = ((void*)instance->setMaterial(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -649,7 +650,7 @@ int lua_Model_setMaterial(lua_State* state) int param2 = (int)luaL_checkint(state, 3); Model* instance = getInstance(state); - void* returnPtr = (void*)instance->setMaterial(param1, param2); + void* returnPtr = ((void*)instance->setMaterial(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -690,7 +691,7 @@ int lua_Model_setMaterial(lua_State* state) const char* param3 = gameplay::ScriptUtil::getString(4, false); Model* instance = getInstance(state); - void* returnPtr = (void*)instance->setMaterial(param1, param2, param3); + void* returnPtr = ((void*)instance->setMaterial(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -735,7 +736,7 @@ int lua_Model_setMaterial(lua_State* state) int param4 = (int)luaL_checkint(state, 5); Model* instance = getInstance(state); - void* returnPtr = (void*)instance->setMaterial(param1, param2, param3, param4); + void* returnPtr = ((void*)instance->setMaterial(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -767,48 +768,6 @@ int lua_Model_setMaterial(lua_State* state) return 0; } -int lua_Model_setNode(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_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Node", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Node'."); - lua_error(state); - } - - Model* instance = getInstance(state); - instance->setNode(param1); - - return 0; - } - - lua_pushstring(state, "lua_Model_setNode - 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; -} - int lua_Model_static_create(lua_State* state) { // Get the number of parameters. @@ -830,7 +789,7 @@ int lua_Model_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)Model::create(param1); + void* returnPtr = ((void*)Model::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Model.h b/gameplay/src/lua/lua_Model.h index 02b84c263b..924079032f 100644 --- a/gameplay/src/lua/lua_Model.h +++ b/gameplay/src/lua/lua_Model.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MODEL_H_ #define LUA_MODEL_H_ @@ -17,7 +18,6 @@ int lua_Model_getSkin(lua_State* state); int lua_Model_hasMaterial(lua_State* state); int lua_Model_release(lua_State* state); int lua_Model_setMaterial(lua_State* state); -int lua_Model_setNode(lua_State* state); int lua_Model_static_create(lua_State* state); void luaRegister_Model(); diff --git a/gameplay/src/lua/lua_Mouse.cpp b/gameplay/src/lua/lua_Mouse.cpp index 706096ae7f..b2803728e8 100644 --- a/gameplay/src/lua/lua_Mouse.cpp +++ b/gameplay/src/lua/lua_Mouse.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Mouse.h" diff --git a/gameplay/src/lua/lua_Mouse.h b/gameplay/src/lua/lua_Mouse.h index d4b936ba68..0d07afd1d9 100644 --- a/gameplay/src/lua/lua_Mouse.h +++ b/gameplay/src/lua/lua_Mouse.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_MOUSE_H_ #define LUA_MOUSE_H_ diff --git a/gameplay/src/lua/lua_MouseMouseEvent.cpp b/gameplay/src/lua/lua_MouseMouseEvent.cpp deleted file mode 100644 index 9c0ca4526d..0000000000 --- a/gameplay/src/lua/lua_MouseMouseEvent.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "Base.h" -#include "lua_MouseMouseEvent.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_MouseMouseEvent_MOUSE_PRESS_LEFT_BUTTON = "MOUSE_PRESS_LEFT_BUTTON"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_RELEASE_LEFT_BUTTON = "MOUSE_RELEASE_LEFT_BUTTON"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_PRESS_MIDDLE_BUTTON = "MOUSE_PRESS_MIDDLE_BUTTON"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_RELEASE_MIDDLE_BUTTON = "MOUSE_RELEASE_MIDDLE_BUTTON"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_PRESS_RIGHT_BUTTON = "MOUSE_PRESS_RIGHT_BUTTON"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_RELEASE_RIGHT_BUTTON = "MOUSE_RELEASE_RIGHT_BUTTON"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_MOVE = "MOUSE_MOVE"; -static const char* luaEnumString_MouseMouseEvent_MOUSE_WHEEL = "MOUSE_WHEEL"; - -Mouse::MouseEvent lua_enumFromString_MouseMouseEvent(const char* s) -{ - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_PRESS_LEFT_BUTTON) == 0) - return Mouse::MOUSE_PRESS_LEFT_BUTTON; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_RELEASE_LEFT_BUTTON) == 0) - return Mouse::MOUSE_RELEASE_LEFT_BUTTON; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_PRESS_MIDDLE_BUTTON) == 0) - return Mouse::MOUSE_PRESS_MIDDLE_BUTTON; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_RELEASE_MIDDLE_BUTTON) == 0) - return Mouse::MOUSE_RELEASE_MIDDLE_BUTTON; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_PRESS_RIGHT_BUTTON) == 0) - return Mouse::MOUSE_PRESS_RIGHT_BUTTON; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_RELEASE_RIGHT_BUTTON) == 0) - return Mouse::MOUSE_RELEASE_RIGHT_BUTTON; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_MOVE) == 0) - return Mouse::MOUSE_MOVE; - if (strcmp(s, luaEnumString_MouseMouseEvent_MOUSE_WHEEL) == 0) - return Mouse::MOUSE_WHEEL; - return Mouse::MOUSE_PRESS_LEFT_BUTTON; -} - -const char* lua_stringFromEnum_MouseMouseEvent(Mouse::MouseEvent e) -{ - if (e == Mouse::MOUSE_PRESS_LEFT_BUTTON) - return luaEnumString_MouseMouseEvent_MOUSE_PRESS_LEFT_BUTTON; - if (e == Mouse::MOUSE_RELEASE_LEFT_BUTTON) - return luaEnumString_MouseMouseEvent_MOUSE_RELEASE_LEFT_BUTTON; - if (e == Mouse::MOUSE_PRESS_MIDDLE_BUTTON) - return luaEnumString_MouseMouseEvent_MOUSE_PRESS_MIDDLE_BUTTON; - if (e == Mouse::MOUSE_RELEASE_MIDDLE_BUTTON) - return luaEnumString_MouseMouseEvent_MOUSE_RELEASE_MIDDLE_BUTTON; - if (e == Mouse::MOUSE_PRESS_RIGHT_BUTTON) - return luaEnumString_MouseMouseEvent_MOUSE_PRESS_RIGHT_BUTTON; - if (e == Mouse::MOUSE_RELEASE_RIGHT_BUTTON) - return luaEnumString_MouseMouseEvent_MOUSE_RELEASE_RIGHT_BUTTON; - if (e == Mouse::MOUSE_MOVE) - return luaEnumString_MouseMouseEvent_MOUSE_MOVE; - if (e == Mouse::MOUSE_WHEEL) - return luaEnumString_MouseMouseEvent_MOUSE_WHEEL; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_MouseMouseEvent.h b/gameplay/src/lua/lua_MouseMouseEvent.h deleted file mode 100644 index e0cafd1fca..0000000000 --- a/gameplay/src/lua/lua_MouseMouseEvent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_MOUSEMOUSEEVENT_H_ -#define LUA_MOUSEMOUSEEVENT_H_ - -#include "Mouse.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Mouse::MouseEvent. -Mouse::MouseEvent lua_enumFromString_MouseMouseEvent(const char* s); -const char* lua_stringFromEnum_MouseMouseEvent(Mouse::MouseEvent e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Node.cpp b/gameplay/src/lua/lua_Node.cpp index 34141a7ca0..01cb902774 100644 --- a/gameplay/src/lua/lua_Node.cpp +++ b/gameplay/src/lua/lua_Node.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Node.h" @@ -5,8 +6,11 @@ #include "AnimationTarget.h" #include "AudioSource.h" #include "Base.h" +#include "Drawable.h" +#include "Form.h" #include "Game.h" #include "Joint.h" +#include "MaterialParameter.h" #include "Node.h" #include "PhysicsCharacter.h" #include "PhysicsGhostObject.h" @@ -19,9 +23,6 @@ #include "ScriptTarget.h" #include "Terrain.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_NodeType.h" -#include "lua_PhysicsCollisionObjectType.h" namespace gameplay { @@ -33,7 +34,9 @@ void luaRegister_Node() {"addChild", lua_Node_addChild}, {"addListener", lua_Node_addListener}, {"addRef", lua_Node_addRef}, + {"addScript", lua_Node_addScript}, {"addScriptCallback", lua_Node_addScriptCallback}, + {"clearScripts", lua_Node_clearScripts}, {"clone", lua_Node_clone}, {"createAnimation", lua_Node_createAnimation}, {"createAnimationFromBy", lua_Node_createAnimationFromBy}, @@ -53,8 +56,8 @@ void luaRegister_Node() {"getChildCount", lua_Node_getChildCount}, {"getCollisionObject", lua_Node_getCollisionObject}, {"getDownVector", lua_Node_getDownVector}, + {"getDrawable", lua_Node_getDrawable}, {"getFirstChild", lua_Node_getFirstChild}, - {"getForm", lua_Node_getForm}, {"getForwardVector", lua_Node_getForwardVector}, {"getForwardVectorView", lua_Node_getForwardVectorView}, {"getForwardVectorWorld", lua_Node_getForwardVectorWorld}, @@ -66,10 +69,8 @@ void luaRegister_Node() {"getLeftVector", lua_Node_getLeftVector}, {"getLight", lua_Node_getLight}, {"getMatrix", lua_Node_getMatrix}, - {"getModel", lua_Node_getModel}, {"getNextSibling", lua_Node_getNextSibling}, {"getParent", lua_Node_getParent}, - {"getParticleEmitter", lua_Node_getParticleEmitter}, {"getPreviousSibling", lua_Node_getPreviousSibling}, {"getProjectionMatrix", lua_Node_getProjectionMatrix}, {"getRefCount", lua_Node_getRefCount}, @@ -82,8 +83,8 @@ void luaRegister_Node() {"getScaleY", lua_Node_getScaleY}, {"getScaleZ", lua_Node_getScaleZ}, {"getScene", lua_Node_getScene}, + {"getScriptEvent", lua_Node_getScriptEvent}, {"getTag", lua_Node_getTag}, - {"getTerrain", lua_Node_getTerrain}, {"getTranslation", lua_Node_getTranslation}, {"getTranslationView", lua_Node_getTranslationView}, {"getTranslationWorld", lua_Node_getTranslationWorld}, @@ -91,21 +92,25 @@ void luaRegister_Node() {"getTranslationY", lua_Node_getTranslationY}, {"getTranslationZ", lua_Node_getTranslationZ}, {"getType", lua_Node_getType}, + {"getTypeName", lua_Node_getTypeName}, {"getUpVector", lua_Node_getUpVector}, {"getUpVectorWorld", lua_Node_getUpVectorWorld}, + {"getUserObject", lua_Node_getUserObject}, {"getViewMatrix", lua_Node_getViewMatrix}, {"getViewProjectionMatrix", lua_Node_getViewProjectionMatrix}, {"getWorldMatrix", lua_Node_getWorldMatrix}, {"getWorldViewMatrix", lua_Node_getWorldViewMatrix}, {"getWorldViewProjectionMatrix", lua_Node_getWorldViewProjectionMatrix}, + {"hasScriptListener", lua_Node_hasScriptListener}, {"hasTag", lua_Node_hasTag}, - {"isActive", lua_Node_isActive}, - {"isActiveInHierarchy", lua_Node_isActiveInHierarchy}, + {"isEnabled", lua_Node_isEnabled}, + {"isEnabledInHierarchy", lua_Node_isEnabledInHierarchy}, {"isStatic", lua_Node_isStatic}, {"release", lua_Node_release}, {"removeAllChildren", lua_Node_removeAllChildren}, {"removeChild", lua_Node_removeChild}, {"removeListener", lua_Node_removeListener}, + {"removeScript", lua_Node_removeScript}, {"removeScriptCallback", lua_Node_removeScriptCallback}, {"rotate", lua_Node_rotate}, {"rotateX", lua_Node_rotateX}, @@ -116,29 +121,27 @@ void luaRegister_Node() {"scaleY", lua_Node_scaleY}, {"scaleZ", lua_Node_scaleZ}, {"set", lua_Node_set}, - {"setActive", lua_Node_setActive}, {"setAgent", lua_Node_setAgent}, {"setAnimationPropertyValue", lua_Node_setAnimationPropertyValue}, {"setAudioSource", lua_Node_setAudioSource}, {"setCamera", lua_Node_setCamera}, {"setCollisionObject", lua_Node_setCollisionObject}, - {"setForm", lua_Node_setForm}, + {"setDrawable", lua_Node_setDrawable}, + {"setEnabled", lua_Node_setEnabled}, {"setId", lua_Node_setId}, {"setIdentity", lua_Node_setIdentity}, {"setLight", lua_Node_setLight}, - {"setModel", lua_Node_setModel}, - {"setParticleEmitter", lua_Node_setParticleEmitter}, {"setRotation", lua_Node_setRotation}, {"setScale", lua_Node_setScale}, {"setScaleX", lua_Node_setScaleX}, {"setScaleY", lua_Node_setScaleY}, {"setScaleZ", lua_Node_setScaleZ}, {"setTag", lua_Node_setTag}, - {"setTerrain", lua_Node_setTerrain}, {"setTranslation", lua_Node_setTranslation}, {"setTranslationX", lua_Node_setTranslationX}, {"setTranslationY", lua_Node_setTranslationY}, {"setTranslationZ", lua_Node_setTranslationZ}, + {"setUserObject", lua_Node_setUserObject}, {"transformPoint", lua_Node_transformPoint}, {"transformVector", lua_Node_transformVector}, {"translate", lua_Node_translate}, @@ -368,6 +371,54 @@ int lua_Node_addRef(lua_State* state) return 0; } +int lua_Node_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Node* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Node_addScript - 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; +} + int lua_Node_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -379,14 +430,20 @@ int lua_Node_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Node* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -408,6 +465,38 @@ int lua_Node_addScriptCallback(lua_State* state) return 0; } +int lua_Node_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Node* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_Node_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Node_clone(lua_State* state) { // Get the number of parameters. @@ -421,7 +510,7 @@ int lua_Node_clone(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->clone(); + void* returnPtr = ((void*)instance->clone()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -475,7 +564,7 @@ int lua_Node_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -509,7 +598,7 @@ int lua_Node_createAnimation(lua_State* state) break; Node* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -541,7 +630,7 @@ int lua_Node_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -559,10 +648,10 @@ int lua_Node_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -596,7 +685,7 @@ int lua_Node_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -620,10 +709,10 @@ int lua_Node_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -670,7 +759,7 @@ int lua_Node_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -686,13 +775,13 @@ int lua_Node_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -738,7 +827,7 @@ int lua_Node_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -754,13 +843,13 @@ int lua_Node_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -858,7 +947,7 @@ int lua_Node_findNode(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1); + void* returnPtr = ((void*)instance->findNode(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -892,7 +981,7 @@ int lua_Node_findNode(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1, param2); + void* returnPtr = ((void*)instance->findNode(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -930,7 +1019,7 @@ int lua_Node_findNode(lua_State* state) bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1, param2, param3); + void* returnPtr = ((void*)instance->findNode(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1062,7 +1151,7 @@ int lua_Node_getAgent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getAgent(); + void* returnPtr = ((void*)instance->getAgent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1106,7 +1195,7 @@ int lua_Node_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1136,7 +1225,7 @@ int lua_Node_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1265,7 +1354,7 @@ int lua_Node_getAudioSource(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getAudioSource(); + void* returnPtr = ((void*)instance->getAudioSource()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1424,7 +1513,7 @@ int lua_Node_getCamera(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getCamera(); + void* returnPtr = ((void*)instance->getCamera()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1503,7 +1592,7 @@ int lua_Node_getCollisionObject(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionObject(); + void* returnPtr = ((void*)instance->getCollisionObject()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1605,7 +1694,7 @@ int lua_Node_getDownVector(lua_State* state) return 0; } -int lua_Node_getFirstChild(lua_State* state) +int lua_Node_getDrawable(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -1618,13 +1707,13 @@ int lua_Node_getFirstChild(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getFirstChild(); + void* returnPtr = ((void*)instance->getDrawable()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); object->instance = returnPtr; object->owns = false; - luaL_getmetatable(state, "Node"); + luaL_getmetatable(state, "Drawable"); lua_setmetatable(state, -2); } else @@ -1635,7 +1724,7 @@ int lua_Node_getFirstChild(lua_State* state) return 1; } - lua_pushstring(state, "lua_Node_getFirstChild - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_getDrawable - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -1649,7 +1738,7 @@ int lua_Node_getFirstChild(lua_State* state) return 0; } -int lua_Node_getForm(lua_State* state) +int lua_Node_getFirstChild(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -1662,13 +1751,13 @@ int lua_Node_getForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getForm(); + void* returnPtr = ((void*)instance->getFirstChild()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); object->instance = returnPtr; object->owns = false; - luaL_getmetatable(state, "Form"); + luaL_getmetatable(state, "Node"); lua_setmetatable(state, -2); } else @@ -1679,7 +1768,7 @@ int lua_Node_getForm(lua_State* state) return 1; } - lua_pushstring(state, "lua_Node_getForm - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_getFirstChild - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2147,7 +2236,7 @@ int lua_Node_getLight(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getLight(); + void* returnPtr = ((void*)instance->getLight()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2222,50 +2311,6 @@ int lua_Node_getMatrix(lua_State* state) return 0; } -int lua_Node_getModel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getModel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "Model"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Node_getModel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_Node_getNextSibling(lua_State* state) { // Get the number of parameters. @@ -2279,7 +2324,7 @@ int lua_Node_getNextSibling(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getNextSibling(); + void* returnPtr = ((void*)instance->getNextSibling()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2323,7 +2368,7 @@ int lua_Node_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2354,50 +2399,6 @@ int lua_Node_getParent(lua_State* state) return 0; } -int lua_Node_getParticleEmitter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getParticleEmitter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "ParticleEmitter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_Node_getParticleEmitter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_Node_getPreviousSibling(lua_State* state) { // Get the number of parameters. @@ -2411,7 +2412,7 @@ int lua_Node_getPreviousSibling(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getPreviousSibling(); + void* returnPtr = ((void*)instance->getPreviousSibling()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2649,7 +2650,7 @@ int lua_Node_getRootNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getRootNode(); + void* returnPtr = ((void*)instance->getRootNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2979,7 +2980,7 @@ int lua_Node_getScene(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getScene(); + void* returnPtr = ((void*)instance->getScene()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3010,7 +3011,7 @@ int lua_Node_getScene(lua_State* state) return 0; } -int lua_Node_getTag(lua_State* state) +int lua_Node_getScriptEvent(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3027,15 +3028,24 @@ int lua_Node_getTag(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Node* instance = getInstance(state); - const char* result = instance->getTag(param1); - - // Push the return value onto the stack. - lua_pushstring(state, result); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } return 1; } - lua_pushstring(state, "lua_Node_getTag - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_getScriptEvent - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3049,7 +3059,7 @@ int lua_Node_getTag(lua_State* state) return 0; } -int lua_Node_getTerrain(lua_State* state) +int lua_Node_getTag(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3057,35 +3067,30 @@ int lua_Node_getTerrain(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 1: + case 2: { - if ((lua_type(state, 1) == LUA_TUSERDATA)) + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + Node* instance = getInstance(state); - void* returnPtr = (void*)instance->getTerrain(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "Terrain"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } + const char* result = instance->getTag(param1); + + // Push the return value onto the stack. + lua_pushstring(state, result); return 1; } - lua_pushstring(state, "lua_Node_getTerrain - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_getTag - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 2)."); lua_error(state); break; } @@ -3373,7 +3378,7 @@ int lua_Node_getType(lua_State* state) Node::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_NodeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -3392,6 +3397,41 @@ int lua_Node_getType(lua_State* state) return 0; } +int lua_Node_getTypeName(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Node* instance = getInstance(state); + const char* result = instance->getTypeName(); + + // Push the return value onto the stack. + lua_pushstring(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Node_getTypeName - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_Node_getUpVector(lua_State* state) { // Get the number of parameters. @@ -3507,7 +3547,7 @@ int lua_Node_getUpVectorWorld(lua_State* state) return 0; } -int lua_Node_getViewMatrix(lua_State* state) +int lua_Node_getUserObject(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3520,13 +3560,13 @@ int lua_Node_getViewMatrix(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)&(instance->getViewMatrix()); + void* returnPtr = ((void*)instance->getUserObject()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); object->instance = returnPtr; object->owns = false; - luaL_getmetatable(state, "Matrix"); + luaL_getmetatable(state, "Ref"); lua_setmetatable(state, -2); } else @@ -3537,7 +3577,7 @@ int lua_Node_getViewMatrix(lua_State* state) return 1; } - lua_pushstring(state, "lua_Node_getViewMatrix - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_getUserObject - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3551,7 +3591,7 @@ int lua_Node_getViewMatrix(lua_State* state) return 0; } -int lua_Node_getViewProjectionMatrix(lua_State* state) +int lua_Node_getViewMatrix(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3564,7 +3604,7 @@ int lua_Node_getViewProjectionMatrix(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)&(instance->getViewProjectionMatrix()); + void* returnPtr = (void*)&(instance->getViewMatrix()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3581,7 +3621,7 @@ int lua_Node_getViewProjectionMatrix(lua_State* state) return 1; } - lua_pushstring(state, "lua_Node_getViewProjectionMatrix - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_getViewMatrix - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3595,7 +3635,7 @@ int lua_Node_getViewProjectionMatrix(lua_State* state) return 0; } -int lua_Node_getWorldMatrix(lua_State* state) +int lua_Node_getViewProjectionMatrix(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3608,7 +3648,51 @@ int lua_Node_getWorldMatrix(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - void* returnPtr = (void*)&(instance->getWorldMatrix()); + void* returnPtr = (void*)&(instance->getViewProjectionMatrix()); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Matrix"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_Node_getViewProjectionMatrix - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Node_getWorldMatrix(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Node* instance = getInstance(state); + void* returnPtr = (void*)&(instance->getWorldMatrix()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -3727,6 +3811,69 @@ int lua_Node_getWorldViewProjectionMatrix(lua_State* state) return 0; } +int lua_Node_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Node* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + Node* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_Node_hasScriptListener - 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; +} + int lua_Node_hasTag(lua_State* state) { // Get the number of parameters. @@ -3766,7 +3913,7 @@ int lua_Node_hasTag(lua_State* state) return 0; } -int lua_Node_isActive(lua_State* state) +int lua_Node_isEnabled(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3779,7 +3926,7 @@ int lua_Node_isActive(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - bool result = instance->isActive(); + bool result = instance->isEnabled(); // Push the return value onto the stack. lua_pushboolean(state, result); @@ -3787,7 +3934,7 @@ int lua_Node_isActive(lua_State* state) return 1; } - lua_pushstring(state, "lua_Node_isActive - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_isEnabled - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -3801,7 +3948,7 @@ int lua_Node_isActive(lua_State* state) return 0; } -int lua_Node_isActiveInHierarchy(lua_State* state) +int lua_Node_isEnabledInHierarchy(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -3814,7 +3961,7 @@ int lua_Node_isActiveInHierarchy(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Node* instance = getInstance(state); - bool result = instance->isActiveInHierarchy(); + bool result = instance->isEnabledInHierarchy(); // Push the return value onto the stack. lua_pushboolean(state, result); @@ -3822,7 +3969,7 @@ int lua_Node_isActiveInHierarchy(lua_State* state) return 1; } - lua_pushstring(state, "lua_Node_isActiveInHierarchy - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_isEnabledInHierarchy - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -4019,6 +4166,45 @@ int lua_Node_removeListener(lua_State* state) return 0; } +int lua_Node_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Node* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Node_removeScript - 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; +} + int lua_Node_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -4030,14 +4216,20 @@ int lua_Node_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); Node* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -4636,42 +4828,6 @@ int lua_Node_set(lua_State* state) return 0; } -int lua_Node_setActive(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_TUSERDATA) && - lua_type(state, 2) == LUA_TBOOLEAN) - { - // Get parameter 1 off the stack. - bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); - - Node* instance = getInstance(state); - instance->setActive(param1); - - return 0; - } - - lua_pushstring(state, "lua_Node_setActive - 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; -} - int lua_Node_setAgent(lua_State* state) { // Get the number of parameters. @@ -4889,13 +5045,13 @@ int lua_Node_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1); + void* returnPtr = ((void*)instance->setCollisionObject(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -4922,37 +5078,7 @@ int lua_Node_setCollisionObject(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCollisionObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - } while (0); - - do - { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Properties", false, ¶m1Valid); - if (!param1Valid) - break; - - Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1); + void* returnPtr = ((void*)instance->setCollisionObject(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -4979,11 +5105,11 @@ int lua_Node_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -4992,7 +5118,7 @@ int lua_Node_setCollisionObject(lua_State* state) break; Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5019,12 +5145,12 @@ int lua_Node_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5039,7 +5165,7 @@ int lua_Node_setCollisionObject(lua_State* state) break; Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5066,13 +5192,13 @@ int lua_Node_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5090,7 +5216,7 @@ int lua_Node_setCollisionObject(lua_State* state) int param4 = (int)luaL_checkint(state, 5); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3, param4); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5117,14 +5243,14 @@ int lua_Node_setCollisionObject(lua_State* state) do { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL) && lua_type(state, 5) == LUA_TNUMBER && lua_type(state, 6) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -5145,7 +5271,7 @@ int lua_Node_setCollisionObject(lua_State* state) int param5 = (int)luaL_checkint(state, 6); Node* instance = getInstance(state); - void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3, param4, param5); + void* returnPtr = ((void*)instance->setCollisionObject(param1, *param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5177,7 +5303,7 @@ int lua_Node_setCollisionObject(lua_State* state) return 0; } -int lua_Node_setForm(lua_State* state) +int lua_Node_setDrawable(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5192,20 +5318,20 @@ int lua_Node_setForm(lua_State* state) { // Get parameter 1 off the stack. bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Form", false, ¶m1Valid); + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Drawable", false, ¶m1Valid); if (!param1Valid) { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Form'."); + lua_pushstring(state, "Failed to convert parameter 1 to type 'Drawable'."); lua_error(state); } Node* instance = getInstance(state); - instance->setForm(param1); + instance->setDrawable(param1); return 0; } - lua_pushstring(state, "lua_Node_setForm - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_setDrawable - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5219,7 +5345,7 @@ int lua_Node_setForm(lua_State* state) return 0; } -int lua_Node_setId(lua_State* state) +int lua_Node_setEnabled(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5230,18 +5356,18 @@ int lua_Node_setId(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TBOOLEAN) { // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(2, false); + bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); Node* instance = getInstance(state); - instance->setId(param1); + instance->setEnabled(param1); return 0; } - lua_pushstring(state, "lua_Node_setId - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_setEnabled - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5255,39 +5381,7 @@ int lua_Node_setId(lua_State* state) return 0; } -int lua_Node_setIdentity(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - Node* instance = getInstance(state); - instance->setIdentity(); - - return 0; - } - - lua_pushstring(state, "lua_Node_setIdentity - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_Node_setLight(lua_State* state) +int lua_Node_setId(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5298,24 +5392,18 @@ int lua_Node_setLight(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) { // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Light", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Light'."); - lua_error(state); - } + const char* param1 = gameplay::ScriptUtil::getString(2, false); Node* instance = getInstance(state); - instance->setLight(param1); + instance->setId(param1); return 0; } - lua_pushstring(state, "lua_Node_setLight - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_setId - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5329,7 +5417,7 @@ int lua_Node_setLight(lua_State* state) return 0; } -int lua_Node_setModel(lua_State* state) +int lua_Node_setIdentity(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5337,33 +5425,23 @@ int lua_Node_setModel(lua_State* state) // Attempt to match the parameters to a valid binding. switch (paramCount) { - case 2: + case 1: { - if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + if ((lua_type(state, 1) == LUA_TUSERDATA)) { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Model", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Model'."); - lua_error(state); - } - Node* instance = getInstance(state); - instance->setModel(param1); + instance->setIdentity(); return 0; } - lua_pushstring(state, "lua_Node_setModel - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_setIdentity - 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_pushstring(state, "Invalid number of parameters (expected 1)."); lua_error(state); break; } @@ -5371,7 +5449,7 @@ int lua_Node_setModel(lua_State* state) return 0; } -int lua_Node_setParticleEmitter(lua_State* state) +int lua_Node_setLight(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -5386,20 +5464,20 @@ int lua_Node_setParticleEmitter(lua_State* state) { // Get parameter 1 off the stack. bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ParticleEmitter", false, ¶m1Valid); + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Light", false, ¶m1Valid); if (!param1Valid) { - lua_pushstring(state, "Failed to convert parameter 1 to type 'ParticleEmitter'."); + lua_pushstring(state, "Failed to convert parameter 1 to type 'Light'."); lua_error(state); } Node* instance = getInstance(state); - instance->setParticleEmitter(param1); + instance->setLight(param1); return 0; } - lua_pushstring(state, "lua_Node_setParticleEmitter - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_Node_setLight - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -5786,48 +5864,6 @@ int lua_Node_setTag(lua_State* state) return 0; } -int lua_Node_setTerrain(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_TUSERDATA) && - (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - bool param1Valid; - gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Terrain", false, ¶m1Valid); - if (!param1Valid) - { - lua_pushstring(state, "Failed to convert parameter 1 to type 'Terrain'."); - lua_error(state); - } - - Node* instance = getInstance(state); - instance->setTerrain(param1); - - return 0; - } - - lua_pushstring(state, "lua_Node_setTerrain - 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; -} - int lua_Node_setTranslation(lua_State* state) { // Get the number of parameters. @@ -6007,6 +6043,48 @@ int lua_Node_setTranslationZ(lua_State* state) return 0; } +int lua_Node_setUserObject(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "Ref", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'Ref'."); + lua_error(state); + } + + Node* instance = getInstance(state); + instance->setUserObject(param1); + + return 0; + } + + lua_pushstring(state, "lua_Node_setUserObject - 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; +} + int lua_Node_static_ANIMATE_ROTATE(lua_State* state) { // Validate the number of parameters. @@ -6255,7 +6333,7 @@ int lua_Node_static_create(lua_State* state) { case 0: { - void* returnPtr = (void*)Node::create(); + void* returnPtr = ((void*)Node::create()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -6279,7 +6357,7 @@ int lua_Node_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Node::create(param1); + void* returnPtr = ((void*)Node::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Node.h b/gameplay/src/lua/lua_Node.h index b0f8fbd154..02ea03b56e 100644 --- a/gameplay/src/lua/lua_Node.h +++ b/gameplay/src/lua/lua_Node.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_NODE_H_ #define LUA_NODE_H_ @@ -9,7 +10,9 @@ int lua_Node__gc(lua_State* state); int lua_Node_addChild(lua_State* state); int lua_Node_addListener(lua_State* state); int lua_Node_addRef(lua_State* state); +int lua_Node_addScript(lua_State* state); int lua_Node_addScriptCallback(lua_State* state); +int lua_Node_clearScripts(lua_State* state); int lua_Node_clone(lua_State* state); int lua_Node_createAnimation(lua_State* state); int lua_Node_createAnimationFromBy(lua_State* state); @@ -29,8 +32,8 @@ int lua_Node_getCamera(lua_State* state); int lua_Node_getChildCount(lua_State* state); int lua_Node_getCollisionObject(lua_State* state); int lua_Node_getDownVector(lua_State* state); +int lua_Node_getDrawable(lua_State* state); int lua_Node_getFirstChild(lua_State* state); -int lua_Node_getForm(lua_State* state); int lua_Node_getForwardVector(lua_State* state); int lua_Node_getForwardVectorView(lua_State* state); int lua_Node_getForwardVectorWorld(lua_State* state); @@ -42,10 +45,8 @@ int lua_Node_getInverseViewProjectionMatrix(lua_State* state); int lua_Node_getLeftVector(lua_State* state); int lua_Node_getLight(lua_State* state); int lua_Node_getMatrix(lua_State* state); -int lua_Node_getModel(lua_State* state); int lua_Node_getNextSibling(lua_State* state); int lua_Node_getParent(lua_State* state); -int lua_Node_getParticleEmitter(lua_State* state); int lua_Node_getPreviousSibling(lua_State* state); int lua_Node_getProjectionMatrix(lua_State* state); int lua_Node_getRefCount(lua_State* state); @@ -58,8 +59,8 @@ int lua_Node_getScaleX(lua_State* state); int lua_Node_getScaleY(lua_State* state); int lua_Node_getScaleZ(lua_State* state); int lua_Node_getScene(lua_State* state); +int lua_Node_getScriptEvent(lua_State* state); int lua_Node_getTag(lua_State* state); -int lua_Node_getTerrain(lua_State* state); int lua_Node_getTranslation(lua_State* state); int lua_Node_getTranslationView(lua_State* state); int lua_Node_getTranslationWorld(lua_State* state); @@ -67,21 +68,25 @@ int lua_Node_getTranslationX(lua_State* state); int lua_Node_getTranslationY(lua_State* state); int lua_Node_getTranslationZ(lua_State* state); int lua_Node_getType(lua_State* state); +int lua_Node_getTypeName(lua_State* state); int lua_Node_getUpVector(lua_State* state); int lua_Node_getUpVectorWorld(lua_State* state); +int lua_Node_getUserObject(lua_State* state); int lua_Node_getViewMatrix(lua_State* state); int lua_Node_getViewProjectionMatrix(lua_State* state); int lua_Node_getWorldMatrix(lua_State* state); int lua_Node_getWorldViewMatrix(lua_State* state); int lua_Node_getWorldViewProjectionMatrix(lua_State* state); +int lua_Node_hasScriptListener(lua_State* state); int lua_Node_hasTag(lua_State* state); -int lua_Node_isActive(lua_State* state); -int lua_Node_isActiveInHierarchy(lua_State* state); +int lua_Node_isEnabled(lua_State* state); +int lua_Node_isEnabledInHierarchy(lua_State* state); int lua_Node_isStatic(lua_State* state); int lua_Node_release(lua_State* state); int lua_Node_removeAllChildren(lua_State* state); int lua_Node_removeChild(lua_State* state); int lua_Node_removeListener(lua_State* state); +int lua_Node_removeScript(lua_State* state); int lua_Node_removeScriptCallback(lua_State* state); int lua_Node_rotate(lua_State* state); int lua_Node_rotateX(lua_State* state); @@ -92,29 +97,27 @@ int lua_Node_scaleX(lua_State* state); int lua_Node_scaleY(lua_State* state); int lua_Node_scaleZ(lua_State* state); int lua_Node_set(lua_State* state); -int lua_Node_setActive(lua_State* state); int lua_Node_setAgent(lua_State* state); int lua_Node_setAnimationPropertyValue(lua_State* state); int lua_Node_setAudioSource(lua_State* state); int lua_Node_setCamera(lua_State* state); int lua_Node_setCollisionObject(lua_State* state); -int lua_Node_setForm(lua_State* state); +int lua_Node_setDrawable(lua_State* state); +int lua_Node_setEnabled(lua_State* state); int lua_Node_setId(lua_State* state); int lua_Node_setIdentity(lua_State* state); int lua_Node_setLight(lua_State* state); -int lua_Node_setModel(lua_State* state); -int lua_Node_setParticleEmitter(lua_State* state); int lua_Node_setRotation(lua_State* state); int lua_Node_setScale(lua_State* state); int lua_Node_setScaleX(lua_State* state); int lua_Node_setScaleY(lua_State* state); int lua_Node_setScaleZ(lua_State* state); int lua_Node_setTag(lua_State* state); -int lua_Node_setTerrain(lua_State* state); int lua_Node_setTranslation(lua_State* state); int lua_Node_setTranslationX(lua_State* state); int lua_Node_setTranslationY(lua_State* state); int lua_Node_setTranslationZ(lua_State* state); +int lua_Node_setUserObject(lua_State* state); int lua_Node_static_ANIMATE_ROTATE(lua_State* state); int lua_Node_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state); int lua_Node_static_ANIMATE_SCALE(lua_State* state); diff --git a/gameplay/src/lua/lua_NodeCloneContext.cpp b/gameplay/src/lua/lua_NodeCloneContext.cpp index dae8baab5e..ed98678909 100644 --- a/gameplay/src/lua/lua_NodeCloneContext.cpp +++ b/gameplay/src/lua/lua_NodeCloneContext.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_NodeCloneContext.h" @@ -5,8 +6,11 @@ #include "AnimationTarget.h" #include "AudioSource.h" #include "Base.h" +#include "Drawable.h" +#include "Form.h" #include "Game.h" #include "Joint.h" +#include "MaterialParameter.h" #include "Node.h" #include "PhysicsCharacter.h" #include "PhysicsGhostObject.h" @@ -19,9 +23,6 @@ #include "ScriptTarget.h" #include "Terrain.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_NodeType.h" -#include "lua_PhysicsCollisionObjectType.h" namespace gameplay { @@ -97,7 +98,7 @@ int lua_NodeCloneContext__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new NodeCloneContext(); + void* returnPtr = ((void*)new NodeCloneContext()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -147,7 +148,7 @@ int lua_NodeCloneContext_findClonedAnimation(lua_State* state) } NodeCloneContext* instance = getInstance(state); - void* returnPtr = (void*)instance->findClonedAnimation(param1); + void* returnPtr = ((void*)instance->findClonedAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -201,7 +202,7 @@ int lua_NodeCloneContext_findClonedNode(lua_State* state) } NodeCloneContext* instance = getInstance(state); - void* returnPtr = (void*)instance->findClonedNode(param1); + void* returnPtr = ((void*)instance->findClonedNode(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_NodeCloneContext.h b/gameplay/src/lua/lua_NodeCloneContext.h index 534aef1012..62292a66f1 100644 --- a/gameplay/src/lua/lua_NodeCloneContext.h +++ b/gameplay/src/lua/lua_NodeCloneContext.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_NODECLONECONTEXT_H_ #define LUA_NODECLONECONTEXT_H_ diff --git a/gameplay/src/lua/lua_NodeType.cpp b/gameplay/src/lua/lua_NodeType.cpp deleted file mode 100644 index 8081d0f854..0000000000 --- a/gameplay/src/lua/lua_NodeType.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_NodeType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_NodeType_NODE = "NODE"; -static const char* luaEnumString_NodeType_JOINT = "JOINT"; - -Node::Type lua_enumFromString_NodeType(const char* s) -{ - if (strcmp(s, luaEnumString_NodeType_NODE) == 0) - return Node::NODE; - if (strcmp(s, luaEnumString_NodeType_JOINT) == 0) - return Node::JOINT; - return Node::NODE; -} - -const char* lua_stringFromEnum_NodeType(Node::Type e) -{ - if (e == Node::NODE) - return luaEnumString_NodeType_NODE; - if (e == Node::JOINT) - return luaEnumString_NodeType_JOINT; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_NodeType.h b/gameplay/src/lua/lua_NodeType.h deleted file mode 100644 index c0688a21cf..0000000000 --- a/gameplay/src/lua/lua_NodeType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_NODETYPE_H_ -#define LUA_NODETYPE_H_ - -#include "Node.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Node::Type. -Node::Type lua_enumFromString_NodeType(const char* s); -const char* lua_stringFromEnum_NodeType(Node::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_ParticleEmitter.cpp b/gameplay/src/lua/lua_ParticleEmitter.cpp index 409c98706d..7bfec6fb77 100644 --- a/gameplay/src/lua/lua_ParticleEmitter.cpp +++ b/gameplay/src/lua/lua_ParticleEmitter.cpp @@ -1,7 +1,9 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_ParticleEmitter.h" #include "Base.h" +#include "Drawable.h" #include "Game.h" #include "Node.h" #include "ParticleEmitter.h" @@ -9,7 +11,6 @@ #include "Quaternion.h" #include "Ref.h" #include "Scene.h" -#include "lua_ParticleEmitterTextureBlending.h" namespace gameplay { @@ -19,11 +20,11 @@ void luaRegister_ParticleEmitter() const luaL_Reg lua_members[] = { {"addRef", lua_ParticleEmitter_addRef}, - {"clone", lua_ParticleEmitter_clone}, {"draw", lua_ParticleEmitter_draw}, {"emitOnce", lua_ParticleEmitter_emitOnce}, {"getAcceleration", lua_ParticleEmitter_getAcceleration}, {"getAccelerationVariance", lua_ParticleEmitter_getAccelerationVariance}, + {"getBlendMode", lua_ParticleEmitter_getBlendMode}, {"getColorEnd", lua_ParticleEmitter_getColorEnd}, {"getColorEndVariance", lua_ParticleEmitter_getColorEndVariance}, {"getColorStart", lua_ParticleEmitter_getColorStart}, @@ -56,7 +57,6 @@ void luaRegister_ParticleEmitter() {"getSpriteHeight", lua_ParticleEmitter_getSpriteHeight}, {"getSpriteWidth", lua_ParticleEmitter_getSpriteWidth}, {"getTexture", lua_ParticleEmitter_getTexture}, - {"getTextureBlending", lua_ParticleEmitter_getTextureBlending}, {"getVelocity", lua_ParticleEmitter_getVelocity}, {"getVelocityVariance", lua_ParticleEmitter_getVelocityVariance}, {"isActive", lua_ParticleEmitter_isActive}, @@ -66,6 +66,7 @@ void luaRegister_ParticleEmitter() {"isStarted", lua_ParticleEmitter_isStarted}, {"release", lua_ParticleEmitter_release}, {"setAcceleration", lua_ParticleEmitter_setAcceleration}, + {"setBlendMode", lua_ParticleEmitter_setBlendMode}, {"setColor", lua_ParticleEmitter_setColor}, {"setEllipsoid", lua_ParticleEmitter_setEllipsoid}, {"setEmissionRate", lua_ParticleEmitter_setEmissionRate}, @@ -83,7 +84,6 @@ void luaRegister_ParticleEmitter() {"setSpriteLooped", lua_ParticleEmitter_setSpriteLooped}, {"setSpriteTexCoords", lua_ParticleEmitter_setSpriteTexCoords}, {"setTexture", lua_ParticleEmitter_setTexture}, - {"setTextureBlending", lua_ParticleEmitter_setTextureBlending}, {"setVelocity", lua_ParticleEmitter_setVelocity}, {"start", lua_ParticleEmitter_start}, {"stop", lua_ParticleEmitter_stop}, @@ -93,7 +93,6 @@ void luaRegister_ParticleEmitter() const luaL_Reg lua_statics[] = { {"create", lua_ParticleEmitter_static_create}, - {"getTextureBlendingFromString", lua_ParticleEmitter_static_getTextureBlendingFromString}, {NULL, NULL} }; std::vector scopePath; @@ -178,7 +177,7 @@ int lua_ParticleEmitter_addRef(lua_State* state) return 0; } -int lua_ParticleEmitter_clone(lua_State* state) +int lua_ParticleEmitter_draw(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -191,51 +190,28 @@ int lua_ParticleEmitter_clone(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ParticleEmitter* instance = getInstance(state); - void* returnPtr = (void*)instance->clone(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "ParticleEmitter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } + unsigned int result = instance->draw(); + + // Push the return value onto the stack. + lua_pushunsigned(state, result); return 1; } - lua_pushstring(state, "lua_ParticleEmitter_clone - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "lua_ParticleEmitter_draw - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } - } - return 0; -} - -int lua_ParticleEmitter_draw(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 1: + case 2: { - if ((lua_type(state, 1) == LUA_TUSERDATA)) + if ((lua_type(state, 1) == LUA_TUSERDATA) && + lua_type(state, 2) == LUA_TBOOLEAN) { + // Get parameter 1 off the stack. + bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2); + ParticleEmitter* instance = getInstance(state); - unsigned int result = instance->draw(); + unsigned int result = instance->draw(param1); // Push the return value onto the stack. lua_pushunsigned(state, result); @@ -249,7 +225,7 @@ int lua_ParticleEmitter_draw(lua_State* state) } default: { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_pushstring(state, "Invalid number of parameters (expected 1 or 2)."); lua_error(state); break; } @@ -381,6 +357,41 @@ int lua_ParticleEmitter_getAccelerationVariance(lua_State* state) return 0; } +int lua_ParticleEmitter_getBlendMode(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + ParticleEmitter* instance = getInstance(state); + ParticleEmitter::BlendMode result = instance->getBlendMode(); + + // Push the return value onto the stack. + lua_pushnumber(state, (int)result); + + return 1; + } + + lua_pushstring(state, "lua_ParticleEmitter_getBlendMode - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_ParticleEmitter_getColorEnd(lua_State* state) { // Get the number of parameters. @@ -675,7 +686,7 @@ int lua_ParticleEmitter_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ParticleEmitter* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1560,7 +1571,7 @@ int lua_ParticleEmitter_getTexture(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { ParticleEmitter* instance = getInstance(state); - void* returnPtr = (void*)instance->getTexture(); + void* returnPtr = ((void*)instance->getTexture()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1591,41 +1602,6 @@ int lua_ParticleEmitter_getTexture(lua_State* state) return 0; } -int lua_ParticleEmitter_getTextureBlending(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - ParticleEmitter* instance = getInstance(state); - ParticleEmitter::TextureBlending result = instance->getTextureBlending(); - - // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ParticleEmitterTextureBlending(result)); - - return 1; - } - - lua_pushstring(state, "lua_ParticleEmitter_getTextureBlending - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_ParticleEmitter_getVelocity(lua_State* state) { // Get the number of parameters. @@ -1973,6 +1949,42 @@ int lua_ParticleEmitter_setAcceleration(lua_State* state) return 0; } +int lua_ParticleEmitter_setBlendMode(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_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER) + { + // Get parameter 1 off the stack. + ParticleEmitter::BlendMode param1 = (ParticleEmitter::BlendMode)luaL_checkint(state, 2); + + ParticleEmitter* instance = getInstance(state); + instance->setBlendMode(param1); + + return 0; + } + + lua_pushstring(state, "lua_ParticleEmitter_setBlendMode - 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; +} + int lua_ParticleEmitter_setColor(lua_State* state) { // Get the number of parameters. @@ -2710,13 +2722,13 @@ int lua_ParticleEmitter_setTexture(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - ParticleEmitter::TextureBlending param2 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 3)); + ParticleEmitter::BlendMode param2 = (ParticleEmitter::BlendMode)luaL_checkint(state, 3); ParticleEmitter* instance = getInstance(state); instance->setTexture(param1, param2); @@ -2729,7 +2741,7 @@ int lua_ParticleEmitter_setTexture(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. bool param1Valid; @@ -2738,7 +2750,7 @@ int lua_ParticleEmitter_setTexture(lua_State* state) break; // Get parameter 2 off the stack. - ParticleEmitter::TextureBlending param2 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 3)); + ParticleEmitter::BlendMode param2 = (ParticleEmitter::BlendMode)luaL_checkint(state, 3); ParticleEmitter* instance = getInstance(state); instance->setTexture(param1, param2); @@ -2761,42 +2773,6 @@ int lua_ParticleEmitter_setTexture(lua_State* state) return 0; } -int lua_ParticleEmitter_setTextureBlending(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_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - ParticleEmitter::TextureBlending param1 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 2)); - - ParticleEmitter* instance = getInstance(state); - instance->setTextureBlending(param1); - - return 0; - } - - lua_pushstring(state, "lua_ParticleEmitter_setTextureBlending - 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; -} - int lua_ParticleEmitter_setVelocity(lua_State* state) { // Get the number of parameters. @@ -2898,7 +2874,7 @@ int lua_ParticleEmitter_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)ParticleEmitter::create(param1); + void* returnPtr = ((void*)ParticleEmitter::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2926,7 +2902,7 @@ int lua_ParticleEmitter_static_create(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)ParticleEmitter::create(param1); + void* returnPtr = ((void*)ParticleEmitter::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2953,19 +2929,19 @@ int lua_ParticleEmitter_static_create(lua_State* state) do { if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); // Get parameter 2 off the stack. - ParticleEmitter::TextureBlending param2 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 2)); + ParticleEmitter::BlendMode param2 = (ParticleEmitter::BlendMode)luaL_checkint(state, 2); // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 3); - void* returnPtr = (void*)ParticleEmitter::create(param1, param2, param3); + void* returnPtr = ((void*)ParticleEmitter::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2997,43 +2973,6 @@ int lua_ParticleEmitter_static_create(lua_State* state) return 0; } -int lua_ParticleEmitter_static_getTextureBlendingFromString(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 1: - { - if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL)) - { - // Get parameter 1 off the stack. - const char* param1 = gameplay::ScriptUtil::getString(1, false); - - ParticleEmitter::TextureBlending result = ParticleEmitter::getTextureBlendingFromString(param1); - - // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ParticleEmitterTextureBlending(result)); - - return 1; - } - - lua_pushstring(state, "lua_ParticleEmitter_static_getTextureBlendingFromString - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_ParticleEmitter_stop(lua_State* state) { // Get the number of parameters. diff --git a/gameplay/src/lua/lua_ParticleEmitter.h b/gameplay/src/lua/lua_ParticleEmitter.h index f25cab3e14..b33201fc82 100644 --- a/gameplay/src/lua/lua_ParticleEmitter.h +++ b/gameplay/src/lua/lua_ParticleEmitter.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PARTICLEEMITTER_H_ #define LUA_PARTICLEEMITTER_H_ @@ -7,11 +8,11 @@ namespace gameplay // Lua bindings for ParticleEmitter. int lua_ParticleEmitter__gc(lua_State* state); int lua_ParticleEmitter_addRef(lua_State* state); -int lua_ParticleEmitter_clone(lua_State* state); int lua_ParticleEmitter_draw(lua_State* state); int lua_ParticleEmitter_emitOnce(lua_State* state); int lua_ParticleEmitter_getAcceleration(lua_State* state); int lua_ParticleEmitter_getAccelerationVariance(lua_State* state); +int lua_ParticleEmitter_getBlendMode(lua_State* state); int lua_ParticleEmitter_getColorEnd(lua_State* state); int lua_ParticleEmitter_getColorEndVariance(lua_State* state); int lua_ParticleEmitter_getColorStart(lua_State* state); @@ -44,7 +45,6 @@ int lua_ParticleEmitter_getSpriteFrameRandomOffset(lua_State* state); int lua_ParticleEmitter_getSpriteHeight(lua_State* state); int lua_ParticleEmitter_getSpriteWidth(lua_State* state); int lua_ParticleEmitter_getTexture(lua_State* state); -int lua_ParticleEmitter_getTextureBlending(lua_State* state); int lua_ParticleEmitter_getVelocity(lua_State* state); int lua_ParticleEmitter_getVelocityVariance(lua_State* state); int lua_ParticleEmitter_isActive(lua_State* state); @@ -54,6 +54,7 @@ int lua_ParticleEmitter_isSpriteLooped(lua_State* state); int lua_ParticleEmitter_isStarted(lua_State* state); int lua_ParticleEmitter_release(lua_State* state); int lua_ParticleEmitter_setAcceleration(lua_State* state); +int lua_ParticleEmitter_setBlendMode(lua_State* state); int lua_ParticleEmitter_setColor(lua_State* state); int lua_ParticleEmitter_setEllipsoid(lua_State* state); int lua_ParticleEmitter_setEmissionRate(lua_State* state); @@ -71,11 +72,9 @@ int lua_ParticleEmitter_setSpriteFrameRandomOffset(lua_State* state); int lua_ParticleEmitter_setSpriteLooped(lua_State* state); int lua_ParticleEmitter_setSpriteTexCoords(lua_State* state); int lua_ParticleEmitter_setTexture(lua_State* state); -int lua_ParticleEmitter_setTextureBlending(lua_State* state); int lua_ParticleEmitter_setVelocity(lua_State* state); int lua_ParticleEmitter_start(lua_State* state); int lua_ParticleEmitter_static_create(lua_State* state); -int lua_ParticleEmitter_static_getTextureBlendingFromString(lua_State* state); int lua_ParticleEmitter_stop(lua_State* state); int lua_ParticleEmitter_update(lua_State* state); diff --git a/gameplay/src/lua/lua_ParticleEmitterTextureBlending.cpp b/gameplay/src/lua/lua_ParticleEmitterTextureBlending.cpp deleted file mode 100644 index bb0f9580a5..0000000000 --- a/gameplay/src/lua/lua_ParticleEmitterTextureBlending.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "Base.h" -#include "lua_ParticleEmitterTextureBlending.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_ParticleEmitterTextureBlending_BLEND_OPAQUE = "BLEND_OPAQUE"; -static const char* luaEnumString_ParticleEmitterTextureBlending_BLEND_TRANSPARENT = "BLEND_TRANSPARENT"; -static const char* luaEnumString_ParticleEmitterTextureBlending_BLEND_ADDITIVE = "BLEND_ADDITIVE"; -static const char* luaEnumString_ParticleEmitterTextureBlending_BLEND_MULTIPLIED = "BLEND_MULTIPLIED"; - -ParticleEmitter::TextureBlending lua_enumFromString_ParticleEmitterTextureBlending(const char* s) -{ - if (strcmp(s, luaEnumString_ParticleEmitterTextureBlending_BLEND_OPAQUE) == 0) - return ParticleEmitter::BLEND_OPAQUE; - if (strcmp(s, luaEnumString_ParticleEmitterTextureBlending_BLEND_TRANSPARENT) == 0) - return ParticleEmitter::BLEND_TRANSPARENT; - if (strcmp(s, luaEnumString_ParticleEmitterTextureBlending_BLEND_ADDITIVE) == 0) - return ParticleEmitter::BLEND_ADDITIVE; - if (strcmp(s, luaEnumString_ParticleEmitterTextureBlending_BLEND_MULTIPLIED) == 0) - return ParticleEmitter::BLEND_MULTIPLIED; - return ParticleEmitter::BLEND_OPAQUE; -} - -const char* lua_stringFromEnum_ParticleEmitterTextureBlending(ParticleEmitter::TextureBlending e) -{ - if (e == ParticleEmitter::BLEND_OPAQUE) - return luaEnumString_ParticleEmitterTextureBlending_BLEND_OPAQUE; - if (e == ParticleEmitter::BLEND_TRANSPARENT) - return luaEnumString_ParticleEmitterTextureBlending_BLEND_TRANSPARENT; - if (e == ParticleEmitter::BLEND_ADDITIVE) - return luaEnumString_ParticleEmitterTextureBlending_BLEND_ADDITIVE; - if (e == ParticleEmitter::BLEND_MULTIPLIED) - return luaEnumString_ParticleEmitterTextureBlending_BLEND_MULTIPLIED; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_ParticleEmitterTextureBlending.h b/gameplay/src/lua/lua_ParticleEmitterTextureBlending.h deleted file mode 100644 index a852eeb92d..0000000000 --- a/gameplay/src/lua/lua_ParticleEmitterTextureBlending.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_PARTICLEEMITTERTEXTUREBLENDING_H_ -#define LUA_PARTICLEEMITTERTEXTUREBLENDING_H_ - -#include "ParticleEmitter.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for ParticleEmitter::TextureBlending. -ParticleEmitter::TextureBlending lua_enumFromString_ParticleEmitterTextureBlending(const char* s); -const char* lua_stringFromEnum_ParticleEmitterTextureBlending(ParticleEmitter::TextureBlending e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Pass.cpp b/gameplay/src/lua/lua_Pass.cpp index bd4025d7c8..e62ca888dd 100644 --- a/gameplay/src/lua/lua_Pass.cpp +++ b/gameplay/src/lua/lua_Pass.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Pass.h" @@ -10,13 +11,6 @@ #include "RenderState.h" #include "Scene.h" #include "Technique.h" -#include "lua_RenderStateAutoBinding.h" -#include "lua_RenderStateBlend.h" -#include "lua_RenderStateCullFaceSide.h" -#include "lua_RenderStateDepthFunction.h" -#include "lua_RenderStateFrontFace.h" -#include "lua_RenderStateStencilFunction.h" -#include "lua_RenderStateStencilOperation.h" namespace gameplay { @@ -215,7 +209,7 @@ int lua_Pass_getEffect(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Pass* instance = getInstance(state); - void* returnPtr = (void*)instance->getEffect(); + void* returnPtr = ((void*)instance->getEffect()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -298,7 +292,7 @@ int lua_Pass_getParameter(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Pass* instance = getInstance(state); - void* returnPtr = (void*)instance->getParameter(param1); + void* returnPtr = ((void*)instance->getParameter(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -346,7 +340,7 @@ int lua_Pass_getParameterByIndex(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); Pass* instance = getInstance(state); - void* returnPtr = (void*)instance->getParameterByIndex(param1); + void* returnPtr = ((void*)instance->getParameterByIndex(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -460,7 +454,7 @@ int lua_Pass_getStateBlock(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Pass* instance = getInstance(state); - void* returnPtr = (void*)instance->getStateBlock(); + void* returnPtr = ((void*)instance->getStateBlock()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -504,7 +498,7 @@ int lua_Pass_getVertexAttributeBinding(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Pass* instance = getInstance(state); - void* returnPtr = (void*)instance->getVertexAttributeBinding(); + void* returnPtr = ((void*)instance->getVertexAttributeBinding()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -659,13 +653,13 @@ int lua_Pass_setParameterAutoBinding(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - RenderState::AutoBinding param2 = (RenderState::AutoBinding)lua_enumFromString_RenderStateAutoBinding(luaL_checkstring(state, 3)); + RenderState::AutoBinding param2 = (RenderState::AutoBinding)luaL_checkint(state, 3); Pass* instance = getInstance(state); instance->setParameterAutoBinding(param1, param2); diff --git a/gameplay/src/lua/lua_Pass.h b/gameplay/src/lua/lua_Pass.h index b7463cfdda..190756dbae 100644 --- a/gameplay/src/lua/lua_Pass.h +++ b/gameplay/src/lua/lua_Pass.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PASS_H_ #define LUA_PASS_H_ diff --git a/gameplay/src/lua/lua_PhysicsCharacter.cpp b/gameplay/src/lua/lua_PhysicsCharacter.cpp index 571569137b..7081252534 100644 --- a/gameplay/src/lua/lua_PhysicsCharacter.cpp +++ b/gameplay/src/lua/lua_PhysicsCharacter.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsCharacter.h" @@ -5,6 +6,7 @@ #include "AnimationTarget.h" #include "Base.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "PhysicsCharacter.h" #include "PhysicsCollisionObject.h" @@ -17,10 +19,6 @@ #include "ScriptController.h" #include "ScriptTarget.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -30,11 +28,6 @@ void luaRegister_PhysicsCharacter() const luaL_Reg lua_members[] = { {"addCollisionListener", lua_PhysicsCharacter_addCollisionListener}, - {"asCharacter", lua_PhysicsCharacter_asCharacter}, - {"asGhostObject", lua_PhysicsCharacter_asGhostObject}, - {"asRigidBody", lua_PhysicsCharacter_asRigidBody}, - {"asVehicle", lua_PhysicsCharacter_asVehicle}, - {"asVehicleWheel", lua_PhysicsCharacter_asVehicleWheel}, {"collidesWith", lua_PhysicsCharacter_collidesWith}, {"getCollisionShape", lua_PhysicsCharacter_getCollisionShape}, {"getCurrentVelocity", lua_PhysicsCharacter_getCurrentVelocity}, @@ -50,6 +43,7 @@ void luaRegister_PhysicsCharacter() {"isStatic", lua_PhysicsCharacter_isStatic}, {"jump", lua_PhysicsCharacter_jump}, {"removeCollisionListener", lua_PhysicsCharacter_removeCollisionListener}, + {"resetVelocityState", lua_PhysicsCharacter_resetVelocityState}, {"rotate", lua_PhysicsCharacter_rotate}, {"setEnabled", lua_PhysicsCharacter_setEnabled}, {"setForwardVelocity", lua_PhysicsCharacter_setForwardVelocity}, @@ -185,226 +179,6 @@ int lua_PhysicsCharacter_addCollisionListener(lua_State* state) return 0; } -int lua_PhysicsCharacter_asCharacter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->asCharacter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCharacter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCharacter_asCharacter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCharacter_asGhostObject(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->asGhostObject(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsGhostObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCharacter_asGhostObject - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCharacter_asRigidBody(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->asRigidBody(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsRigidBody"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCharacter_asRigidBody - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCharacter_asVehicle(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicle(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicle"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCharacter_asVehicle - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCharacter_asVehicleWheel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicleWheel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicleWheel"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCharacter_asVehicleWheel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsCharacter_collidesWith(lua_State* state) { // Get the number of parameters. @@ -463,7 +237,7 @@ int lua_PhysicsCharacter_getCollisionShape(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionShape(); + void* returnPtr = ((void*)instance->getCollisionShape()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -621,7 +395,7 @@ int lua_PhysicsCharacter_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsCharacter* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -668,7 +442,7 @@ int lua_PhysicsCharacter_getShapeType(lua_State* state) PhysicsCollisionShape::Type result = instance->getShapeType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -703,7 +477,7 @@ int lua_PhysicsCharacter_getType(lua_State* state) PhysicsCollisionObject::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionObjectType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -923,9 +697,31 @@ int lua_PhysicsCharacter_jump(lua_State* state) lua_error(state); break; } + case 3: + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + lua_type(state, 2) == LUA_TNUMBER && + lua_type(state, 3) == LUA_TBOOLEAN) + { + // Get parameter 1 off the stack. + float param1 = (float)luaL_checknumber(state, 2); + + // Get parameter 2 off the stack. + bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + + PhysicsCharacter* instance = getInstance(state); + instance->jump(param1, param2); + + return 0; + } + + lua_pushstring(state, "lua_PhysicsCharacter_jump - 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_pushstring(state, "Invalid number of parameters (expected 2 or 3)."); lua_error(state); break; } @@ -1043,6 +839,38 @@ int lua_PhysicsCharacter_removeCollisionListener(lua_State* state) return 0; } +int lua_PhysicsCharacter_resetVelocityState(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + PhysicsCharacter* instance = getInstance(state); + instance->resetVelocityState(); + + return 0; + } + + lua_pushstring(state, "lua_PhysicsCharacter_resetVelocityState - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_PhysicsCharacter_rotate(lua_State* state) { // Get the number of parameters. diff --git a/gameplay/src/lua/lua_PhysicsCharacter.h b/gameplay/src/lua/lua_PhysicsCharacter.h index 2d534419a5..4033cc22ae 100644 --- a/gameplay/src/lua/lua_PhysicsCharacter.h +++ b/gameplay/src/lua/lua_PhysicsCharacter.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCHARACTER_H_ #define LUA_PHYSICSCHARACTER_H_ @@ -6,11 +7,6 @@ namespace gameplay // Lua bindings for PhysicsCharacter. int lua_PhysicsCharacter_addCollisionListener(lua_State* state); -int lua_PhysicsCharacter_asCharacter(lua_State* state); -int lua_PhysicsCharacter_asGhostObject(lua_State* state); -int lua_PhysicsCharacter_asRigidBody(lua_State* state); -int lua_PhysicsCharacter_asVehicle(lua_State* state); -int lua_PhysicsCharacter_asVehicleWheel(lua_State* state); int lua_PhysicsCharacter_collidesWith(lua_State* state); int lua_PhysicsCharacter_getCollisionShape(lua_State* state); int lua_PhysicsCharacter_getCurrentVelocity(lua_State* state); @@ -26,6 +22,7 @@ int lua_PhysicsCharacter_isPhysicsEnabled(lua_State* state); int lua_PhysicsCharacter_isStatic(lua_State* state); int lua_PhysicsCharacter_jump(lua_State* state); int lua_PhysicsCharacter_removeCollisionListener(lua_State* state); +int lua_PhysicsCharacter_resetVelocityState(lua_State* state); int lua_PhysicsCharacter_rotate(lua_State* state); int lua_PhysicsCharacter_setEnabled(lua_State* state); int lua_PhysicsCharacter_setForwardVelocity(lua_State* state); diff --git a/gameplay/src/lua/lua_PhysicsCollisionObject.cpp b/gameplay/src/lua/lua_PhysicsCollisionObject.cpp index 78a5d3b4a4..02d7b5ee05 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionObject.cpp +++ b/gameplay/src/lua/lua_PhysicsCollisionObject.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsCollisionObject.h" @@ -12,9 +13,6 @@ #include "PhysicsVehicle.h" #include "PhysicsVehicleWheel.h" #include "ScriptController.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -24,11 +22,6 @@ void luaRegister_PhysicsCollisionObject() const luaL_Reg lua_members[] = { {"addCollisionListener", lua_PhysicsCollisionObject_addCollisionListener}, - {"asCharacter", lua_PhysicsCollisionObject_asCharacter}, - {"asGhostObject", lua_PhysicsCollisionObject_asGhostObject}, - {"asRigidBody", lua_PhysicsCollisionObject_asRigidBody}, - {"asVehicle", lua_PhysicsCollisionObject_asVehicle}, - {"asVehicleWheel", lua_PhysicsCollisionObject_asVehicleWheel}, {"collidesWith", lua_PhysicsCollisionObject_collidesWith}, {"getCollisionShape", lua_PhysicsCollisionObject_getCollisionShape}, {"getNode", lua_PhysicsCollisionObject_getNode}, @@ -203,226 +196,6 @@ int lua_PhysicsCollisionObject_addCollisionListener(lua_State* state) return 0; } -int lua_PhysicsCollisionObject_asCharacter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asCharacter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCharacter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCollisionObject_asCharacter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCollisionObject_asGhostObject(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asGhostObject(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsGhostObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCollisionObject_asGhostObject - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCollisionObject_asRigidBody(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asRigidBody(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsRigidBody"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCollisionObject_asRigidBody - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCollisionObject_asVehicle(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicle(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicle"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCollisionObject_asVehicle - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsCollisionObject_asVehicleWheel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicleWheel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicleWheel"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsCollisionObject_asVehicleWheel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsCollisionObject_collidesWith(lua_State* state) { // Get the number of parameters. @@ -481,7 +254,7 @@ int lua_PhysicsCollisionObject_getCollisionShape(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionShape(); + void* returnPtr = ((void*)instance->getCollisionShape()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -525,7 +298,7 @@ int lua_PhysicsCollisionObject_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsCollisionObject* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -572,7 +345,7 @@ int lua_PhysicsCollisionObject_getShapeType(lua_State* state) PhysicsCollisionShape::Type result = instance->getShapeType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -607,7 +380,7 @@ int lua_PhysicsCollisionObject_getType(lua_State* state) PhysicsCollisionObject::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionObjectType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_PhysicsCollisionObject.h b/gameplay/src/lua/lua_PhysicsCollisionObject.h index ae1bd34d03..bd80cc6e1e 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionObject.h +++ b/gameplay/src/lua/lua_PhysicsCollisionObject.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCOLLISIONOBJECT_H_ #define LUA_PHYSICSCOLLISIONOBJECT_H_ @@ -7,11 +8,6 @@ namespace gameplay // Lua bindings for PhysicsCollisionObject. int lua_PhysicsCollisionObject__gc(lua_State* state); int lua_PhysicsCollisionObject_addCollisionListener(lua_State* state); -int lua_PhysicsCollisionObject_asCharacter(lua_State* state); -int lua_PhysicsCollisionObject_asGhostObject(lua_State* state); -int lua_PhysicsCollisionObject_asRigidBody(lua_State* state); -int lua_PhysicsCollisionObject_asVehicle(lua_State* state); -int lua_PhysicsCollisionObject_asVehicleWheel(lua_State* state); int lua_PhysicsCollisionObject_collidesWith(lua_State* state); int lua_PhysicsCollisionObject_getCollisionShape(lua_State* state); int lua_PhysicsCollisionObject_getNode(lua_State* state); diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.cpp b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.cpp index 160c436832..26784d60a3 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.cpp +++ b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsCollisionObjectCollisionListener.h" @@ -12,9 +13,6 @@ #include "PhysicsVehicle.h" #include "PhysicsVehicleWheel.h" #include "ScriptController.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -89,11 +87,11 @@ int lua_PhysicsCollisionObjectCollisionListener_collisionEvent(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::CollisionListener::EventType param1 = (PhysicsCollisionObject::CollisionListener::EventType)lua_enumFromString_PhysicsCollisionObjectCollisionListenerEventType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::CollisionListener::EventType param1 = (PhysicsCollisionObject::CollisionListener::EventType)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -117,12 +115,12 @@ int lua_PhysicsCollisionObjectCollisionListener_collisionEvent(lua_State* state) case 4: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::CollisionListener::EventType param1 = (PhysicsCollisionObject::CollisionListener::EventType)lua_enumFromString_PhysicsCollisionObjectCollisionListenerEventType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::CollisionListener::EventType param1 = (PhysicsCollisionObject::CollisionListener::EventType)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; @@ -155,13 +153,13 @@ int lua_PhysicsCollisionObjectCollisionListener_collisionEvent(lua_State* state) case 5: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) && (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) && (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL)) { // Get parameter 1 off the stack. - PhysicsCollisionObject::CollisionListener::EventType param1 = (PhysicsCollisionObject::CollisionListener::EventType)lua_enumFromString_PhysicsCollisionObjectCollisionListenerEventType(luaL_checkstring(state, 2)); + PhysicsCollisionObject::CollisionListener::EventType param1 = (PhysicsCollisionObject::CollisionListener::EventType)luaL_checkint(state, 2); // Get parameter 2 off the stack. bool param2Valid; diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.h b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.h index 7ef6a6884e..b3d4425025 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.h +++ b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCOLLISIONOBJECTCOLLISIONLISTENER_H_ #define LUA_PHYSICSCOLLISIONOBJECTCOLLISIONLISTENER_H_ diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.cpp b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.cpp deleted file mode 100644 index f94157e65a..0000000000 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_PhysicsCollisionObjectCollisionListenerEventType_COLLIDING = "COLLIDING"; -static const char* luaEnumString_PhysicsCollisionObjectCollisionListenerEventType_NOT_COLLIDING = "NOT_COLLIDING"; - -PhysicsCollisionObject::CollisionListener::EventType lua_enumFromString_PhysicsCollisionObjectCollisionListenerEventType(const char* s) -{ - if (strcmp(s, luaEnumString_PhysicsCollisionObjectCollisionListenerEventType_COLLIDING) == 0) - return PhysicsCollisionObject::CollisionListener::COLLIDING; - if (strcmp(s, luaEnumString_PhysicsCollisionObjectCollisionListenerEventType_NOT_COLLIDING) == 0) - return PhysicsCollisionObject::CollisionListener::NOT_COLLIDING; - return PhysicsCollisionObject::CollisionListener::COLLIDING; -} - -const char* lua_stringFromEnum_PhysicsCollisionObjectCollisionListenerEventType(PhysicsCollisionObject::CollisionListener::EventType e) -{ - if (e == PhysicsCollisionObject::CollisionListener::COLLIDING) - return luaEnumString_PhysicsCollisionObjectCollisionListenerEventType_COLLIDING; - if (e == PhysicsCollisionObject::CollisionListener::NOT_COLLIDING) - return luaEnumString_PhysicsCollisionObjectCollisionListenerEventType_NOT_COLLIDING; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.h b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.h deleted file mode 100644 index 13b2e54d19..0000000000 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionListenerEventType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_PHYSICSCOLLISIONOBJECTCOLLISIONLISTENEREVENTTYPE_H_ -#define LUA_PHYSICSCOLLISIONOBJECTCOLLISIONLISTENEREVENTTYPE_H_ - -#include "PhysicsCollisionObject.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for PhysicsCollisionObject::CollisionListener::EventType. -PhysicsCollisionObject::CollisionListener::EventType lua_enumFromString_PhysicsCollisionObjectCollisionListenerEventType(const char* s); -const char* lua_stringFromEnum_PhysicsCollisionObjectCollisionListenerEventType(PhysicsCollisionObject::CollisionListener::EventType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.cpp b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.cpp index 72d7d2be80..616df68ea6 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.cpp +++ b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsCollisionObjectCollisionPair.h" @@ -12,9 +13,6 @@ #include "PhysicsVehicle.h" #include "PhysicsVehicleWheel.h" #include "ScriptController.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -110,7 +108,7 @@ int lua_PhysicsCollisionObjectCollisionPair__init(lua_State* state) lua_error(state); } - void* returnPtr = (void*)new PhysicsCollisionObject::CollisionPair(param1, param2); + void* returnPtr = ((void*)new PhysicsCollisionObject::CollisionPair(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.h b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.h index e65b7605c5..4efacb0644 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.h +++ b/gameplay/src/lua/lua_PhysicsCollisionObjectCollisionPair.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCOLLISIONOBJECTCOLLISIONPAIR_H_ #define LUA_PHYSICSCOLLISIONOBJECTCOLLISIONPAIR_H_ diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectType.cpp b/gameplay/src/lua/lua_PhysicsCollisionObjectType.cpp deleted file mode 100644 index b01dda59a3..0000000000 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectType.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "Base.h" -#include "lua_PhysicsCollisionObjectType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_PhysicsCollisionObjectType_RIGID_BODY = "RIGID_BODY"; -static const char* luaEnumString_PhysicsCollisionObjectType_CHARACTER = "CHARACTER"; -static const char* luaEnumString_PhysicsCollisionObjectType_GHOST_OBJECT = "GHOST_OBJECT"; -static const char* luaEnumString_PhysicsCollisionObjectType_VEHICLE = "VEHICLE"; -static const char* luaEnumString_PhysicsCollisionObjectType_VEHICLE_WHEEL = "VEHICLE_WHEEL"; -static const char* luaEnumString_PhysicsCollisionObjectType_NONE = "NONE"; - -PhysicsCollisionObject::Type lua_enumFromString_PhysicsCollisionObjectType(const char* s) -{ - if (strcmp(s, luaEnumString_PhysicsCollisionObjectType_RIGID_BODY) == 0) - return PhysicsCollisionObject::RIGID_BODY; - if (strcmp(s, luaEnumString_PhysicsCollisionObjectType_CHARACTER) == 0) - return PhysicsCollisionObject::CHARACTER; - if (strcmp(s, luaEnumString_PhysicsCollisionObjectType_GHOST_OBJECT) == 0) - return PhysicsCollisionObject::GHOST_OBJECT; - if (strcmp(s, luaEnumString_PhysicsCollisionObjectType_VEHICLE) == 0) - return PhysicsCollisionObject::VEHICLE; - if (strcmp(s, luaEnumString_PhysicsCollisionObjectType_VEHICLE_WHEEL) == 0) - return PhysicsCollisionObject::VEHICLE_WHEEL; - if (strcmp(s, luaEnumString_PhysicsCollisionObjectType_NONE) == 0) - return PhysicsCollisionObject::NONE; - return PhysicsCollisionObject::RIGID_BODY; -} - -const char* lua_stringFromEnum_PhysicsCollisionObjectType(PhysicsCollisionObject::Type e) -{ - if (e == PhysicsCollisionObject::RIGID_BODY) - return luaEnumString_PhysicsCollisionObjectType_RIGID_BODY; - if (e == PhysicsCollisionObject::CHARACTER) - return luaEnumString_PhysicsCollisionObjectType_CHARACTER; - if (e == PhysicsCollisionObject::GHOST_OBJECT) - return luaEnumString_PhysicsCollisionObjectType_GHOST_OBJECT; - if (e == PhysicsCollisionObject::VEHICLE) - return luaEnumString_PhysicsCollisionObjectType_VEHICLE; - if (e == PhysicsCollisionObject::VEHICLE_WHEEL) - return luaEnumString_PhysicsCollisionObjectType_VEHICLE_WHEEL; - if (e == PhysicsCollisionObject::NONE) - return luaEnumString_PhysicsCollisionObjectType_NONE; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_PhysicsCollisionObjectType.h b/gameplay/src/lua/lua_PhysicsCollisionObjectType.h deleted file mode 100644 index ea785e118f..0000000000 --- a/gameplay/src/lua/lua_PhysicsCollisionObjectType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_PHYSICSCOLLISIONOBJECTTYPE_H_ -#define LUA_PHYSICSCOLLISIONOBJECTTYPE_H_ - -#include "PhysicsCollisionObject.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for PhysicsCollisionObject::Type. -PhysicsCollisionObject::Type lua_enumFromString_PhysicsCollisionObjectType(const char* s); -const char* lua_stringFromEnum_PhysicsCollisionObjectType(PhysicsCollisionObject::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_PhysicsCollisionShape.cpp b/gameplay/src/lua/lua_PhysicsCollisionShape.cpp index 19a2497641..f99e06aef5 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionShape.cpp +++ b/gameplay/src/lua/lua_PhysicsCollisionShape.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsCollisionShape.h" @@ -10,7 +11,7 @@ #include "PhysicsCollisionShape.h" #include "Properties.h" #include "Ref.h" -#include "lua_PhysicsCollisionShapeType.h" +#include "Terrain.h" namespace gameplay { @@ -167,7 +168,7 @@ int lua_PhysicsCollisionShape_getType(lua_State* state) PhysicsCollisionShape::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_PhysicsCollisionShape.h b/gameplay/src/lua/lua_PhysicsCollisionShape.h index a0903f93ab..2d86e08616 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionShape.h +++ b/gameplay/src/lua/lua_PhysicsCollisionShape.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCOLLISIONSHAPE_H_ #define LUA_PHYSICSCOLLISIONSHAPE_H_ diff --git a/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.cpp b/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.cpp index eb292e6aff..a0587a95a4 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.cpp +++ b/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsCollisionShapeDefinition.h" @@ -10,7 +11,7 @@ #include "PhysicsCollisionShape.h" #include "Properties.h" #include "Ref.h" -#include "lua_PhysicsCollisionShapeType.h" +#include "Terrain.h" namespace gameplay { @@ -84,7 +85,7 @@ int lua_PhysicsCollisionShapeDefinition__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new PhysicsCollisionShape::Definition(); + void* returnPtr = ((void*)new PhysicsCollisionShape::Definition()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -113,7 +114,7 @@ int lua_PhysicsCollisionShapeDefinition__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new PhysicsCollisionShape::Definition(*param1); + void* returnPtr = ((void*)new PhysicsCollisionShape::Definition(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.h b/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.h index 4532e3f13b..7a07dcd075 100644 --- a/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.h +++ b/gameplay/src/lua/lua_PhysicsCollisionShapeDefinition.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCOLLISIONSHAPEDEFINITION_H_ #define LUA_PHYSICSCOLLISIONSHAPEDEFINITION_H_ diff --git a/gameplay/src/lua/lua_PhysicsCollisionShapeType.cpp b/gameplay/src/lua/lua_PhysicsCollisionShapeType.cpp deleted file mode 100644 index 6731d13796..0000000000 --- a/gameplay/src/lua/lua_PhysicsCollisionShapeType.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "Base.h" -#include "lua_PhysicsCollisionShapeType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_PhysicsCollisionShapeType_SHAPE_NONE = "SHAPE_NONE"; -static const char* luaEnumString_PhysicsCollisionShapeType_SHAPE_BOX = "SHAPE_BOX"; -static const char* luaEnumString_PhysicsCollisionShapeType_SHAPE_SPHERE = "SHAPE_SPHERE"; -static const char* luaEnumString_PhysicsCollisionShapeType_SHAPE_CAPSULE = "SHAPE_CAPSULE"; -static const char* luaEnumString_PhysicsCollisionShapeType_SHAPE_MESH = "SHAPE_MESH"; -static const char* luaEnumString_PhysicsCollisionShapeType_SHAPE_HEIGHTFIELD = "SHAPE_HEIGHTFIELD"; - -PhysicsCollisionShape::Type lua_enumFromString_PhysicsCollisionShapeType(const char* s) -{ - if (strcmp(s, luaEnumString_PhysicsCollisionShapeType_SHAPE_NONE) == 0) - return PhysicsCollisionShape::SHAPE_NONE; - if (strcmp(s, luaEnumString_PhysicsCollisionShapeType_SHAPE_BOX) == 0) - return PhysicsCollisionShape::SHAPE_BOX; - if (strcmp(s, luaEnumString_PhysicsCollisionShapeType_SHAPE_SPHERE) == 0) - return PhysicsCollisionShape::SHAPE_SPHERE; - if (strcmp(s, luaEnumString_PhysicsCollisionShapeType_SHAPE_CAPSULE) == 0) - return PhysicsCollisionShape::SHAPE_CAPSULE; - if (strcmp(s, luaEnumString_PhysicsCollisionShapeType_SHAPE_MESH) == 0) - return PhysicsCollisionShape::SHAPE_MESH; - if (strcmp(s, luaEnumString_PhysicsCollisionShapeType_SHAPE_HEIGHTFIELD) == 0) - return PhysicsCollisionShape::SHAPE_HEIGHTFIELD; - return PhysicsCollisionShape::SHAPE_NONE; -} - -const char* lua_stringFromEnum_PhysicsCollisionShapeType(PhysicsCollisionShape::Type e) -{ - if (e == PhysicsCollisionShape::SHAPE_NONE) - return luaEnumString_PhysicsCollisionShapeType_SHAPE_NONE; - if (e == PhysicsCollisionShape::SHAPE_BOX) - return luaEnumString_PhysicsCollisionShapeType_SHAPE_BOX; - if (e == PhysicsCollisionShape::SHAPE_SPHERE) - return luaEnumString_PhysicsCollisionShapeType_SHAPE_SPHERE; - if (e == PhysicsCollisionShape::SHAPE_CAPSULE) - return luaEnumString_PhysicsCollisionShapeType_SHAPE_CAPSULE; - if (e == PhysicsCollisionShape::SHAPE_MESH) - return luaEnumString_PhysicsCollisionShapeType_SHAPE_MESH; - if (e == PhysicsCollisionShape::SHAPE_HEIGHTFIELD) - return luaEnumString_PhysicsCollisionShapeType_SHAPE_HEIGHTFIELD; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_PhysicsCollisionShapeType.h b/gameplay/src/lua/lua_PhysicsCollisionShapeType.h deleted file mode 100644 index 945b216540..0000000000 --- a/gameplay/src/lua/lua_PhysicsCollisionShapeType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_PHYSICSCOLLISIONSHAPETYPE_H_ -#define LUA_PHYSICSCOLLISIONSHAPETYPE_H_ - -#include "PhysicsCollisionShape.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for PhysicsCollisionShape::Type. -PhysicsCollisionShape::Type lua_enumFromString_PhysicsCollisionShapeType(const char* s); -const char* lua_stringFromEnum_PhysicsCollisionShapeType(PhysicsCollisionShape::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_PhysicsConstraint.cpp b/gameplay/src/lua/lua_PhysicsConstraint.cpp index ea395591fc..4655d84675 100644 --- a/gameplay/src/lua/lua_PhysicsConstraint.cpp +++ b/gameplay/src/lua/lua_PhysicsConstraint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsConstraint.h" diff --git a/gameplay/src/lua/lua_PhysicsConstraint.h b/gameplay/src/lua/lua_PhysicsConstraint.h index 694f8c0c74..f74a5405ee 100644 --- a/gameplay/src/lua/lua_PhysicsConstraint.h +++ b/gameplay/src/lua/lua_PhysicsConstraint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCONSTRAINT_H_ #define LUA_PHYSICSCONSTRAINT_H_ diff --git a/gameplay/src/lua/lua_PhysicsController.cpp b/gameplay/src/lua/lua_PhysicsController.cpp index 30a37ab632..3713873a0a 100644 --- a/gameplay/src/lua/lua_PhysicsController.cpp +++ b/gameplay/src/lua/lua_PhysicsController.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsController.h" @@ -11,7 +12,6 @@ #include "ScriptController.h" #include "ScriptTarget.h" #include "Terrain.h" -#include "lua_PhysicsControllerListenerEventType.h" namespace gameplay { @@ -20,8 +20,10 @@ void luaRegister_PhysicsController() { const luaL_Reg lua_members[] = { + {"addScript", lua_PhysicsController_addScript}, {"addScriptCallback", lua_PhysicsController_addScriptCallback}, {"addStatusListener", lua_PhysicsController_addStatusListener}, + {"clearScripts", lua_PhysicsController_clearScripts}, {"createFixedConstraint", lua_PhysicsController_createFixedConstraint}, {"createGenericConstraint", lua_PhysicsController_createGenericConstraint}, {"createHingeConstraint", lua_PhysicsController_createHingeConstraint}, @@ -29,7 +31,11 @@ void luaRegister_PhysicsController() {"createSpringConstraint", lua_PhysicsController_createSpringConstraint}, {"drawDebug", lua_PhysicsController_drawDebug}, {"getGravity", lua_PhysicsController_getGravity}, + {"getScriptEvent", lua_PhysicsController_getScriptEvent}, + {"getTypeName", lua_PhysicsController_getTypeName}, + {"hasScriptListener", lua_PhysicsController_hasScriptListener}, {"rayTest", lua_PhysicsController_rayTest}, + {"removeScript", lua_PhysicsController_removeScript}, {"removeScriptCallback", lua_PhysicsController_removeScriptCallback}, {"removeStatusListener", lua_PhysicsController_removeStatusListener}, {"setGravity", lua_PhysicsController_setGravity}, @@ -49,6 +55,54 @@ static PhysicsController* getInstance(lua_State* state) return (PhysicsController*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance; } +int lua_PhysicsController_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + PhysicsController* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_PhysicsController_addScript - 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; +} + int lua_PhysicsController_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -60,14 +114,20 @@ int lua_PhysicsController_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); PhysicsController* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -131,6 +191,38 @@ int lua_PhysicsController_addStatusListener(lua_State* state) return 0; } +int lua_PhysicsController_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + PhysicsController* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_PhysicsController_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_PhysicsController_createFixedConstraint(lua_State* state) { // Get the number of parameters. @@ -154,7 +246,7 @@ int lua_PhysicsController_createFixedConstraint(lua_State* state) } PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createFixedConstraint(param1); + void* returnPtr = ((void*)instance->createFixedConstraint(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -200,7 +292,7 @@ int lua_PhysicsController_createFixedConstraint(lua_State* state) } PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createFixedConstraint(param1, param2); + void* returnPtr = ((void*)instance->createFixedConstraint(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -253,7 +345,7 @@ int lua_PhysicsController_createGenericConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createGenericConstraint(param1); + void* returnPtr = ((void*)instance->createGenericConstraint(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -296,7 +388,7 @@ int lua_PhysicsController_createGenericConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createGenericConstraint(param1, param2); + void* returnPtr = ((void*)instance->createGenericConstraint(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -346,7 +438,7 @@ int lua_PhysicsController_createGenericConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createGenericConstraint(param1, *param2, *param3); + void* returnPtr = ((void*)instance->createGenericConstraint(param1, *param2, *param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -403,7 +495,7 @@ int lua_PhysicsController_createGenericConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createGenericConstraint(param1, *param2, *param3, param4); + void* returnPtr = ((void*)instance->createGenericConstraint(param1, *param2, *param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -467,7 +559,7 @@ int lua_PhysicsController_createGenericConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createGenericConstraint(param1, *param2, *param3, param4, *param5); + void* returnPtr = ((void*)instance->createGenericConstraint(param1, *param2, *param3, param4, *param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -538,7 +630,7 @@ int lua_PhysicsController_createGenericConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createGenericConstraint(param1, *param2, *param3, param4, *param5, *param6); + void* returnPtr = ((void*)instance->createGenericConstraint(param1, *param2, *param3, param4, *param5, *param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -613,7 +705,7 @@ int lua_PhysicsController_createHingeConstraint(lua_State* state) } PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createHingeConstraint(param1, *param2, *param3); + void* returnPtr = ((void*)instance->createHingeConstraint(param1, *param2, *param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -679,7 +771,7 @@ int lua_PhysicsController_createHingeConstraint(lua_State* state) } PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createHingeConstraint(param1, *param2, *param3, param4); + void* returnPtr = ((void*)instance->createHingeConstraint(param1, *param2, *param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -755,7 +847,7 @@ int lua_PhysicsController_createHingeConstraint(lua_State* state) } PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createHingeConstraint(param1, *param2, *param3, param4, *param5); + void* returnPtr = ((void*)instance->createHingeConstraint(param1, *param2, *param3, param4, *param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -841,7 +933,7 @@ int lua_PhysicsController_createHingeConstraint(lua_State* state) } PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createHingeConstraint(param1, *param2, *param3, param4, *param5, *param6); + void* returnPtr = ((void*)instance->createHingeConstraint(param1, *param2, *param3, param4, *param5, *param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -894,7 +986,7 @@ int lua_PhysicsController_createSocketConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSocketConstraint(param1); + void* returnPtr = ((void*)instance->createSocketConstraint(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -937,7 +1029,7 @@ int lua_PhysicsController_createSocketConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSocketConstraint(param1, param2); + void* returnPtr = ((void*)instance->createSocketConstraint(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -974,7 +1066,7 @@ int lua_PhysicsController_createSocketConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSocketConstraint(param1, *param2); + void* returnPtr = ((void*)instance->createSocketConstraint(param1, *param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1024,7 +1116,7 @@ int lua_PhysicsController_createSocketConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSocketConstraint(param1, *param2, param3); + void* returnPtr = ((void*)instance->createSocketConstraint(param1, *param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1081,7 +1173,7 @@ int lua_PhysicsController_createSocketConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSocketConstraint(param1, *param2, param3, *param4); + void* returnPtr = ((void*)instance->createSocketConstraint(param1, *param2, param3, *param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1142,7 +1234,7 @@ int lua_PhysicsController_createSpringConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSpringConstraint(param1, param2); + void* returnPtr = ((void*)instance->createSpringConstraint(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1213,7 +1305,7 @@ int lua_PhysicsController_createSpringConstraint(lua_State* state) break; PhysicsController* instance = getInstance(state); - void* returnPtr = (void*)instance->createSpringConstraint(param1, *param2, *param3, param4, *param5, *param6); + void* returnPtr = ((void*)instance->createSpringConstraint(param1, *param2, *param3, param4, *param5, *param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1331,6 +1423,152 @@ int lua_PhysicsController_getGravity(lua_State* state) return 0; } +int lua_PhysicsController_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + PhysicsController* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_PhysicsController_getScriptEvent - 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; +} + +int lua_PhysicsController_getTypeName(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + PhysicsController* instance = getInstance(state); + const char* result = instance->getTypeName(); + + // Push the return value onto the stack. + lua_pushstring(state, result); + + return 1; + } + + lua_pushstring(state, "lua_PhysicsController_getTypeName - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_PhysicsController_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + PhysicsController* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + PhysicsController* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_PhysicsController_hasScriptListener - 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; +} + int lua_PhysicsController_rayTest(lua_State* state) { // Get the number of parameters. @@ -1472,6 +1710,45 @@ int lua_PhysicsController_rayTest(lua_State* state) return 0; } +int lua_PhysicsController_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + PhysicsController* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_PhysicsController_removeScript - 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; +} + int lua_PhysicsController_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -1483,14 +1760,20 @@ int lua_PhysicsController_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); PhysicsController* instance = getInstance(state); instance->removeScriptCallback(param1, param2); diff --git a/gameplay/src/lua/lua_PhysicsController.h b/gameplay/src/lua/lua_PhysicsController.h index fef67051e8..8ace1f0e80 100644 --- a/gameplay/src/lua/lua_PhysicsController.h +++ b/gameplay/src/lua/lua_PhysicsController.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCONTROLLER_H_ #define LUA_PHYSICSCONTROLLER_H_ @@ -5,8 +6,10 @@ namespace gameplay { // Lua bindings for PhysicsController. +int lua_PhysicsController_addScript(lua_State* state); int lua_PhysicsController_addScriptCallback(lua_State* state); int lua_PhysicsController_addStatusListener(lua_State* state); +int lua_PhysicsController_clearScripts(lua_State* state); int lua_PhysicsController_createFixedConstraint(lua_State* state); int lua_PhysicsController_createGenericConstraint(lua_State* state); int lua_PhysicsController_createHingeConstraint(lua_State* state); @@ -14,7 +17,11 @@ int lua_PhysicsController_createSocketConstraint(lua_State* state); int lua_PhysicsController_createSpringConstraint(lua_State* state); int lua_PhysicsController_drawDebug(lua_State* state); int lua_PhysicsController_getGravity(lua_State* state); +int lua_PhysicsController_getScriptEvent(lua_State* state); +int lua_PhysicsController_getTypeName(lua_State* state); +int lua_PhysicsController_hasScriptListener(lua_State* state); int lua_PhysicsController_rayTest(lua_State* state); +int lua_PhysicsController_removeScript(lua_State* state); int lua_PhysicsController_removeScriptCallback(lua_State* state); int lua_PhysicsController_removeStatusListener(lua_State* state); int lua_PhysicsController_setGravity(lua_State* state); diff --git a/gameplay/src/lua/lua_PhysicsControllerHitFilter.cpp b/gameplay/src/lua/lua_PhysicsControllerHitFilter.cpp index 8582500d46..86e1eb5792 100644 --- a/gameplay/src/lua/lua_PhysicsControllerHitFilter.cpp +++ b/gameplay/src/lua/lua_PhysicsControllerHitFilter.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsControllerHitFilter.h" @@ -11,7 +12,6 @@ #include "ScriptController.h" #include "ScriptTarget.h" #include "Terrain.h" -#include "lua_PhysicsControllerListenerEventType.h" namespace gameplay { @@ -86,7 +86,7 @@ int lua_PhysicsControllerHitFilter__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new PhysicsController::HitFilter(); + void* returnPtr = ((void*)new PhysicsController::HitFilter()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_PhysicsControllerHitFilter.h b/gameplay/src/lua/lua_PhysicsControllerHitFilter.h index 1e33f9f5f0..3eee8039fa 100644 --- a/gameplay/src/lua/lua_PhysicsControllerHitFilter.h +++ b/gameplay/src/lua/lua_PhysicsControllerHitFilter.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCONTROLLERHITFILTER_H_ #define LUA_PHYSICSCONTROLLERHITFILTER_H_ diff --git a/gameplay/src/lua/lua_PhysicsControllerHitResult.cpp b/gameplay/src/lua/lua_PhysicsControllerHitResult.cpp index bc5b241767..4e8c1cee24 100644 --- a/gameplay/src/lua/lua_PhysicsControllerHitResult.cpp +++ b/gameplay/src/lua/lua_PhysicsControllerHitResult.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsControllerHitResult.h" @@ -11,7 +12,6 @@ #include "ScriptController.h" #include "ScriptTarget.h" #include "Terrain.h" -#include "lua_PhysicsControllerListenerEventType.h" namespace gameplay { @@ -88,7 +88,7 @@ int lua_PhysicsControllerHitResult__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new PhysicsController::HitResult(); + void* returnPtr = ((void*)new PhysicsController::HitResult()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_PhysicsControllerHitResult.h b/gameplay/src/lua/lua_PhysicsControllerHitResult.h index 24ad52919b..c7abaa9baa 100644 --- a/gameplay/src/lua/lua_PhysicsControllerHitResult.h +++ b/gameplay/src/lua/lua_PhysicsControllerHitResult.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCONTROLLERHITRESULT_H_ #define LUA_PHYSICSCONTROLLERHITRESULT_H_ diff --git a/gameplay/src/lua/lua_PhysicsControllerListener.cpp b/gameplay/src/lua/lua_PhysicsControllerListener.cpp index 4eebb6d520..d2da8c018c 100644 --- a/gameplay/src/lua/lua_PhysicsControllerListener.cpp +++ b/gameplay/src/lua/lua_PhysicsControllerListener.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsControllerListener.h" @@ -11,7 +12,6 @@ #include "ScriptController.h" #include "ScriptTarget.h" #include "Terrain.h" -#include "lua_PhysicsControllerListenerEventType.h" namespace gameplay { @@ -48,10 +48,10 @@ int lua_PhysicsControllerListener_statusEvent(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - PhysicsController::Listener::EventType param1 = (PhysicsController::Listener::EventType)lua_enumFromString_PhysicsControllerListenerEventType(luaL_checkstring(state, 2)); + PhysicsController::Listener::EventType param1 = (PhysicsController::Listener::EventType)luaL_checkint(state, 2); PhysicsController::Listener* instance = getInstance(state); instance->statusEvent(param1); diff --git a/gameplay/src/lua/lua_PhysicsControllerListener.h b/gameplay/src/lua/lua_PhysicsControllerListener.h index d4e8f62636..fcc3285eb6 100644 --- a/gameplay/src/lua/lua_PhysicsControllerListener.h +++ b/gameplay/src/lua/lua_PhysicsControllerListener.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSCONTROLLERLISTENER_H_ #define LUA_PHYSICSCONTROLLERLISTENER_H_ diff --git a/gameplay/src/lua/lua_PhysicsControllerListenerEventType.cpp b/gameplay/src/lua/lua_PhysicsControllerListenerEventType.cpp deleted file mode 100644 index 916e0a11ce..0000000000 --- a/gameplay/src/lua/lua_PhysicsControllerListenerEventType.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_PhysicsControllerListenerEventType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_PhysicsControllerListenerEventType_ACTIVATED = "ACTIVATED"; -static const char* luaEnumString_PhysicsControllerListenerEventType_DEACTIVATED = "DEACTIVATED"; - -PhysicsController::Listener::EventType lua_enumFromString_PhysicsControllerListenerEventType(const char* s) -{ - if (strcmp(s, luaEnumString_PhysicsControllerListenerEventType_ACTIVATED) == 0) - return PhysicsController::Listener::ACTIVATED; - if (strcmp(s, luaEnumString_PhysicsControllerListenerEventType_DEACTIVATED) == 0) - return PhysicsController::Listener::DEACTIVATED; - return PhysicsController::Listener::ACTIVATED; -} - -const char* lua_stringFromEnum_PhysicsControllerListenerEventType(PhysicsController::Listener::EventType e) -{ - if (e == PhysicsController::Listener::ACTIVATED) - return luaEnumString_PhysicsControllerListenerEventType_ACTIVATED; - if (e == PhysicsController::Listener::DEACTIVATED) - return luaEnumString_PhysicsControllerListenerEventType_DEACTIVATED; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_PhysicsControllerListenerEventType.h b/gameplay/src/lua/lua_PhysicsControllerListenerEventType.h deleted file mode 100644 index daf6fd3673..0000000000 --- a/gameplay/src/lua/lua_PhysicsControllerListenerEventType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_PHYSICSCONTROLLERLISTENEREVENTTYPE_H_ -#define LUA_PHYSICSCONTROLLERLISTENEREVENTTYPE_H_ - -#include "PhysicsController.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for PhysicsController::Listener::EventType. -PhysicsController::Listener::EventType lua_enumFromString_PhysicsControllerListenerEventType(const char* s); -const char* lua_stringFromEnum_PhysicsControllerListenerEventType(PhysicsController::Listener::EventType e); - -} - -#endif diff --git a/gameplay/src/lua/lua_PhysicsFixedConstraint.cpp b/gameplay/src/lua/lua_PhysicsFixedConstraint.cpp index 57502a47b1..4671285bf2 100644 --- a/gameplay/src/lua/lua_PhysicsFixedConstraint.cpp +++ b/gameplay/src/lua/lua_PhysicsFixedConstraint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsFixedConstraint.h" diff --git a/gameplay/src/lua/lua_PhysicsFixedConstraint.h b/gameplay/src/lua/lua_PhysicsFixedConstraint.h index a2371784bd..7f590ebe4b 100644 --- a/gameplay/src/lua/lua_PhysicsFixedConstraint.h +++ b/gameplay/src/lua/lua_PhysicsFixedConstraint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSFIXEDCONSTRAINT_H_ #define LUA_PHYSICSFIXEDCONSTRAINT_H_ diff --git a/gameplay/src/lua/lua_PhysicsGenericConstraint.cpp b/gameplay/src/lua/lua_PhysicsGenericConstraint.cpp index 1a8cd3b940..36a608c9b8 100644 --- a/gameplay/src/lua/lua_PhysicsGenericConstraint.cpp +++ b/gameplay/src/lua/lua_PhysicsGenericConstraint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsGenericConstraint.h" diff --git a/gameplay/src/lua/lua_PhysicsGenericConstraint.h b/gameplay/src/lua/lua_PhysicsGenericConstraint.h index 9bec5bcbc1..11a5476b90 100644 --- a/gameplay/src/lua/lua_PhysicsGenericConstraint.h +++ b/gameplay/src/lua/lua_PhysicsGenericConstraint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSGENERICCONSTRAINT_H_ #define LUA_PHYSICSGENERICCONSTRAINT_H_ diff --git a/gameplay/src/lua/lua_PhysicsGhostObject.cpp b/gameplay/src/lua/lua_PhysicsGhostObject.cpp index a0ffddb24a..a84ce9f081 100644 --- a/gameplay/src/lua/lua_PhysicsGhostObject.cpp +++ b/gameplay/src/lua/lua_PhysicsGhostObject.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsGhostObject.h" @@ -5,6 +6,7 @@ #include "AnimationTarget.h" #include "Base.h" #include "Game.h" +#include "MaterialParameter.h" #include "Node.h" #include "PhysicsCharacter.h" #include "PhysicsCollisionObject.h" @@ -16,10 +18,6 @@ #include "ScriptController.h" #include "ScriptTarget.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -29,11 +27,6 @@ void luaRegister_PhysicsGhostObject() const luaL_Reg lua_members[] = { {"addCollisionListener", lua_PhysicsGhostObject_addCollisionListener}, - {"asCharacter", lua_PhysicsGhostObject_asCharacter}, - {"asGhostObject", lua_PhysicsGhostObject_asGhostObject}, - {"asRigidBody", lua_PhysicsGhostObject_asRigidBody}, - {"asVehicle", lua_PhysicsGhostObject_asVehicle}, - {"asVehicleWheel", lua_PhysicsGhostObject_asVehicleWheel}, {"collidesWith", lua_PhysicsGhostObject_collidesWith}, {"getCollisionShape", lua_PhysicsGhostObject_getCollisionShape}, {"getNode", lua_PhysicsGhostObject_getNode}, @@ -171,226 +164,6 @@ int lua_PhysicsGhostObject_addCollisionListener(lua_State* state) return 0; } -int lua_PhysicsGhostObject_asCharacter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asCharacter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCharacter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsGhostObject_asCharacter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsGhostObject_asGhostObject(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asGhostObject(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsGhostObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsGhostObject_asGhostObject - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsGhostObject_asRigidBody(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asRigidBody(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsRigidBody"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsGhostObject_asRigidBody - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsGhostObject_asVehicle(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicle(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicle"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsGhostObject_asVehicle - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsGhostObject_asVehicleWheel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicleWheel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicleWheel"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsGhostObject_asVehicleWheel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsGhostObject_collidesWith(lua_State* state) { // Get the number of parameters. @@ -449,7 +222,7 @@ int lua_PhysicsGhostObject_getCollisionShape(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionShape(); + void* returnPtr = ((void*)instance->getCollisionShape()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -493,7 +266,7 @@ int lua_PhysicsGhostObject_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsGhostObject* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -540,7 +313,7 @@ int lua_PhysicsGhostObject_getShapeType(lua_State* state) PhysicsCollisionShape::Type result = instance->getShapeType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -575,7 +348,7 @@ int lua_PhysicsGhostObject_getType(lua_State* state) PhysicsCollisionObject::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionObjectType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_PhysicsGhostObject.h b/gameplay/src/lua/lua_PhysicsGhostObject.h index a00ee7308a..85c8bc75cf 100644 --- a/gameplay/src/lua/lua_PhysicsGhostObject.h +++ b/gameplay/src/lua/lua_PhysicsGhostObject.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSGHOSTOBJECT_H_ #define LUA_PHYSICSGHOSTOBJECT_H_ @@ -6,11 +7,6 @@ namespace gameplay // Lua bindings for PhysicsGhostObject. int lua_PhysicsGhostObject_addCollisionListener(lua_State* state); -int lua_PhysicsGhostObject_asCharacter(lua_State* state); -int lua_PhysicsGhostObject_asGhostObject(lua_State* state); -int lua_PhysicsGhostObject_asRigidBody(lua_State* state); -int lua_PhysicsGhostObject_asVehicle(lua_State* state); -int lua_PhysicsGhostObject_asVehicleWheel(lua_State* state); int lua_PhysicsGhostObject_collidesWith(lua_State* state); int lua_PhysicsGhostObject_getCollisionShape(lua_State* state); int lua_PhysicsGhostObject_getNode(lua_State* state); diff --git a/gameplay/src/lua/lua_PhysicsHingeConstraint.cpp b/gameplay/src/lua/lua_PhysicsHingeConstraint.cpp index 00421e0445..61ca7ee966 100644 --- a/gameplay/src/lua/lua_PhysicsHingeConstraint.cpp +++ b/gameplay/src/lua/lua_PhysicsHingeConstraint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsHingeConstraint.h" diff --git a/gameplay/src/lua/lua_PhysicsHingeConstraint.h b/gameplay/src/lua/lua_PhysicsHingeConstraint.h index d6f4deb2b4..dddaf7d54d 100644 --- a/gameplay/src/lua/lua_PhysicsHingeConstraint.h +++ b/gameplay/src/lua/lua_PhysicsHingeConstraint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSHINGECONSTRAINT_H_ #define LUA_PHYSICSHINGECONSTRAINT_H_ diff --git a/gameplay/src/lua/lua_PhysicsRigidBody.cpp b/gameplay/src/lua/lua_PhysicsRigidBody.cpp index 38ff3f26ac..c4cf328be0 100644 --- a/gameplay/src/lua/lua_PhysicsRigidBody.cpp +++ b/gameplay/src/lua/lua_PhysicsRigidBody.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsRigidBody.h" @@ -6,6 +7,7 @@ #include "Base.h" #include "Game.h" #include "Image.h" +#include "MaterialParameter.h" #include "MeshPart.h" #include "Node.h" #include "PhysicsCharacter.h" @@ -19,10 +21,6 @@ #include "ScriptTarget.h" #include "Terrain.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -36,11 +34,6 @@ void luaRegister_PhysicsRigidBody() {"applyImpulse", lua_PhysicsRigidBody_applyImpulse}, {"applyTorque", lua_PhysicsRigidBody_applyTorque}, {"applyTorqueImpulse", lua_PhysicsRigidBody_applyTorqueImpulse}, - {"asCharacter", lua_PhysicsRigidBody_asCharacter}, - {"asGhostObject", lua_PhysicsRigidBody_asGhostObject}, - {"asRigidBody", lua_PhysicsRigidBody_asRigidBody}, - {"asVehicle", lua_PhysicsRigidBody_asVehicle}, - {"asVehicleWheel", lua_PhysicsRigidBody_asVehicleWheel}, {"collidesWith", lua_PhysicsRigidBody_collidesWith}, {"getAngularDamping", lua_PhysicsRigidBody_getAngularDamping}, {"getAngularFactor", lua_PhysicsRigidBody_getAngularFactor}, @@ -435,226 +428,6 @@ int lua_PhysicsRigidBody_applyTorqueImpulse(lua_State* state) return 0; } -int lua_PhysicsRigidBody_asCharacter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->asCharacter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCharacter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsRigidBody_asCharacter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsRigidBody_asGhostObject(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->asGhostObject(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsGhostObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsRigidBody_asGhostObject - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsRigidBody_asRigidBody(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->asRigidBody(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsRigidBody"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsRigidBody_asRigidBody - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsRigidBody_asVehicle(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicle(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicle"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsRigidBody_asVehicle - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsRigidBody_asVehicleWheel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicleWheel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicleWheel"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsRigidBody_asVehicleWheel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsRigidBody_collidesWith(lua_State* state) { // Get the number of parameters. @@ -880,7 +653,7 @@ int lua_PhysicsRigidBody_getCollisionShape(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionShape(); + void* returnPtr = ((void*)instance->getCollisionShape()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1204,7 +977,7 @@ int lua_PhysicsRigidBody_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsRigidBody* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1286,7 +1059,7 @@ int lua_PhysicsRigidBody_getShapeType(lua_State* state) PhysicsCollisionShape::Type result = instance->getShapeType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1321,7 +1094,7 @@ int lua_PhysicsRigidBody_getType(lua_State* state) PhysicsCollisionObject::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionObjectType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_PhysicsRigidBody.h b/gameplay/src/lua/lua_PhysicsRigidBody.h index d682c277b2..2f368d7848 100644 --- a/gameplay/src/lua/lua_PhysicsRigidBody.h +++ b/gameplay/src/lua/lua_PhysicsRigidBody.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSRIGIDBODY_H_ #define LUA_PHYSICSRIGIDBODY_H_ @@ -10,11 +11,6 @@ int lua_PhysicsRigidBody_applyForce(lua_State* state); int lua_PhysicsRigidBody_applyImpulse(lua_State* state); int lua_PhysicsRigidBody_applyTorque(lua_State* state); int lua_PhysicsRigidBody_applyTorqueImpulse(lua_State* state); -int lua_PhysicsRigidBody_asCharacter(lua_State* state); -int lua_PhysicsRigidBody_asGhostObject(lua_State* state); -int lua_PhysicsRigidBody_asRigidBody(lua_State* state); -int lua_PhysicsRigidBody_asVehicle(lua_State* state); -int lua_PhysicsRigidBody_asVehicleWheel(lua_State* state); int lua_PhysicsRigidBody_collidesWith(lua_State* state); int lua_PhysicsRigidBody_getAngularDamping(lua_State* state); int lua_PhysicsRigidBody_getAngularFactor(lua_State* state); diff --git a/gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp b/gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp index 09956b6952..5d0fccb1a9 100644 --- a/gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp +++ b/gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsRigidBodyParameters.h" @@ -6,6 +7,7 @@ #include "Base.h" #include "Game.h" #include "Image.h" +#include "MaterialParameter.h" #include "MeshPart.h" #include "Node.h" #include "PhysicsCharacter.h" @@ -19,10 +21,6 @@ #include "ScriptTarget.h" #include "Terrain.h" #include "Transform.h" -#include "lua_CurveInterpolationType.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -104,7 +102,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -130,7 +128,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) // Get parameter 1 off the stack. float param1 = (float)luaL_checknumber(state, 1); - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -165,7 +163,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -204,7 +202,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) // Get parameter 3 off the stack. float param3 = (float)luaL_checknumber(state, 3); - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -247,7 +245,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -294,7 +292,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) // Get parameter 5 off the stack. float param5 = (float)luaL_checknumber(state, 5); - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -345,7 +343,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) // Get parameter 6 off the stack. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 6); - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -403,7 +401,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) if (!param7Valid) break; - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6, *param7); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6, *param7)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -468,7 +466,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) if (!param8Valid) break; - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6, *param7, *param8); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6, *param7, *param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -540,7 +538,7 @@ int lua_PhysicsRigidBodyParameters__init(lua_State* state) if (!param9Valid) break; - void* returnPtr = (void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6, *param7, *param8, *param9); + void* returnPtr = ((void*)new PhysicsRigidBody::Parameters(param1, param2, param3, param4, param5, param6, *param7, *param8, *param9)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_PhysicsRigidBodyParameters.h b/gameplay/src/lua/lua_PhysicsRigidBodyParameters.h index e6958e9694..e2a3746796 100644 --- a/gameplay/src/lua/lua_PhysicsRigidBodyParameters.h +++ b/gameplay/src/lua/lua_PhysicsRigidBodyParameters.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSRIGIDBODYPARAMETERS_H_ #define LUA_PHYSICSRIGIDBODYPARAMETERS_H_ diff --git a/gameplay/src/lua/lua_PhysicsSocketConstraint.cpp b/gameplay/src/lua/lua_PhysicsSocketConstraint.cpp index 41590d25dc..e10806217e 100644 --- a/gameplay/src/lua/lua_PhysicsSocketConstraint.cpp +++ b/gameplay/src/lua/lua_PhysicsSocketConstraint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsSocketConstraint.h" diff --git a/gameplay/src/lua/lua_PhysicsSocketConstraint.h b/gameplay/src/lua/lua_PhysicsSocketConstraint.h index 655d570116..f93057398b 100644 --- a/gameplay/src/lua/lua_PhysicsSocketConstraint.h +++ b/gameplay/src/lua/lua_PhysicsSocketConstraint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSSOCKETCONSTRAINT_H_ #define LUA_PHYSICSSOCKETCONSTRAINT_H_ diff --git a/gameplay/src/lua/lua_PhysicsSpringConstraint.cpp b/gameplay/src/lua/lua_PhysicsSpringConstraint.cpp index 1421bb05e5..5ec485bd20 100644 --- a/gameplay/src/lua/lua_PhysicsSpringConstraint.cpp +++ b/gameplay/src/lua/lua_PhysicsSpringConstraint.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsSpringConstraint.h" diff --git a/gameplay/src/lua/lua_PhysicsSpringConstraint.h b/gameplay/src/lua/lua_PhysicsSpringConstraint.h index 68ee6588cd..a7527a6b19 100644 --- a/gameplay/src/lua/lua_PhysicsSpringConstraint.h +++ b/gameplay/src/lua/lua_PhysicsSpringConstraint.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSSPRINGCONSTRAINT_H_ #define LUA_PHYSICSSPRINGCONSTRAINT_H_ diff --git a/gameplay/src/lua/lua_PhysicsVehicle.cpp b/gameplay/src/lua/lua_PhysicsVehicle.cpp index 53ae07ca6f..ffc2428565 100644 --- a/gameplay/src/lua/lua_PhysicsVehicle.cpp +++ b/gameplay/src/lua/lua_PhysicsVehicle.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsVehicle.h" @@ -13,9 +14,6 @@ #include "PhysicsVehicle.h" #include "PhysicsVehicleWheel.h" #include "ScriptController.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -26,11 +24,6 @@ void luaRegister_PhysicsVehicle() { {"addCollisionListener", lua_PhysicsVehicle_addCollisionListener}, {"addWheel", lua_PhysicsVehicle_addWheel}, - {"asCharacter", lua_PhysicsVehicle_asCharacter}, - {"asGhostObject", lua_PhysicsVehicle_asGhostObject}, - {"asRigidBody", lua_PhysicsVehicle_asRigidBody}, - {"asVehicle", lua_PhysicsVehicle_asVehicle}, - {"asVehicleWheel", lua_PhysicsVehicle_asVehicleWheel}, {"collidesWith", lua_PhysicsVehicle_collidesWith}, {"getBoostGain", lua_PhysicsVehicle_getBoostGain}, {"getBoostSpeed", lua_PhysicsVehicle_getBoostSpeed}, @@ -43,7 +36,6 @@ void luaRegister_PhysicsVehicle() {"getDrivedownStart", lua_PhysicsVehicle_getDrivedownStart}, {"getDrivingForce", lua_PhysicsVehicle_getDrivingForce}, {"getNode", lua_PhysicsVehicle_getNode}, - {"getNumWheels", lua_PhysicsVehicle_getNumWheels}, {"getRigidBody", lua_PhysicsVehicle_getRigidBody}, {"getShapeType", lua_PhysicsVehicle_getShapeType}, {"getSpeedKph", lua_PhysicsVehicle_getSpeedKph}, @@ -53,6 +45,7 @@ void luaRegister_PhysicsVehicle() {"getSteeringGain", lua_PhysicsVehicle_getSteeringGain}, {"getType", lua_PhysicsVehicle_getType}, {"getWheel", lua_PhysicsVehicle_getWheel}, + {"getWheelCount", lua_PhysicsVehicle_getWheelCount}, {"isDynamic", lua_PhysicsVehicle_isDynamic}, {"isEnabled", lua_PhysicsVehicle_isEnabled}, {"isKinematic", lua_PhysicsVehicle_isKinematic}, @@ -236,226 +229,6 @@ int lua_PhysicsVehicle_addWheel(lua_State* state) return 0; } -int lua_PhysicsVehicle_asCharacter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->asCharacter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCharacter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicle_asCharacter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicle_asGhostObject(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->asGhostObject(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsGhostObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicle_asGhostObject - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicle_asRigidBody(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->asRigidBody(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsRigidBody"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicle_asRigidBody - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicle_asVehicle(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicle(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicle"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicle_asVehicle - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicle_asVehicleWheel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicleWheel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicleWheel"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicle_asVehicleWheel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsVehicle_collidesWith(lua_State* state) { // Get the number of parameters. @@ -689,7 +462,7 @@ int lua_PhysicsVehicle_getCollisionShape(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionShape(); + void* returnPtr = ((void*)instance->getCollisionShape()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -873,7 +646,7 @@ int lua_PhysicsVehicle_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -904,41 +677,6 @@ int lua_PhysicsVehicle_getNode(lua_State* state) return 0; } -int lua_PhysicsVehicle_getNumWheels(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicle* instance = getInstance(state); - unsigned int result = instance->getNumWheels(); - - // Push the return value onto the stack. - lua_pushunsigned(state, result); - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicle_getNumWheels - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsVehicle_getRigidBody(lua_State* state) { // Get the number of parameters. @@ -952,7 +690,7 @@ int lua_PhysicsVehicle_getRigidBody(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->getRigidBody(); + void* returnPtr = ((void*)instance->getRigidBody()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -999,7 +737,7 @@ int lua_PhysicsVehicle_getShapeType(lua_State* state) PhysicsCollisionShape::Type result = instance->getShapeType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1209,7 +947,7 @@ int lua_PhysicsVehicle_getType(lua_State* state) PhysicsCollisionObject::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionObjectType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1245,7 +983,7 @@ int lua_PhysicsVehicle_getWheel(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); PhysicsVehicle* instance = getInstance(state); - void* returnPtr = (void*)instance->getWheel(param1); + void* returnPtr = ((void*)instance->getWheel(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1276,6 +1014,41 @@ int lua_PhysicsVehicle_getWheel(lua_State* state) return 0; } +int lua_PhysicsVehicle_getWheelCount(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + PhysicsVehicle* instance = getInstance(state); + unsigned int result = instance->getWheelCount(); + + // Push the return value onto the stack. + lua_pushunsigned(state, result); + + return 1; + } + + lua_pushstring(state, "lua_PhysicsVehicle_getWheelCount - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_PhysicsVehicle_isDynamic(lua_State* state) { // Get the number of parameters. diff --git a/gameplay/src/lua/lua_PhysicsVehicle.h b/gameplay/src/lua/lua_PhysicsVehicle.h index 1678360ea6..5a1fa01f8a 100644 --- a/gameplay/src/lua/lua_PhysicsVehicle.h +++ b/gameplay/src/lua/lua_PhysicsVehicle.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSVEHICLE_H_ #define LUA_PHYSICSVEHICLE_H_ @@ -7,11 +8,6 @@ namespace gameplay // Lua bindings for PhysicsVehicle. int lua_PhysicsVehicle_addCollisionListener(lua_State* state); int lua_PhysicsVehicle_addWheel(lua_State* state); -int lua_PhysicsVehicle_asCharacter(lua_State* state); -int lua_PhysicsVehicle_asGhostObject(lua_State* state); -int lua_PhysicsVehicle_asRigidBody(lua_State* state); -int lua_PhysicsVehicle_asVehicle(lua_State* state); -int lua_PhysicsVehicle_asVehicleWheel(lua_State* state); int lua_PhysicsVehicle_collidesWith(lua_State* state); int lua_PhysicsVehicle_getBoostGain(lua_State* state); int lua_PhysicsVehicle_getBoostSpeed(lua_State* state); @@ -24,7 +20,6 @@ int lua_PhysicsVehicle_getDrivedownFull(lua_State* state); int lua_PhysicsVehicle_getDrivedownStart(lua_State* state); int lua_PhysicsVehicle_getDrivingForce(lua_State* state); int lua_PhysicsVehicle_getNode(lua_State* state); -int lua_PhysicsVehicle_getNumWheels(lua_State* state); int lua_PhysicsVehicle_getRigidBody(lua_State* state); int lua_PhysicsVehicle_getShapeType(lua_State* state); int lua_PhysicsVehicle_getSpeedKph(lua_State* state); @@ -34,6 +29,7 @@ int lua_PhysicsVehicle_getSteerdownSpeed(lua_State* state); int lua_PhysicsVehicle_getSteeringGain(lua_State* state); int lua_PhysicsVehicle_getType(lua_State* state); int lua_PhysicsVehicle_getWheel(lua_State* state); +int lua_PhysicsVehicle_getWheelCount(lua_State* state); int lua_PhysicsVehicle_isDynamic(lua_State* state); int lua_PhysicsVehicle_isEnabled(lua_State* state); int lua_PhysicsVehicle_isKinematic(lua_State* state); diff --git a/gameplay/src/lua/lua_PhysicsVehicleWheel.cpp b/gameplay/src/lua/lua_PhysicsVehicleWheel.cpp index d5cbf13c79..d34eda998c 100644 --- a/gameplay/src/lua/lua_PhysicsVehicleWheel.cpp +++ b/gameplay/src/lua/lua_PhysicsVehicleWheel.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_PhysicsVehicleWheel.h" @@ -12,9 +13,6 @@ #include "PhysicsVehicle.h" #include "PhysicsVehicleWheel.h" #include "ScriptController.h" -#include "lua_PhysicsCollisionObjectCollisionListenerEventType.h" -#include "lua_PhysicsCollisionObjectType.h" -#include "lua_PhysicsCollisionShapeType.h" namespace gameplay { @@ -24,11 +22,6 @@ void luaRegister_PhysicsVehicleWheel() const luaL_Reg lua_members[] = { {"addCollisionListener", lua_PhysicsVehicleWheel_addCollisionListener}, - {"asCharacter", lua_PhysicsVehicleWheel_asCharacter}, - {"asGhostObject", lua_PhysicsVehicleWheel_asGhostObject}, - {"asRigidBody", lua_PhysicsVehicleWheel_asRigidBody}, - {"asVehicle", lua_PhysicsVehicleWheel_asVehicle}, - {"asVehicleWheel", lua_PhysicsVehicleWheel_asVehicleWheel}, {"collidesWith", lua_PhysicsVehicleWheel_collidesWith}, {"getCollisionShape", lua_PhysicsVehicleWheel_getCollisionShape}, {"getFrictionBreakout", lua_PhysicsVehicleWheel_getFrictionBreakout}, @@ -192,226 +185,6 @@ int lua_PhysicsVehicleWheel_addCollisionListener(lua_State* state) return 0; } -int lua_PhysicsVehicleWheel_asCharacter(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->asCharacter(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsCharacter"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicleWheel_asCharacter - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicleWheel_asGhostObject(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->asGhostObject(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsGhostObject"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicleWheel_asGhostObject - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicleWheel_asRigidBody(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->asRigidBody(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsRigidBody"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicleWheel_asRigidBody - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicleWheel_asVehicle(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicle(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicle"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicleWheel_asVehicle - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - -int lua_PhysicsVehicleWheel_asVehicleWheel(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 1: - { - if ((lua_type(state, 1) == LUA_TUSERDATA)) - { - PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->asVehicleWheel(); - if (returnPtr) - { - gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); - object->instance = returnPtr; - object->owns = false; - luaL_getmetatable(state, "PhysicsVehicleWheel"); - lua_setmetatable(state, -2); - } - else - { - lua_pushnil(state); - } - - return 1; - } - - lua_pushstring(state, "lua_PhysicsVehicleWheel_asVehicleWheel - Failed to match the given parameters to a valid function signature."); - lua_error(state); - break; - } - default: - { - lua_pushstring(state, "Invalid number of parameters (expected 1)."); - lua_error(state); - break; - } - } - return 0; -} - int lua_PhysicsVehicleWheel_collidesWith(lua_State* state) { // Get the number of parameters. @@ -470,7 +243,7 @@ int lua_PhysicsVehicleWheel_getCollisionShape(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->getCollisionShape(); + void* returnPtr = ((void*)instance->getCollisionShape()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -549,7 +322,7 @@ int lua_PhysicsVehicleWheel_getNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { PhysicsVehicleWheel* instance = getInstance(state); - void* returnPtr = (void*)instance->getNode(); + void* returnPtr = ((void*)instance->getNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -631,7 +404,7 @@ int lua_PhysicsVehicleWheel_getShapeType(lua_State* state) PhysicsCollisionShape::Type result = instance->getShapeType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionShapeType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -918,7 +691,7 @@ int lua_PhysicsVehicleWheel_getType(lua_State* state) PhysicsCollisionObject::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PhysicsCollisionObjectType(result)); + lua_pushnumber(state, (int)result); return 1; } diff --git a/gameplay/src/lua/lua_PhysicsVehicleWheel.h b/gameplay/src/lua/lua_PhysicsVehicleWheel.h index dd44e85298..b6d9d7fae6 100644 --- a/gameplay/src/lua/lua_PhysicsVehicleWheel.h +++ b/gameplay/src/lua/lua_PhysicsVehicleWheel.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PHYSICSVEHICLEWHEEL_H_ #define LUA_PHYSICSVEHICLEWHEEL_H_ @@ -6,11 +7,6 @@ namespace gameplay // Lua bindings for PhysicsVehicleWheel. int lua_PhysicsVehicleWheel_addCollisionListener(lua_State* state); -int lua_PhysicsVehicleWheel_asCharacter(lua_State* state); -int lua_PhysicsVehicleWheel_asGhostObject(lua_State* state); -int lua_PhysicsVehicleWheel_asRigidBody(lua_State* state); -int lua_PhysicsVehicleWheel_asVehicle(lua_State* state); -int lua_PhysicsVehicleWheel_asVehicleWheel(lua_State* state); int lua_PhysicsVehicleWheel_collidesWith(lua_State* state); int lua_PhysicsVehicleWheel_getCollisionShape(lua_State* state); int lua_PhysicsVehicleWheel_getFrictionBreakout(lua_State* state); diff --git a/gameplay/src/lua/lua_Plane.cpp b/gameplay/src/lua/lua_Plane.cpp index ed39f92656..ebac1f1f19 100644 --- a/gameplay/src/lua/lua_Plane.cpp +++ b/gameplay/src/lua/lua_Plane.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Plane.h" @@ -94,7 +95,7 @@ int lua_Plane__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new Plane(); + void* returnPtr = ((void*)new Plane()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -123,7 +124,7 @@ int lua_Plane__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Plane(*param1); + void* returnPtr = ((void*)new Plane(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -161,7 +162,7 @@ int lua_Plane__init(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)new Plane(*param1, param2); + void* returnPtr = ((void*)new Plane(*param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -204,7 +205,7 @@ int lua_Plane__init(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)new Plane(param1, param2, param3, param4); + void* returnPtr = ((void*)new Plane(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Plane.h b/gameplay/src/lua/lua_Plane.h index 75351175c9..be23efc483 100644 --- a/gameplay/src/lua/lua_Plane.h +++ b/gameplay/src/lua/lua_Plane.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PLANE_H_ #define LUA_PLANE_H_ diff --git a/gameplay/src/lua/lua_Platform.cpp b/gameplay/src/lua/lua_Platform.cpp index f77e272d04..2954c12aaa 100644 --- a/gameplay/src/lua/lua_Platform.cpp +++ b/gameplay/src/lua/lua_Platform.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Platform.h" diff --git a/gameplay/src/lua/lua_Platform.h b/gameplay/src/lua/lua_Platform.h index 52695a86ed..ee71f27d49 100644 --- a/gameplay/src/lua/lua_Platform.h +++ b/gameplay/src/lua/lua_Platform.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PLATFORM_H_ #define LUA_PLATFORM_H_ diff --git a/gameplay/src/lua/lua_Properties.cpp b/gameplay/src/lua/lua_Properties.cpp index a0c836922a..17a1557da0 100644 --- a/gameplay/src/lua/lua_Properties.cpp +++ b/gameplay/src/lua/lua_Properties.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Properties.h" @@ -5,7 +6,6 @@ #include "FileSystem.h" #include "Properties.h" #include "Quaternion.h" -#include "lua_PropertiesType.h" namespace gameplay { @@ -582,7 +582,7 @@ int lua_Properties_getNamespace(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Properties* instance = getInstance(state); - void* returnPtr = (void*)instance->getNamespace(param1); + void* returnPtr = ((void*)instance->getNamespace(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -619,7 +619,7 @@ int lua_Properties_getNamespace(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); Properties* instance = getInstance(state); - void* returnPtr = (void*)instance->getNamespace(param1, param2); + void* returnPtr = ((void*)instance->getNamespace(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -660,7 +660,7 @@ int lua_Properties_getNamespace(lua_State* state) bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4); Properties* instance = getInstance(state); - void* returnPtr = (void*)instance->getNamespace(param1, param2, param3); + void* returnPtr = ((void*)instance->getNamespace(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -705,7 +705,7 @@ int lua_Properties_getNextNamespace(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Properties* instance = getInstance(state); - void* returnPtr = (void*)instance->getNextNamespace(); + void* returnPtr = ((void*)instance->getNextNamespace()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -917,7 +917,7 @@ int lua_Properties_getType(lua_State* state) Properties::Type result = instance->getType(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PropertiesType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -938,7 +938,7 @@ int lua_Properties_getType(lua_State* state) Properties::Type result = instance->getType(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_PropertiesType(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1298,7 +1298,7 @@ int lua_Properties_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Properties::create(param1); + void* returnPtr = ((void*)Properties::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Properties.h b/gameplay/src/lua/lua_Properties.h index e887584135..cff920fce3 100644 --- a/gameplay/src/lua/lua_Properties.h +++ b/gameplay/src/lua/lua_Properties.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_PROPERTIES_H_ #define LUA_PROPERTIES_H_ diff --git a/gameplay/src/lua/lua_PropertiesType.cpp b/gameplay/src/lua/lua_PropertiesType.cpp deleted file mode 100644 index 36a5eed4fb..0000000000 --- a/gameplay/src/lua/lua_PropertiesType.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "Base.h" -#include "lua_PropertiesType.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_PropertiesType_NONE = "NONE"; -static const char* luaEnumString_PropertiesType_STRING = "STRING"; -static const char* luaEnumString_PropertiesType_NUMBER = "NUMBER"; -static const char* luaEnumString_PropertiesType_VECTOR2 = "VECTOR2"; -static const char* luaEnumString_PropertiesType_VECTOR3 = "VECTOR3"; -static const char* luaEnumString_PropertiesType_VECTOR4 = "VECTOR4"; -static const char* luaEnumString_PropertiesType_MATRIX = "MATRIX"; - -Properties::Type lua_enumFromString_PropertiesType(const char* s) -{ - if (strcmp(s, luaEnumString_PropertiesType_NONE) == 0) - return Properties::NONE; - if (strcmp(s, luaEnumString_PropertiesType_STRING) == 0) - return Properties::STRING; - if (strcmp(s, luaEnumString_PropertiesType_NUMBER) == 0) - return Properties::NUMBER; - if (strcmp(s, luaEnumString_PropertiesType_VECTOR2) == 0) - return Properties::VECTOR2; - if (strcmp(s, luaEnumString_PropertiesType_VECTOR3) == 0) - return Properties::VECTOR3; - if (strcmp(s, luaEnumString_PropertiesType_VECTOR4) == 0) - return Properties::VECTOR4; - if (strcmp(s, luaEnumString_PropertiesType_MATRIX) == 0) - return Properties::MATRIX; - return Properties::NONE; -} - -const char* lua_stringFromEnum_PropertiesType(Properties::Type e) -{ - if (e == Properties::NONE) - return luaEnumString_PropertiesType_NONE; - if (e == Properties::STRING) - return luaEnumString_PropertiesType_STRING; - if (e == Properties::NUMBER) - return luaEnumString_PropertiesType_NUMBER; - if (e == Properties::VECTOR2) - return luaEnumString_PropertiesType_VECTOR2; - if (e == Properties::VECTOR3) - return luaEnumString_PropertiesType_VECTOR3; - if (e == Properties::VECTOR4) - return luaEnumString_PropertiesType_VECTOR4; - if (e == Properties::MATRIX) - return luaEnumString_PropertiesType_MATRIX; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_PropertiesType.h b/gameplay/src/lua/lua_PropertiesType.h deleted file mode 100644 index c8b2fb51dc..0000000000 --- a/gameplay/src/lua/lua_PropertiesType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_PROPERTIESTYPE_H_ -#define LUA_PROPERTIESTYPE_H_ - -#include "Properties.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for Properties::Type. -Properties::Type lua_enumFromString_PropertiesType(const char* s); -const char* lua_stringFromEnum_PropertiesType(Properties::Type e); - -} - -#endif diff --git a/gameplay/src/lua/lua_Quaternion.cpp b/gameplay/src/lua/lua_Quaternion.cpp index ec26147709..4386d241be 100644 --- a/gameplay/src/lua/lua_Quaternion.cpp +++ b/gameplay/src/lua/lua_Quaternion.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Quaternion.h" @@ -98,7 +99,7 @@ int lua_Quaternion__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new Quaternion(); + void* returnPtr = ((void*)new Quaternion()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -124,7 +125,7 @@ int lua_Quaternion__init(lua_State* state) // Get parameter 1 off the stack. gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getFloatPointer(1); - void* returnPtr = (void*)new Quaternion(param1); + void* returnPtr = ((void*)new Quaternion(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -152,7 +153,7 @@ int lua_Quaternion__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Quaternion(*param1); + void* returnPtr = ((void*)new Quaternion(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -180,7 +181,7 @@ int lua_Quaternion__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Quaternion(*param1); + void* returnPtr = ((void*)new Quaternion(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -218,7 +219,7 @@ int lua_Quaternion__init(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)new Quaternion(*param1, param2); + void* returnPtr = ((void*)new Quaternion(*param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -261,7 +262,7 @@ int lua_Quaternion__init(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)new Quaternion(param1, param2, param3, param4); + void* returnPtr = ((void*)new Quaternion(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Quaternion.h b/gameplay/src/lua/lua_Quaternion.h index 5b35f8dd06..4d5aeb8256 100644 --- a/gameplay/src/lua/lua_Quaternion.h +++ b/gameplay/src/lua/lua_Quaternion.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_QUATERNION_H_ #define LUA_QUATERNION_H_ diff --git a/gameplay/src/lua/lua_RadioButton.cpp b/gameplay/src/lua/lua_RadioButton.cpp index d6d6f95bbf..4cf3f2d813 100644 --- a/gameplay/src/lua/lua_RadioButton.cpp +++ b/gameplay/src/lua/lua_RadioButton.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_RadioButton.h" @@ -10,18 +11,13 @@ #include "Game.h" #include "Gamepad.h" #include "Label.h" +#include "MaterialParameter.h" #include "Node.h" #include "RadioButton.h" #include "Ref.h" #include "ScriptController.h" #include "ScriptTarget.h" #include "Theme.h" -#include "lua_ControlAlignment.h" -#include "lua_ControlAutoSize.h" -#include "lua_ControlListenerEventType.h" -#include "lua_ControlState.h" -#include "lua_CurveInterpolationType.h" -#include "lua_FontJustify.h" namespace gameplay { @@ -32,8 +28,10 @@ void luaRegister_RadioButton() { {"addListener", lua_RadioButton_addListener}, {"addRef", lua_RadioButton_addRef}, + {"addScript", lua_RadioButton_addScript}, {"addScriptCallback", lua_RadioButton_addScriptCallback}, {"canFocus", lua_RadioButton_canFocus}, + {"clearScripts", lua_RadioButton_clearScripts}, {"createAnimation", lua_RadioButton_createAnimation}, {"createAnimationFromBy", lua_RadioButton_createAnimationFromBy}, {"createAnimationFromTo", lua_RadioButton_createAnimationFromTo}, @@ -66,6 +64,7 @@ void luaRegister_RadioButton() {"getPadding", lua_RadioButton_getPadding}, {"getParent", lua_RadioButton_getParent}, {"getRefCount", lua_RadioButton_getRefCount}, + {"getScriptEvent", lua_RadioButton_getScriptEvent}, {"getSkinColor", lua_RadioButton_getSkinColor}, {"getSkinRegion", lua_RadioButton_getSkinRegion}, {"getState", lua_RadioButton_getState}, @@ -76,12 +75,13 @@ void luaRegister_RadioButton() {"getTextRightToLeft", lua_RadioButton_getTextRightToLeft}, {"getTheme", lua_RadioButton_getTheme}, {"getTopLevelForm", lua_RadioButton_getTopLevelForm}, - {"getType", lua_RadioButton_getType}, + {"getTypeName", lua_RadioButton_getTypeName}, {"getWidth", lua_RadioButton_getWidth}, {"getX", lua_RadioButton_getX}, {"getY", lua_RadioButton_getY}, {"getZIndex", lua_RadioButton_getZIndex}, {"hasFocus", lua_RadioButton_hasFocus}, + {"hasScriptListener", lua_RadioButton_hasScriptListener}, {"isChild", lua_RadioButton_isChild}, {"isContainer", lua_RadioButton_isContainer}, {"isEnabled", lua_RadioButton_isEnabled}, @@ -95,6 +95,7 @@ void luaRegister_RadioButton() {"isYPercentage", lua_RadioButton_isYPercentage}, {"release", lua_RadioButton_release}, {"removeListener", lua_RadioButton_removeListener}, + {"removeScript", lua_RadioButton_removeScript}, {"removeScriptCallback", lua_RadioButton_removeScriptCallback}, {"setAlignment", lua_RadioButton_setAlignment}, {"setAnimationPropertyValue", lua_RadioButton_setAnimationPropertyValue}, @@ -275,6 +276,54 @@ int lua_RadioButton_addRef(lua_State* state) return 0; } +int lua_RadioButton_addScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + RadioButton* instance = getInstance(state); + void* returnPtr = ((void*)instance->addScript(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "Script"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_RadioButton_addScript - 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; +} + int lua_RadioButton_addScriptCallback(lua_State* state) { // Get the number of parameters. @@ -286,14 +335,20 @@ int lua_RadioButton_addScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); RadioButton* instance = getInstance(state); instance->addScriptCallback(param1, param2); @@ -350,6 +405,38 @@ int lua_RadioButton_canFocus(lua_State* state) return 0; } +int lua_RadioButton_clearScripts(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + RadioButton* instance = getInstance(state); + instance->clearScripts(); + + return 0; + } + + lua_pushstring(state, "lua_RadioButton_clearScripts - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + int lua_RadioButton_createAnimation(lua_State* state) { // Get the number of parameters. @@ -373,7 +460,7 @@ int lua_RadioButton_createAnimation(lua_State* state) const char* param2 = gameplay::ScriptUtil::getString(3, false); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -407,7 +494,7 @@ int lua_RadioButton_createAnimation(lua_State* state) break; RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2); + void* returnPtr = ((void*)instance->createAnimation(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -439,7 +526,7 @@ int lua_RadioButton_createAnimation(lua_State* state) lua_type(state, 4) == LUA_TNUMBER && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL)) + lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -457,10 +544,10 @@ int lua_RadioButton_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param5 = gameplay::ScriptUtil::getFloatPointer(6); // Get parameter 6 off the stack. - Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7)); + Curve::InterpolationType param6 = (Curve::InterpolationType)luaL_checkint(state, 7); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -494,7 +581,7 @@ int lua_RadioButton_createAnimation(lua_State* state) (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) && (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) && (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL)) + lua_type(state, 9) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); @@ -518,10 +605,10 @@ int lua_RadioButton_createAnimation(lua_State* state) gameplay::ScriptUtil::LuaArray param7 = gameplay::ScriptUtil::getFloatPointer(8); // Get parameter 8 off the stack. - Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9)); + Curve::InterpolationType param8 = (Curve::InterpolationType)luaL_checkint(state, 9); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8); + void* returnPtr = ((void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -568,7 +655,7 @@ int lua_RadioButton_createAnimationFromBy(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -584,13 +671,13 @@ int lua_RadioButton_createAnimationFromBy(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -636,7 +723,7 @@ int lua_RadioButton_createAnimationFromTo(lua_State* state) lua_type(state, 3) == LUA_TNUMBER && (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) && (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) && - (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) && + lua_type(state, 6) == LUA_TNUMBER && lua_type(state, 7) == LUA_TNUMBER) { // Get parameter 1 off the stack. @@ -652,13 +739,13 @@ int lua_RadioButton_createAnimationFromTo(lua_State* state) gameplay::ScriptUtil::LuaArray param4 = gameplay::ScriptUtil::getFloatPointer(5); // Get parameter 5 off the stack. - Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6)); + Curve::InterpolationType param5 = (Curve::InterpolationType)luaL_checkint(state, 6); // Get parameter 6 off the stack. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -799,7 +886,7 @@ int lua_RadioButton_getAlignment(lua_State* state) Control::Alignment result = instance->getAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -831,7 +918,7 @@ int lua_RadioButton_getAnimation(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(); + void* returnPtr = ((void*)instance->getAnimation()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -861,7 +948,7 @@ int lua_RadioButton_getAnimation(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getAnimation(param1); + void* returnPtr = ((void*)instance->getAnimation(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -993,7 +1080,7 @@ int lua_RadioButton_getAutoSize(lua_State* state) Control::AutoSize result = instance->getAutoSize(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -1049,10 +1136,10 @@ int lua_RadioButton_getBorder(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getBorder(param1)); @@ -1264,10 +1351,10 @@ int lua_RadioButton_getCursorColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorColor(param1)); @@ -1312,10 +1399,10 @@ int lua_RadioButton_getCursorRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorRegion(param1)); @@ -1360,10 +1447,10 @@ int lua_RadioButton_getCursorUVs(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getCursorUVs(param1)); @@ -1445,7 +1532,7 @@ int lua_RadioButton_getFont(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(); + void* returnPtr = ((void*)instance->getFont()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1469,13 +1556,13 @@ int lua_RadioButton_getFont(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getFont(param1); + void* returnPtr = ((void*)instance->getFont(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1534,10 +1621,10 @@ int lua_RadioButton_getFontSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); unsigned int result = instance->getFontSize(param1); @@ -1679,13 +1766,13 @@ int lua_RadioButton_getImageColor(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageColor(param1, param2)); @@ -1731,13 +1818,13 @@ int lua_RadioButton_getImageRegion(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageRegion(param1, param2)); @@ -1783,13 +1870,13 @@ int lua_RadioButton_getImageUVs(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3)); + Control::State param2 = (Control::State)luaL_checkint(state, 3); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getImageUVs(param1, param2)); @@ -1895,10 +1982,10 @@ int lua_RadioButton_getOpacity(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); float result = instance->getOpacity(param1); @@ -1980,7 +2067,7 @@ int lua_RadioButton_getParent(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getParent(); + void* returnPtr = ((void*)instance->getParent()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2046,6 +2133,54 @@ int lua_RadioButton_getRefCount(lua_State* state) return 0; } +int lua_RadioButton_getScriptEvent(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + RadioButton* instance = getInstance(state); + void* returnPtr = ((void*)instance->getScriptEvent(param1)); + if (returnPtr) + { + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); + object->instance = returnPtr; + object->owns = false; + luaL_getmetatable(state, "ScriptTargetEvent"); + lua_setmetatable(state, -2); + } + else + { + lua_pushnil(state); + } + + return 1; + } + + lua_pushstring(state, "lua_RadioButton_getScriptEvent - 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; +} + int lua_RadioButton_getSkinColor(lua_State* state) { // Get the number of parameters. @@ -2083,10 +2218,10 @@ int lua_RadioButton_getSkinColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinColor(param1)); @@ -2157,10 +2292,10 @@ int lua_RadioButton_getSkinRegion(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getSkinRegion(param1)); @@ -2210,7 +2345,7 @@ int lua_RadioButton_getState(lua_State* state) Control::State result = instance->getState(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_ControlState(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2242,7 +2377,7 @@ int lua_RadioButton_getStyle(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getStyle(); + void* returnPtr = ((void*)instance->getStyle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2324,7 +2459,7 @@ int lua_RadioButton_getTextAlignment(lua_State* state) Font::Justify result = instance->getTextAlignment(); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2336,16 +2471,16 @@ int lua_RadioButton_getTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); Font::Justify result = instance->getTextAlignment(param1); // Push the return value onto the stack. - lua_pushstring(state, lua_stringFromEnum_FontJustify(result)); + lua_pushnumber(state, (int)result); return 1; } @@ -2401,10 +2536,10 @@ int lua_RadioButton_getTextColor(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); void* returnPtr = (void*)&(instance->getTextColor(param1)); @@ -2466,10 +2601,10 @@ int lua_RadioButton_getTextRightToLeft(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2)); + Control::State param1 = (Control::State)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); bool result = instance->getTextRightToLeft(param1); @@ -2507,7 +2642,7 @@ int lua_RadioButton_getTheme(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getTheme(); + void* returnPtr = ((void*)instance->getTheme()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2551,7 +2686,7 @@ int lua_RadioButton_getTopLevelForm(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - void* returnPtr = (void*)instance->getTopLevelForm(); + void* returnPtr = ((void*)instance->getTopLevelForm()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -2582,7 +2717,7 @@ int lua_RadioButton_getTopLevelForm(lua_State* state) return 0; } -int lua_RadioButton_getType(lua_State* state) +int lua_RadioButton_getTypeName(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -2595,7 +2730,7 @@ int lua_RadioButton_getType(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RadioButton* instance = getInstance(state); - const char* result = instance->getType(); + const char* result = instance->getTypeName(); // Push the return value onto the stack. lua_pushstring(state, result); @@ -2603,7 +2738,7 @@ int lua_RadioButton_getType(lua_State* state) return 1; } - lua_pushstring(state, "lua_RadioButton_getType - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_RadioButton_getTypeName - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -2792,6 +2927,69 @@ int lua_RadioButton_hasFocus(lua_State* state) return 0; } +int lua_RadioButton_hasScriptListener(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: + { + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + RadioButton* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + do + { + if ((lua_type(state, 1) == LUA_TUSERDATA) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + break; + + RadioButton* instance = getInstance(state); + bool result = instance->hasScriptListener(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + } while (0); + + lua_pushstring(state, "lua_RadioButton_hasScriptListener - 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; +} + int lua_RadioButton_isChild(lua_State* state) { // Get the number of parameters. @@ -3261,6 +3459,45 @@ int lua_RadioButton_removeListener(lua_State* state) return 0; } +int lua_RadioButton_removeScript(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + RadioButton* instance = getInstance(state); + bool result = instance->removeScript(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_RadioButton_removeScript - 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; +} + int lua_RadioButton_removeScriptCallback(lua_State* state) { // Get the number of parameters. @@ -3272,14 +3509,20 @@ int lua_RadioButton_removeScriptCallback(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) && (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. - std::string param1 = gameplay::ScriptUtil::getString(2, true); + bool param1Valid; + gameplay::ScriptUtil::LuaArray param1 = gameplay::ScriptUtil::getObjectPointer(2, "ScriptTargetEvent", false, ¶m1Valid); + if (!param1Valid) + { + lua_pushstring(state, "Failed to convert parameter 1 to type 'ScriptTarget::Event'."); + lua_error(state); + } // Get parameter 2 off the stack. - std::string param2 = gameplay::ScriptUtil::getString(3, true); + const char* param2 = gameplay::ScriptUtil::getString(3, false); RadioButton* instance = getInstance(state); instance->removeScriptCallback(param1, param2); @@ -3312,10 +3555,10 @@ int lua_RadioButton_setAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2)); + Control::Alignment param1 = (Control::Alignment)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); instance->setAlignment(param1); @@ -3426,10 +3669,10 @@ int lua_RadioButton_setAutoSize(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2)); + Control::AutoSize param1 = (Control::AutoSize)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); instance->setAutoSize(param1); @@ -4759,10 +5002,10 @@ int lua_RadioButton_setTextAlignment(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); RadioButton* instance = getInstance(state); instance->setTextAlignment(param1); @@ -4777,11 +5020,11 @@ int lua_RadioButton_setTextAlignment(lua_State* state) case 3: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. - Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2)); + Font::Justify param1 = (Font::Justify)luaL_checkint(state, 2); // Get parameter 2 off the stack. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3); @@ -5314,7 +5557,7 @@ int lua_RadioButton_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)RadioButton::create(param1); + void* returnPtr = ((void*)RadioButton::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -5352,7 +5595,7 @@ int lua_RadioButton_static_create(lua_State* state) lua_error(state); } - void* returnPtr = (void*)RadioButton::create(param1, param2); + void* returnPtr = ((void*)RadioButton::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_RadioButton.h b/gameplay/src/lua/lua_RadioButton.h index 7ef1048844..4e72a57a69 100644 --- a/gameplay/src/lua/lua_RadioButton.h +++ b/gameplay/src/lua/lua_RadioButton.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_RADIOBUTTON_H_ #define LUA_RADIOBUTTON_H_ @@ -8,8 +9,10 @@ namespace gameplay int lua_RadioButton__gc(lua_State* state); int lua_RadioButton_addListener(lua_State* state); int lua_RadioButton_addRef(lua_State* state); +int lua_RadioButton_addScript(lua_State* state); int lua_RadioButton_addScriptCallback(lua_State* state); int lua_RadioButton_canFocus(lua_State* state); +int lua_RadioButton_clearScripts(lua_State* state); int lua_RadioButton_createAnimation(lua_State* state); int lua_RadioButton_createAnimationFromBy(lua_State* state); int lua_RadioButton_createAnimationFromTo(lua_State* state); @@ -42,6 +45,7 @@ int lua_RadioButton_getOpacity(lua_State* state); int lua_RadioButton_getPadding(lua_State* state); int lua_RadioButton_getParent(lua_State* state); int lua_RadioButton_getRefCount(lua_State* state); +int lua_RadioButton_getScriptEvent(lua_State* state); int lua_RadioButton_getSkinColor(lua_State* state); int lua_RadioButton_getSkinRegion(lua_State* state); int lua_RadioButton_getState(lua_State* state); @@ -52,12 +56,13 @@ int lua_RadioButton_getTextColor(lua_State* state); int lua_RadioButton_getTextRightToLeft(lua_State* state); int lua_RadioButton_getTheme(lua_State* state); int lua_RadioButton_getTopLevelForm(lua_State* state); -int lua_RadioButton_getType(lua_State* state); +int lua_RadioButton_getTypeName(lua_State* state); int lua_RadioButton_getWidth(lua_State* state); int lua_RadioButton_getX(lua_State* state); int lua_RadioButton_getY(lua_State* state); int lua_RadioButton_getZIndex(lua_State* state); int lua_RadioButton_hasFocus(lua_State* state); +int lua_RadioButton_hasScriptListener(lua_State* state); int lua_RadioButton_isChild(lua_State* state); int lua_RadioButton_isContainer(lua_State* state); int lua_RadioButton_isEnabled(lua_State* state); @@ -71,6 +76,7 @@ int lua_RadioButton_isXPercentage(lua_State* state); int lua_RadioButton_isYPercentage(lua_State* state); int lua_RadioButton_release(lua_State* state); int lua_RadioButton_removeListener(lua_State* state); +int lua_RadioButton_removeScript(lua_State* state); int lua_RadioButton_removeScriptCallback(lua_State* state); int lua_RadioButton_setAlignment(lua_State* state); int lua_RadioButton_setAnimationPropertyValue(lua_State* state); diff --git a/gameplay/src/lua/lua_Ray.cpp b/gameplay/src/lua/lua_Ray.cpp index fcf896bee5..3c9916ec0c 100644 --- a/gameplay/src/lua/lua_Ray.cpp +++ b/gameplay/src/lua/lua_Ray.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Ray.h" @@ -89,7 +90,7 @@ int lua_Ray__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new Ray(); + void* returnPtr = ((void*)new Ray()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -118,7 +119,7 @@ int lua_Ray__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Ray(*param1); + void* returnPtr = ((void*)new Ray(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -159,7 +160,7 @@ int lua_Ray__init(lua_State* state) if (!param2Valid) break; - void* returnPtr = (void*)new Ray(*param1, *param2); + void* returnPtr = ((void*)new Ray(*param1, *param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -210,7 +211,7 @@ int lua_Ray__init(lua_State* state) // Get parameter 6 off the stack. float param6 = (float)luaL_checknumber(state, 6); - void* returnPtr = (void*)new Ray(param1, param2, param3, param4, param5, param6); + void* returnPtr = ((void*)new Ray(param1, param2, param3, param4, param5, param6)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Ray.h b/gameplay/src/lua/lua_Ray.h index 91ef364a5c..aa9f85f6c6 100644 --- a/gameplay/src/lua/lua_Ray.h +++ b/gameplay/src/lua/lua_Ray.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_RAY_H_ #define LUA_RAY_H_ diff --git a/gameplay/src/lua/lua_Rectangle.cpp b/gameplay/src/lua/lua_Rectangle.cpp index 1a2032c7db..e46699ab9d 100644 --- a/gameplay/src/lua/lua_Rectangle.cpp +++ b/gameplay/src/lua/lua_Rectangle.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Rectangle.h" @@ -94,7 +95,7 @@ int lua_Rectangle__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new Rectangle(); + void* returnPtr = ((void*)new Rectangle()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -123,7 +124,7 @@ int lua_Rectangle__init(lua_State* state) if (!param1Valid) break; - void* returnPtr = (void*)new Rectangle(*param1); + void* returnPtr = ((void*)new Rectangle(*param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -158,7 +159,7 @@ int lua_Rectangle__init(lua_State* state) // Get parameter 2 off the stack. float param2 = (float)luaL_checknumber(state, 2); - void* returnPtr = (void*)new Rectangle(param1, param2); + void* returnPtr = ((void*)new Rectangle(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -201,7 +202,7 @@ int lua_Rectangle__init(lua_State* state) // Get parameter 4 off the stack. float param4 = (float)luaL_checknumber(state, 4); - void* returnPtr = (void*)new Rectangle(param1, param2, param3, param4); + void* returnPtr = ((void*)new Rectangle(param1, param2, param3, param4)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Rectangle.h b/gameplay/src/lua/lua_Rectangle.h index 20ba15d7e0..cd3930823d 100644 --- a/gameplay/src/lua/lua_Rectangle.h +++ b/gameplay/src/lua/lua_Rectangle.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_RECTANGLE_H_ #define LUA_RECTANGLE_H_ diff --git a/gameplay/src/lua/lua_Ref.cpp b/gameplay/src/lua/lua_Ref.cpp index ae5bcd6063..082f0f16ca 100644 --- a/gameplay/src/lua/lua_Ref.cpp +++ b/gameplay/src/lua/lua_Ref.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Ref.h" diff --git a/gameplay/src/lua/lua_Ref.h b/gameplay/src/lua/lua_Ref.h index 89c1f05383..1ea13e7666 100644 --- a/gameplay/src/lua/lua_Ref.h +++ b/gameplay/src/lua/lua_Ref.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_REF_H_ #define LUA_REF_H_ diff --git a/gameplay/src/lua/lua_RenderState.cpp b/gameplay/src/lua/lua_RenderState.cpp index 5df06474f1..6575dc72f4 100644 --- a/gameplay/src/lua/lua_RenderState.cpp +++ b/gameplay/src/lua/lua_RenderState.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_RenderState.h" @@ -9,13 +10,6 @@ #include "RenderState.h" #include "Scene.h" #include "Technique.h" -#include "lua_RenderStateAutoBinding.h" -#include "lua_RenderStateBlend.h" -#include "lua_RenderStateCullFaceSide.h" -#include "lua_RenderStateDepthFunction.h" -#include "lua_RenderStateFrontFace.h" -#include "lua_RenderStateStencilFunction.h" -#include "lua_RenderStateStencilOperation.h" namespace gameplay { @@ -180,7 +174,7 @@ int lua_RenderState_getParameter(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); RenderState* instance = getInstance(state); - void* returnPtr = (void*)instance->getParameter(param1); + void* returnPtr = ((void*)instance->getParameter(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -228,7 +222,7 @@ int lua_RenderState_getParameterByIndex(lua_State* state) unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2); RenderState* instance = getInstance(state); - void* returnPtr = (void*)instance->getParameterByIndex(param1); + void* returnPtr = ((void*)instance->getParameterByIndex(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -342,7 +336,7 @@ int lua_RenderState_getStateBlock(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RenderState* instance = getInstance(state); - void* returnPtr = (void*)instance->getStateBlock(); + void* returnPtr = ((void*)instance->getStateBlock()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -497,13 +491,13 @@ int lua_RenderState_setParameterAutoBinding(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL)) + lua_type(state, 3) == LUA_TNUMBER) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - RenderState::AutoBinding param2 = (RenderState::AutoBinding)lua_enumFromString_RenderStateAutoBinding(luaL_checkstring(state, 3)); + RenderState::AutoBinding param2 = (RenderState::AutoBinding)luaL_checkint(state, 3); RenderState* instance = getInstance(state); instance->setParameterAutoBinding(param1, param2); diff --git a/gameplay/src/lua/lua_RenderState.h b/gameplay/src/lua/lua_RenderState.h index f0b068809e..89f6b67933 100644 --- a/gameplay/src/lua/lua_RenderState.h +++ b/gameplay/src/lua/lua_RenderState.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_RENDERSTATE_H_ #define LUA_RENDERSTATE_H_ diff --git a/gameplay/src/lua/lua_RenderStateAutoBinding.cpp b/gameplay/src/lua/lua_RenderStateAutoBinding.cpp deleted file mode 100644 index e3d6b50db9..0000000000 --- a/gameplay/src/lua/lua_RenderStateAutoBinding.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateAutoBinding.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateAutoBinding_NONE = "NONE"; -static const char* luaEnumString_RenderStateAutoBinding_WORLD_MATRIX = "WORLD_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_VIEW_MATRIX = "VIEW_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_PROJECTION_MATRIX = "PROJECTION_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_WORLD_VIEW_MATRIX = "WORLD_VIEW_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_VIEW_PROJECTION_MATRIX = "VIEW_PROJECTION_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_WORLD_VIEW_PROJECTION_MATRIX = "WORLD_VIEW_PROJECTION_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_INVERSE_TRANSPOSE_WORLD_MATRIX = "INVERSE_TRANSPOSE_WORLD_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX = "INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX"; -static const char* luaEnumString_RenderStateAutoBinding_CAMERA_WORLD_POSITION = "CAMERA_WORLD_POSITION"; -static const char* luaEnumString_RenderStateAutoBinding_CAMERA_VIEW_POSITION = "CAMERA_VIEW_POSITION"; -static const char* luaEnumString_RenderStateAutoBinding_MATRIX_PALETTE = "MATRIX_PALETTE"; -static const char* luaEnumString_RenderStateAutoBinding_SCENE_AMBIENT_COLOR = "SCENE_AMBIENT_COLOR"; - -RenderState::AutoBinding lua_enumFromString_RenderStateAutoBinding(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateAutoBinding_NONE) == 0) - return RenderState::NONE; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_WORLD_MATRIX) == 0) - return RenderState::WORLD_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_VIEW_MATRIX) == 0) - return RenderState::VIEW_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_PROJECTION_MATRIX) == 0) - return RenderState::PROJECTION_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_WORLD_VIEW_MATRIX) == 0) - return RenderState::WORLD_VIEW_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_VIEW_PROJECTION_MATRIX) == 0) - return RenderState::VIEW_PROJECTION_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_WORLD_VIEW_PROJECTION_MATRIX) == 0) - return RenderState::WORLD_VIEW_PROJECTION_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_INVERSE_TRANSPOSE_WORLD_MATRIX) == 0) - return RenderState::INVERSE_TRANSPOSE_WORLD_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX) == 0) - return RenderState::INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_CAMERA_WORLD_POSITION) == 0) - return RenderState::CAMERA_WORLD_POSITION; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_CAMERA_VIEW_POSITION) == 0) - return RenderState::CAMERA_VIEW_POSITION; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_MATRIX_PALETTE) == 0) - return RenderState::MATRIX_PALETTE; - if (strcmp(s, luaEnumString_RenderStateAutoBinding_SCENE_AMBIENT_COLOR) == 0) - return RenderState::SCENE_AMBIENT_COLOR; - return RenderState::NONE; -} - -const char* lua_stringFromEnum_RenderStateAutoBinding(RenderState::AutoBinding e) -{ - if (e == RenderState::NONE) - return luaEnumString_RenderStateAutoBinding_NONE; - if (e == RenderState::WORLD_MATRIX) - return luaEnumString_RenderStateAutoBinding_WORLD_MATRIX; - if (e == RenderState::VIEW_MATRIX) - return luaEnumString_RenderStateAutoBinding_VIEW_MATRIX; - if (e == RenderState::PROJECTION_MATRIX) - return luaEnumString_RenderStateAutoBinding_PROJECTION_MATRIX; - if (e == RenderState::WORLD_VIEW_MATRIX) - return luaEnumString_RenderStateAutoBinding_WORLD_VIEW_MATRIX; - if (e == RenderState::VIEW_PROJECTION_MATRIX) - return luaEnumString_RenderStateAutoBinding_VIEW_PROJECTION_MATRIX; - if (e == RenderState::WORLD_VIEW_PROJECTION_MATRIX) - return luaEnumString_RenderStateAutoBinding_WORLD_VIEW_PROJECTION_MATRIX; - if (e == RenderState::INVERSE_TRANSPOSE_WORLD_MATRIX) - return luaEnumString_RenderStateAutoBinding_INVERSE_TRANSPOSE_WORLD_MATRIX; - if (e == RenderState::INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX) - return luaEnumString_RenderStateAutoBinding_INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX; - if (e == RenderState::CAMERA_WORLD_POSITION) - return luaEnumString_RenderStateAutoBinding_CAMERA_WORLD_POSITION; - if (e == RenderState::CAMERA_VIEW_POSITION) - return luaEnumString_RenderStateAutoBinding_CAMERA_VIEW_POSITION; - if (e == RenderState::MATRIX_PALETTE) - return luaEnumString_RenderStateAutoBinding_MATRIX_PALETTE; - if (e == RenderState::SCENE_AMBIENT_COLOR) - return luaEnumString_RenderStateAutoBinding_SCENE_AMBIENT_COLOR; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateAutoBinding.h b/gameplay/src/lua/lua_RenderStateAutoBinding.h deleted file mode 100644 index d3fd28afe6..0000000000 --- a/gameplay/src/lua/lua_RenderStateAutoBinding.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATEAUTOBINDING_H_ -#define LUA_RENDERSTATEAUTOBINDING_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::AutoBinding. -RenderState::AutoBinding lua_enumFromString_RenderStateAutoBinding(const char* s); -const char* lua_stringFromEnum_RenderStateAutoBinding(RenderState::AutoBinding e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderStateBlend.cpp b/gameplay/src/lua/lua_RenderStateBlend.cpp deleted file mode 100644 index 800827ea4d..0000000000 --- a/gameplay/src/lua/lua_RenderStateBlend.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateBlend.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateBlend_BLEND_ZERO = "BLEND_ZERO"; -static const char* luaEnumString_RenderStateBlend_BLEND_ONE = "BLEND_ONE"; -static const char* luaEnumString_RenderStateBlend_BLEND_SRC_COLOR = "BLEND_SRC_COLOR"; -static const char* luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_SRC_COLOR = "BLEND_ONE_MINUS_SRC_COLOR"; -static const char* luaEnumString_RenderStateBlend_BLEND_DST_COLOR = "BLEND_DST_COLOR"; -static const char* luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_DST_COLOR = "BLEND_ONE_MINUS_DST_COLOR"; -static const char* luaEnumString_RenderStateBlend_BLEND_SRC_ALPHA = "BLEND_SRC_ALPHA"; -static const char* luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_SRC_ALPHA = "BLEND_ONE_MINUS_SRC_ALPHA"; -static const char* luaEnumString_RenderStateBlend_BLEND_DST_ALPHA = "BLEND_DST_ALPHA"; -static const char* luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_DST_ALPHA = "BLEND_ONE_MINUS_DST_ALPHA"; -static const char* luaEnumString_RenderStateBlend_BLEND_CONSTANT_ALPHA = "BLEND_CONSTANT_ALPHA"; -static const char* luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_CONSTANT_ALPHA = "BLEND_ONE_MINUS_CONSTANT_ALPHA"; -static const char* luaEnumString_RenderStateBlend_BLEND_SRC_ALPHA_SATURATE = "BLEND_SRC_ALPHA_SATURATE"; - -RenderState::Blend lua_enumFromString_RenderStateBlend(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ZERO) == 0) - return RenderState::BLEND_ZERO; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ONE) == 0) - return RenderState::BLEND_ONE; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_SRC_COLOR) == 0) - return RenderState::BLEND_SRC_COLOR; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_SRC_COLOR) == 0) - return RenderState::BLEND_ONE_MINUS_SRC_COLOR; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_DST_COLOR) == 0) - return RenderState::BLEND_DST_COLOR; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_DST_COLOR) == 0) - return RenderState::BLEND_ONE_MINUS_DST_COLOR; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_SRC_ALPHA) == 0) - return RenderState::BLEND_SRC_ALPHA; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_SRC_ALPHA) == 0) - return RenderState::BLEND_ONE_MINUS_SRC_ALPHA; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_DST_ALPHA) == 0) - return RenderState::BLEND_DST_ALPHA; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_DST_ALPHA) == 0) - return RenderState::BLEND_ONE_MINUS_DST_ALPHA; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_CONSTANT_ALPHA) == 0) - return RenderState::BLEND_CONSTANT_ALPHA; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_CONSTANT_ALPHA) == 0) - return RenderState::BLEND_ONE_MINUS_CONSTANT_ALPHA; - if (strcmp(s, luaEnumString_RenderStateBlend_BLEND_SRC_ALPHA_SATURATE) == 0) - return RenderState::BLEND_SRC_ALPHA_SATURATE; - return RenderState::BLEND_ZERO; -} - -const char* lua_stringFromEnum_RenderStateBlend(RenderState::Blend e) -{ - if (e == RenderState::BLEND_ZERO) - return luaEnumString_RenderStateBlend_BLEND_ZERO; - if (e == RenderState::BLEND_ONE) - return luaEnumString_RenderStateBlend_BLEND_ONE; - if (e == RenderState::BLEND_SRC_COLOR) - return luaEnumString_RenderStateBlend_BLEND_SRC_COLOR; - if (e == RenderState::BLEND_ONE_MINUS_SRC_COLOR) - return luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_SRC_COLOR; - if (e == RenderState::BLEND_DST_COLOR) - return luaEnumString_RenderStateBlend_BLEND_DST_COLOR; - if (e == RenderState::BLEND_ONE_MINUS_DST_COLOR) - return luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_DST_COLOR; - if (e == RenderState::BLEND_SRC_ALPHA) - return luaEnumString_RenderStateBlend_BLEND_SRC_ALPHA; - if (e == RenderState::BLEND_ONE_MINUS_SRC_ALPHA) - return luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_SRC_ALPHA; - if (e == RenderState::BLEND_DST_ALPHA) - return luaEnumString_RenderStateBlend_BLEND_DST_ALPHA; - if (e == RenderState::BLEND_ONE_MINUS_DST_ALPHA) - return luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_DST_ALPHA; - if (e == RenderState::BLEND_CONSTANT_ALPHA) - return luaEnumString_RenderStateBlend_BLEND_CONSTANT_ALPHA; - if (e == RenderState::BLEND_ONE_MINUS_CONSTANT_ALPHA) - return luaEnumString_RenderStateBlend_BLEND_ONE_MINUS_CONSTANT_ALPHA; - if (e == RenderState::BLEND_SRC_ALPHA_SATURATE) - return luaEnumString_RenderStateBlend_BLEND_SRC_ALPHA_SATURATE; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateBlend.h b/gameplay/src/lua/lua_RenderStateBlend.h deleted file mode 100644 index f77b9bad9e..0000000000 --- a/gameplay/src/lua/lua_RenderStateBlend.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATEBLEND_H_ -#define LUA_RENDERSTATEBLEND_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::Blend. -RenderState::Blend lua_enumFromString_RenderStateBlend(const char* s); -const char* lua_stringFromEnum_RenderStateBlend(RenderState::Blend e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderStateCullFaceSide.cpp b/gameplay/src/lua/lua_RenderStateCullFaceSide.cpp deleted file mode 100644 index 29229283f4..0000000000 --- a/gameplay/src/lua/lua_RenderStateCullFaceSide.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateCullFaceSide.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_BACK = "CULL_FACE_SIDE_BACK"; -static const char* luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_FRONT = "CULL_FACE_SIDE_FRONT"; -static const char* luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_FRONT_AND_BACK = "CULL_FACE_SIDE_FRONT_AND_BACK"; - -RenderState::CullFaceSide lua_enumFromString_RenderStateCullFaceSide(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_BACK) == 0) - return RenderState::CULL_FACE_SIDE_BACK; - if (strcmp(s, luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_FRONT) == 0) - return RenderState::CULL_FACE_SIDE_FRONT; - if (strcmp(s, luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_FRONT_AND_BACK) == 0) - return RenderState::CULL_FACE_SIDE_FRONT_AND_BACK; - return RenderState::CULL_FACE_SIDE_BACK; -} - -const char* lua_stringFromEnum_RenderStateCullFaceSide(RenderState::CullFaceSide e) -{ - if (e == RenderState::CULL_FACE_SIDE_BACK) - return luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_BACK; - if (e == RenderState::CULL_FACE_SIDE_FRONT) - return luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_FRONT; - if (e == RenderState::CULL_FACE_SIDE_FRONT_AND_BACK) - return luaEnumString_RenderStateCullFaceSide_CULL_FACE_SIDE_FRONT_AND_BACK; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateCullFaceSide.h b/gameplay/src/lua/lua_RenderStateCullFaceSide.h deleted file mode 100644 index 2f17294ba9..0000000000 --- a/gameplay/src/lua/lua_RenderStateCullFaceSide.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATECULLFACESIDE_H_ -#define LUA_RENDERSTATECULLFACESIDE_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::CullFaceSide. -RenderState::CullFaceSide lua_enumFromString_RenderStateCullFaceSide(const char* s); -const char* lua_stringFromEnum_RenderStateCullFaceSide(RenderState::CullFaceSide e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderStateDepthFunction.cpp b/gameplay/src/lua/lua_RenderStateDepthFunction.cpp deleted file mode 100644 index 2a782d9663..0000000000 --- a/gameplay/src/lua/lua_RenderStateDepthFunction.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateDepthFunction.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_NEVER = "DEPTH_NEVER"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_LESS = "DEPTH_LESS"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_EQUAL = "DEPTH_EQUAL"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_LEQUAL = "DEPTH_LEQUAL"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_GREATER = "DEPTH_GREATER"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_NOTEQUAL = "DEPTH_NOTEQUAL"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_GEQUAL = "DEPTH_GEQUAL"; -static const char* luaEnumString_RenderStateDepthFunction_DEPTH_ALWAYS = "DEPTH_ALWAYS"; - -RenderState::DepthFunction lua_enumFromString_RenderStateDepthFunction(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_NEVER) == 0) - return RenderState::DEPTH_NEVER; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_LESS) == 0) - return RenderState::DEPTH_LESS; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_EQUAL) == 0) - return RenderState::DEPTH_EQUAL; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_LEQUAL) == 0) - return RenderState::DEPTH_LEQUAL; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_GREATER) == 0) - return RenderState::DEPTH_GREATER; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_NOTEQUAL) == 0) - return RenderState::DEPTH_NOTEQUAL; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_GEQUAL) == 0) - return RenderState::DEPTH_GEQUAL; - if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_ALWAYS) == 0) - return RenderState::DEPTH_ALWAYS; - return RenderState::DEPTH_NEVER; -} - -const char* lua_stringFromEnum_RenderStateDepthFunction(RenderState::DepthFunction e) -{ - if (e == RenderState::DEPTH_NEVER) - return luaEnumString_RenderStateDepthFunction_DEPTH_NEVER; - if (e == RenderState::DEPTH_LESS) - return luaEnumString_RenderStateDepthFunction_DEPTH_LESS; - if (e == RenderState::DEPTH_EQUAL) - return luaEnumString_RenderStateDepthFunction_DEPTH_EQUAL; - if (e == RenderState::DEPTH_LEQUAL) - return luaEnumString_RenderStateDepthFunction_DEPTH_LEQUAL; - if (e == RenderState::DEPTH_GREATER) - return luaEnumString_RenderStateDepthFunction_DEPTH_GREATER; - if (e == RenderState::DEPTH_NOTEQUAL) - return luaEnumString_RenderStateDepthFunction_DEPTH_NOTEQUAL; - if (e == RenderState::DEPTH_GEQUAL) - return luaEnumString_RenderStateDepthFunction_DEPTH_GEQUAL; - if (e == RenderState::DEPTH_ALWAYS) - return luaEnumString_RenderStateDepthFunction_DEPTH_ALWAYS; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateDepthFunction.h b/gameplay/src/lua/lua_RenderStateDepthFunction.h deleted file mode 100644 index 027025a0ed..0000000000 --- a/gameplay/src/lua/lua_RenderStateDepthFunction.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATEDEPTHFUNCTION_H_ -#define LUA_RENDERSTATEDEPTHFUNCTION_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::DepthFunction. -RenderState::DepthFunction lua_enumFromString_RenderStateDepthFunction(const char* s); -const char* lua_stringFromEnum_RenderStateDepthFunction(RenderState::DepthFunction e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderStateFrontFace.cpp b/gameplay/src/lua/lua_RenderStateFrontFace.cpp deleted file mode 100644 index 743e01ee56..0000000000 --- a/gameplay/src/lua/lua_RenderStateFrontFace.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateFrontFace.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateFrontFace_FRONT_FACE_CW = "FRONT_FACE_CW"; -static const char* luaEnumString_RenderStateFrontFace_FRONT_FACE_CCW = "FRONT_FACE_CCW"; - -RenderState::FrontFace lua_enumFromString_RenderStateFrontFace(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateFrontFace_FRONT_FACE_CW) == 0) - return RenderState::FRONT_FACE_CW; - if (strcmp(s, luaEnumString_RenderStateFrontFace_FRONT_FACE_CCW) == 0) - return RenderState::FRONT_FACE_CCW; - return RenderState::FRONT_FACE_CW; -} - -const char* lua_stringFromEnum_RenderStateFrontFace(RenderState::FrontFace e) -{ - if (e == RenderState::FRONT_FACE_CW) - return luaEnumString_RenderStateFrontFace_FRONT_FACE_CW; - if (e == RenderState::FRONT_FACE_CCW) - return luaEnumString_RenderStateFrontFace_FRONT_FACE_CCW; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateFrontFace.h b/gameplay/src/lua/lua_RenderStateFrontFace.h deleted file mode 100644 index e5ef194cd4..0000000000 --- a/gameplay/src/lua/lua_RenderStateFrontFace.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATEFRONTFACE_H_ -#define LUA_RENDERSTATEFRONTFACE_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::FrontFace. -RenderState::FrontFace lua_enumFromString_RenderStateFrontFace(const char* s); -const char* lua_stringFromEnum_RenderStateFrontFace(RenderState::FrontFace e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderStateStateBlock.cpp b/gameplay/src/lua/lua_RenderStateStateBlock.cpp index 98d2f0a2e2..f14f895ad6 100644 --- a/gameplay/src/lua/lua_RenderStateStateBlock.cpp +++ b/gameplay/src/lua/lua_RenderStateStateBlock.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_RenderStateStateBlock.h" @@ -9,13 +10,6 @@ #include "RenderState.h" #include "Scene.h" #include "Technique.h" -#include "lua_RenderStateAutoBinding.h" -#include "lua_RenderStateBlend.h" -#include "lua_RenderStateCullFaceSide.h" -#include "lua_RenderStateDepthFunction.h" -#include "lua_RenderStateFrontFace.h" -#include "lua_RenderStateStencilFunction.h" -#include "lua_RenderStateStencilOperation.h" namespace gameplay { @@ -278,10 +272,10 @@ int lua_RenderStateStateBlock_setBlendDst(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::Blend param1 = (RenderState::Blend)lua_enumFromString_RenderStateBlend(luaL_checkstring(state, 2)); + RenderState::Blend param1 = (RenderState::Blend)luaL_checkint(state, 2); RenderState::StateBlock* instance = getInstance(state); instance->setBlendDst(param1); @@ -314,10 +308,10 @@ int lua_RenderStateStateBlock_setBlendSrc(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::Blend param1 = (RenderState::Blend)lua_enumFromString_RenderStateBlend(luaL_checkstring(state, 2)); + RenderState::Blend param1 = (RenderState::Blend)luaL_checkint(state, 2); RenderState::StateBlock* instance = getInstance(state); instance->setBlendSrc(param1); @@ -386,10 +380,10 @@ int lua_RenderStateStateBlock_setCullFaceSide(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::CullFaceSide param1 = (RenderState::CullFaceSide)lua_enumFromString_RenderStateCullFaceSide(luaL_checkstring(state, 2)); + RenderState::CullFaceSide param1 = (RenderState::CullFaceSide)luaL_checkint(state, 2); RenderState::StateBlock* instance = getInstance(state); instance->setCullFaceSide(param1); @@ -422,10 +416,10 @@ int lua_RenderStateStateBlock_setDepthFunction(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::DepthFunction param1 = (RenderState::DepthFunction)lua_enumFromString_RenderStateDepthFunction(luaL_checkstring(state, 2)); + RenderState::DepthFunction param1 = (RenderState::DepthFunction)luaL_checkint(state, 2); RenderState::StateBlock* instance = getInstance(state); instance->setDepthFunction(param1); @@ -530,10 +524,10 @@ int lua_RenderStateStateBlock_setFrontFace(lua_State* state) case 2: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::FrontFace param1 = (RenderState::FrontFace)lua_enumFromString_RenderStateFrontFace(luaL_checkstring(state, 2)); + RenderState::FrontFace param1 = (RenderState::FrontFace)luaL_checkint(state, 2); RenderState::StateBlock* instance = getInstance(state); instance->setFrontFace(param1); @@ -606,12 +600,12 @@ int lua_RenderStateStateBlock_setStencilFunction(lua_State* state) case 4: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && + lua_type(state, 2) == LUA_TNUMBER && lua_type(state, 3) == LUA_TNUMBER && lua_type(state, 4) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::StencilFunction param1 = (RenderState::StencilFunction)lua_enumFromString_RenderStateStencilFunction(luaL_checkstring(state, 2)); + RenderState::StencilFunction param1 = (RenderState::StencilFunction)luaL_checkint(state, 2); // Get parameter 2 off the stack. int param2 = (int)luaL_checkint(state, 3); @@ -650,18 +644,18 @@ int lua_RenderStateStateBlock_setStencilOperation(lua_State* state) case 4: { if ((lua_type(state, 1) == LUA_TUSERDATA) && - (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) && - (lua_type(state, 4) == LUA_TSTRING || lua_type(state, 4) == LUA_TNIL)) + lua_type(state, 2) == LUA_TNUMBER && + lua_type(state, 3) == LUA_TNUMBER && + lua_type(state, 4) == LUA_TNUMBER) { // Get parameter 1 off the stack. - RenderState::StencilOperation param1 = (RenderState::StencilOperation)lua_enumFromString_RenderStateStencilOperation(luaL_checkstring(state, 2)); + RenderState::StencilOperation param1 = (RenderState::StencilOperation)luaL_checkint(state, 2); // Get parameter 2 off the stack. - RenderState::StencilOperation param2 = (RenderState::StencilOperation)lua_enumFromString_RenderStateStencilOperation(luaL_checkstring(state, 3)); + RenderState::StencilOperation param2 = (RenderState::StencilOperation)luaL_checkint(state, 3); // Get parameter 3 off the stack. - RenderState::StencilOperation param3 = (RenderState::StencilOperation)lua_enumFromString_RenderStateStencilOperation(luaL_checkstring(state, 4)); + RenderState::StencilOperation param3 = (RenderState::StencilOperation)luaL_checkint(state, 4); RenderState::StateBlock* instance = getInstance(state); instance->setStencilOperation(param1, param2, param3); @@ -765,7 +759,7 @@ int lua_RenderStateStateBlock_static_create(lua_State* state) { case 0: { - void* returnPtr = (void*)RenderState::StateBlock::create(); + void* returnPtr = ((void*)RenderState::StateBlock::create()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_RenderStateStateBlock.h b/gameplay/src/lua/lua_RenderStateStateBlock.h index c147523cc2..9d87a8cbc7 100644 --- a/gameplay/src/lua/lua_RenderStateStateBlock.h +++ b/gameplay/src/lua/lua_RenderStateStateBlock.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_RENDERSTATESTATEBLOCK_H_ #define LUA_RENDERSTATESTATEBLOCK_H_ diff --git a/gameplay/src/lua/lua_RenderStateStencilFunction.cpp b/gameplay/src/lua/lua_RenderStateStencilFunction.cpp deleted file mode 100644 index 662ce78c93..0000000000 --- a/gameplay/src/lua/lua_RenderStateStencilFunction.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateStencilFunction.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_NEVER = "STENCIL_NEVER"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_ALWAYS = "STENCIL_ALWAYS"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_LESS = "STENCIL_LESS"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_LEQUAL = "STENCIL_LEQUAL"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_EQUAL = "STENCIL_EQUAL"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_GREATER = "STENCIL_GREATER"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_GEQUAL = "STENCIL_GEQUAL"; -static const char* luaEnumString_RenderStateStencilFunction_STENCIL_NOTEQUAL = "STENCIL_NOTEQUAL"; - -RenderState::StencilFunction lua_enumFromString_RenderStateStencilFunction(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_NEVER) == 0) - return RenderState::STENCIL_NEVER; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_ALWAYS) == 0) - return RenderState::STENCIL_ALWAYS; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_LESS) == 0) - return RenderState::STENCIL_LESS; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_LEQUAL) == 0) - return RenderState::STENCIL_LEQUAL; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_EQUAL) == 0) - return RenderState::STENCIL_EQUAL; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_GREATER) == 0) - return RenderState::STENCIL_GREATER; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_GEQUAL) == 0) - return RenderState::STENCIL_GEQUAL; - if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_NOTEQUAL) == 0) - return RenderState::STENCIL_NOTEQUAL; - return RenderState::STENCIL_NEVER; -} - -const char* lua_stringFromEnum_RenderStateStencilFunction(RenderState::StencilFunction e) -{ - if (e == RenderState::STENCIL_NEVER) - return luaEnumString_RenderStateStencilFunction_STENCIL_NEVER; - if (e == RenderState::STENCIL_ALWAYS) - return luaEnumString_RenderStateStencilFunction_STENCIL_ALWAYS; - if (e == RenderState::STENCIL_LESS) - return luaEnumString_RenderStateStencilFunction_STENCIL_LESS; - if (e == RenderState::STENCIL_LEQUAL) - return luaEnumString_RenderStateStencilFunction_STENCIL_LEQUAL; - if (e == RenderState::STENCIL_EQUAL) - return luaEnumString_RenderStateStencilFunction_STENCIL_EQUAL; - if (e == RenderState::STENCIL_GREATER) - return luaEnumString_RenderStateStencilFunction_STENCIL_GREATER; - if (e == RenderState::STENCIL_GEQUAL) - return luaEnumString_RenderStateStencilFunction_STENCIL_GEQUAL; - if (e == RenderState::STENCIL_NOTEQUAL) - return luaEnumString_RenderStateStencilFunction_STENCIL_NOTEQUAL; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateStencilFunction.h b/gameplay/src/lua/lua_RenderStateStencilFunction.h deleted file mode 100644 index 1f33347277..0000000000 --- a/gameplay/src/lua/lua_RenderStateStencilFunction.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATESTENCILFUNCTION_H_ -#define LUA_RENDERSTATESTENCILFUNCTION_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::StencilFunction. -RenderState::StencilFunction lua_enumFromString_RenderStateStencilFunction(const char* s); -const char* lua_stringFromEnum_RenderStateStencilFunction(RenderState::StencilFunction e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderStateStencilOperation.cpp b/gameplay/src/lua/lua_RenderStateStencilOperation.cpp deleted file mode 100644 index b5ee77cab4..0000000000 --- a/gameplay/src/lua/lua_RenderStateStencilOperation.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "Base.h" -#include "lua_RenderStateStencilOperation.h" - -namespace gameplay -{ - -static const char* enumStringEmpty = ""; - -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_KEEP = "STENCIL_OP_KEEP"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_ZERO = "STENCIL_OP_ZERO"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_REPLACE = "STENCIL_OP_REPLACE"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR = "STENCIL_OP_INCR"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR = "STENCIL_OP_DECR"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_INVERT = "STENCIL_OP_INVERT"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR_WRAP = "STENCIL_OP_INCR_WRAP"; -static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR_WRAP = "STENCIL_OP_DECR_WRAP"; - -RenderState::StencilOperation lua_enumFromString_RenderStateStencilOperation(const char* s) -{ - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_KEEP) == 0) - return RenderState::STENCIL_OP_KEEP; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_ZERO) == 0) - return RenderState::STENCIL_OP_ZERO; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_REPLACE) == 0) - return RenderState::STENCIL_OP_REPLACE; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR) == 0) - return RenderState::STENCIL_OP_INCR; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR) == 0) - return RenderState::STENCIL_OP_DECR; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_INVERT) == 0) - return RenderState::STENCIL_OP_INVERT; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR_WRAP) == 0) - return RenderState::STENCIL_OP_INCR_WRAP; - if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR_WRAP) == 0) - return RenderState::STENCIL_OP_DECR_WRAP; - return RenderState::STENCIL_OP_KEEP; -} - -const char* lua_stringFromEnum_RenderStateStencilOperation(RenderState::StencilOperation e) -{ - if (e == RenderState::STENCIL_OP_KEEP) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_KEEP; - if (e == RenderState::STENCIL_OP_ZERO) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_ZERO; - if (e == RenderState::STENCIL_OP_REPLACE) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_REPLACE; - if (e == RenderState::STENCIL_OP_INCR) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR; - if (e == RenderState::STENCIL_OP_DECR) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR; - if (e == RenderState::STENCIL_OP_INVERT) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_INVERT; - if (e == RenderState::STENCIL_OP_INCR_WRAP) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR_WRAP; - if (e == RenderState::STENCIL_OP_DECR_WRAP) - return luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR_WRAP; - return enumStringEmpty; -} - -} - diff --git a/gameplay/src/lua/lua_RenderStateStencilOperation.h b/gameplay/src/lua/lua_RenderStateStencilOperation.h deleted file mode 100644 index 2a596f2897..0000000000 --- a/gameplay/src/lua/lua_RenderStateStencilOperation.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LUA_RENDERSTATESTENCILOPERATION_H_ -#define LUA_RENDERSTATESTENCILOPERATION_H_ - -#include "RenderState.h" - -namespace gameplay -{ - -// Lua bindings for enum conversion functions for RenderState::StencilOperation. -RenderState::StencilOperation lua_enumFromString_RenderStateStencilOperation(const char* s); -const char* lua_stringFromEnum_RenderStateStencilOperation(RenderState::StencilOperation e); - -} - -#endif diff --git a/gameplay/src/lua/lua_RenderTarget.cpp b/gameplay/src/lua/lua_RenderTarget.cpp index 2ae5e8c889..06fe999ee6 100644 --- a/gameplay/src/lua/lua_RenderTarget.cpp +++ b/gameplay/src/lua/lua_RenderTarget.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_RenderTarget.h" @@ -228,7 +229,7 @@ int lua_RenderTarget_getTexture(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { RenderTarget* instance = getInstance(state); - void* returnPtr = (void*)instance->getTexture(); + void* returnPtr = ((void*)instance->getTexture()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -350,7 +351,7 @@ int lua_RenderTarget_static_create(lua_State* state) if (!param2Valid) break; - void* returnPtr = (void*)RenderTarget::create(param1, param2); + void* returnPtr = ((void*)RenderTarget::create(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -389,7 +390,7 @@ int lua_RenderTarget_static_create(lua_State* state) // Get parameter 3 off the stack. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 3); - void* returnPtr = (void*)RenderTarget::create(param1, param2, param3); + void* returnPtr = ((void*)RenderTarget::create(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -436,7 +437,7 @@ int lua_RenderTarget_static_getRenderTarget(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)RenderTarget::getRenderTarget(param1); + void* returnPtr = ((void*)RenderTarget::getRenderTarget(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_RenderTarget.h b/gameplay/src/lua/lua_RenderTarget.h index 647ab137e0..c6fcd58017 100644 --- a/gameplay/src/lua/lua_RenderTarget.h +++ b/gameplay/src/lua/lua_RenderTarget.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_RENDERTARGET_H_ #define LUA_RENDERTARGET_H_ diff --git a/gameplay/src/lua/lua_Scene.cpp b/gameplay/src/lua/lua_Scene.cpp index e7fb1d5f9d..2e1050218e 100644 --- a/gameplay/src/lua/lua_Scene.cpp +++ b/gameplay/src/lua/lua_Scene.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_Scene.h" @@ -113,7 +114,7 @@ int lua_Scene_addNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->addNode(); + void* returnPtr = ((void*)instance->addNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -146,7 +147,7 @@ int lua_Scene_addNode(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->addNode(param1); + void* returnPtr = ((void*)instance->addNode(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -281,7 +282,7 @@ int lua_Scene_findNode(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1); + void* returnPtr = ((void*)instance->findNode(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -315,7 +316,7 @@ int lua_Scene_findNode(lua_State* state) bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1, param2); + void* returnPtr = ((void*)instance->findNode(param1, param2)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -353,7 +354,7 @@ int lua_Scene_findNode(lua_State* state) bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4); Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->findNode(param1, param2, param3); + void* returnPtr = ((void*)instance->findNode(param1, param2, param3)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -397,7 +398,7 @@ int lua_Scene_getActiveCamera(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->getActiveCamera(); + void* returnPtr = ((void*)instance->getActiveCamera()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -485,7 +486,7 @@ int lua_Scene_getFirstNode(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->getFirstNode(); + void* returnPtr = ((void*)instance->getFirstNode()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -564,7 +565,7 @@ int lua_Scene_getNext(lua_State* state) if ((lua_type(state, 1) == LUA_TUSERDATA)) { Scene* instance = getInstance(state); - void* returnPtr = (void*)instance->getNext(); + void* returnPtr = ((void*)instance->getNext()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -935,7 +936,7 @@ int lua_Scene_static_create(lua_State* state) { case 0: { - void* returnPtr = (void*)Scene::create(); + void* returnPtr = ((void*)Scene::create()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -959,7 +960,7 @@ int lua_Scene_static_create(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Scene::create(param1); + void* returnPtr = ((void*)Scene::create(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1000,7 +1001,7 @@ int lua_Scene_static_getScene(lua_State* state) { case 0: { - void* returnPtr = (void*)Scene::getScene(); + void* returnPtr = ((void*)Scene::getScene()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1024,7 +1025,7 @@ int lua_Scene_static_getScene(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Scene::getScene(param1); + void* returnPtr = ((void*)Scene::getScene(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); @@ -1070,7 +1071,7 @@ int lua_Scene_static_load(lua_State* state) // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(1, false); - void* returnPtr = (void*)Scene::load(param1); + void* returnPtr = ((void*)Scene::load(param1)); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_Scene.h b/gameplay/src/lua/lua_Scene.h index 73e92d50ea..246eaa249b 100644 --- a/gameplay/src/lua/lua_Scene.h +++ b/gameplay/src/lua/lua_Scene.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_SCENE_H_ #define LUA_SCENE_H_ diff --git a/gameplay/src/lua/lua_ScreenDisplayer.cpp b/gameplay/src/lua/lua_ScreenDisplayer.cpp index acdd2f90d3..459301ef39 100644 --- a/gameplay/src/lua/lua_ScreenDisplayer.cpp +++ b/gameplay/src/lua/lua_ScreenDisplayer.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_ScreenDisplayer.h" @@ -79,7 +80,7 @@ int lua_ScreenDisplayer__init(lua_State* state) { case 0: { - void* returnPtr = (void*)new ScreenDisplayer(); + void* returnPtr = ((void*)new ScreenDisplayer()); if (returnPtr) { gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject)); diff --git a/gameplay/src/lua/lua_ScreenDisplayer.h b/gameplay/src/lua/lua_ScreenDisplayer.h index eabf329a67..9d34604942 100644 --- a/gameplay/src/lua/lua_ScreenDisplayer.h +++ b/gameplay/src/lua/lua_ScreenDisplayer.h @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #ifndef LUA_SCREENDISPLAYER_H_ #define LUA_SCREENDISPLAYER_H_ diff --git a/gameplay/src/lua/lua_Script.cpp b/gameplay/src/lua/lua_Script.cpp new file mode 100644 index 0000000000..33466560b3 --- /dev/null +++ b/gameplay/src/lua/lua_Script.cpp @@ -0,0 +1,321 @@ +// Autogenerated by gameplay-luagen +#include "Base.h" +#include "ScriptController.h" +#include "lua_Script.h" +#include "Base.h" +#include "Game.h" +#include "Ref.h" +#include "Script.h" +#include "ScriptController.h" + +namespace gameplay +{ + +void luaRegister_Script() +{ + const luaL_Reg lua_members[] = + { + {"addRef", lua_Script_addRef}, + {"functionExists", lua_Script_functionExists}, + {"getPath", lua_Script_getPath}, + {"getRefCount", lua_Script_getRefCount}, + {"getScope", lua_Script_getScope}, + {"release", lua_Script_release}, + {"reload", lua_Script_reload}, + {NULL, NULL} + }; + const luaL_Reg* lua_statics = NULL; + std::vector scopePath; + + gameplay::ScriptUtil::registerClass("Script", lua_members, NULL, lua_Script__gc, lua_statics, scopePath); +} + +static Script* getInstance(lua_State* state) +{ + void* userdata = luaL_checkudata(state, 1, "Script"); + luaL_argcheck(state, userdata != NULL, 1, "'Script' expected."); + return (Script*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance; +} + +int lua_Script__gc(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + void* userdata = luaL_checkudata(state, 1, "Script"); + luaL_argcheck(state, userdata != NULL, 1, "'Script' expected."); + gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata; + if (object->owns) + { + Script* instance = (Script*)object->instance; + SAFE_RELEASE(instance); + } + + return 0; + } + + lua_pushstring(state, "lua_Script__gc - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Script_addRef(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Script* instance = getInstance(state); + instance->addRef(); + + return 0; + } + + lua_pushstring(state, "lua_Script_addRef - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Script_functionExists(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_TUSERDATA) && + (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL)) + { + // Get parameter 1 off the stack. + const char* param1 = gameplay::ScriptUtil::getString(2, false); + + Script* instance = getInstance(state); + bool result = instance->functionExists(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Script_functionExists - 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; +} + +int lua_Script_getPath(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Script* instance = getInstance(state); + const char* result = instance->getPath(); + + // Push the return value onto the stack. + lua_pushstring(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Script_getPath - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Script_getRefCount(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Script* instance = getInstance(state); + unsigned int result = instance->getRefCount(); + + // Push the return value onto the stack. + lua_pushunsigned(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Script_getRefCount - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Script_getScope(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Script* instance = getInstance(state); + Script::Scope result = instance->getScope(); + + // Push the return value onto the stack. + lua_pushnumber(state, (int)result); + + return 1; + } + + lua_pushstring(state, "lua_Script_getScope - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Script_release(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Script* instance = getInstance(state); + instance->release(); + + return 0; + } + + lua_pushstring(state, "lua_Script_release - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +int lua_Script_reload(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 1: + { + if ((lua_type(state, 1) == LUA_TUSERDATA)) + { + Script* instance = getInstance(state); + bool result = instance->reload(); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; + } + + lua_pushstring(state, "lua_Script_reload - Failed to match the given parameters to a valid function signature."); + lua_error(state); + break; + } + default: + { + lua_pushstring(state, "Invalid number of parameters (expected 1)."); + lua_error(state); + break; + } + } + return 0; +} + +} diff --git a/gameplay/src/lua/lua_Script.h b/gameplay/src/lua/lua_Script.h new file mode 100644 index 0000000000..bc8efee34a --- /dev/null +++ b/gameplay/src/lua/lua_Script.h @@ -0,0 +1,22 @@ +// Autogenerated by gameplay-luagen +#ifndef LUA_SCRIPT_H_ +#define LUA_SCRIPT_H_ + +namespace gameplay +{ + +// Lua bindings for Script. +int lua_Script__gc(lua_State* state); +int lua_Script_addRef(lua_State* state); +int lua_Script_functionExists(lua_State* state); +int lua_Script_getPath(lua_State* state); +int lua_Script_getRefCount(lua_State* state); +int lua_Script_getScope(lua_State* state); +int lua_Script_release(lua_State* state); +int lua_Script_reload(lua_State* state); + +void luaRegister_Script(); + +} + +#endif diff --git a/gameplay/src/lua/lua_ScriptController.cpp b/gameplay/src/lua/lua_ScriptController.cpp index 49f8bdbaa2..d06e32319c 100644 --- a/gameplay/src/lua/lua_ScriptController.cpp +++ b/gameplay/src/lua/lua_ScriptController.cpp @@ -1,3 +1,4 @@ +// Autogenerated by gameplay-luagen #include "Base.h" #include "ScriptController.h" #include "lua_ScriptController.h" @@ -12,10 +13,9 @@ void luaRegister_ScriptController() { const luaL_Reg lua_members[] = { + {"functionExists", lua_ScriptController_functionExists}, + {"getCurrentScript", lua_ScriptController_getCurrentScript}, {"loadScript", lua_ScriptController_loadScript}, - {"loadUrl", lua_ScriptController_loadUrl}, - {"registerCallback", lua_ScriptController_registerCallback}, - {"unregisterCallback", lua_ScriptController_unregisterCallback}, {NULL, NULL} }; const luaL_Reg lua_statics[] = @@ -35,7 +35,7 @@ static ScriptController* getInstance(lua_State* state) return (ScriptController*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance; } -int lua_ScriptController_loadScript(lua_State* state) +int lua_ScriptController_functionExists(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); @@ -52,12 +52,15 @@ int lua_ScriptController_loadScript(lua_State* state) const char* param1 = gameplay::ScriptUtil::getString(2, false); ScriptController* instance = getInstance(state); - instance->loadScript(param1); - - return 0; + bool result = instance->functionExists(param1); + + // Push the return value onto the stack. + lua_pushboolean(state, result); + + return 1; } - lua_pushstring(state, "lua_ScriptController_loadScript - Failed to match the given parameters to a valid function signature."); + lua_pushstring(state, "lua_ScriptController_functionExists - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } @@ -65,21 +68,30 @@ int lua_ScriptController_loadScript(lua_State* state) { if ((lua_type(state, 1) == LUA_TUSERDATA) && (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) && - lua_type(state, 3) == LUA_TBOOLEAN) + (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL)) { // Get parameter 1 off the stack. const char* param1 = gameplay::ScriptUtil::getString(2, false); // Get parameter 2 off the stack. - bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3); + bool param2Valid; + gameplay::ScriptUtil::LuaArray