Browse Source

Merge branch 'next' of https://github.com/gameplay3d/GamePlay

seanpaultaylor 11 years ago
parent
commit
5a1aecca71
100 changed files with 3966 additions and 3716 deletions
  1. 171 247
      .gitignore
  2. 28 1
      CHANGES.md
  3. 3 2
      CMakeLists.txt
  4. 9 9
      README.md
  5. 0 60
      build.xml
  6. 0 155
      codestyle.xml
  7. 1 1
      gameplay.doxyfile
  8. 1 85
      gameplay.sln
  9. 0 9
      gameplay.xcworkspace/contents.xcworkspacedata
  10. 131 170
      gameplay/.cproject
  11. 83 77
      gameplay/.project
  12. 29 109
      gameplay/CMakeLists.txt
  13. 13 0
      gameplay/android/.classpath
  14. 57 0
      gameplay/android/.cproject
  15. 38 21
      gameplay/android/.project
  16. 6 11
      gameplay/android/AndroidManifest.xml
  17. 28 70
      gameplay/android/build.xml
  18. 33 56
      gameplay/android/jni/Android.mk
  19. 7 3
      gameplay/android/jni/Application.mk
  20. 3 0
      gameplay/android/project.properties
  21. BIN
      gameplay/android/res/drawable/icon.png
  22. 562 0
      gameplay/gameplay.pro
  23. 48 253
      gameplay/gameplay.vcxproj
  24. 80 308
      gameplay/gameplay.vcxproj.filters
  25. 0 3
      gameplay/gameplay.vcxproj.user
  26. 550 711
      gameplay/gameplay.xcodeproj/project.pbxproj
  27. 10 1
      gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-ios.xcscheme
  28. 10 1
      gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-macosx.xcscheme
  29. BIN
      gameplay/res/icon_tray.png
  30. 11 1
      gameplay/res/shaders/colored.frag
  31. 12 0
      gameplay/res/shaders/colored.vert
  32. 13 0
      gameplay/res/shaders/terrain.frag
  33. 8 0
      gameplay/res/shaders/textured.frag
  34. 13 0
      gameplay/res/shaders/textured.vert
  35. BIN
      gameplay/res/ui/arial.gpb
  36. 10 5
      gameplay/src/AIAgent.cpp
  37. 7 2
      gameplay/src/AIAgent.h
  38. 1 5
      gameplay/src/AIMessage.cpp
  39. 11 6
      gameplay/src/AIState.cpp
  40. 1 2
      gameplay/src/AIState.h
  41. 1 0
      gameplay/src/AIStateMachine.h
  42. 4 2
      gameplay/src/Animation.cpp
  43. 3 3
      gameplay/src/Animation.h
  44. 82 56
      gameplay/src/AnimationClip.cpp
  45. 35 51
      gameplay/src/AnimationClip.h
  46. 1 0
      gameplay/src/AnimationTarget.cpp
  47. 158 45
      gameplay/src/AudioBuffer.cpp
  48. 33 6
      gameplay/src/AudioBuffer.h
  49. 66 1
      gameplay/src/AudioController.cpp
  50. 10 0
      gameplay/src/AudioController.h
  51. 78 20
      gameplay/src/AudioSource.cpp
  52. 13 4
      gameplay/src/AudioSource.h
  53. 31 49
      gameplay/src/Base.h
  54. 50 12
      gameplay/src/Bundle.cpp
  55. 1 0
      gameplay/src/Bundle.h
  56. 2 2
      gameplay/src/Button.cpp
  57. 7 2
      gameplay/src/Button.h
  58. 1 1
      gameplay/src/Camera.cpp
  59. 2 5
      gameplay/src/Camera.h
  60. 5 5
      gameplay/src/CheckBox.cpp
  61. 10 5
      gameplay/src/CheckBox.h
  62. 10 7
      gameplay/src/Container.cpp
  63. 32 19
      gameplay/src/Container.h
  64. 76 80
      gameplay/src/Control.cpp
  65. 82 13
      gameplay/src/Control.h
  66. 4 2
      gameplay/src/ControlFactory.cpp
  67. 27 0
      gameplay/src/Curve.cpp
  68. 33 5
      gameplay/src/Curve.h
  69. 10 2
      gameplay/src/DebugNew.cpp
  70. 28 0
      gameplay/src/Drawable.cpp
  71. 67 0
      gameplay/src/Drawable.h
  72. 9 5
      gameplay/src/Effect.cpp
  73. 35 9
      gameplay/src/FileSystem.cpp
  74. 17 0
      gameplay/src/FileSystem.h
  75. 44 327
      gameplay/src/Font.cpp
  76. 32 91
      gameplay/src/Font.h
  77. 69 48
      gameplay/src/Form.cpp
  78. 34 19
      gameplay/src/Form.h
  79. 29 15
      gameplay/src/FrameBuffer.cpp
  80. 27 16
      gameplay/src/FrameBuffer.h
  81. 219 50
      gameplay/src/Game.cpp
  82. 33 33
      gameplay/src/Game.h
  83. 28 62
      gameplay/src/Gamepad.cpp
  84. 18 55
      gameplay/src/Gamepad.h
  85. 28 28
      gameplay/src/Image.cpp
  86. 5 5
      gameplay/src/Image.h
  87. 5 5
      gameplay/src/ImageControl.cpp
  88. 10 2
      gameplay/src/ImageControl.h
  89. 1 0
      gameplay/src/Joint.cpp
  90. 266 127
      gameplay/src/JoystickControl.cpp
  91. 72 15
      gameplay/src/JoystickControl.h
  92. 8 7
      gameplay/src/Label.cpp
  93. 10 5
      gameplay/src/Label.h
  94. 1 1
      gameplay/src/Light.cpp
  95. 1 2
      gameplay/src/Light.h
  96. 6 5
      gameplay/src/Logger.cpp
  97. 6 1
      gameplay/src/Material.cpp
  98. 1 1
      gameplay/src/MathUtil.h
  99. 1 0
      gameplay/src/MeshSkin.cpp
  100. 1 1
      gameplay/src/MeshSkin.h

+ 171 - 247
.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/

+ 28 - 1
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.

+ 3 - 2
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)

+ 9 - 9
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. 
 
 <img align="right" src="https://raw.github.com/wiki/gameplay3d/GamePlay/img/logo.png" alt="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).

+ 0 - 60
build.xml

@@ -1,60 +0,0 @@
-<!-- Android build script -->
-<project name="gameplay" default="all" basedir=".">
-
-  <fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
-    <condition>
-      <not>
-        <or>
-          <os family="unix"/>
-          <os family="windows"/>
-        </or>
-      </not>
-    </condition>
-  </fail>
-
-  <macrodef name="build-native">
-    <attribute name="location"/>
-    <sequential>
-
-      <exec osfamily="unix" dir="@{location}/android" executable="android">
-        <arg value="update"/>
-        <arg value="project"/>
-        <arg value="-t"/>
-        <arg value="1"/>
-        <arg value="-p"/>
-        <arg value="."/>
-        <arg value="-s"/>
-      </exec>
-      <exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
-
-      <exec osfamily="windows" dir="@{location}/android" executable="cmd">
-        <arg value="/c"/>
-        <arg value="android.bat"/>
-        <arg value="update"/>
-        <arg value="project"/>
-        <arg value="-t"/>
-        <arg value="1"/>
-        <arg value="-p"/>
-        <arg value="."/>
-        <arg value="-s"/>
-      </exec>
-      <exec osfamily="windows" dir="@{location}/android" executable="cmd">
-        <arg value="/c"/>
-        <arg value="ndk-build"/>
-      </exec>
-      
-    </sequential>
-  </macrodef>
-
-  <target name="all">
-    <build-native location="gameplay"/>
-    <build-native location="samples/browser"/>
-    <build-native location="samples/character"/>
-    <build-native location="samples/lua"/>
-    <build-native location="samples/mesh"/>
-    <build-native location="samples/particles"/>
-    <build-native location="samples/racer"/>
-    <build-native location="samples/spaceship"/>
-  </target>
-  
-</project>

+ 0 - 155
codestyle.xml

@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<profiles version="1">
-<profile kind="CodeFormatterProfile" name="BSD/Allman Gaming" version="1">
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.lineSplit" value="1024"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_enumerator_list" value="49"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_declarator_list" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_block" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.continuation_indentation" value="2"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_expression_list" value="0"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_compact_if" value="0"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration" value="80"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_switch" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_array_initializer" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments" value="do not insert"/>
-</profile>
-</profiles>

+ 1 - 1
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 

+ 1 - 85
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

+ 0 - 9
gameplay.xcworkspace/contents.xcworkspacedata

@@ -10,15 +10,6 @@
    <FileRef
       location = "group:samples/character/sample-character.xcodeproj">
    </FileRef>
-   <FileRef
-      location = "group:samples/lua/sample-lua.xcodeproj">
-   </FileRef>  
-   <FileRef
-      location = "group:samples/mesh/sample-mesh.xcodeproj">
-   </FileRef>
-   <FileRef
-      location = "group:samples/particles/sample-particles.xcodeproj">
-   </FileRef>
    <FileRef
       location = "group:samples/racer/sample-racer.xcodeproj">
    </FileRef>

+ 131 - 170
gameplay/.cproject

@@ -3,222 +3,183 @@
 
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 	<storageModule moduleId="org.eclipse.cdt.core.settings">
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.17111725">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.17111725" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
-				<externalSettings/>
+		<cconfiguration id="cdt.managedbuild.config.gnu.lib.debug.1678352131">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.lib.debug.1678352131" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+				<externalSettings>
+					<externalSetting>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/gameplay"/>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/gameplay/Debug"/>
+						<entry flags="RESOLVED" kind="libraryFile" name="gameplay" srcPrefixMapping="" srcRootPath=""/>
+					</externalSetting>
+				</externalSettings>
 				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.17111725" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.17111725." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1686166742" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<option id="com.qnx.qcc.option.cpu.545743487" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.158841187" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Device-Debug}" id="org.eclipse.cdt.build.core.internal.builder.159190287" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
-							<tool id="com.qnx.qcc.tool.compiler.96907942" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.1765481355" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.311918799" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.1481323494" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-									<listOptionValue builtIn="false" value="BT_USE_NEON"/>
-									<listOptionValue builtIn="false" value="GP_USE_GAMEPAD"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.2133604142" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/lua/include&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/bullet/include&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/oggvorbis/include&quot;"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.qccoptions.1968057343" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList">
-									<listOptionValue builtIn="false" value="-Wno-psabi"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.ccoptions.1078137668" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
-									<listOptionValue builtIn="false" value="-mfpu=neon"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.997142816" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.1988140188" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.1929307156" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.assembler.defines.1866459653" name="Defines (-D)" superClass="com.qnx.qcc.option.assembler.defines"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1944074393" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.85592747" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1489037662" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.1824441870" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.908036009" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.821495066" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.1650721640" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.release.936504809">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.936504809" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
 					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.release.936504809" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.release.936504809." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.release.11990035" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<option id="com.qnx.qcc.option.cpu.33079389" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1117051584" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Device-Release}" id="cdt.managedbuild.target.gnu.builder.base.1199322737" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.1345567866" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compiler.optlevel.1056793982" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.1" valueType="enumerated"/>
-								<option id="com.qnx.qcc.option.compiler.security.324540233" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.398688299" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-									<listOptionValue builtIn="false" value="BT_USE_NEON"/>
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.lib.debug.1678352131" name="Debug" parent="cdt.managedbuild.config.gnu.lib.debug">
+					<folderInfo id="cdt.managedbuild.config.gnu.lib.debug.1678352131." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.lib.debug.1261019646" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.lib.debug">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.lib.debug.890249609" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.lib.debug"/>
+							<builder buildPath="${workspace_loc:/gameplay/Debug}" id="cdt.managedbuild.target.gnu.builder.lib.debug.895962601" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.lib.debug"/>
+							<tool command="ar" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.archiver.lib.debug.708167895" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.lib.debug"/>
+							<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.cpp.compiler.lib.debug.777535448" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.lib.debug">
+								<option id="gnu.cpp.compiler.lib.debug.option.optimization.level.1229794772" name="Optimization Level" superClass="gnu.cpp.compiler.lib.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.lib.debug.option.debugging.level.1539213802" name="Debug Level" superClass="gnu.cpp.compiler.lib.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.preprocessor.def.1310031438" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="__linux__"/>
 									<listOptionValue builtIn="false" value="GP_USE_GAMEPAD"/>
 								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.1670164593" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/bullet/include&quot;"/>
+								<option id="gnu.cpp.compiler.option.include.paths.800094241" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/lua/include&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/oggvorbis/include&quot;"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.ccoptions.1122311163" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
-									<listOptionValue builtIn="false" value="-mfpu=neon"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/lua}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;../../external-deps/include&quot;"/>
+									<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/gtk-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/atk-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/cairo"/>
+									<listOptionValue builtIn="false" value="/usr/include/gdk-pixbuf-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/pango-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/gio-unix-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/freetype2"/>
+									<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/glib-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/pixman-1"/>
+									<listOptionValue builtIn="false" value="/usr/include/libpng12"/>
+									<listOptionValue builtIn="false" value="/usr/include/harfbuzz"/>
 								</option>
-								<option id="com.qnx.qcc.option.compiler.qccoptions.1770609643" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList">
-									<listOptionValue builtIn="false" value="-Wno-psabi"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.1380846613" superClass="com.qnx.qcc.inputType.compiler"/>
+								<option id="gnu.cpp.compiler.option.other.pic.224962351" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" value="false" valueType="boolean"/>
+								<option id="gnu.cpp.compiler.option.other.other.400565331" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++11 -lstdc++ -pthread&#9;" valueType="string"/>
+								<option id="gnu.cpp.compiler.option.warnings.wconversion.860278291" name="Implicit conversion warnings (-Wconversion)" superClass="gnu.cpp.compiler.option.warnings.wconversion" value="false" valueType="boolean"/>
+								<option id="gnu.cpp.compiler.option.warnings.allwarn.124718788" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" value="false" valueType="boolean"/>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.760206134" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
 							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.855139060" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<inputType id="com.qnx.qcc.inputType.assembler.590404074" superClass="com.qnx.qcc.inputType.assembler"/>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.lib.debug.544132463" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.lib.debug">
+								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.lib.debug.option.optimization.level.932372982" name="Optimization Level" superClass="gnu.c.compiler.lib.debug.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.lib.debug.option.debugging.level.1396320451" name="Debug Level" superClass="gnu.c.compiler.lib.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.828880230" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
 							</tool>
-							<tool id="com.qnx.qcc.tool.linker.2038455782" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.langcpp.868659975" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.1604612317" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.823080047" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-								</option>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.base.53199152" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1704479578" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.lib.debug.466993033" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.lib.debug">
+								<option id="gnu.both.asm.option.include.paths.1220313575" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.135160384" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
 							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.97765823" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
 						</toolChain>
 					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
 				</configuration>
 			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+				<externalSettings containerId="org.eclipse.cdt.managedbuilder.pkgconfig.extSettings" factoryId="org.eclipse.cdt.core.extension.container.factory">
+					<externalSetting contentTypes="org.eclipse.cdt.core.cSource:org.eclipse.cdt.core.cxxSource"/>
+					<externalSetting contentTypes="org.eclipse.cdt.managedbuilder.core.compiledObjectFile"/>
+				</externalSettings>
+			</storageModule>
+			<storageModule moduleId="packages"/>
 		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.559445444">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.559445444" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
-				<externalSettings/>
+		<cconfiguration id="cdt.managedbuild.config.gnu.lib.release.405865560">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.lib.release.405865560" moduleId="org.eclipse.cdt.core.settings" name="Release">
+				<externalSettings>
+					<externalSetting>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/gameplay"/>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/gameplay/Release"/>
+						<entry flags="RESOLVED" kind="libraryFile" name="gameplay" srcPrefixMapping="" srcRootPath=""/>
+					</externalSetting>
+				</externalSettings>
 				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
 					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.559445444" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.559445444." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1260117207" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.795462400" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Simulator}" id="cdt.managedbuild.target.gnu.builder.base.10075032" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.1004416224" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.1122485646" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.1671403331" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.1863269886" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-									<listOptionValue builtIn="false" value="BT_USE_NEON"/>
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.lib.release.405865560" name="Release" parent="cdt.managedbuild.config.gnu.lib.release">
+					<folderInfo id="cdt.managedbuild.config.gnu.lib.release.405865560." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.lib.release.1240021764" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.lib.release">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.lib.release.124670092" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.lib.release"/>
+							<builder buildPath="${workspace_loc:/gameplay/Release}" id="cdt.managedbuild.target.gnu.builder.lib.release.1993392626" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.lib.release"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.lib.release.954619908" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.lib.release"/>
+							<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.lib.release.1098041763" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.lib.release">
+								<option id="gnu.cpp.compiler.lib.release.option.optimization.level.965385539" name="Optimization Level" superClass="gnu.cpp.compiler.lib.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.lib.release.option.debugging.level.1041543613" name="Debug Level" superClass="gnu.cpp.compiler.lib.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.preprocessor.def.458473463" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="__linux__"/>
 									<listOptionValue builtIn="false" value="GP_USE_GAMEPAD"/>
 								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.847642559" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/bullet/include&quot;"/>
+								<option id="gnu.cpp.compiler.option.include.paths.1112278724" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/lua/include&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;../../external-deps/oggvorbis/include&quot;"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.ccoptions.1432778691" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions"/>
-								<option id="com.qnx.qcc.option.compiler.qccoptions.245518255" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList">
-									<listOptionValue builtIn="false" value="-Wno-psabi"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/lua}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;../../external-deps/include&quot;"/>
+									<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/gtk-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/atk-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/cairo"/>
+									<listOptionValue builtIn="false" value="/usr/include/gdk-pixbuf-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/pango-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/gio-unix-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/freetype2"/>
+									<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/glib-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/pixman-1"/>
+									<listOptionValue builtIn="false" value="/usr/include/libpng12"/>
+									<listOptionValue builtIn="false" value="/usr/include/harfbuzz"/>
 								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.1038720310" superClass="com.qnx.qcc.inputType.compiler"/>
+								<option id="gnu.cpp.compiler.option.other.pic.63956772" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" value="false" valueType="boolean"/>
+								<option id="gnu.cpp.compiler.option.other.other.1866787375" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++11 -lstdc++ -pthread" valueType="string"/>
+								<option id="gnu.cpp.compiler.option.warnings.wconversion.1384263317" name="Implicit conversion warnings (-Wconversion)" superClass="gnu.cpp.compiler.option.warnings.wconversion" value="false" valueType="boolean"/>
+								<option id="gnu.cpp.compiler.option.warnings.allwarn.80993715" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" value="false" valueType="boolean"/>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1821410876" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
 							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.521146732" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.180925874" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1284236061" superClass="com.qnx.qcc.inputType.assembler"/>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.lib.release.1485072111" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.lib.release">
+								<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.lib.release.option.optimization.level.1195664601" name="Optimization Level" superClass="gnu.c.compiler.lib.release.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.lib.release.option.debugging.level.268531470" name="Debug Level" superClass="gnu.c.compiler.lib.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1440092387" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
 							</tool>
-							<tool id="com.qnx.qcc.tool.linker.1609792323" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1885061957" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.538911746" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.1731404314" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.1915056460" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
-								</option>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1816796144" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.883556826" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.lib.release.1951181920" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.lib.release">
+								<option id="gnu.both.asm.option.include.paths.755753468" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.618314481" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
 							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.1201481995" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
 						</toolChain>
 					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
 				</configuration>
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 	</storageModule>
 	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="gameplay.null.436970955" name="gameplay"/>
+		<project id="gameplay.cdt.managedbuild.target.gnu.lib.1260324719" name="Static Library" projectType="cdt.managedbuild.target.gnu.lib"/>
 	</storageModule>
 	<storageModule moduleId="scannerConfiguration">
-		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.796584174">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.191203500">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.lib.release.405865560;cdt.managedbuild.config.gnu.lib.release.405865560.;cdt.managedbuild.tool.gnu.cpp.compiler.lib.release.1098041763;cdt.managedbuild.tool.gnu.cpp.compiler.input.1821410876">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.559445444">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.lib.debug.1678352131;cdt.managedbuild.config.gnu.lib.debug.1678352131.;cdt.managedbuild.tool.gnu.cpp.compiler.lib.debug.777535448;cdt.managedbuild.tool.gnu.cpp.compiler.input.760206134">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.936504809">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.lib.release.405865560;cdt.managedbuild.config.gnu.lib.release.405865560.;cdt.managedbuild.tool.gnu.c.compiler.lib.release.1485072111;cdt.managedbuild.tool.gnu.c.compiler.input.1440092387">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.851611337">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.304786667">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.17111725">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.lib.debug.1678352131;cdt.managedbuild.config.gnu.lib.debug.1678352131.;cdt.managedbuild.tool.gnu.c.compiler.lib.debug.544132463;cdt.managedbuild.tool.gnu.c.compiler.input.828880230">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
 		</scannerConfigBuildInfo>
 	</storageModule>
-	<storageModule moduleId="refreshScope" versionNumber="1">
-		<resource resourceType="PROJECT" workspacePath="/gameplay"/>
+	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="Release">
+			<resource resourceType="PROJECT" workspacePath="/gameplay"/>
+		</configuration>
+		<configuration configurationName="Debug">
+			<resource resourceType="PROJECT" workspacePath="/gameplay"/>
+		</configuration>
 	</storageModule>
-	<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
-	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
-	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 </cproject>

+ 83 - 77
gameplay/.project

@@ -1,77 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>gameplay</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
-			<triggers>clean,full,incremental,</triggers>
-			<arguments>
-				<dictionary>
-					<key>?name?</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.append_environment</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildArguments</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value>${workspace_loc:/gameplay/Device-Debug}</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.contents</key>
-					<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
-			<triggers>full,incremental,</triggers>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
-		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
-		<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
-		<nature>org.eclipse.cdt.core.ccnature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>gameplay</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+				<dictionary>
+					<key>?name?</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.append_environment</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildArguments</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value>${workspace_loc:/gameplay/Debug}</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.contents</key>
+					<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>

+ 29 - 109
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

+ 13 - 0
gameplay/android/.classpath

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="src" path="src">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="gameplay/src"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

+ 57 - 0
gameplay/android/.cproject

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="com.android.toolchain.gcc.1762611861">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.1762611861" moduleId="org.eclipse.cdt.core.settings" name="Default">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.1762611861" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
+					<folderInfo id="com.android.toolchain.gcc.1762611861.1006586964" name="/" resourcePath="">
+						<toolChain id="com.android.toolchain.gcc.104843543" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.849260442" isAbstract="false" superClass="com.android.targetPlatform"/>
+							<builder arguments="NDK_DEBUG=1 -j4" command="ndk-build" id="com.android.builder.584998984" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
+								<outputEntries>
+									<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
+									<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
+								</outputEntries>
+							</builder>
+							<tool id="com.android.gcc.compiler.1357063072" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
+								<inputType id="com.android.gcc.inputType.871576572" superClass="com.android.gcc.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="gameplay.null.1788907050" name="gameplay"/>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1762611861;com.android.toolchain.gcc.1762611861.1006586964;com.android.gcc.compiler.1357063072;com.android.gcc.inputType.871576572">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="Default">
+			<resource resourceType="PROJECT" workspacePath="/gameplay"/>
+		</configuration>
+	</storageModule>
+</cproject>

+ 38 - 21
template/template.project → gameplay/android/.project

@@ -1,12 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>TEMPLATE_PROJECT</name>
+	<name>gameplay</name>
 	<comment></comment>
+	<projects>
+	</projects>
 	<buildSpec>
 		<buildCommand>
 			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
 			<triggers>clean,full,incremental,</triggers>
 			<arguments>
+				<dictionary>
+					<key>?children?</key>
+					<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
+				</dictionary>
 				<dictionary>
 					<key>?name?</key>
 					<value></value>
@@ -15,21 +21,13 @@
 					<key>org.eclipse.cdt.make.core.append_environment</key>
 					<value>true</value>
 				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildArguments</key>
-					<value></value>
+					<value>NDK_DEBUG=1 -j4</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value>${workspace_loc:/TEMPLATE_PROJECT/Device-Debug}</value>
+					<value>ndk-build</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
@@ -51,37 +49,56 @@
 					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
 					<value>true</value>
 				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.stopOnError</key>
 					<value>true</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
+					<value>false</value>
 				</dictionary>
 			</arguments>
 		</buildCommand>
 		<buildCommand>
-			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
-			<triggers>full,incremental,</triggers>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
 			<arguments>
 			</arguments>
 		</buildCommand>
 		<buildCommand>
-			<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
 			<arguments>
 			</arguments>
 		</buildCommand>
 	</buildSpec>
 	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
 		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
 		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
 		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
-		<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
-		<nature>org.eclipse.cdt.core.ccnature</nature>
 	</natures>
+	<linkedResources>
+		<link>
+			<name>src</name>
+			<type>2</type>
+			<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/gameplay/src</locationURI>
+		</link>
+	</linkedResources>
 </projectDescription>

+ 6 - 11
gameplay/android/AndroidManifest.xml

@@ -1,14 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.gameplay3d.gameplay"
-    android:versionCode="1"
-    android:versionName="2.0" >
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
+	package="org.gameplay3d" 
+	android:versionCode="1" 
+	android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="14" />
+    <uses-sdk android:minSdkVersion="16" />
 
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-    </application>
-
-</manifest>
+</manifest>

+ 28 - 70
gameplay/android/build.xml

@@ -1,81 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project name="gameplay" default="help">
 
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
     <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
     <property file="ant.properties" />
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
+   
     <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" unless="sdk.dir" />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
+    
+    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project -t 1 -p . -s'" unless="sdk.dir" />
+    <fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+        <condition>
+            <not>
+                <or>
+                    <os family="unix"/>
+                    <os family="windows"/>
+                </or>
+            </not>
+        </condition>
+    </fail>
+    <macrodef name="build-native">
+        <attribute name="location"/>
+        <sequential>
+            <exec osfamily="unix" dir="@{location}/android" executable="ndk-build">
+                <arg value="-j4"/>
+            </exec>
+            <exec osfamily="windows" dir="@{location}/android" executable="cmd">
+                <arg value="/c"/>
+                <arg value="ndk-build -j4"/>
+            </exec> 
+        </sequential>
+    </macrodef>
+    
     <target name="-pre-build">
+        <build-native location=".."/>
     </target>
-    <target name="-pre-compile">
-    </target>
-
-    /* This is typically used for code obfuscation.
-       Compiled code location: ${out.classes.absolute.dir}
-       If this is not done in place, override ${out.dex.input.absolute.dir} */
-    <target name="-post-compile">
-    </target>
--->
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
+    
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />
 

+ 33 - 56
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)
+

+ 7 - 3
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
+

+ 3 - 0
gameplay/android/project.properties

@@ -0,0 +1,3 @@
+target=android-16
+android.library=true
+source.dir=../src

BIN
gameplay/android/res/drawable/icon.png


+ 562 - 0
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

+ 48 - 253
gameplay/gameplay.vcxproj

@@ -1,26 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugMem|Win32">
-      <Configuration>DebugMem</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
     <ProjectConfiguration Include="DebugMem|x64">
       <Configuration>DebugMem</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
     <ProjectConfiguration Include="Debug|x64">
       <Configuration>Debug</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|x64">
       <Configuration>Release</Configuration>
       <Platform>x64</Platform>
@@ -53,6 +41,7 @@
     <ClCompile Include="src\Curve.cpp" />
     <ClCompile Include="src\DebugNew.cpp" />
     <ClCompile Include="src\DepthStencilTarget.cpp" />
+    <ClCompile Include="src\Drawable.cpp" />
     <ClCompile Include="src\Effect.cpp" />
     <ClCompile Include="src\FileSystem.cpp" />
     <ClCompile Include="src\FlowLayout.cpp" />
@@ -63,7 +52,6 @@
     <ClCompile Include="src\Game.cpp" />
     <ClCompile Include="src\Gamepad.cpp" />
     <ClCompile Include="src\gameplay-main-android.cpp" />
-    <ClCompile Include="src\gameplay-main-blackberry.cpp" />
     <ClCompile Include="src\gameplay-main-linux.cpp" />
     <ClCompile Include="src\gameplay-main-windows.cpp" />
     <ClCompile Include="src\HeightField.cpp" />
@@ -80,7 +68,6 @@
     <ClCompile Include="src\lua\lua_AIAgentListener.cpp" />
     <ClCompile Include="src\lua\lua_AIController.cpp" />
     <ClCompile Include="src\lua\lua_AIMessage.cpp" />
-    <ClCompile Include="src\lua\lua_AIMessageParameterType.cpp" />
     <ClCompile Include="src\lua\lua_AIState.cpp" />
     <ClCompile Include="src\lua\lua_AIStateListener.cpp" />
     <ClCompile Include="src\lua\lua_AIStateMachine.cpp" />
@@ -88,7 +75,6 @@
     <ClCompile Include="src\lua\lua_Animation.cpp" />
     <ClCompile Include="src\lua\lua_AnimationClip.cpp" />
     <ClCompile Include="src\lua\lua_AnimationClipListener.cpp" />
-    <ClCompile Include="src\lua\lua_AnimationClipListenerEventType.cpp" />
     <ClCompile Include="src\lua\lua_AnimationController.cpp" />
     <ClCompile Include="src\lua\lua_AnimationTarget.cpp" />
     <ClCompile Include="src\lua\lua_AnimationValue.cpp" />
@@ -96,97 +82,65 @@
     <ClCompile Include="src\lua\lua_AudioController.cpp" />
     <ClCompile Include="src\lua\lua_AudioListener.cpp" />
     <ClCompile Include="src\lua\lua_AudioSource.cpp" />
-    <ClCompile Include="src\lua\lua_AudioSourceState.cpp" />
     <ClCompile Include="src\lua\lua_BoundingBox.cpp" />
     <ClCompile Include="src\lua\lua_BoundingSphere.cpp" />
     <ClCompile Include="src\lua\lua_Bundle.cpp" />
     <ClCompile Include="src\lua\lua_Button.cpp" />
     <ClCompile Include="src\lua\lua_Camera.cpp" />
     <ClCompile Include="src\lua\lua_CameraListener.cpp" />
-    <ClCompile Include="src\lua\lua_CameraType.cpp" />
     <ClCompile Include="src\lua\lua_CheckBox.cpp" />
     <ClCompile Include="src\lua\lua_Container.cpp" />
-    <ClCompile Include="src\lua\lua_ContainerScroll.cpp" />
     <ClCompile Include="src\lua\lua_Control.cpp" />
-    <ClCompile Include="src\lua\lua_ControlAlignment.cpp" />
-    <ClCompile Include="src\lua\lua_ControlAutoSize.cpp" />
     <ClCompile Include="src\lua\lua_ControlListener.cpp" />
-    <ClCompile Include="src\lua\lua_ControlListenerEventType.cpp" />
-    <ClCompile Include="src\lua\lua_ControlState.cpp" />
     <ClCompile Include="src\lua\lua_Curve.cpp" />
-    <ClCompile Include="src\lua\lua_CurveInterpolationType.cpp" />
     <ClCompile Include="src\lua\lua_DepthStencilTarget.cpp" />
-    <ClCompile Include="src\lua\lua_DepthStencilTargetFormat.cpp" />
+    <ClCompile Include="src\lua\lua_Drawable.cpp" />
     <ClCompile Include="src\lua\lua_Effect.cpp" />
     <ClCompile Include="src\lua\lua_FileSystem.cpp" />
     <ClCompile Include="src\lua\lua_FlowLayout.cpp" />
     <ClCompile Include="src\lua\lua_Font.cpp" />
-    <ClCompile Include="src\lua\lua_FontFormat.cpp" />
-    <ClCompile Include="src\lua\lua_FontJustify.cpp" />
-    <ClCompile Include="src\lua\lua_FontStyle.cpp" />
-    <ClCompile Include="src\lua\lua_FontText.cpp" />
     <ClCompile Include="src\lua\lua_Form.cpp" />
     <ClCompile Include="src\lua\lua_FrameBuffer.cpp" />
     <ClCompile Include="src\lua\lua_Frustum.cpp" />
     <ClCompile Include="src\lua\lua_Game.cpp" />
-    <ClCompile Include="src\lua\lua_GameClearFlags.cpp" />
     <ClCompile Include="src\lua\lua_Gamepad.cpp" />
-    <ClCompile Include="src\lua\lua_GamepadButtonMapping.cpp" />
-    <ClCompile Include="src\lua\lua_GamepadGamepadEvent.cpp" />
-    <ClCompile Include="src\lua\lua_GameState.cpp" />
     <ClCompile Include="src\lua\lua_Gesture.cpp" />
-    <ClCompile Include="src\lua\lua_GestureGestureEvent.cpp" />
     <ClCompile Include="src\lua\lua_Global.cpp" />
     <ClCompile Include="src\lua\lua_HeightField.cpp" />
     <ClCompile Include="src\lua\lua_Image.cpp" />
     <ClCompile Include="src\lua\lua_ImageControl.cpp" />
-    <ClCompile Include="src\lua\lua_ImageFormat.cpp" />
     <ClCompile Include="src\lua\lua_Joint.cpp" />
     <ClCompile Include="src\lua\lua_JoystickControl.cpp" />
     <ClCompile Include="src\lua\lua_Keyboard.cpp" />
-    <ClCompile Include="src\lua\lua_KeyboardKey.cpp" />
-    <ClCompile Include="src\lua\lua_KeyboardKeyEvent.cpp" />
     <ClCompile Include="src\lua\lua_Label.cpp" />
     <ClCompile Include="src\lua\lua_Layout.cpp" />
-    <ClCompile Include="src\lua\lua_LayoutType.cpp" />
     <ClCompile Include="src\lua\lua_Light.cpp" />
-    <ClCompile Include="src\lua\lua_LightType.cpp" />
     <ClCompile Include="src\lua\lua_Logger.cpp" />
-    <ClCompile Include="src\lua\lua_LoggerLevel.cpp" />
     <ClCompile Include="src\lua\lua_Material.cpp" />
     <ClCompile Include="src\lua\lua_MaterialParameter.cpp" />
     <ClCompile Include="src\lua\lua_MathUtil.cpp" />
     <ClCompile Include="src\lua\lua_Matrix.cpp" />
     <ClCompile Include="src\lua\lua_Mesh.cpp" />
     <ClCompile Include="src\lua\lua_MeshBatch.cpp" />
-    <ClCompile Include="src\lua\lua_MeshIndexFormat.cpp" />
     <ClCompile Include="src\lua\lua_MeshPart.cpp" />
-    <ClCompile Include="src\lua\lua_MeshPrimitiveType.cpp" />
     <ClCompile Include="src\lua\lua_MeshSkin.cpp" />
     <ClCompile Include="src\lua\lua_Model.cpp" />
     <ClCompile Include="src\lua\lua_Mouse.cpp" />
-    <ClCompile Include="src\lua\lua_MouseMouseEvent.cpp" />
     <ClCompile Include="src\lua\lua_Node.cpp" />
     <ClCompile Include="src\lua\lua_NodeCloneContext.cpp" />
-    <ClCompile Include="src\lua\lua_NodeType.cpp" />
     <ClCompile Include="src\lua\lua_ParticleEmitter.cpp" />
-    <ClCompile Include="src\lua\lua_ParticleEmitterTextureBlending.cpp" />
     <ClCompile Include="src\lua\lua_Pass.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsCharacter.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsCollisionObject.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsCollisionObjectCollisionListener.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsCollisionObjectCollisionListenerEventType.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsCollisionObjectCollisionPair.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsCollisionObjectType.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsCollisionShape.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsCollisionShapeDefinition.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsCollisionShapeType.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsConstraint.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsController.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsControllerHitFilter.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsControllerHitResult.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsControllerListener.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsControllerListenerEventType.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsFixedConstraint.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsGenericConstraint.cpp" />
     <ClCompile Include="src\lua\lua_PhysicsGhostObject.cpp" />
@@ -200,46 +154,39 @@
     <ClCompile Include="src\lua\lua_Plane.cpp" />
     <ClCompile Include="src\lua\lua_Platform.cpp" />
     <ClCompile Include="src\lua\lua_Properties.cpp" />
-    <ClCompile Include="src\lua\lua_PropertiesType.cpp" />
     <ClCompile Include="src\lua\lua_Quaternion.cpp" />
     <ClCompile Include="src\lua\lua_RadioButton.cpp" />
     <ClCompile Include="src\lua\lua_Ray.cpp" />
     <ClCompile Include="src\lua\lua_Rectangle.cpp" />
     <ClCompile Include="src\lua\lua_Ref.cpp" />
     <ClCompile Include="src\lua\lua_RenderState.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateAutoBinding.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateBlend.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateCullFaceSide.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateDepthFunction.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateFrontFace.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateStateBlock.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateStencilFunction.cpp" />
-    <ClCompile Include="src\lua\lua_RenderStateStencilOperation.cpp" />
     <ClCompile Include="src\lua\lua_RenderTarget.cpp" />
     <ClCompile Include="src\lua\lua_Scene.cpp" />
     <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp" />
+    <ClCompile Include="src\lua\lua_Script.cpp" />
     <ClCompile Include="src\lua\lua_ScriptController.cpp" />
     <ClCompile Include="src\lua\lua_ScriptTarget.cpp" />
+    <ClCompile Include="src\lua\lua_ScriptTargetEvent.cpp" />
+    <ClCompile Include="src\lua\lua_ScriptTargetEventRegistry.cpp" />
     <ClCompile Include="src\lua\lua_Slider.cpp" />
+    <ClCompile Include="src\lua\lua_Sprite.cpp" />
     <ClCompile Include="src\lua\lua_SpriteBatch.cpp" />
+    <ClCompile Include="src\lua\lua_SpriteBatchSpriteVertex.cpp" />
     <ClCompile Include="src\lua\lua_Technique.cpp" />
     <ClCompile Include="src\lua\lua_Terrain.cpp" />
-    <ClCompile Include="src\lua\lua_TerrainFlags.cpp" />
     <ClCompile Include="src\lua\lua_TerrainPatch.cpp" />
+    <ClCompile Include="src\lua\lua_Text.cpp" />
     <ClCompile Include="src\lua\lua_TextBox.cpp" />
-    <ClCompile Include="src\lua\lua_TextBoxInputMode.cpp" />
     <ClCompile Include="src\lua\lua_Texture.cpp" />
-    <ClCompile Include="src\lua\lua_TextureFilter.cpp" />
-    <ClCompile Include="src\lua\lua_TextureFormat.cpp" />
     <ClCompile Include="src\lua\lua_TextureSampler.cpp" />
-    <ClCompile Include="src\lua\lua_TextureWrap.cpp" />
     <ClCompile Include="src\lua\lua_Theme.cpp" />
     <ClCompile Include="src\lua\lua_ThemeSideRegions.cpp" />
     <ClCompile Include="src\lua\lua_ThemeStyle.cpp" />
     <ClCompile Include="src\lua\lua_ThemeThemeImage.cpp" />
     <ClCompile Include="src\lua\lua_ThemeUVs.cpp" />
+    <ClCompile Include="src\lua\lua_TileSet.cpp" />
     <ClCompile Include="src\lua\lua_Touch.cpp" />
-    <ClCompile Include="src\lua\lua_TouchTouchEvent.cpp" />
     <ClCompile Include="src\lua\lua_Transform.cpp" />
     <ClCompile Include="src\lua\lua_TransformListener.cpp" />
     <ClCompile Include="src\lua\lua_Uniform.cpp" />
@@ -249,7 +196,6 @@
     <ClCompile Include="src\lua\lua_VertexAttributeBinding.cpp" />
     <ClCompile Include="src\lua\lua_VertexFormat.cpp" />
     <ClCompile Include="src\lua\lua_VertexFormatElement.cpp" />
-    <ClCompile Include="src\lua\lua_VertexFormatUsage.cpp" />
     <ClCompile Include="src\lua\lua_VerticalLayout.cpp" />
     <ClCompile Include="src\Material.cpp" />
     <ClCompile Include="src\MathUtil.cpp" />
@@ -281,7 +227,6 @@
     <ClCompile Include="src\Plane.cpp" />
     <ClCompile Include="src\Platform.cpp" />
     <ClCompile Include="src\PlatformAndroid.cpp" />
-    <ClCompile Include="src\PlatformBlackBerry.cpp" />
     <ClCompile Include="src\PlatformLinux.cpp" />
     <ClCompile Include="src\PlatformWindows.cpp" />
     <ClCompile Include="src\Properties.cpp" />
@@ -295,17 +240,21 @@
     <ClCompile Include="src\Scene.cpp" />
     <ClCompile Include="src\SceneLoader.cpp" />
     <ClCompile Include="src\ScreenDisplayer.cpp" />
+    <ClCompile Include="src\Script.cpp" />
     <ClCompile Include="src\ScriptController.cpp" />
     <ClCompile Include="src\ScriptTarget.cpp" />
     <ClCompile Include="src\Slider.cpp" />
+    <ClCompile Include="src\Sprite.cpp" />
     <ClCompile Include="src\SpriteBatch.cpp" />
     <ClCompile Include="src\Technique.cpp" />
     <ClCompile Include="src\Terrain.cpp" />
     <ClCompile Include="src\TerrainPatch.cpp" />
+    <ClCompile Include="src\Text.cpp" />
     <ClCompile Include="src\TextBox.cpp" />
     <ClCompile Include="src\Texture.cpp" />
     <ClCompile Include="src\Theme.cpp" />
     <ClCompile Include="src\ThemeStyle.cpp" />
+    <ClCompile Include="src\TileSet.cpp" />
     <ClCompile Include="src\Transform.cpp" />
     <ClCompile Include="src\Vector2.cpp" />
     <ClCompile Include="src\Vector3.cpp" />
@@ -342,6 +291,7 @@
     <ClInclude Include="src\Curve.h" />
     <ClInclude Include="src\DebugNew.h" />
     <ClInclude Include="src\DepthStencilTarget.h" />
+    <ClInclude Include="src\Drawable.h" />
     <ClInclude Include="src\Effect.h" />
     <ClInclude Include="src\FileSystem.h" />
     <ClInclude Include="src\FlowLayout.h" />
@@ -368,7 +318,6 @@
     <ClInclude Include="src\lua\lua_AIAgentListener.h" />
     <ClInclude Include="src\lua\lua_AIController.h" />
     <ClInclude Include="src\lua\lua_AIMessage.h" />
-    <ClInclude Include="src\lua\lua_AIMessageParameterType.h" />
     <ClInclude Include="src\lua\lua_AIState.h" />
     <ClInclude Include="src\lua\lua_AIStateListener.h" />
     <ClInclude Include="src\lua\lua_AIStateMachine.h" />
@@ -376,7 +325,6 @@
     <ClInclude Include="src\lua\lua_Animation.h" />
     <ClInclude Include="src\lua\lua_AnimationClip.h" />
     <ClInclude Include="src\lua\lua_AnimationClipListener.h" />
-    <ClInclude Include="src\lua\lua_AnimationClipListenerEventType.h" />
     <ClInclude Include="src\lua\lua_AnimationController.h" />
     <ClInclude Include="src\lua\lua_AnimationTarget.h" />
     <ClInclude Include="src\lua\lua_AnimationValue.h" />
@@ -384,97 +332,65 @@
     <ClInclude Include="src\lua\lua_AudioController.h" />
     <ClInclude Include="src\lua\lua_AudioListener.h" />
     <ClInclude Include="src\lua\lua_AudioSource.h" />
-    <ClInclude Include="src\lua\lua_AudioSourceState.h" />
     <ClInclude Include="src\lua\lua_BoundingBox.h" />
     <ClInclude Include="src\lua\lua_BoundingSphere.h" />
     <ClInclude Include="src\lua\lua_Bundle.h" />
     <ClInclude Include="src\lua\lua_Button.h" />
     <ClInclude Include="src\lua\lua_Camera.h" />
     <ClInclude Include="src\lua\lua_CameraListener.h" />
-    <ClInclude Include="src\lua\lua_CameraType.h" />
     <ClInclude Include="src\lua\lua_CheckBox.h" />
     <ClInclude Include="src\lua\lua_Container.h" />
-    <ClInclude Include="src\lua\lua_ContainerScroll.h" />
     <ClInclude Include="src\lua\lua_Control.h" />
-    <ClInclude Include="src\lua\lua_ControlAlignment.h" />
-    <ClInclude Include="src\lua\lua_ControlAutoSize.h" />
     <ClInclude Include="src\lua\lua_ControlListener.h" />
-    <ClInclude Include="src\lua\lua_ControlListenerEventType.h" />
-    <ClInclude Include="src\lua\lua_ControlState.h" />
     <ClInclude Include="src\lua\lua_Curve.h" />
-    <ClInclude Include="src\lua\lua_CurveInterpolationType.h" />
     <ClInclude Include="src\lua\lua_DepthStencilTarget.h" />
-    <ClInclude Include="src\lua\lua_DepthStencilTargetFormat.h" />
+    <ClInclude Include="src\lua\lua_Drawable.h" />
     <ClInclude Include="src\lua\lua_Effect.h" />
     <ClInclude Include="src\lua\lua_FileSystem.h" />
     <ClInclude Include="src\lua\lua_FlowLayout.h" />
     <ClInclude Include="src\lua\lua_Font.h" />
-    <ClInclude Include="src\lua\lua_FontFormat.h" />
-    <ClInclude Include="src\lua\lua_FontJustify.h" />
-    <ClInclude Include="src\lua\lua_FontStyle.h" />
-    <ClInclude Include="src\lua\lua_FontText.h" />
     <ClInclude Include="src\lua\lua_Form.h" />
     <ClInclude Include="src\lua\lua_FrameBuffer.h" />
     <ClInclude Include="src\lua\lua_Frustum.h" />
     <ClInclude Include="src\lua\lua_Game.h" />
-    <ClInclude Include="src\lua\lua_GameClearFlags.h" />
     <ClInclude Include="src\lua\lua_Gamepad.h" />
-    <ClInclude Include="src\lua\lua_GamepadButtonMapping.h" />
-    <ClInclude Include="src\lua\lua_GamepadGamepadEvent.h" />
-    <ClInclude Include="src\lua\lua_GameState.h" />
     <ClInclude Include="src\lua\lua_Gesture.h" />
-    <ClInclude Include="src\lua\lua_GestureGestureEvent.h" />
     <ClInclude Include="src\lua\lua_Global.h" />
     <ClInclude Include="src\lua\lua_HeightField.h" />
     <ClInclude Include="src\lua\lua_Image.h" />
     <ClInclude Include="src\lua\lua_ImageControl.h" />
-    <ClInclude Include="src\lua\lua_ImageFormat.h" />
     <ClInclude Include="src\lua\lua_Joint.h" />
     <ClInclude Include="src\lua\lua_JoystickControl.h" />
     <ClInclude Include="src\lua\lua_Keyboard.h" />
-    <ClInclude Include="src\lua\lua_KeyboardKey.h" />
-    <ClInclude Include="src\lua\lua_KeyboardKeyEvent.h" />
     <ClInclude Include="src\lua\lua_Label.h" />
     <ClInclude Include="src\lua\lua_Layout.h" />
-    <ClInclude Include="src\lua\lua_LayoutType.h" />
     <ClInclude Include="src\lua\lua_Light.h" />
-    <ClInclude Include="src\lua\lua_LightType.h" />
     <ClInclude Include="src\lua\lua_Logger.h" />
-    <ClInclude Include="src\lua\lua_LoggerLevel.h" />
     <ClInclude Include="src\lua\lua_Material.h" />
     <ClInclude Include="src\lua\lua_MaterialParameter.h" />
     <ClInclude Include="src\lua\lua_MathUtil.h" />
     <ClInclude Include="src\lua\lua_Matrix.h" />
     <ClInclude Include="src\lua\lua_Mesh.h" />
     <ClInclude Include="src\lua\lua_MeshBatch.h" />
-    <ClInclude Include="src\lua\lua_MeshIndexFormat.h" />
     <ClInclude Include="src\lua\lua_MeshPart.h" />
-    <ClInclude Include="src\lua\lua_MeshPrimitiveType.h" />
     <ClInclude Include="src\lua\lua_MeshSkin.h" />
     <ClInclude Include="src\lua\lua_Model.h" />
     <ClInclude Include="src\lua\lua_Mouse.h" />
-    <ClInclude Include="src\lua\lua_MouseMouseEvent.h" />
     <ClInclude Include="src\lua\lua_Node.h" />
     <ClInclude Include="src\lua\lua_NodeCloneContext.h" />
-    <ClInclude Include="src\lua\lua_NodeType.h" />
     <ClInclude Include="src\lua\lua_ParticleEmitter.h" />
-    <ClInclude Include="src\lua\lua_ParticleEmitterTextureBlending.h" />
     <ClInclude Include="src\lua\lua_Pass.h" />
     <ClInclude Include="src\lua\lua_PhysicsCharacter.h" />
     <ClInclude Include="src\lua\lua_PhysicsCollisionObject.h" />
     <ClInclude Include="src\lua\lua_PhysicsCollisionObjectCollisionListener.h" />
-    <ClInclude Include="src\lua\lua_PhysicsCollisionObjectCollisionListenerEventType.h" />
     <ClInclude Include="src\lua\lua_PhysicsCollisionObjectCollisionPair.h" />
-    <ClInclude Include="src\lua\lua_PhysicsCollisionObjectType.h" />
     <ClInclude Include="src\lua\lua_PhysicsCollisionShape.h" />
     <ClInclude Include="src\lua\lua_PhysicsCollisionShapeDefinition.h" />
-    <ClInclude Include="src\lua\lua_PhysicsCollisionShapeType.h" />
     <ClInclude Include="src\lua\lua_PhysicsConstraint.h" />
     <ClInclude Include="src\lua\lua_PhysicsController.h" />
     <ClInclude Include="src\lua\lua_PhysicsControllerHitFilter.h" />
     <ClInclude Include="src\lua\lua_PhysicsControllerHitResult.h" />
     <ClInclude Include="src\lua\lua_PhysicsControllerListener.h" />
-    <ClInclude Include="src\lua\lua_PhysicsControllerListenerEventType.h" />
     <ClInclude Include="src\lua\lua_PhysicsFixedConstraint.h" />
     <ClInclude Include="src\lua\lua_PhysicsGenericConstraint.h" />
     <ClInclude Include="src\lua\lua_PhysicsGhostObject.h" />
@@ -488,46 +404,39 @@
     <ClInclude Include="src\lua\lua_Plane.h" />
     <ClInclude Include="src\lua\lua_Platform.h" />
     <ClInclude Include="src\lua\lua_Properties.h" />
-    <ClInclude Include="src\lua\lua_PropertiesType.h" />
     <ClInclude Include="src\lua\lua_Quaternion.h" />
     <ClInclude Include="src\lua\lua_RadioButton.h" />
     <ClInclude Include="src\lua\lua_Ray.h" />
     <ClInclude Include="src\lua\lua_Rectangle.h" />
     <ClInclude Include="src\lua\lua_Ref.h" />
     <ClInclude Include="src\lua\lua_RenderState.h" />
-    <ClInclude Include="src\lua\lua_RenderStateAutoBinding.h" />
-    <ClInclude Include="src\lua\lua_RenderStateBlend.h" />
-    <ClInclude Include="src\lua\lua_RenderStateCullFaceSide.h" />
-    <ClInclude Include="src\lua\lua_RenderStateDepthFunction.h" />
-    <ClInclude Include="src\lua\lua_RenderStateFrontFace.h" />
     <ClInclude Include="src\lua\lua_RenderStateStateBlock.h" />
-    <ClInclude Include="src\lua\lua_RenderStateStencilFunction.h" />
-    <ClInclude Include="src\lua\lua_RenderStateStencilOperation.h" />
     <ClInclude Include="src\lua\lua_RenderTarget.h" />
     <ClInclude Include="src\lua\lua_Scene.h" />
     <ClInclude Include="src\lua\lua_ScreenDisplayer.h" />
+    <ClInclude Include="src\lua\lua_Script.h" />
     <ClInclude Include="src\lua\lua_ScriptController.h" />
     <ClInclude Include="src\lua\lua_ScriptTarget.h" />
+    <ClInclude Include="src\lua\lua_ScriptTargetEvent.h" />
+    <ClInclude Include="src\lua\lua_ScriptTargetEventRegistry.h" />
     <ClInclude Include="src\lua\lua_Slider.h" />
+    <ClInclude Include="src\lua\lua_Sprite.h" />
     <ClInclude Include="src\lua\lua_SpriteBatch.h" />
+    <ClInclude Include="src\lua\lua_SpriteBatchSpriteVertex.h" />
     <ClInclude Include="src\lua\lua_Technique.h" />
     <ClInclude Include="src\lua\lua_Terrain.h" />
-    <ClInclude Include="src\lua\lua_TerrainFlags.h" />
     <ClInclude Include="src\lua\lua_TerrainPatch.h" />
+    <ClInclude Include="src\lua\lua_Text.h" />
     <ClInclude Include="src\lua\lua_TextBox.h" />
-    <ClInclude Include="src\lua\lua_TextBoxInputMode.h" />
     <ClInclude Include="src\lua\lua_Texture.h" />
-    <ClInclude Include="src\lua\lua_TextureFilter.h" />
-    <ClInclude Include="src\lua\lua_TextureFormat.h" />
     <ClInclude Include="src\lua\lua_TextureSampler.h" />
-    <ClInclude Include="src\lua\lua_TextureWrap.h" />
     <ClInclude Include="src\lua\lua_Theme.h" />
     <ClInclude Include="src\lua\lua_ThemeSideRegions.h" />
     <ClInclude Include="src\lua\lua_ThemeStyle.h" />
     <ClInclude Include="src\lua\lua_ThemeThemeImage.h" />
     <ClInclude Include="src\lua\lua_ThemeUVs.h" />
+    <ClInclude Include="src\lua\lua_TileSet.h" />
     <ClInclude Include="src\lua\lua_Touch.h" />
-    <ClInclude Include="src\lua\lua_TouchTouchEvent.h" />
     <ClInclude Include="src\lua\lua_Transform.h" />
     <ClInclude Include="src\lua\lua_TransformListener.h" />
     <ClInclude Include="src\lua\lua_Uniform.h" />
@@ -537,7 +446,6 @@
     <ClInclude Include="src\lua\lua_VertexAttributeBinding.h" />
     <ClInclude Include="src\lua\lua_VertexFormat.h" />
     <ClInclude Include="src\lua\lua_VertexFormatElement.h" />
-    <ClInclude Include="src\lua\lua_VertexFormatUsage.h" />
     <ClInclude Include="src\lua\lua_VerticalLayout.h" />
     <ClInclude Include="src\Material.h" />
     <ClInclude Include="src\MathUtil.h" />
@@ -580,18 +488,22 @@
     <ClInclude Include="src\Scene.h" />
     <ClInclude Include="src\SceneLoader.h" />
     <ClInclude Include="src\ScreenDisplayer.h" />
+    <ClInclude Include="src\Script.h" />
     <ClInclude Include="src\ScriptController.h" />
     <ClInclude Include="src\ScriptTarget.h" />
     <ClInclude Include="src\Slider.h" />
+    <ClInclude Include="src\Sprite.h" />
     <ClInclude Include="src\SpriteBatch.h" />
     <ClInclude Include="src\Stream.h" />
     <ClInclude Include="src\Technique.h" />
     <ClInclude Include="src\Terrain.h" />
     <ClInclude Include="src\TerrainPatch.h" />
+    <ClInclude Include="src\Text.h" />
     <ClInclude Include="src\TextBox.h" />
     <ClInclude Include="src\Texture.h" />
     <ClInclude Include="src\Theme.h" />
     <ClInclude Include="src\ThemeStyle.h" />
+    <ClInclude Include="src\TileSet.h" />
     <ClInclude Include="src\TimeListener.h" />
     <ClInclude Include="src\Touch.h" />
     <ClInclude Include="src\Transform.h" />
@@ -653,168 +565,70 @@
     <RootNamespace>gameplay</RootNamespace>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>windows\x86\$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <OutDir>windows\x64\$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'">
-    <OutDir>windows\x86\$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'">
-    <OutDir>windows\x64\$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IntDir>windows\x86\$(Configuration)\</IntDir>
-  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IntDir>windows\x64\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'">
-    <IntDir>windows\x86\$(Configuration)\</IntDir>
+    <OutDir>Debug</OutDir>
+    <IntDir>$(Configuration)\</IntDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'">
-    <IntDir>windows\x64\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>windows\x86\$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <OutDir>windows\x64\$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IntDir>windows\x86\$(Configuration)\</IntDir>
+    <OutDir>$(Configuration)\</OutDir>
+    <IntDir>$(Configuration)\</IntDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IntDir>windows\x64\$(Configuration)\</IntDir>
+    <IntDir>$(Configuration)\</IntDir>
+    <OutDir>$(Configuration)\</OutDir>
   </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
-      <RuntimeTypeInfo>
-      </RuntimeTypeInfo>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <DisableSpecificWarnings>
-      </DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Lib>
-  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <PrecompiledHeader>
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;GP_USE_GAMEPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(ProjectDir)src;..\external-deps\include;$(MSBuildProgramFiles32)\Microsoft DirectX SDK (June 2010)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <RuntimeTypeInfo>
       </RuntimeTypeInfo>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;GP_USE_MEM_LEAK_DETECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <DisableSpecificWarnings>
-      </DisableSpecificWarnings>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <MinimalRebuild>false</MinimalRebuild>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
     </Link>
     <Lib>
-      <Verbose>
-      </Verbose>
-      <AdditionalDependencies>
-      </AdditionalDependencies>
-      <AdditionalLibraryDirectories>
-      </AdditionalLibraryDirectories>
+      <TargetMachine>MachineX64</TargetMachine>
     </Lib>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'">
@@ -823,10 +637,12 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;GP_USE_MEM_LEAK_DETECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;GP_USE_GAMEPAD;GP_USE_MEM_LEAK_DETECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(ProjectDir)src;..\external-deps\include;$(MSBuildProgramFiles32)\Microsoft DirectX SDK (June 2010)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <MinimalRebuild>false</MinimalRebuild>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -837,40 +653,19 @@
       </Verbose>
     </Lib>
   </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <DisableSpecificWarnings>
-      </DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <PrecompiledHeader>
       </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
+      <Optimization>Full</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
+      <IntrinsicFunctions>false</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;GP_USE_GAMEPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(ProjectDir)src;..\external-deps\include;$(MSBuildProgramFiles32)\Microsoft DirectX SDK (June 2010)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <DebugInformationFormat>
       </DebugInformationFormat>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

+ 80 - 308
gameplay/gameplay.vcxproj.filters

@@ -24,9 +24,6 @@
     <ClCompile Include="src\Plane.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\PlatformBlackBerry.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
     <ClCompile Include="src\PlatformWindows.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -279,9 +276,6 @@
     <ClCompile Include="src\gameplay-main-android.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\gameplay-main-blackberry.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
     <ClCompile Include="src\gameplay-main-linux.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -348,6 +342,24 @@
     <ClCompile Include="src\ControlFactory.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\JoystickControl.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Script.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Sprite.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Text.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\TileSet.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Drawable.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\lua\lua_AbsoluteLayout.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -363,9 +375,6 @@
     <ClCompile Include="src\lua\lua_AIMessage.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_AIMessageParameterType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_AIState.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -387,9 +396,6 @@
     <ClCompile Include="src\lua\lua_AnimationClipListener.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_AnimationClipListenerEventType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_AnimationController.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -411,9 +417,6 @@
     <ClCompile Include="src\lua\lua_AudioSource.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_AudioSourceState.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_BoundingBox.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -429,7 +432,7 @@
     <ClCompile Include="src\lua\lua_Camera.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_CameraType.cpp">
+    <ClCompile Include="src\lua\lua_CameraListener.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_CheckBox.cpp">
@@ -438,37 +441,19 @@
     <ClCompile Include="src\lua\lua_Container.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ContainerScroll.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Control.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ControlAlignment.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_ControlAutoSize.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_ControlListener.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ControlListenerEventType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_ControlState.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Curve.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_CurveInterpolationType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_DepthStencilTarget.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_DepthStencilTargetFormat.cpp">
+    <ClCompile Include="src\lua\lua_Drawable.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_Effect.cpp">
@@ -483,18 +468,6 @@
     <ClCompile Include="src\lua\lua_Font.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_FontFormat.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_FontJustify.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_FontStyle.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_FontText.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Form.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -507,27 +480,12 @@
     <ClCompile Include="src\lua\lua_Game.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_GameClearFlags.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Gamepad.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_GamepadButtonMapping.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_GamepadGamepadEvent.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_GameState.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Gesture.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_GestureGestureEvent.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Global.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -540,19 +498,13 @@
     <ClCompile Include="src\lua\lua_ImageControl.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ImageFormat.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Joint.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_Keyboard.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_KeyboardKey.cpp">
+    <ClCompile Include="src\lua\lua_JoystickControl.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_KeyboardKeyEvent.cpp">
+    <ClCompile Include="src\lua\lua_Keyboard.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_Label.cpp">
@@ -561,21 +513,12 @@
     <ClCompile Include="src\lua\lua_Layout.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_LayoutType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Light.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_LightType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Logger.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_LoggerLevel.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Material.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -594,15 +537,9 @@
     <ClCompile Include="src\lua\lua_MeshBatch.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_MeshIndexFormat.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_MeshPart.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_MeshPrimitiveType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_MeshSkin.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -612,24 +549,15 @@
     <ClCompile Include="src\lua\lua_Mouse.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_MouseMouseEvent.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Node.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_NodeCloneContext.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_NodeType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_ParticleEmitter.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ParticleEmitterTextureBlending.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Pass.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -642,24 +570,15 @@
     <ClCompile Include="src\lua\lua_PhysicsCollisionObjectCollisionListener.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_PhysicsCollisionObjectCollisionListenerEventType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_PhysicsCollisionObjectCollisionPair.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_PhysicsCollisionObjectType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_PhysicsCollisionShape.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_PhysicsCollisionShapeDefinition.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_PhysicsCollisionShapeType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_PhysicsConstraint.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -675,9 +594,6 @@
     <ClCompile Include="src\lua\lua_PhysicsControllerListener.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_PhysicsControllerListenerEventType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_PhysicsFixedConstraint.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -717,9 +633,6 @@
     <ClCompile Include="src\lua\lua_Properties.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_PropertiesType.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Quaternion.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -738,49 +651,43 @@
     <ClCompile Include="src\lua\lua_RenderState.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateAutoBinding.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateBlend.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateCullFaceSide.cpp">
+    <ClCompile Include="src\lua\lua_RenderStateStateBlock.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateDepthFunction.cpp">
+    <ClCompile Include="src\lua\lua_RenderTarget.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateFrontFace.cpp">
+    <ClCompile Include="src\lua\lua_Scene.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateStateBlock.cpp">
+    <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateStencilFunction.cpp">
+    <ClCompile Include="src\lua\lua_Script.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderStateStencilOperation.cpp">
+    <ClCompile Include="src\lua\lua_ScriptController.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_RenderTarget.cpp">
+    <ClCompile Include="src\lua\lua_ScriptTarget.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_Scene.cpp">
+    <ClCompile Include="src\lua\lua_ScriptTargetEvent.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp">
+    <ClCompile Include="src\lua\lua_ScriptTargetEventRegistry.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ScriptController.cpp">
+    <ClCompile Include="src\lua\lua_Slider.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ScriptTarget.cpp">
+    <ClCompile Include="src\lua\lua_Sprite.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_Slider.cpp">
+    <ClCompile Include="src\lua\lua_SpriteBatch.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_SpriteBatch.cpp">
+    <ClCompile Include="src\lua\lua_SpriteBatchSpriteVertex.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_Technique.cpp">
@@ -789,30 +696,21 @@
     <ClCompile Include="src\lua\lua_Terrain.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TerrainFlags.cpp">
+    <ClCompile Include="src\lua\lua_TerrainPatch.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TextBox.cpp">
+    <ClCompile Include="src\lua\lua_Text.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TextBoxInputMode.cpp">
+    <ClCompile Include="src\lua\lua_TextBox.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_Texture.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TextureFilter.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_TextureFormat.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_TextureSampler.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TextureWrap.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_Theme.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -828,10 +726,10 @@
     <ClCompile Include="src\lua\lua_ThemeUVs.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_Touch.cpp">
+    <ClCompile Include="src\lua\lua_TileSet.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TouchTouchEvent.cpp">
+    <ClCompile Include="src\lua\lua_Touch.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\lua\lua_Transform.cpp">
@@ -861,24 +759,9 @@
     <ClCompile Include="src\lua\lua_VertexFormatElement.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_VertexFormatUsage.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_VerticalLayout.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_TerrainPatch.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_CameraListener.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\JoystickControl.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_JoystickControl.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\Plane.h">
@@ -1208,6 +1091,24 @@
     <ClInclude Include="src\ControlFactory.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\JoystickControl.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Script.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Sprite.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Text.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\TileSet.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Drawable.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_AbsoluteLayout.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1223,9 +1124,6 @@
     <ClInclude Include="src\lua\lua_AIMessage.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_AIMessageParameterType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_AIState.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1247,9 +1145,6 @@
     <ClInclude Include="src\lua\lua_AnimationClipListener.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_AnimationClipListenerEventType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_AnimationController.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1271,9 +1166,6 @@
     <ClInclude Include="src\lua\lua_AudioSource.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_AudioSourceState.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_BoundingBox.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1289,7 +1181,7 @@
     <ClInclude Include="src\lua\lua_Camera.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_CameraType.h">
+    <ClInclude Include="src\lua\lua_CameraListener.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_CheckBox.h">
@@ -1298,37 +1190,19 @@
     <ClInclude Include="src\lua\lua_Container.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ContainerScroll.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Control.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ControlAlignment.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_ControlAutoSize.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_ControlListener.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ControlListenerEventType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_ControlState.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Curve.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_CurveInterpolationType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_DepthStencilTarget.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_DepthStencilTargetFormat.h">
+    <ClInclude Include="src\lua\lua_Drawable.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_Effect.h">
@@ -1343,18 +1217,6 @@
     <ClInclude Include="src\lua\lua_Font.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_FontFormat.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_FontJustify.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_FontStyle.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_FontText.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Form.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1367,27 +1229,12 @@
     <ClInclude Include="src\lua\lua_Game.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_GameClearFlags.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Gamepad.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_GamepadButtonMapping.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_GamepadGamepadEvent.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_GameState.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Gesture.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_GestureGestureEvent.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Global.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1400,19 +1247,13 @@
     <ClInclude Include="src\lua\lua_ImageControl.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ImageFormat.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Joint.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_Keyboard.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_KeyboardKey.h">
+    <ClInclude Include="src\lua\lua_JoystickControl.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_KeyboardKeyEvent.h">
+    <ClInclude Include="src\lua\lua_Keyboard.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_Label.h">
@@ -1421,21 +1262,12 @@
     <ClInclude Include="src\lua\lua_Layout.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_LayoutType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Light.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_LightType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Logger.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_LoggerLevel.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Material.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1454,15 +1286,9 @@
     <ClInclude Include="src\lua\lua_MeshBatch.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_MeshIndexFormat.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_MeshPart.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_MeshPrimitiveType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_MeshSkin.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1472,24 +1298,15 @@
     <ClInclude Include="src\lua\lua_Mouse.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_MouseMouseEvent.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Node.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_NodeCloneContext.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_NodeType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_ParticleEmitter.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ParticleEmitterTextureBlending.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Pass.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1502,24 +1319,15 @@
     <ClInclude Include="src\lua\lua_PhysicsCollisionObjectCollisionListener.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_PhysicsCollisionObjectCollisionListenerEventType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_PhysicsCollisionObjectCollisionPair.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_PhysicsCollisionObjectType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_PhysicsCollisionShape.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_PhysicsCollisionShapeDefinition.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_PhysicsCollisionShapeType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_PhysicsConstraint.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1535,9 +1343,6 @@
     <ClInclude Include="src\lua\lua_PhysicsControllerListener.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_PhysicsControllerListenerEventType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_PhysicsFixedConstraint.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1577,9 +1382,6 @@
     <ClInclude Include="src\lua\lua_Properties.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_PropertiesType.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Quaternion.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1598,49 +1400,43 @@
     <ClInclude Include="src\lua\lua_RenderState.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateAutoBinding.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateBlend.h">
+    <ClInclude Include="src\lua\lua_RenderStateStateBlock.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateCullFaceSide.h">
+    <ClInclude Include="src\lua\lua_RenderTarget.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateDepthFunction.h">
+    <ClInclude Include="src\lua\lua_Scene.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateFrontFace.h">
+    <ClInclude Include="src\lua\lua_ScreenDisplayer.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateStateBlock.h">
+    <ClInclude Include="src\lua\lua_Script.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateStencilFunction.h">
+    <ClInclude Include="src\lua\lua_ScriptController.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderStateStencilOperation.h">
+    <ClInclude Include="src\lua\lua_ScriptTarget.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_RenderTarget.h">
+    <ClInclude Include="src\lua\lua_ScriptTargetEvent.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_Scene.h">
+    <ClInclude Include="src\lua\lua_ScriptTargetEventRegistry.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ScreenDisplayer.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_ScriptController.h">
+    <ClInclude Include="src\lua\lua_Slider.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ScriptTarget.h">
+    <ClInclude Include="src\lua\lua_Sprite.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_Slider.h">
+    <ClInclude Include="src\lua\lua_SpriteBatch.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_SpriteBatch.h">
+    <ClInclude Include="src\lua\lua_SpriteBatchSpriteVertex.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_Technique.h">
@@ -1649,30 +1445,21 @@
     <ClInclude Include="src\lua\lua_Terrain.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TerrainFlags.h">
+    <ClInclude Include="src\lua\lua_TerrainPatch.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TextBox.h">
+    <ClInclude Include="src\lua\lua_Text.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TextBoxInputMode.h">
+    <ClInclude Include="src\lua\lua_TextBox.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_Texture.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TextureFilter.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_TextureFormat.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_TextureSampler.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TextureWrap.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_Theme.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1688,10 +1475,10 @@
     <ClInclude Include="src\lua\lua_ThemeUVs.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_Touch.h">
+    <ClInclude Include="src\lua\lua_TileSet.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TouchTouchEvent.h">
+    <ClInclude Include="src\lua\lua_Touch.h">
       <Filter>src\lua</Filter>
     </ClInclude>
     <ClInclude Include="src\lua\lua_Transform.h">
@@ -1721,24 +1508,9 @@
     <ClInclude Include="src\lua\lua_VertexFormatElement.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_VertexFormatUsage.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_VerticalLayout.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_TerrainPatch.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_CameraListener.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\JoystickControl.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_JoystickControl.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="src\ScriptController.inl">

+ 0 - 3
gameplay/gameplay.vcxproj.user

@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-</Project>

File diff suppressed because it is too large
+ 550 - 711
gameplay/gameplay.xcodeproj/project.pbxproj


+ 10 - 1
gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-ios.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0500"
+   LastUpgradeVersion = "0610"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -39,6 +39,15 @@
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
       allowLocationSimulation = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "5B04C52B14BFCFE100EB0071"
+            BuildableName = "libgameplay.a"
+            BlueprintName = "gameplay-ios"
+            ReferencedContainer = "container:gameplay.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
       <AdditionalOptions>
       </AdditionalOptions>
    </LaunchAction>

+ 10 - 1
gameplay/gameplay.xcodeproj/xcshareddata/xcschemes/gameplay-macosx.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0500"
+   LastUpgradeVersion = "0610"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -39,6 +39,15 @@
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
       allowLocationSimulation = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "4234D99914686C52003031B3"
+            BuildableName = "libgameplay.a"
+            BlueprintName = "gameplay-macosx"
+            ReferencedContainer = "container:gameplay.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
       <AdditionalOptions>
       </AdditionalOptions>
    </LaunchAction>

BIN
gameplay/res/icon_tray.png


+ 11 - 1
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)

+ 12 - 0
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    
 }

+ 13 - 0
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
 

+ 8 - 0
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;

+ 13 - 0
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
 }

BIN
gameplay/res/ui/arial.gpb


+ 10 - 5
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", "<AIMessage>");
 }
 
 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<bool>("message", message))
+
+    if (_node && _node->fireScriptEvent<bool>(GP_GET_SCRIPT_EVENT(Node, messageReceived), dynamic_cast<void*>(_node), message))
         return true;
-    
+
     return false;
 }
 

+ 7 - 2
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 @@ private:
      * 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.

+ 1 - 5
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;
 }

+ 11 - 6
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", "<AIAgent><AIState>");
-    addScriptEvent("exit", "<AIAgent><AIState>");
-    addScriptEvent("update", "<AIAgent><AIState>f");
 }
 
 AIState::~AIState()
@@ -39,7 +38,9 @@ void AIState::enter(AIStateMachine* stateMachine)
     if (_listener)
         _listener->stateEnter(stateMachine->getAgent(), this);
 
-    fireScriptEvent<void>("enter", stateMachine->getAgent(), this);
+    Node* node = stateMachine->_agent->_node;
+    if (node)
+        node->fireScriptEvent<void>(GP_GET_SCRIPT_EVENT(Node, stateEnter), dynamic_cast<void*>(node), this);
 }
 
 void AIState::exit(AIStateMachine* stateMachine)
@@ -47,7 +48,9 @@ void AIState::exit(AIStateMachine* stateMachine)
     if (_listener)
         _listener->stateExit(stateMachine->getAgent(), this);
 
-    fireScriptEvent<void>("exit", stateMachine->getAgent(), this);
+    Node* node = stateMachine->_agent->_node;
+    if (node)
+        node->fireScriptEvent<void>(GP_GET_SCRIPT_EVENT(Node, stateExit), dynamic_cast<void*>(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<void>("update", stateMachine->getAgent(), this, elapsedTime);
+    Node* node = stateMachine->_agent->_node;
+    if (node)
+        node->fireScriptEvent<void>(GP_GET_SCRIPT_EVENT(Node, stateUpdate), dynamic_cast<void*>(node), this, elapsedTime);
 }
 
 AIState::Listener::~Listener()

+ 1 - 2
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;
 

+ 1 - 0
gameplay/src/AIStateMachine.h

@@ -30,6 +30,7 @@ class AIAgent;
 class AIStateMachine
 {
     friend class AIAgent;
+    friend class AIState;
 
 public:
 

+ 4 - 2
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;

+ 3 - 3
gameplay/src/Animation.h

@@ -57,13 +57,13 @@ public:
      * 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.

+ 82 - 56
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<ListenerEvent*>::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<Listener*>::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*>;
-
-    ScriptListener* listener = new ScriptListener(function);
-    _scriptListeners->push_back(listener);
-    addBeginListener(listener);
-}
-
-void AnimationClip::addEndListener(const char* function)
-{
-    if (!_scriptListeners)
-        _scriptListeners = new std::vector<ScriptListener*>;
-
-    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*>;
-
-    ScriptListener* listener = new ScriptListener(function);
-    _scriptListeners->push_back(listener);
-    addListener(listener, eventTime);
+    if (_endListeners)
+    {
+        GP_ASSERT(listener);
+        std::vector<Listener*>::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<void>(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<void>(GP_GET_SCRIPT_EVENT(AnimationClip, clipBegin), this);
+
     release();
 }
 
@@ -609,6 +644,9 @@ void AnimationClip::onEnd()
         }
     }
 
+    // Fire script end event
+    fireScriptEvent<void>(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<void>(function.c_str(), "<AnimationClip>[AnimationClip::Listener::EventType]", clip, type);
-}
-
-
 }

+ 35 - 51
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, "<AnimationClip>");
+    GP_SCRIPT_EVENT(clipEnd, "<AnimationClip>");
+    GP_SCRIPT_EVENT(clipUpdate, "<AnimationClip>f");
+    GP_SCRIPT_EVENTS_END();
+
 public:
 
     /**
@@ -37,7 +42,7 @@ public:
 
     public:
 
-        /*
+        /**
          * Constructor.
          */
         Listener() 
@@ -76,6 +81,14 @@ public:
         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 @@ public:
      */
     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 @@ public:
      */
     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 @@ public:
     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 @@ private:
         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 @@ private:
     std::vector<Listener*>* _endListeners;              // Collection of end listeners on the clip.
     std::list<ListenerEvent*>* _listeners;              // Ordered collection of listeners on the clip.
     std::list<ListenerEvent*>::iterator* _listenerItr;  // Iterator that points to the next listener event to be triggered.
-    std::vector<ScriptListener*>* _scriptListeners;     // Collection of listeners that are bound to Lua script functions.
 };
 
 }

+ 1 - 0
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"
 

+ 158 - 45
gameplay/src/AudioBuffer.cpp

@@ -9,7 +9,7 @@ namespace gameplay
 static std::vector<AudioBuffer*> __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<Stream*>(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<Stream*>(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<AudioStreamStateWav> streamStateWav;
+    std::unique_ptr<AudioStreamStateOgg> streamStateOgg;
+
     // Load sound file.
-    std::auto_ptr<Stream> stream(FileSystem::open(path));
+    std::unique_ptr<Stream> 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, &section);
+        result = ov_read(&streamState->oggFile, data + size, data_size - size, 0, 2, 1, &section);
         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, &section);
+            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;
+}
+
 }

+ 33 - 6
gameplay/src/AudioBuffer.h

@@ -23,7 +23,7 @@ private:
     /**
      * Constructor.
      */
-    AudioBuffer(const char* path, ALuint buffer);
+    AudioBuffer(const char* path, ALuint* buffers, bool streamed);
 
     /**
      * Destructor.
@@ -42,14 +42,41 @@ private:
      * 
      * @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<Stream> _fileStream;
+    std::unique_ptr<AudioStreamStateWav> _streamStateWav;
+    std::unique_ptr<AudioStreamStateOgg> _streamStateOgg;
+    int _buffersNeededCount;
 };
 
 }

+ 66 - 1
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<AudioSource*>::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));
+    }
+}
+
 }

+ 10 - 0
gameplay/src/AudioController.h

@@ -54,11 +54,21 @@ private:
      */
     void update(float elapsedTime);
 
+    void addPlayingSource(AudioSource* source);
+    
+    void removePlayingSource(AudioSource* source);
+
+    static void streamingThreadProc(void* arg);
 
     ALCdevice* _alcDevice;
     ALCcontext* _alcContext;
     std::set<AudioSource*> _playingSources;
+    std::set<AudioSource*> _streamingSources;
     AudioSource* _pausingSource;
+
+    bool _streamingThreadActive;
+    std::unique_ptr<std::thread> _streamingThread;
+    std::unique_ptr<std::mutex> _streamingMutex;
 };
 
 }

+ 78 - 20
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<AudioSource*>::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<AudioSource*>::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<int>(_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;
+}
+
 }

+ 13 - 4
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 @@ public:
      * "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" and "#<namespace-id>/<namespace-id>/.../<namespace-id>" 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 @@ public:
      */
     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 @@ private:
      * 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;

+ 31 - 49
gameplay/src/Base.h

@@ -28,6 +28,9 @@
 #include <functional>
 #include <bitset>
 #include <typeinfo>
+#include <thread>
+#include <mutex>
+#include <chrono>
 #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 <AL/al.h>
-#include <AL/alc.h>
-#elif __ANDROID__
-#include <AL/al.h>
-#include <AL/alc.h>
-#elif __linux__
-#include <AL/al.h>
-#include <AL/alc.h>
+// Audio (OpenAL)
+#ifdef __ANDROID__
+    #include <AL/al.h>
+    #include <AL/alc.h>
 #elif WIN32
-#include <al.h>
-#include <alc.h>
+    #define AL_LIBTYPE_STATIC
+    #include <AL/al.h>
+    #include <AL/alc.h>
+#elif __linux__
+    #include <AL/al.h>
+    #include <AL/alc.h>
 #elif __APPLE__
-#include <OpenAL/al.h>
-#include <OpenAL/alc.h>
+    #include <OpenAL/al.h>
+    #include <OpenAL/alc.h>
 #endif
+
+// Compressed Media
 #include <vorbis/vorbisfile.h>
 
 // Image
@@ -199,28 +202,12 @@ extern int strcmpnocase(const char* s1, const char* s2);
 
 // Scripting
 using std::va_list;
-#include <lua.hpp>
+#include <lua/lua.hpp>
 
 #define WINDOW_VSYNC        1
 
 // Graphics (OpenGL)
-#ifdef __QNX__
-    #include <EGL/egl.h>
-    #include <GLES2/gl2.h>
-    #include <GLES2/gl2ext.h>
-    #include <screen/screen.h>
-    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 <EGL/egl.h>
     #include <GLES2/gl2.h>
     #include <GLES2/gl2ext.h>
@@ -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 <GL/glew.h>
-    #define USE_VAO
+        #define WIN32_LEAN_AND_MEAN
+        #define GLEW_STATIC
+        #include <GL/glew.h>
+        #define GP_USE_VAO
 #elif __linux__
         #define GLEW_STATIC
         #include <GL/glew.h>
-        #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 <OpenGL/gl.h>
         #include <OpenGL/glext.h>
@@ -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 \

+ 50 - 12
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)
 {
 }
 

+ 1 - 0
gameplay/src/Bundle.h

@@ -5,6 +5,7 @@
 #include "Font.h"
 #include "Node.h"
 #include "Game.h"
+#include "MeshSkin.h"
 
 namespace gameplay
 {

+ 2 - 2
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

+ 7 - 2
gameplay/src/Button.h

@@ -62,9 +62,14 @@ protected:
     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.

+ 1 - 1
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)

+ 2 - 5
gameplay/src/Camera.h

@@ -51,7 +51,7 @@ public:
     /**
      * 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 @@ private:
      * @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 @@ private:
      */
     void transformChanged(Transform* transform, long cookie);
 
-    /**
-     *
-     */
     void cameraChanged();
 
     Camera::Type _type;

+ 5 - 5
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";
-}
-
 }

+ 10 - 5
gameplay/src/CheckBox.h

@@ -34,6 +34,16 @@ public:
      */
     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 @@ public:
      */
     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.

+ 10 - 7
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)

+ 32 - 19
gameplay/src/Container.h

@@ -37,6 +37,19 @@ public:
         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 @@ public:
      */
     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 @@ public:
      */
     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 @@ public:
      */
     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 @@ private:
      */
     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);
 

+ 76 - 80
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>[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<Container *>(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<void>("controlEvent", this, eventType);
+    fireScriptEvent<void>(GP_GET_SCRIPT_EVENT(Control, controlEvent), dynamic_cast<void*>(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;
+}
+
 }

+ 82 - 13
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>[Control::Listener::EventType]");
+    GP_SCRIPT_EVENTS_END();
+
 public:
 
     /**
@@ -231,6 +235,16 @@ public:
      */
     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 @@ public:
      */
     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 @@ protected:
      */
     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 @@ protected:
     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 @@ protected:
      * @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 @@ protected:
      */
     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.
      */ 

+ 4 - 2
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);
 }
 
 }

+ 27 - 0
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);

+ 33 - 5
gameplay/src/Curve.h

@@ -313,7 +313,7 @@ public:
     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 @@ public:
      * @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.

+ 10 - 2
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

+ 28 - 0
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;
+}
+
+}

+ 67 - 0
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

+ 9 - 5
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> stream(FileSystem::open(path.c_str(), FileSystem::WRITE));
+    std::unique_ptr<Stream> 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<Texture::Sampler*>(values[i])->getTexture()->getType() == Texture::TEXTURE_2D && uniform->_type == GL_SAMPLER_2D) || 
+            (const_cast<Texture::Sampler*>(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)
 {
 }
 

+ 35 - 9
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<std::string, std::string> __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> stream(open(filePath));
+    std::unique_ptr<Stream> 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__

+ 17 - 0
gameplay/src/FileSystem.h

@@ -201,6 +201,23 @@ public:
      */
     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).
      * 

+ 44 - 327
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<Font*> __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<int> xPositions;
-    std::vector<unsigned int> 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<int>::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<unsigned int>::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, &currentLineLength, &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<int>(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, &currentLineLength, &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, &currentLineLength, &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, &currentLineLength, &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, &currentLineLength, &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, &currentLineLength, &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, &currentLineLength, &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();
-}
-
 }

+ 32 - 91
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 @@ public:
         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 @@ public:
      *
      * @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 @@ public:
      * @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 @@ public:
      * @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 @@ public:
      * @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 @@ public:
     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 @@ public:
     /**
      * 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 @@ public:
     /**
      * 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 @@ private:
          */
         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 @@ private:
      * @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);

+ 69 - 48
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);
         }
     }
 }

+ 34 - 19
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 @@ public:
     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 @@ public:
      *
      * @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 @@ private:
      */
     virtual ~Form();
 
+    /**
+     * @see Drawable::clone
+     */
+    Drawable* clone(NodeCloneContext &context);
+
     /**
      * @see Control::initialize
      */
@@ -201,11 +203,25 @@ private:
     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 @@ private:
 
     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<SpriteBatch*> _batches;
     bool _batched;

+ 29 - 15
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()

+ 27 - 16
gameplay/src/FrameBuffer.h

@@ -101,11 +101,20 @@ public:
     /**
      * 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 @@ public:
      */
     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 @@ private:
      */
     FrameBuffer& operator=(const FrameBuffer&);
 
+    void setRenderTarget(RenderTarget* target, unsigned int index, GLenum textureTarget);
+
     static void initialize();
 
     static void finalize();

+ 219 - 50
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]<Gamepad>");
+    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<TimeEvent, std::vector<TimeEvent>, std::less<TimeEvent> >();
 }
 
 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<void>(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<void>(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<void>(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<void>(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<void>(GP_GET_SCRIPT_EVENT(GameScriptTarget, update), 0);
 
         // Graphics Rendering.
         render(0);
 
         // Script render.
-        _scriptController->render(0);
+        if (_scriptTarget)
+            _scriptTarget->fireScriptEvent<void>(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<void>(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<void>(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<void>(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<bool>(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<void>(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<void>(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<void>(GP_GET_SCRIPT_EVENT(GameScriptTarget, gesturePinchEvent), x, y, scale);
+}
+
+void Game::gestureTapEventInternal(int x, int y)
+{
+    gestureTapEvent(x, y);
+    if (_scriptTarget)
+        _scriptTarget->fireScriptEvent<void>(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<void>(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureLongTapevent), x, y, duration);
+}
+
+void Game::gestureDragEventInternal(int x, int y)
+{
+    gestureDragEvent(x, y);
+    if (_scriptTarget)
+        _scriptTarget->fireScriptEvent<void>(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureDragEvent), x, y);
+}
+
+void Game::gestureDropEventInternal(int x, int y)
+{
+    gestureDropEvent(x, y);
+    if (_scriptTarget)
+        _scriptTarget->fireScriptEvent<void>(GP_GET_SCRIPT_EVENT(GameScriptTarget, gestureDropEvent), x, y);
+}
+
+void Game::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad)
+{
+    gamepadEvent(evt, gamepad);
+    if (_scriptTarget)
+        _scriptTarget->fireScriptEvent<void>(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<ScriptListener*>();
+    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<TimeEvent, std::vector<TimeEvent>, std::less<TimeEvent> >();
 }
 
 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<void>(function.c_str(), "l", timeDiff);
-}
-
 Game::TimeEvent::TimeEvent(double time, TimeListener* timeListener, void* cookie)
     : time(time), listener(timeListener), cookie(cookie)
 {

+ 33 - 33
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 @@ public:
         CLEAR_COLOR_DEPTH_STENCIL = CLEAR_COLOR | CLEAR_DEPTH | CLEAR_STENCIL
     };
 
+    /**
+     * Constructor.
+     */
+    Game();
+
     /**
      * Destructor.
      */
@@ -590,14 +596,20 @@ public:
      * 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 @@ public:
 
 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 @@ protected:
      *
      * @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 @@ protected:
      *
      * @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 @@ protected:
 
     /**
      * 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 @@ protected:
 
 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 @@ private:
      */
     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 @@ private:
     AudioListener* _audioListener;              // The audio listener in 3D space.
     std::priority_queue<TimeEvent, std::vector<TimeEvent>, std::less<TimeEvent> >* _timeEvents;     // Contains the scheduled time events.
     ScriptController* _scriptController;            // Controls the scripting engine.
-    std::vector<ScriptListener*>* _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.
 

+ 28 - 62
gameplay/src/Gamepad.cpp

@@ -12,15 +12,13 @@ namespace gameplay
 static std::vector<Gamepad*> __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);
     }
 }
 

+ 18 - 55
gameplay/src/Gamepad.h

@@ -32,27 +32,18 @@ public:
     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 @@ public:
         BUTTON_UP,
         BUTTON_DOWN,
         BUTTON_LEFT,
-        BUTTON_RIGHT
+        BUTTON_RIGHT,
+        BUTTON_MENU1,
+        BUTTON_MENU2,
+        BUTTON_MENU3
     };
 
     /**
@@ -113,33 +107,12 @@ public:
      */
     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 @@ private:
      * @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 @@ private:
 
     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 @@ private:
 
     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 @@ private:
     
     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];

+ 28 - 28
gameplay/src/Image.cpp

@@ -19,7 +19,7 @@ Image* Image::create(const char* path)
     GP_ASSERT(path);
 
     // Open the file.
-    std::auto_ptr<Stream> stream(FileSystem::open(path));
+    std::unique_ptr<Stream> 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)

+ 5 - 5
gameplay/src/Image.h

@@ -33,17 +33,17 @@ public:
      */
     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.

+ 5 - 5
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)

+ 10 - 2
gameplay/src/ImageControl.h

@@ -35,6 +35,16 @@ public:
      */
     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 @@ public:
      */
     const Rectangle& getRegionDst() const;
 
-    const char* getType() const;
-
 protected:
 
     ImageControl();

+ 1 - 0
gameplay/src/Joint.cpp

@@ -1,6 +1,7 @@
 #include "Base.h"
 #include "Joint.h"
 #include "MeshSkin.h"
+#include "Model.h"
 
 namespace gameplay
 {

+ 266 - 127
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, &regionOut.x, &regionOut.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;
 }
 
 }

+ 72 - 15
gameplay/src/JoystickControl.h

@@ -32,6 +32,16 @@ public:
      */
     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 @@ public:
      * 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 @@ public:
      * @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 @@ protected:
      * 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 @@ protected:
      */
     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 @@ protected:
 
 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;
 };
 

+ 8 - 7
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";
-}
-
 }

+ 10 - 5
gameplay/src/Label.h

@@ -32,6 +32,16 @@ public:
      */
     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 @@ public:
      */
     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.

+ 1 - 1
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)

+ 1 - 2
gameplay/src/Light.h

@@ -299,10 +299,9 @@ private:
      * 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;
     

+ 6 - 5
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)

+ 6 - 1
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);
             }
         }

+ 1 - 1
gameplay/src/MathUtil.h

@@ -73,7 +73,7 @@ private:
 
 #define MATRIX_SIZE ( sizeof(float) * 16)
 
-#ifdef USE_NEON
+#ifdef GP_USE_NEON
 #include "MathUtilNeon.inl"
 #else
 #include "MathUtil.inl"

+ 1 - 0
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

+ 1 - 1
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.

Some files were not shown because too many files changed in this diff