2
0
Эх сурвалжийг харах

Merge remote-tracking branch 'blackberry/next' into controls_factory

Conflicts:
	gameplay/CMakeLists.txt
SAUVAGEOT Paul-Arthur 12 жил өмнө
parent
commit
0a273d32d8
100 өөрчлөгдсөн 6698 нэмэгдсэн , 5856 устгасан
  1. 224 220
      CHANGES.md
  2. 0 1
      CMakeLists.txt
  3. 153 205
      gameplay.sln
  4. 20 3
      gameplay/CMakeLists.txt
  5. 40 42
      gameplay/android/java/src/org/gameplay3d/GamePlayActivity.java
  6. 39 53
      gameplay/android/java/src/org/gameplay3d/GooglePlayClientHelper.java
  7. 3 4
      gameplay/android/java/src/org/gameplay3d/GooglePlaySocial.java
  8. 0 12
      gameplay/android/java/src/org/gameplay3d/lib/TestClass.java
  9. 12 2
      gameplay/android/jni/Android.mk
  10. 914 1139
      gameplay/gameplay.vcxproj
  11. 383 356
      gameplay/gameplay.vcxproj.filters
  12. 1835 1708
      gameplay/gameplay.xcodeproj/project.pbxproj
  13. 0 45
      gameplay/res/shaders/colored-unlit.frag
  14. 0 53
      gameplay/res/shaders/colored-unlit.vert
  15. 93 38
      gameplay/res/shaders/colored.frag
  16. 96 41
      gameplay/res/shaders/colored.vert
  17. 10 4
      gameplay/res/shaders/font.frag
  18. 4 0
      gameplay/res/shaders/font.vert
  19. 2 0
      gameplay/res/shaders/form.frag
  20. 3 0
      gameplay/res/shaders/form.vert
  21. 0 41
      gameplay/res/shaders/lighting-directional.frag
  22. 0 31
      gameplay/res/shaders/lighting-directional.vert
  23. 0 46
      gameplay/res/shaders/lighting-point.frag
  24. 0 50
      gameplay/res/shaders/lighting-point.vert
  25. 0 63
      gameplay/res/shaders/lighting-spot.frag
  26. 0 52
      gameplay/res/shaders/lighting-spot.vert
  27. 79 38
      gameplay/res/shaders/lighting.frag
  28. 66 0
      gameplay/res/shaders/lighting.vert
  29. 0 2
      gameplay/res/shaders/skinning-none.vert
  30. 33 15
      gameplay/res/shaders/skinning.vert
  31. 2 0
      gameplay/res/shaders/sprite.frag
  32. 3 0
      gameplay/res/shaders/sprite.vert
  33. 7 6
      gameplay/res/shaders/terrain.vert
  34. 0 76
      gameplay/res/shaders/textured-bumped.frag
  35. 0 106
      gameplay/res/shaders/textured-bumped.vert
  36. 0 47
      gameplay/res/shaders/textured-unlit.frag
  37. 0 57
      gameplay/res/shaders/textured-unlit.vert
  38. 102 39
      gameplay/res/shaders/textured.frag
  39. 123 52
      gameplay/res/shaders/textured.vert
  40. 366 372
      gameplay/src/Base.h
  41. 21 0
      gameplay/src/Effect.cpp
  42. 1 1
      gameplay/src/Effect.h
  43. 1 1
      gameplay/src/Font.cpp
  44. 3 2
      gameplay/src/Form.cpp
  45. 1 1
      gameplay/src/Form.h
  46. 58 38
      gameplay/src/Model.cpp
  47. 44 5
      gameplay/src/Model.h
  48. 27 16
      gameplay/src/Node.cpp
  49. 42 60
      gameplay/src/Node.h
  50. 4 5
      gameplay/src/ParticleEmitter.cpp
  51. 1 1
      gameplay/src/ParticleEmitter.h
  52. 0 7
      gameplay/src/PhysicsVehicle.cpp
  53. 35 16
      gameplay/src/PhysicsVehicleWheel.cpp
  54. 7 0
      gameplay/src/PhysicsVehicleWheel.h
  55. 0 33
      gameplay/src/RenderState.cpp
  56. 1 15
      gameplay/src/RenderState.h
  57. 1 22
      gameplay/src/Scene.cpp
  58. 1 49
      gameplay/src/Scene.h
  59. 0 4
      gameplay/src/SceneLoader.cpp
  60. 26 0
      gameplay/src/SceneRenderer.cpp
  61. 62 0
      gameplay/src/SceneRenderer.h
  62. 73 0
      gameplay/src/SceneRendererForward.cpp
  63. 49 0
      gameplay/src/SceneRendererForward.h
  64. 3 3
      gameplay/src/SocialController.cpp
  65. 1 1
      gameplay/src/SocialController.h
  66. 2 1
      gameplay/src/Terrain.cpp
  67. 2 1
      gameplay/src/Terrain.h
  68. 7 25
      gameplay/src/TerrainPatch.cpp
  69. 1 5
      gameplay/src/TerrainPatch.h
  70. 53 0
      gameplay/src/VisibleSet.h
  71. 89 0
      gameplay/src/VisibleSetDefault.cpp
  72. 73 0
      gameplay/src/VisibleSetDefault.h
  73. 5 1
      gameplay/src/gameplay.h
  74. 6 3
      gameplay/src/lua/lua_Form.cpp
  75. 2 2
      gameplay/src/lua/lua_Global.cpp
  76. 109 128
      gameplay/src/lua/lua_Joint.cpp
  77. 3 3
      gameplay/src/lua/lua_Joint.h
  78. 158 6
      gameplay/src/lua/lua_Model.cpp
  79. 4 0
      gameplay/src/lua/lua_Model.h
  80. 109 128
      gameplay/src/lua/lua_Node.cpp
  81. 3 3
      gameplay/src/lua/lua_Node.h
  82. 6 3
      gameplay/src/lua/lua_ParticleEmitter.cpp
  83. 0 10
      gameplay/src/lua/lua_RenderStateAutoBinding.cpp
  84. 0 178
      gameplay/src/lua/lua_Scene.cpp
  85. 0 4
      gameplay/src/lua/lua_Scene.h
  86. 186 0
      gameplay/src/lua/lua_SceneRenderer.cpp
  87. 17 0
      gameplay/src/lua/lua_SceneRenderer.h
  88. 194 0
      gameplay/src/lua/lua_SceneRendererForward.cpp
  89. 17 0
      gameplay/src/lua/lua_SceneRendererForward.h
  90. 12 6
      gameplay/src/lua/lua_Terrain.cpp
  91. 232 0
      gameplay/src/lua/lua_VisibleSet.cpp
  92. 18 0
      gameplay/src/lua/lua_VisibleSet.h
  93. 251 0
      gameplay/src/lua/lua_VisibleSetDefault.cpp
  94. 18 0
      gameplay/src/lua/lua_VisibleSetDefault.h
  95. 4 0
      gameplay/src/lua/lua_all_bindings.cpp
  96. 4 0
      gameplay/src/lua/lua_all_bindings.h
  97. 26 37
      gameplay/src/social/GooglePlaySocialSession.cpp
  98. 8 8
      gameplay/src/social/GooglePlaySocialSession.h
  99. 2 2
      samples/browser/res/common/box.material
  100. 3 3
      samples/browser/res/common/duck.material

+ 224 - 220
CHANGES.md

@@ -1,220 +1,224 @@
-## v2.0.0
-
-- Adds support for Visual Studio 2012
-- Adds support for iOS 7, MacOS 10.8 and XCode 5.
-- Adds support for BlackBerry NDK 10.2.
-- Adds support for social achievements, leaderboard and challenges.
-- Adds password mode on textbox controls.
-- Adds collision object group mask filtering.
-- Fixes Mesh Collision shapes.
-
-## v1.7.0
-
-- Adds -m parameter to encoder to support exporting Material from FBX scenes.
-- Adds encoder animation grouping arguments for auto grouping and disabling grouping via -g:auto and -g:off
-- Adds UI ImageControl
-- Adds UI control events for enter and leave.
-- Adds UI and theme support for focus state on controls.
-- Adds Gamepad support in UI.
-- Adds smooth interial mouse scrolling.
-- Adds keyboard event handling code that was missed on some UI containers and controls.
-- Adds Game accelerometer and gyro improvements.
-- Adds XBox 360 controller support to MacOS X.
-- Adds RenderState enum for supporting cull side definition for front, back and front-back culling.
-- Adds a lua function "convert(object, className)" that will convert a gameplay userdata object to another class type by changing the metatable. (For example: This lets you convert Control to Button in lua)
-- Adds gesture events to script.
-- Adds script friendly verions of Camera:project(..)
-- Adds support for defining lights in .scene file.
-- Adds MaterialParameter setter that are script friendly.
-- Adds methods to FrameBuffer for querying render target info.
-- Adds FileSystem::getDirectoryName()
-- Adds support so that Properties can be loaded relative to .property files.
-- Adds methods on ScriptController for registering and unregisering global script callback functions.
-- Adds Game::resizeEvent(..)
-- Adds Game::getArguments()
-- Adds Scene::load() so it can load from ".gpb" files.
-- Adds some additional operators overloads for Vector classes.
-- Adds RenderState::clearParameter method to allow existing material parameter values/bindings to be cleared.
-- Adds loopBlendTime property for animation clips to support interpolating between the end points of an animation clip when looping.
-- Fixes Xcode support to be up to date to version 6.1
-- Fixes Form::projectPoint for forms that are scaled.
-- Fixes Bullet NEON build problems.
-- Fixes problem with static rigid bodies attached to nodes.
-- Fixes problems with ghost objects and kinimatic rigid bodies.
-- Fixes userData pointer that was not cloned properly when cloning a node.
-- Fixes bug in createChannel with keyCount = 1.
-- Fixes encoder to ignore 1 frame animations caused by FBX export on Blender.
-- Fixes buggy tab order in UI.
-- Fixes touch event problems not propagating up on mobile touch platforms.
-- Fixes parent relationship on cloned Technique and Pass.
-- Fixes Node to include light contribution for bounding volume computations.
-- Fixed issue where multiple samplers pointing to the same texture would share the same state instead of using sampler-specific filter and wrap state.
-- Fixes calculation of the transform matrix in FBX encoder for lights properly considering vectors like pre and post rotation scenarios.
-- Fixes blurry borders on UI forms by using proper texture filtering.
-- Fixes lua dofile on Windows.
-- Fixes in colored shader when using spot ligts.
-- Fixes issue in encoder which was converting point lights into ambient lights when they had no decay.
-- Fixes to CMake projects on different platforms.
-- Cleans up Platform by moving commong platform code to Platform.cpp
-- Cleans up and changes Gamepad APIs.
-- Cleans repo directory restructure dropping gameplay- prefix on many folders and files.
-- Removes bin and external-deps folder/contents to external server with new install scripts that are now required to be run after cloning the repo.
-- Removes pre-compiled api/html docs to reduce repository bloat.
-- Removes support for COLLADA DAE and now support FBX.
-- Removes middle mouse button simulated desktop accelerometer.
-
-## v1.6.0
-
-- Adds file Stream interface for reading/writing files instead of using fread/fwrite. 
-- Adds Terrain class to support for heightmap based terrains featuring LOD, multiple surface layers, loading from PNG, RAW8/16, full transform, physics, patch culling and verticle skirt for cracks.
-- Adds object-space normal map generation to gameplay-encoder for terrain normal map generation.
-- Adds scene support for loading .terrain files in .scene files.
-- Adds scene support for inline cameras to .scene files.
-- Adds suppoft for defining .scene files without 'path' to gpb. New node can not be create in .scene file.
-- Adds static Scene::getScene(const char*) to query currently active scenes in a game, helpful for script access.
-- Adds support for multiple translate, rotate and scale commands in a single node entity within .scene files, processed in-order they are defined.
-- Adds scene support for material auto binding scene ambient color, light color and light direction.
-- Adds support for setting the depth compare function on materials.
-- Adds support for texture/sampler arrays being passed to materials.
-- Adds support for loading uncompressed DDS textures for the following formats: R8G8B8, A8R8G8B8, A8B8G8R8, X8R8G8B8, X8B8G8R8
-- Adds improvments to prefer higher quality mipmap generation.
-- Adds improved Gamepad API support for button enumeration, triggers and some mobile Gamepad support on BlackBerry.
-- Adds additional gameplay-tests for billboards, forms, gamepads and lights.
-- Adds support for launching the browser via launchURL(const char*).
-- Adds physics support for setLinearFactor and setAngularFactor  on rigid bodies.
-- Adds methods to PhysicsCollisionObject to allow conversion to subclass types (i.e. PhysicsRigidBody, PhysicsCharacter, etc) from script.
-- Adds option for fullscreen without width/height config to use native desktop resolution.
-- Adds Linux support for OpenAL PulseAudio back-end.
-- Adds support for latest Bullet Physics 2.81 with NEON optimizations for mobile targets.
-- Adds support for preprocessor directive NO_LUA_BINDINGS in the gameplay project to omit inclusion of generated lua bindings in compilation for developer mode value. 
-- Adds optimizations to Lua generator to only write generated files if they differ from existing files, reducing both build times and committing of unchanged script binding files.
-- Adds changes to Slider for setValueTextVisible, setValueTextAlignment, setValueTextPrecision and getters.
-- Adds Microsoft Windows 7 64-bit support.
-- Adds Apple iOS 6 support.
-- Fixes to external-deps to reduce the size of the libraries on Windows.
-- Fixes for Android to no longer need to copy files to the SD card before reading them. None of the Android samples require an SD card.
-- Fixes for animation of opacity on UI and fonts.
-- Fixes in UI for removing controls and also setVisible(bool).
-- Fixes for UI controls missing on MacOSX.
-- Fixes for setting UI alignment programmatically.
-- Fixes for lighting shaders.
-- Fixes to the texture minification mode from GL_LINEAR_MIPMAP_LINEAR to GL_NEAREST_MIPMAP_LINEAR for newly created textures with mipmaps.
-- Fixes minor memory leaks and possible access violations when calling Game::exit() from script.
-- Fixes physics debug drawing for large scenes causing the internal MeshBatch to grow to an enormous size.
-
-## v1.5.0
-
-- Linux support. (tested on Ubuntu 12)
-- CMake support for makefile generation for Linux.
-- Gamepad API support for desktops.
-- Touch gesture support for tap, swipe and pinch.
-- Vehicle physics support via new PhysicsVehicle and PhysicsVehicleWheel classes.
-- Adds new racer sample (sample06-racer).
-- Adds gameplay-tests project as a test app for various basic engine features with some initial tests.
-- Adds support for Scene files for wildcard identifiers.
-- Adds Visual Studio Plug-in support for BlackBerry PlayBook and BlackBerry 10.
-- Adds configurable multi-sampling anti-aliasing support. 
-- Adds updates to latest FBX SDK 2013.3.
-- Adds file formats documentation for game.config .scene, .material, .animation, .physics, .particle
-- Adds Game/Platform::canExit for testing device capabilities to quit. (only ios)
-- Web community forums at http://www.gameplay3d.org/forums.
-- Changed keyTimes from unsigned long[]  to unsigned int[]. (breaks compat. in AnimationTarget and Animation::Channel)
-- Fixes inconsistencies from Bundle::getObjectID() to Bundle::getObjectId() (breaks compat. in Bundle)
-- Fixes the texture coordinates of Mesh::createQuad(float x, float y, float width, float height).
-- Fixes line-wise distortion when loading RGB png's into textures that are non-power of two.
-- Fixes inconsistencies in createXXXX methods.  (breaks compat. in Scene)
-- Fixes Rectangle::contains.
-- Fixes Lua print logging.
-- Fixes Lua errors to be treated as runtime warnings.
-- Fixes setVertexData to pointers instead of constant data.
-- Fixes AudioSource so that it doesn't loop by default.
-- Fixes minor UI scrolling issues.
-
-## v1.4.0
-
-- Lua script bindings for all gameplay interfaces.
-- Lua script binding generator tool (gameplay-luagen) for generating gameplay Lua bindings from doxygen xml output.
-- AIController, AIAgent, AIStateMachine, AIState and AIMessage classes for scripted AI support.
-- Sample for sample05-lua to demonstrate basic Lua with AI scripting.
-- Gamepad class with virtual gamepad support.
-- Pre-built versions gameplay-encoder added to bin folder with TTF, DAE and FBX support built-in.
-- Improved modular shaders with support for #include in shaders. (breaks compat. for shaders)
-- LightMap support into colored-unlit.frag and textured-unlit.frag shaders.
-- Adds cloning and wireframing features to sample03-character.
-- Adds kick the ball on the sample03-character to demonstrate 2 buttons and more physics.
-- Fixes missing mouse events on UI controls.
-- Fixes to gameplay-encoder to prompt user for font size if not specified.
-- Fixes to add "-g" as short form argument for grouping animations.
-- Fixes node cloning.
-- Fixes to gameplay-encoder for output file path when encoding fonts.
-- Fixes to FrameBuffer, RenderTarget and DepthStencilTarget.
-- Fixes user switching in MacOSX to other applications with Apple-Tab.
-- Fixes measureText with empty string to be proper size.
-- Fixes for aliased text by applying linear filtering by default on Fonts.
-- Fixes RenderState::StateBlock::bindNoRestore() issue where blend function was not restored to the proper defaults.
-- Fixes some inconsistencies in Game event method names for menuEvent. (breaks compat. in Game)
-- Fixes some inconsistencies with AnimationClip::getID() to be same as Node::getId() and other classes. (breaks compat. in AnimationClip)
-- Fixes to gameplay-encoder and PhysicsRigidBody for heightmaps which adds height precision into generated heightmap png's.
-
-## v1.3.0
-
-- Portrait mode games on mobile platforms.
-- Fullscreen and configurable game resolutions on desktop platforms.
-- User Interface support for scrolling with scrollbars on Container.
-- PVRTC, ATC and DXT texture compression support.
-- Performance improvements in user interface forms and text.
-- Performance improvements in animations on transforms.
-- Performance improvements using NEON math for BlackBerry and iOS.
-- Fixes for improvements in error handling throughout all systems.
-- Fixes supporting built-in Maya COLLADA exporter via DAE_FBX export.
-- Fixes for latest FBX SDK 2013 support.
-- Fixes for loading from some WAV files that were crashing.
-- Fixes for From/By animations.
-- Fixes allowing all inline properties loaded within .scene files. (breaks compat. for .scene)
-- Fixes in .scene files for collisionObject definitions (breaks compat. for .scene)
-- Fixes for depth/z-ordering of controls.
-
-## v1.2.0
-
-- BlackBerry 10 support.
-- iOS 5.1 support.
-- Android 2.3+ support.
-- User interface system with declarative forms and themes.
-- Bluetooth keyboard/mouse support on BlackBerry platform.
-- Developer guide.
-- Sample/tutorial for sample03-character.
-- Sample for sample04-particles to demonstrate particle emitters.
-- Fixes for loading properties from URL.
-- Fixes on Win32/MacOSX for when mouse pointer leaves the window and returns.
-- Fixes to accelerometer for Android.
-- Fixes in animation blending.
-- Fixes to GPB for loading from single node and parent node. (breaks compat. for .gpb)
-
-## v1.1.0
-
-- FBX support in gameplay-encoder.
-- MacOSX platform support using XCode.
-- Off-screen rendering functionality using FrameBuffer.
-- Loading 3D scenes using declarative  .scene files.
-- Loading audio from .ogg files using vorbis.
-- Loading AudioSources from .audio files.
-- Loading Animations from .animation files.
-- AnimationClip support for cross fading.
-- Physics support using Bullet Physics.
-- Cross-platform new project generator.
-- Overloaded operators in Math classes.
-- Font improvements for justify, clip, wrap and scaling.
-- Fixes for Font::drawText to use point size and not float scalar.
-- Fixes for memory leaks in and fixes to AnimationTarget.
-- Fixes for bumped and parallax shaders.
-- Fixes to simplify folders for resources in samples.
-- Fixes to the material/shader system.
-- Fixes to the ParticleEmitter.
-
-## v1.0.0
-
-- Initial release.
-
-
-
-
+## v2.0.0
+
+- Adds support for Visual Studio 2013.
+- Adds support for iOS 7, MacOS 10.8 and XCode 5.
+- Adds support for BlackBerry NDK 10.2.
+- Adds support for social achievements, leaderboard and challenges.
+- Adds password mode on textbox controls.
+- Adds collision object group mask filtering.
+- Adds support in shaders for mulitple lights.
+- Adds support for scene renderer.
+- Adds support for encoding distance field based fonts.
+- Fixes Mesh Collision shapes.
+
+
+## v1.7.0
+
+- Adds -m parameter to encoder to support exporting Material from FBX scenes.
+- Adds encoder animation grouping arguments for auto grouping and disabling grouping via -g:auto and -g:off
+- Adds UI ImageControl
+- Adds UI control events for enter and leave.
+- Adds UI and theme support for focus state on controls.
+- Adds Gamepad support in UI.
+- Adds smooth interial mouse scrolling.
+- Adds keyboard event handling code that was missed on some UI containers and controls.
+- Adds Game accelerometer and gyro improvements.
+- Adds XBox 360 controller support to MacOS X.
+- Adds RenderState enum for supporting cull side definition for front, back and front-back culling.
+- Adds a lua function "convert(object, className)" that will convert a gameplay userdata object to another class type by changing the metatable. (For example: This lets you convert Control to Button in lua)
+- Adds gesture events to script.
+- Adds script friendly verions of Camera:project(..)
+- Adds support for defining lights in .scene file.
+- Adds MaterialParameter setter that are script friendly.
+- Adds methods to FrameBuffer for querying render target info.
+- Adds FileSystem::getDirectoryName()
+- Adds support so that Properties can be loaded relative to .property files.
+- Adds methods on ScriptController for registering and unregisering global script callback functions.
+- Adds Game::resizeEvent(..)
+- Adds Game::getArguments()
+- Adds Scene::load() so it can load from ".gpb" files.
+- Adds some additional operators overloads for Vector classes.
+- Adds RenderState::clearParameter method to allow existing material parameter values/bindings to be cleared.
+- Adds loopBlendTime property for animation clips to support interpolating between the end points of an animation clip when looping.
+- Fixes Xcode support to be up to date to version 6.1
+- Fixes Form::projectPoint for forms that are scaled.
+- Fixes Bullet NEON build problems.
+- Fixes problem with static rigid bodies attached to nodes.
+- Fixes problems with ghost objects and kinimatic rigid bodies.
+- Fixes userData pointer that was not cloned properly when cloning a node.
+- Fixes bug in createChannel with keyCount = 1.
+- Fixes encoder to ignore 1 frame animations caused by FBX export on Blender.
+- Fixes buggy tab order in UI.
+- Fixes touch event problems not propagating up on mobile touch platforms.
+- Fixes parent relationship on cloned Technique and Pass.
+- Fixes Node to include light contribution for bounding volume computations.
+- Fixed issue where multiple samplers pointing to the same texture would share the same state instead of using sampler-specific filter and wrap state.
+- Fixes calculation of the transform matrix in FBX encoder for lights properly considering vectors like pre and post rotation scenarios.
+- Fixes blurry borders on UI forms by using proper texture filtering.
+- Fixes lua dofile on Windows.
+- Fixes in colored shader when using spot ligts.
+- Fixes issue in encoder which was converting point lights into ambient lights when they had no decay.
+- Fixes to CMake projects on different platforms.
+- Cleans up Platform by moving commong platform code to Platform.cpp
+- Cleans up and changes Gamepad APIs.
+- Cleans repo directory restructure dropping gameplay- prefix on many folders and files.
+- Removes bin and external-deps folder/contents to external server with new install scripts that are now required to be run after cloning the repo.
+- Removes pre-compiled api/html docs to reduce repository bloat.
+- Removes support for COLLADA DAE and now support FBX.
+- Removes middle mouse button simulated desktop accelerometer.
+
+## v1.6.0
+
+- Adds file Stream interface for reading/writing files instead of using fread/fwrite. 
+- Adds Terrain class to support for heightmap based terrains featuring LOD, multiple surface layers, loading from PNG, RAW8/16, full transform, physics, patch culling and verticle skirt for cracks.
+- Adds object-space normal map generation to gameplay-encoder for terrain normal map generation.
+- Adds scene support for loading .terrain files in .scene files.
+- Adds scene support for inline cameras to .scene files.
+- Adds suppoft for defining .scene files without 'path' to gpb. New node can not be create in .scene file.
+- Adds static Scene::getScene(const char*) to query currently active scenes in a game, helpful for script access.
+- Adds support for multiple translate, rotate and scale commands in a single node entity within .scene files, processed in-order they are defined.
+- Adds scene support for material auto binding scene ambient color, light color and light direction.
+- Adds support for setting the depth compare function on materials.
+- Adds support for texture/sampler arrays being passed to materials.
+- Adds support for loading uncompressed DDS textures for the following formats: R8G8B8, A8R8G8B8, A8B8G8R8, X8R8G8B8, X8B8G8R8
+- Adds improvments to prefer higher quality mipmap generation.
+- Adds improved Gamepad API support for button enumeration, triggers and some mobile Gamepad support on BlackBerry.
+- Adds additional gameplay-tests for billboards, forms, gamepads and lights.
+- Adds support for launching the browser via launchURL(const char*).
+- Adds physics support for setLinearFactor and setAngularFactor  on rigid bodies.
+- Adds methods to PhysicsCollisionObject to allow conversion to subclass types (i.e. PhysicsRigidBody, PhysicsCharacter, etc) from script.
+- Adds option for fullscreen without width/height config to use native desktop resolution.
+- Adds Linux support for OpenAL PulseAudio back-end.
+- Adds support for latest Bullet Physics 2.81 with NEON optimizations for mobile targets.
+- Adds support for preprocessor directive NO_LUA_BINDINGS in the gameplay project to omit inclusion of generated lua bindings in compilation for developer mode value. 
+- Adds optimizations to Lua generator to only write generated files if they differ from existing files, reducing both build times and committing of unchanged script binding files.
+- Adds changes to Slider for setValueTextVisible, setValueTextAlignment, setValueTextPrecision and getters.
+- Adds Microsoft Windows 7 64-bit support.
+- Adds Apple iOS 6 support.
+- Fixes to external-deps to reduce the size of the libraries on Windows.
+- Fixes for Android to no longer need to copy files to the SD card before reading them. None of the Android samples require an SD card.
+- Fixes for animation of opacity on UI and fonts.
+- Fixes in UI for removing controls and also setVisible(bool).
+- Fixes for UI controls missing on MacOSX.
+- Fixes for setting UI alignment programmatically.
+- Fixes for lighting shaders.
+- Fixes to the texture minification mode from GL_LINEAR_MIPMAP_LINEAR to GL_NEAREST_MIPMAP_LINEAR for newly created textures with mipmaps.
+- Fixes minor memory leaks and possible access violations when calling Game::exit() from script.
+- Fixes physics debug drawing for large scenes causing the internal MeshBatch to grow to an enormous size.
+
+## v1.5.0
+
+- Linux support. (tested on Ubuntu 12)
+- CMake support for makefile generation for Linux.
+- Gamepad API support for desktops.
+- Touch gesture support for tap, swipe and pinch.
+- Vehicle physics support via new PhysicsVehicle and PhysicsVehicleWheel classes.
+- Adds new racer sample (sample06-racer).
+- Adds gameplay-tests project as a test app for various basic engine features with some initial tests.
+- Adds support for Scene files for wildcard identifiers.
+- Adds Visual Studio Plug-in support for BlackBerry PlayBook and BlackBerry 10.
+- Adds configurable multi-sampling anti-aliasing support. 
+- Adds updates to latest FBX SDK 2013.3.
+- Adds file formats documentation for game.config .scene, .material, .animation, .physics, .particle
+- Adds Game/Platform::canExit for testing device capabilities to quit. (only ios)
+- Web community forums at http://www.gameplay3d.org/forums.
+- Changed keyTimes from unsigned long[]  to unsigned int[]. (breaks compat. in AnimationTarget and Animation::Channel)
+- Fixes inconsistencies from Bundle::getObjectID() to Bundle::getObjectId() (breaks compat. in Bundle)
+- Fixes the texture coordinates of Mesh::createQuad(float x, float y, float width, float height).
+- Fixes line-wise distortion when loading RGB png's into textures that are non-power of two.
+- Fixes inconsistencies in createXXXX methods.  (breaks compat. in Scene)
+- Fixes Rectangle::contains.
+- Fixes Lua print logging.
+- Fixes Lua errors to be treated as runtime warnings.
+- Fixes setVertexData to pointers instead of constant data.
+- Fixes AudioSource so that it doesn't loop by default.
+- Fixes minor UI scrolling issues.
+
+## v1.4.0
+
+- Lua script bindings for all gameplay interfaces.
+- Lua script binding generator tool (gameplay-luagen) for generating gameplay Lua bindings from doxygen xml output.
+- AIController, AIAgent, AIStateMachine, AIState and AIMessage classes for scripted AI support.
+- Sample for sample05-lua to demonstrate basic Lua with AI scripting.
+- Gamepad class with virtual gamepad support.
+- Pre-built versions gameplay-encoder added to bin folder with TTF, DAE and FBX support built-in.
+- Improved modular shaders with support for #include in shaders. (breaks compat. for shaders)
+- LightMap support into colored-unlit.frag and textured-unlit.frag shaders.
+- Adds cloning and wireframing features to sample03-character.
+- Adds kick the ball on the sample03-character to demonstrate 2 buttons and more physics.
+- Fixes missing mouse events on UI controls.
+- Fixes to gameplay-encoder to prompt user for font size if not specified.
+- Fixes to add "-g" as short form argument for grouping animations.
+- Fixes node cloning.
+- Fixes to gameplay-encoder for output file path when encoding fonts.
+- Fixes to FrameBuffer, RenderTarget and DepthStencilTarget.
+- Fixes user switching in MacOSX to other applications with Apple-Tab.
+- Fixes measureText with empty string to be proper size.
+- Fixes for aliased text by applying linear filtering by default on Fonts.
+- Fixes RenderState::StateBlock::bindNoRestore() issue where blend function was not restored to the proper defaults.
+- Fixes some inconsistencies in Game event method names for menuEvent. (breaks compat. in Game)
+- Fixes some inconsistencies with AnimationClip::getID() to be same as Node::getId() and other classes. (breaks compat. in AnimationClip)
+- Fixes to gameplay-encoder and PhysicsRigidBody for heightmaps which adds height precision into generated heightmap png's.
+
+## v1.3.0
+
+- Portrait mode games on mobile platforms.
+- Fullscreen and configurable game resolutions on desktop platforms.
+- User Interface support for scrolling with scrollbars on Container.
+- PVRTC, ATC and DXT texture compression support.
+- Performance improvements in user interface forms and text.
+- Performance improvements in animations on transforms.
+- Performance improvements using NEON math for BlackBerry and iOS.
+- Fixes for improvements in error handling throughout all systems.
+- Fixes supporting built-in Maya COLLADA exporter via DAE_FBX export.
+- Fixes for latest FBX SDK 2013 support.
+- Fixes for loading from some WAV files that were crashing.
+- Fixes for From/By animations.
+- Fixes allowing all inline properties loaded within .scene files. (breaks compat. for .scene)
+- Fixes in .scene files for collisionObject definitions (breaks compat. for .scene)
+- Fixes for depth/z-ordering of controls.
+
+## v1.2.0
+
+- BlackBerry 10 support.
+- iOS 5.1 support.
+- Android 2.3+ support.
+- User interface system with declarative forms and themes.
+- Bluetooth keyboard/mouse support on BlackBerry platform.
+- Developer guide.
+- Sample/tutorial for sample03-character.
+- Sample for sample04-particles to demonstrate particle emitters.
+- Fixes for loading properties from URL.
+- Fixes on Win32/MacOSX for when mouse pointer leaves the window and returns.
+- Fixes to accelerometer for Android.
+- Fixes in animation blending.
+- Fixes to GPB for loading from single node and parent node. (breaks compat. for .gpb)
+
+## v1.1.0
+
+- FBX support in gameplay-encoder.
+- MacOSX platform support using XCode.
+- Off-screen rendering functionality using FrameBuffer.
+- Loading 3D scenes using declarative  .scene files.
+- Loading audio from .ogg files using vorbis.
+- Loading AudioSources from .audio files.
+- Loading Animations from .animation files.
+- AnimationClip support for cross fading.
+- Physics support using Bullet Physics.
+- Cross-platform new project generator.
+- Overloaded operators in Math classes.
+- Font improvements for justify, clip, wrap and scaling.
+- Fixes for Font::drawText to use point size and not float scalar.
+- Fixes for memory leaks in and fixes to AnimationTarget.
+- Fixes for bumped and parallax shaders.
+- Fixes to simplify folders for resources in samples.
+- Fixes to the material/shader system.
+- Fixes to the ParticleEmitter.
+
+## v1.0.0
+
+- Initial release.
+
+
+
+

+ 0 - 1
CMakeLists.txt

@@ -27,5 +27,4 @@ add_subdirectory(samples)
 # gameplay encoder
 # A pre-compiled executable can be found in 'gameplay/bin'
 # Uncomment out this line if you want to build the encoder instead of using the pre-compiled gameplay-encoder.
-
 #add_subdirectory(tools/encoder)

+ 153 - 205
gameplay.sln

@@ -1,205 +1,153 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-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}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
-	EndProjectSection
-EndProject
-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}") = "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}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-character", "samples\character\sample-character.vcxproj", "{87388E8B-F3CF-428F-BC2C-C1886248C111}"
-	ProjectSection(ProjectDependencies) = postProject
-		{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}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|BlackBerry = Debug|BlackBerry
-		Debug|BlackBerrySimulator = Debug|BlackBerrySimulator
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		DebugMem|BlackBerry = DebugMem|BlackBerry
-		DebugMem|BlackBerrySimulator = DebugMem|BlackBerrySimulator
-		DebugMem|Win32 = DebugMem|Win32
-		DebugMem|x64 = DebugMem|x64
-		Release|BlackBerry = Release|BlackBerry
-		Release|BlackBerrySimulator = Release|BlackBerrySimulator
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Debug|BlackBerry.ActiveCfg = Debug|Win32
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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|BlackBerry.ActiveCfg = Debug|Win32
-		{0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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
-		{D672DC66-3CE0-4878-B0D2-813CA731012F}.Debug|BlackBerry.ActiveCfg = Debug|Win32
-		{D672DC66-3CE0-4878-B0D2-813CA731012F}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{D672DC66-3CE0-4878-B0D2-813CA731012F}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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
-		{04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Debug|BlackBerry.ActiveCfg = Debug|Win32
-		{04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{04EAF3E5-0F9E-AF4D-53F9-269CE114211F}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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|BlackBerry.ActiveCfg = Debug|Win32
-		{CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{CC37B8E9-6402-4841-8D6A-5D908A5909B3}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{CC37B8E9-6402-4841-8D6A-5D908A5909B3}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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|BlackBerry.ActiveCfg = Debug|Win32
-		{87388E8B-F3CF-428F-BC2C-C1886248C111}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{87388E8B-F3CF-428F-BC2C-C1886248C111}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{87388E8B-F3CF-428F-BC2C-C1886248C111}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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|BlackBerry.ActiveCfg = Debug|Win32
-		{CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{CB5ABFAA-EA69-E439-5A4D-3B9359916C71}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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|BlackBerry.ActiveCfg = Debug|Win32
-		{82522888-E09A-ED48-AD7D-247237B37B3A}.Debug|BlackBerrySimulator.ActiveCfg = Debug|Win32
-		{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|BlackBerry.ActiveCfg = DebugMem|Win32
-		{82522888-E09A-ED48-AD7D-247237B37B3A}.DebugMem|BlackBerrySimulator.ActiveCfg = DebugMem|Win32
-		{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|BlackBerry.ActiveCfg = Release|Win32
-		{82522888-E09A-ED48-AD7D-247237B37B3A}.Release|BlackBerrySimulator.ActiveCfg = Release|Win32
-		{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
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+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}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
+	EndProjectSection
+EndProject
+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}") = "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}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-character", "samples\character\sample-character.vcxproj", "{87388E8B-F3CF-428F-BC2C-C1886248C111}"
+	ProjectSection(ProjectDependencies) = postProject
+		{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}
+	EndProjectSection
+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
+		{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
+		{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
+		{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
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 20 - 3
gameplay/CMakeLists.txt

@@ -48,6 +48,8 @@ set(GAMEPLAY_SRC
     src/Container.h
     src/Control.cpp
     src/Control.h
+	src/ControlFactory.h
+	src/ControlFactory.cpp
     src/Curve.cpp
     src/Curve.h
     src/DebugNew.cpp
@@ -185,6 +187,10 @@ set(GAMEPLAY_SRC
     src/Scene.h
     src/SceneLoader.cpp
     src/SceneLoader.h
+    src/SceneRenderer.cpp
+    src/SceneRenderer.h
+    src/SceneRendererForward.cpp
+    src/SceneRendererForward.h
     src/ScreenDisplayer.cpp
     src/ScreenDisplayer.h
     src/ScriptController.cpp
@@ -202,6 +208,9 @@ set(GAMEPLAY_SRC
     src/SocialController.h
     src/SocialPlayer.cpp
     src/SocialPlayer.h
+    src/SocialScore.cpp
+    src/SocialScore.h
+    src/SocialSession.h
     src/SocialSessionListener.cpp
     src/SocialSessionListener.h
     src/SpriteBatch.cpp
@@ -237,9 +246,9 @@ set(GAMEPLAY_SRC
     src/VertexFormat.h
     src/VerticalLayout.cpp
     src/VerticalLayout.h
-
-	src/ControlFactory.h
-	src/ControlFactory.cpp
+    src/VisibleSet.h
+    src/VisibleSetDefault.cpp
+    src/VisibleSetDefault.h
 )
 
 set(GAMEPLAY_LUA
@@ -526,6 +535,10 @@ set(GAMEPLAY_LUA
     src/lua/lua_Scene.h
     src/lua/lua_SceneDebugFlags.cpp
     src/lua/lua_SceneDebugFlags.h
+    src/lua/lua_SceneRenderer.cpp
+    src/lua/lua_SceneRenderer.h
+    src/lua/lua_SceneRendererForward.cpp
+    src/lua/lua_SceneRendererForward.h
     src/lua/lua_ScreenDisplayer.cpp
     src/lua/lua_ScreenDisplayer.h
     src/lua/lua_ScriptController.cpp
@@ -594,6 +607,10 @@ set(GAMEPLAY_LUA
     src/lua/lua_VertexFormatUsage.h
     src/lua/lua_VerticalLayout.cpp
     src/lua/lua_VerticalLayout.h
+    src/lua/lua_VisibleSet.cpp
+    src/lua/lua_VisibleSet.h
+    src/lua/lua_VisibleSetDefault.cpp
+    src/lua/lua_VisibleSetDefault.h
 )
 
 set(GAMEPLAY_RES

+ 40 - 42
gameplay/android/java/src/org/gameplay3d/lib/BaseGameActivity.java → gameplay/android/java/src/org/gameplay3d/GamePlayActivity.java

@@ -14,12 +14,11 @@
  * limitations under the License.
  */
 
-package org.gameplay3d.sample_spaceship.basegameutils;
+package org.gameplay3d;
 
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v4.app.FragmentActivity;
-
 import com.google.android.gms.appstate.AppStateClient;
 import com.google.android.gms.common.ConnectionResult;
 import com.google.android.gms.games.GamesClient;
@@ -32,28 +31,27 @@ import com.google.android.gms.plus.PlusClient;
  * methods. To initiate the sign-in flow when the user clicks the sign-in
  * button, subclasses should call @link{#beginUserInitiatedSignIn}. By default,
  * this class only instantiates the GamesClient object. If the PlusClient or
- * AppStateClient objects are also wanted, call the BaseGameActivity(int)
+ * AppStateClient objects are also wanted, call the BaseGooglePlayActivity(int)
  * constructor and specify the requested clients. For example, to request
- * PlusClient and GamesClient, use BaseGameActivity(CLIENT_GAMES | CLIENT_PLUS).
- * To request all available clients, use BaseGameActivity(CLIENT_ALL).
+ * PlusClient and GamesClient, use BaseGooglePlayActivity(CLIENT_GAMES | CLIENT_PLUS).
+ * To request all available clients, use BaseGooglePlayActivity(CLIENT_ALL).
  * Alternatively, you can also specify the requested clients via
  * @link{#setRequestedClients}, but you must do so before @link{#onCreate}
  * gets called, otherwise the call will have no effect.
  *
  * @author Bruno Oliveira (Google)
  */
-public abstract class BaseGameActivity extends FragmentActivity implements
-        GameHelper.GameHelperListener {
+public abstract class GooglePlayActivity extends FragmentActivity implements GooglePlayClientHelper.GamePlayClientHelperListener {
 
     // The game helper object. This class is mainly a wrapper around this object.
-    protected GameHelper mHelper;
+    protected GamePlayClientHelper mClient;
 
     // We expose these constants here because we don't want users of this class
-    // to have to know about GameHelper at all.
-    public static final int CLIENT_GAMES = GameHelper.CLIENT_GAMES;
-    public static final int CLIENT_APPSTATE = GameHelper.CLIENT_APPSTATE;
-    public static final int CLIENT_PLUS = GameHelper.CLIENT_PLUS;
-    public static final int CLIENT_ALL = GameHelper.CLIENT_ALL;
+    // to have to know about GamePlayClientHelper at all.
+    public static final int CLIENT_GAMES = GamePlayClientHelper.CLIENT_GAMES;
+    public static final int CLIENT_APPSTATE = GamePlayClientHelper.CLIENT_APPSTATE;
+    public static final int CLIENT_PLUS = GamePlayClientHelper.CLIENT_PLUS;
+    public static final int CLIENT_ALL = GamePlayClientHelper.CLIENT_ALL;
 
     // Requested clients. By default, that's just the games client.
     protected int mRequestedClients = CLIENT_GAMES;
@@ -61,21 +59,21 @@ public abstract class BaseGameActivity extends FragmentActivity implements
     // stores any additional scopes.
     private String[] mAdditionalScopes;
 
-    protected String mDebugTag = "BaseGameActivity";
+    protected String mDebugTag = "GooglePlayActivity";
     protected boolean mDebugLog = false;
 
-    /** Constructs a BaseGameActivity with default client (GamesClient). */
-    protected BaseGameActivity() {
+    /** Constructs a BaseGooglePlayActivity with default client (GamesClient). */
+    protected GooglePlayActivity() {
         super();
-        mHelper = new GameHelper(this);
+        mClient = new GamePlayClientHelper(this);
     }
 
     /**
-     * Constructs a BaseGameActivity with the requested clients.
+     * Constructs a GooglePlayActivity with the requested clients.
      * @param requestedClients The requested clients (a combination of CLIENT_GAMES,
      *         CLIENT_PLUS and CLIENT_APPSTATE).
      */
-    protected BaseGameActivity(int requestedClients) {
+    protected GooglePlayActivity(int requestedClients) {
         super();
         setRequestedClients(requestedClients);
     }
@@ -99,92 +97,92 @@ public abstract class BaseGameActivity extends FragmentActivity implements
     @Override
     protected void onCreate(Bundle b) {
         super.onCreate(b);
-        mHelper = new GameHelper(this);
+        mClient = new GamePlayClientHelper(this);
         if (mDebugLog) {
-            mHelper.enableDebugLog(mDebugLog, mDebugTag);
+            mClient.enableDebugLog(mDebugLog, mDebugTag);
         }
-        mHelper.setup(this, mRequestedClients, mAdditionalScopes);
+        mClient.setup(this, mRequestedClients, mAdditionalScopes);
     }
 
     @Override
     protected void onStart() {
         super.onStart();
-        mHelper.onStart(this);
+        mClient.onStart(this);
     }
 
     @Override
     protected void onStop() {
         super.onStop();
-        mHelper.onStop();
+        mClient.onStop();
     }
 
     @Override
     protected void onActivityResult(int request, int response, Intent data) {
         super.onActivityResult(request, response, data);
-        mHelper.onActivityResult(request, response, data);
+        mClient.onActivityResult(request, response, data);
     }
 
     protected GamesClient getGamesClient() {
-        return mHelper.getGamesClient();
+        return mClient.getGamesClient();
     }
 
     protected AppStateClient getAppStateClient() {
-        return mHelper.getAppStateClient();
+        return mClient.getAppStateClient();
     }
 
     protected PlusClient getPlusClient() {
-        return mHelper.getPlusClient();
+        return mClient.getPlusClient();
     }
 
     protected boolean isSignedIn() {
-        return mHelper.isSignedIn();
+        return mClient.isSignedIn();
     }
 
     protected void beginUserInitiatedSignIn() {
-        mHelper.beginUserInitiatedSignIn();
+        mClient.beginUserInitiatedSignIn();
     }
 
     protected void signOut() {
-        mHelper.signOut();
+        mClient.signOut();
     }
 
     protected void showAlert(String title, String message) {
-        mHelper.showAlert(title, message);
+        mClient.showAlert(title, message);
     }
 
     protected void showAlert(String message) {
-        mHelper.showAlert(message);
+        mClient.showAlert(message);
     }
 
     protected void enableDebugLog(boolean enabled, String tag) {
         mDebugLog = true;
         mDebugTag = tag;
-        if (mHelper != null) {
-            mHelper.enableDebugLog(enabled, tag);
+        if (mClient != null) {
+            mClient.enableDebugLog(enabled, tag);
         }
     }
 
     protected String getInvitationId() {
-        return mHelper.getInvitationId();
+        return mClient.getInvitationId();
     }
 
     protected void reconnectClients(int whichClients) {
-        mHelper.reconnectClients(whichClients);
+        mClient.reconnectClients(whichClients);
     }
 
     protected String getScopes() {
-        return mHelper.getScopes();
+        return mClient.getScopes();
     }
 
     protected String[] getScopesArray() {
-        return mHelper.getScopesArray();
+        return mClient.getScopesArray();
     }
 
     protected boolean hasSignInError() {
-        return mHelper.hasSignInError();
+        return mClient.hasSignInError();
     }
 
-    protected GameHelper.SignInFailureReason getSignInError() {
-        return mHelper.getSignInError();
+    protected GamePlayClientHelper.SignInFailureReason getSignInError() {
+        return mClient.getSignInError();
     }
 }

+ 39 - 53
gameplay/android/java/src/org/gameplay3d/lib/GameHelper.java → gameplay/android/java/src/org/gameplay3d/GooglePlayClientHelper.java

@@ -1,20 +1,5 @@
-/*
- * Copyright (C) 2013 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gameplay3d.sample_spaceship.basegameutils;
+
+package org.gameplay3d;
 
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -43,11 +28,12 @@ import com.google.android.gms.games.GamesClient;
 import com.google.android.gms.games.multiplayer.Invitation;
 import com.google.android.gms.plus.PlusClient;
 
-public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
+public class GooglePlayClientHelper implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener 
+{
 
     /** Listener for sign-in success or failure events. */
-    public interface GameHelperListener {
+    public interface GooglePlayClientHelperListener 
+    {
         /**
          * Called when sign-in fails. As a result, a "Sign-In" button can be
          * shown to the user; when that button is clicked, call
@@ -71,13 +57,13 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     public static final int STATE_CONNECTED = 3;
 
     // State names (for debug logging, etc)
-    public static final String[] STATE_NAMES = {
+    public static final String[] STATE_NAMES = 
+    {
             "UNCONFIGURED", "DISCONNECTED", "CONNECTING", "CONNECTED"
     };
 
     // State we are in right now
     int mState = STATE_UNCONFIGURED;
-
     // Are we expecting the result of a resolution flow?
     boolean mExpectingResolution = false;
 
@@ -138,7 +124,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     // Print debug logs?
     boolean mDebugLog = false;
-    String mDebugTag = "GameHelper";
+    String mDebugTag = "GooglePlayClientHelper";
 
     /*
      * If we got an invitation id when we connected to the games client, it's
@@ -147,19 +133,19 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     String mInvitationId;
 
     // Listener
-    GameHelperListener mListener = null;
+    GooglePlayClientHelperListener mListener = null;
 
     /**
-     * Construct a GameHelper object, initially tied to the given Activity.
+     * Construct a GooglePlayClientHelper object, initially tied to the given Activity.
      * After constructing this object, call @link{setup} from the onCreate()
      * method of your Activity.
      */
-    public GameHelper(Activity activity) {
+    public GooglePlayClientHelper(Activity activity) {
         mActivity = activity;
     }
 
     static private final int TYPE_DEVELOPER_ERROR = 1001;
-    static private final int TYPE_GAMEHELPER_BUG = 1002;
+    static private final int TYPE_GooglePlayClientHelper_BUG = 1002;
     boolean checkState(int type, String operation, String warning, int... expectedStates) {
         for (int expectedState : expectedStates) {
             if (mState == expectedState) {
@@ -168,9 +154,9 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
         }
         StringBuilder sb = new StringBuilder();
         if (type == TYPE_DEVELOPER_ERROR) {
-            sb.append("GameHelper: you attempted an operation at an invalid. ");
+            sb.append("GooglePlayClientHelper: you attempted an operation at an invalid. ");
         } else {
-            sb.append("GameHelper: bug detected. Please report it at our bug tracker ");
+            sb.append("GooglePlayClientHelper: bug detected. Please report it at our bug tracker ");
             sb.append("https://github.com/playgameservices/android-samples/issues. ");
             sb.append("Please include the last couple hundred lines of logcat output ");
             sb.append("and describe the operation that caused this. ");
@@ -194,7 +180,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     void assertConfigured(String operation) {
         if (mState == STATE_UNCONFIGURED) {
-            String error = "GameHelper error: Operation attempted without setup: " + operation +
+            String error = "GooglePlayClientHelper error: Operation attempted without setup: " + operation +
                     ". The setup() method must be called before attempting any other operation.";
             logError(error);
             throw new IllegalStateException(error);
@@ -202,15 +188,15 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     /**
-     * Same as calling @link{setup(GameHelperListener, int)} requesting only the
+     * Same as calling @link{setup(GooglePlayClientHelperListener, int)} requesting only the
      * CLIENT_GAMES client.
      */
-    public void setup(GameHelperListener listener) {
+    public void setup(GooglePlayClientHelperListener listener) {
         setup(listener, CLIENT_GAMES);
     }
 
     /**
-     * Performs setup on this GameHelper object. Call this from the onCreate()
+     * Performs setup on this GooglePlayClientHelper object. Call this from the onCreate()
      * method of your Activity. This will create the clients and do a few other
      * initialization tasks. Next, call @link{#onStart} from the onStart()
      * method of your Activity.
@@ -224,9 +210,9 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
      *            I.E. for YouTube uploads one would add
      *            "https://www.googleapis.com/auth/youtube.upload"
      */
-    public void setup(GameHelperListener listener, int clientsToUse, String ... additionalScopes) {
+    public void setup(GooglePlayClientHelperListener listener, int clientsToUse, String ... additionalScopes) {
         if (mState != STATE_UNCONFIGURED) {
-            String error = "GameHelper: you called GameHelper.setup() twice. You can only call " +
+            String error = "GooglePlayClientHelper: you called GooglePlayClientHelper.setup() twice. You can only call " +
                     "it once.";
             logError(error);
             throw new IllegalStateException(error);
@@ -416,9 +402,9 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     /**
      * Returns the invitation ID received through an invitation notification.
-     * This should be called from your GameHelperListener's
+     * This should be called from your GooglePlayClientHelperListener's
      *
-     * @link{GameHelperListener#onSignInSucceeded} method, to check if there's an
+     * @link{GooglePlayClientHelperListener#onSignInSucceeded} method, to check if there's an
      * invitation available. In that case, accept the invitation.
      * @return The id of the invitation, or null if none was received.
      */
@@ -493,7 +479,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     void killConnections() {
-        if (!checkState(TYPE_GAMEHELPER_BUG, "killConnections", "killConnections() should only " +
+        if (!checkState(TYPE_GooglePlayClientHelper_BUG, "killConnections", "killConnections() should only " +
                 "get called while connected or connecting.", STATE_CONNECTED, STATE_CONNECTING)) {
             return;
         }
@@ -604,7 +590,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     /**
      * Starts a user-initiated sign-in flow. This should be called when the user
      * clicks on a "Sign In" button. As a result, authentication/consent dialogs
-     * may show up. At the end of the process, the GameHelperListener's
+     * may show up. At the end of the process, the GooglePlayClientHelperListener's
      * onSignInSucceeded() or onSignInFailed() methods will be called.
      */
     public void beginUserInitiatedSignIn() {
@@ -672,7 +658,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     void startConnections() {
-        if (!checkState(TYPE_GAMEHELPER_BUG, "startConnections", "startConnections should " +
+        if (!checkState(TYPE_GooglePlayClientHelper_BUG, "startConnections", "startConnections should " +
                 "only get called when disconnected.", STATE_DISCONNECTED)) {
             return;
         }
@@ -735,10 +721,10 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     void connectCurrentClient() {
         if (mState == STATE_DISCONNECTED) {
             // we got disconnected during the connection process, so abort
-            logWarn("GameHelper got disconnected during connection process. Aborting.");
+            logWarn("GooglePlayClientHelper got disconnected during connection process. Aborting.");
             return;
         }
-        if (!checkState(TYPE_GAMEHELPER_BUG, "connectCurrentClient", "connectCurrentClient " +
+        if (!checkState(TYPE_GooglePlayClientHelper_BUG, "connectCurrentClient", "connectCurrentClient " +
                 "should only get called when connecting.", STATE_CONNECTING)) {
             return;
         }
@@ -782,7 +768,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
         if ((whatClients & CLIENT_PLUS) != 0 && mPlusClient != null
                 && mPlusClient.isConnected()) {
             // PlusClient doesn't need reconnections.
-            logWarn("GameHelper is ignoring your request to reconnect " +
+            logWarn("GooglePlayClientHelper is ignoring your request to reconnect " +
                     "PlusClient because this is unnecessary.");
         }
 
@@ -823,7 +809,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     void succeedSignIn() {
-        checkState(TYPE_GAMEHELPER_BUG, "succeedSignIn", "succeedSignIn should only " +
+        checkState(TYPE_GooglePlayClientHelper_BUG, "succeedSignIn", "succeedSignIn should only " +
                 "get called in the connecting or connected state. Proceeding anyway.",
                 STATE_CONNECTING, STATE_CONNECTED);
         debugLog("All requested clients connected. Sign-in succeeded!");
@@ -875,7 +861,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
      */
     void resolveConnectionResult() {
         // Try to resolve the problem
-        checkState(TYPE_GAMEHELPER_BUG, "resolveConnectionResult",
+        checkState(TYPE_GooglePlayClientHelper_BUG, "resolveConnectionResult",
                 "resolveConnectionResult should only be called when connecting. Proceeding anyway.",
                 STATE_CONNECTING);
 
@@ -914,7 +900,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
      * new version, etc).
      */
     void giveUp(SignInFailureReason reason) {
-        checkState(TYPE_GAMEHELPER_BUG, "giveUp", "giveUp should only be called when " +
+        checkState(TYPE_GooglePlayClientHelper_BUG, "giveUp", "giveUp should only be called when " +
                 "connecting. Proceeding anyway.", STATE_CONNECTING);
         mAutoSignIn = false;
         killConnections();
@@ -960,16 +946,16 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
         switch (actResp) {
             case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
                 errorDialog = makeSimpleDialog(ctx.getString(
-                        R.string.gamehelper_app_misconfigured));
+                        R.string.GooglePlayClientHelper_app_misconfigured));
                 printMisconfiguredDebugInfo();
                 break;
             case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
                 errorDialog = makeSimpleDialog(ctx.getString(
-                        R.string.gamehelper_sign_in_failed));
+                        R.string.GooglePlayClientHelper_sign_in_failed));
                 break;
             case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
                 errorDialog = makeSimpleDialog(ctx.getString(
-                        R.string.gamehelper_license_failed));
+                        R.string.GooglePlayClientHelper_license_failed));
                 break;
             default:
                 // No meaningful Activity response code, so generate default Google
@@ -979,7 +965,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
                 if (errorDialog == null) {
                     // get fallback dialog
                     debugLog("No standard error dialog available. Making fallback dialog.");
-                    errorDialog = makeSimpleDialog(ctx.getString(R.string.gamehelper_unknown_error)
+                    errorDialog = makeSimpleDialog(ctx.getString(R.string.GooglePlayClientHelper_unknown_error)
                             + " " + errorCodeToString(errorCode));
                 }
         }
@@ -995,16 +981,16 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     void debugLog(String message) {
         if (mDebugLog) {
-            Log.d(mDebugTag, "GameHelper: " + message);
+            Log.d(mDebugTag, "GooglePlayClientHelper: " + message);
         }
     }
 
     void logWarn(String message) {
-        Log.w(mDebugTag, "!!! GameHelper WARNING: " + message);
+        Log.w(mDebugTag, "!!! GooglePlayClientHelper WARNING: " + message);
     }
 
     void logError(String message) {
-        Log.e(mDebugTag, "*** GameHelper ERROR: " + message);
+        Log.e(mDebugTag, "*** GooglePlayClientHelper ERROR: " + message);
     }
 
     static String errorCodeToString(int errorCode) {

+ 3 - 4
gameplay/android/java/src/org/gameplay3d/lib/GoogleGamesSocial.java → gameplay/android/java/src/org/gameplay3d/GooglePlaySocial.java

@@ -1,17 +1,16 @@
     
-package org.gameplay3d.lib;
+package org.gameplay3d;
 
 import android.content.Context;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.util.Log;
 import android.widget.Toast;
-
 import com.google.android.gms.games.Player;
 import com.google.example.games.basegameutils.BaseGameActivity;
 
-public class GoogleGamesSocial extends BaseGameActivity {
-	
+public class GooglePlaySocial extends BaseGameActivity 
+{	
 	private static List<Player> mFriends = new ArrayList<Player>();
     private static final int FRIENDS_PER_PAGE = 10;
 	

+ 0 - 12
gameplay/android/java/src/org/gameplay3d/lib/TestClass.java

@@ -1,12 +0,0 @@
-
-package org.gameplay3d.lib;
-
-public class TestClass
-{
-   public TestClass() { }
- 
-   public int ComputeMult(float a, float b)
-   {
-      return (int)(a * b);
-   }
-}

+ 12 - 2
gameplay/android/jni/Android.mk

@@ -87,6 +87,8 @@ LOCAL_SRC_FILES := \
     RenderTarget.cpp \
     Scene.cpp \
     SceneLoader.cpp \
+    SceneRenderer.cpp \
+    SceneRendererForward.cpp \
     ScreenDisplayer.cpp \
     ScriptController.cpp \
     ScriptTarget.cpp \
@@ -112,7 +114,7 @@ LOCAL_SRC_FILES := \
     VertexAttributeBinding.cpp \
     VertexFormat.cpp \
     VerticalLayout.cpp \
-	social/GoogleGamesSocialSession.cpp \
+    VisibleSetDefault.cpp \
     lua/lua_AbsoluteLayout.cpp \
     lua/lua_AIAgent.cpp \
     lua/lua_AIAgentListener.cpp \
@@ -146,6 +148,7 @@ LOCAL_SRC_FILES := \
     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 \
@@ -157,6 +160,7 @@ LOCAL_SRC_FILES := \
     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 \
@@ -246,12 +250,15 @@ LOCAL_SRC_FILES := \
     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_SceneDebugFlags.cpp \
+    lua/lua_SceneRenderer.cpp \
+    lua/lua_SceneRendererForward.cpp \
     lua/lua_ScreenDisplayer.cpp \
     lua/lua_ScriptController.cpp \
     lua/lua_ScriptTarget.cpp \
@@ -285,7 +292,10 @@ LOCAL_SRC_FILES := \
     lua/lua_VertexFormat.cpp \
     lua/lua_VertexFormatElement.cpp \
     lua/lua_VertexFormatUsage.cpp \
-    lua/lua_VerticalLayout.cpp
+    lua/lua_VerticalLayout.cpp \
+    lua/lua_VisibleSet.cpp \
+    lua/lua_VisibleSetDefault.cpp \
+    social/GooglePlaySocialSession.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"

+ 914 - 1139
gameplay/gameplay.vcxproj

@@ -1,1140 +1,915 @@
-<?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|BlackBerry">
-      <Configuration>DebugMem</Configuration>
-      <Platform>BlackBerry</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMem|BlackBerrySimulator">
-      <Configuration>DebugMem</Configuration>
-      <Platform>BlackBerrySimulator</Platform>
-    </ProjectConfiguration>
-    <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|BlackBerry">
-      <Configuration>Debug</Configuration>
-      <Platform>BlackBerry</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|BlackBerrySimulator">
-      <Configuration>Debug</Configuration>
-      <Platform>BlackBerrySimulator</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|BlackBerry">
-      <Configuration>Release</Configuration>
-      <Platform>BlackBerry</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|BlackBerrySimulator">
-      <Configuration>Release</Configuration>
-      <Platform>BlackBerrySimulator</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\AbsoluteLayout.cpp" />
-    <ClCompile Include="src\AIAgent.cpp" />
-    <ClCompile Include="src\AIController.cpp" />
-    <ClCompile Include="src\AIMessage.cpp" />
-    <ClCompile Include="src\AIState.cpp" />
-    <ClCompile Include="src\AIStateMachine.cpp" />
-    <ClCompile Include="src\Animation.cpp" />
-    <ClCompile Include="src\AnimationClip.cpp" />
-    <ClCompile Include="src\AnimationController.cpp" />
-    <ClCompile Include="src\AnimationTarget.cpp" />
-    <ClCompile Include="src\AnimationValue.cpp" />
-    <ClCompile Include="src\AudioBuffer.cpp" />
-    <ClCompile Include="src\AudioController.cpp" />
-    <ClCompile Include="src\AudioListener.cpp" />
-    <ClCompile Include="src\AudioSource.cpp" />
-    <ClCompile Include="src\BoundingBox.cpp" />
-    <ClCompile Include="src\BoundingSphere.cpp" />
-    <ClCompile Include="src\Button.cpp" />
-    <ClCompile Include="src\Camera.cpp" />
-    <ClCompile Include="src\CheckBox.cpp" />
-    <ClCompile Include="src\Container.cpp" />
-    <ClCompile Include="src\Control.cpp" />
-    <ClCompile Include="src\Curve.cpp" />
-    <ClCompile Include="src\DebugNew.cpp" />
-    <ClCompile Include="src\DepthStencilTarget.cpp" />
-    <ClCompile Include="src\Effect.cpp" />
-    <ClCompile Include="src\FileSystem.cpp" />
-    <ClCompile Include="src\FlowLayout.cpp" />
-    <ClCompile Include="src\Font.cpp" />
-    <ClCompile Include="src\Form.cpp" />
-    <ClCompile Include="src\FrameBuffer.cpp" />
-    <ClCompile Include="src\Frustum.cpp" />
-    <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" />
-    <ClCompile Include="src\Image.cpp" />
-    <ClCompile Include="src\ImageControl.cpp" />
-    <ClCompile Include="src\Joint.cpp" />
-    <ClCompile Include="src\Joystick.cpp" />
-    <ClCompile Include="src\Label.cpp" />
-    <ClCompile Include="src\Layout.cpp" />
-    <ClCompile Include="src\Light.cpp" />
-    <ClCompile Include="src\Logger.cpp" />
-    <ClCompile Include="src\lua\lua_AbsoluteLayout.cpp" />
-    <ClCompile Include="src\lua\lua_AIAgent.cpp" />
-    <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" />
-    <ClCompile Include="src\lua\lua_all_bindings.cpp" />
-    <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" />
-    <ClCompile Include="src\lua\lua_AudioBuffer.cpp" />
-    <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_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_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_Joystick.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" />
-    <ClCompile Include="src\lua\lua_PhysicsHingeConstraint.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsRigidBody.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsRigidBodyParameters.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsSocketConstraint.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsSpringConstraint.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsVehicle.cpp" />
-    <ClCompile Include="src\lua\lua_PhysicsVehicleWheel.cpp" />
-    <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_SceneDebugFlags.cpp" />
-    <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp" />
-    <ClCompile Include="src\lua\lua_ScriptController.cpp" />
-    <ClCompile Include="src\lua\lua_ScriptTarget.cpp" />
-    <ClCompile Include="src\lua\lua_Slider.cpp" />
-    <ClCompile Include="src\lua\lua_SpriteBatch.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_TerrainListener.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_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" />
-    <ClCompile Include="src\lua\lua_Vector2.cpp" />
-    <ClCompile Include="src\lua\lua_Vector3.cpp" />
-    <ClCompile Include="src\lua\lua_Vector4.cpp" />
-    <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" />
-    <ClCompile Include="src\MeshBatch.cpp" />
-    <ClCompile Include="src\Pass.cpp" />
-    <ClCompile Include="src\MaterialParameter.cpp" />
-    <ClCompile Include="src\Matrix.cpp" />
-    <ClCompile Include="src\Mesh.cpp" />
-    <ClCompile Include="src\MeshPart.cpp" />
-    <ClCompile Include="src\MeshSkin.cpp" />
-    <ClCompile Include="src\Model.cpp" />
-    <ClCompile Include="src\Node.cpp" />
-    <ClCompile Include="src\Bundle.cpp" />
-    <ClCompile Include="src\ParticleEmitter.cpp" />
-    <ClCompile Include="src\PhysicsCharacter.cpp" />
-    <ClCompile Include="src\PhysicsCollisionObject.cpp" />
-    <ClCompile Include="src\PhysicsCollisionShape.cpp" />
-    <ClCompile Include="src\PhysicsConstraint.cpp" />
-    <ClCompile Include="src\PhysicsController.cpp" />
-    <ClCompile Include="src\PhysicsFixedConstraint.cpp" />
-    <ClCompile Include="src\PhysicsGenericConstraint.cpp" />
-    <ClCompile Include="src\PhysicsGhostObject.cpp" />
-    <ClCompile Include="src\PhysicsHingeConstraint.cpp" />
-    <ClCompile Include="src\PhysicsRigidBody.cpp" />
-    <ClCompile Include="src\PhysicsSocketConstraint.cpp" />
-    <ClCompile Include="src\PhysicsSpringConstraint.cpp" />
-    <ClCompile Include="src\PhysicsVehicle.cpp" />
-    <ClCompile Include="src\PhysicsVehicleWheel.cpp" />
-    <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" />
-    <ClCompile Include="src\Quaternion.cpp" />
-    <ClCompile Include="src\RadioButton.cpp" />
-    <ClCompile Include="src\Ray.cpp" />
-    <ClCompile Include="src\Rectangle.cpp" />
-    <ClCompile Include="src\Ref.cpp" />
-    <ClCompile Include="src\RenderState.cpp" />
-    <ClCompile Include="src\RenderTarget.cpp" />
-    <ClCompile Include="src\Scene.cpp" />
-    <ClCompile Include="src\SceneLoader.cpp" />
-    <ClCompile Include="src\ScreenDisplayer.cpp" />
-    <ClCompile Include="src\ScriptController.cpp" />
-    <ClCompile Include="src\ScriptTarget.cpp" />
-    <ClCompile Include="src\Slider.cpp" />
-    <ClCompile Include="src\SocialAchievement.cpp" />
-    <ClCompile Include="src\SocialChallenge.cpp" />
-    <ClCompile Include="src\SocialController.cpp" />
-    <ClCompile Include="src\SocialPlayer.cpp" />
-    <ClCompile Include="src\SocialScore.cpp" />
-    <ClCompile Include="src\SocialSessionListener.cpp" />
-    <ClCompile Include="src\social\GoogleGamesSocialSession.cpp" />
-    <ClCompile Include="src\social\ScoreloopSocialSession.cpp" />
-    <ClCompile Include="src\SpriteBatch.cpp" />
-    <ClCompile Include="src\Technique.cpp" />
-    <ClCompile Include="src\Terrain.cpp" />
-    <ClCompile Include="src\TerrainPatch.cpp" />
-    <ClCompile Include="src\TextBox.cpp" />
-    <ClCompile Include="src\Texture.cpp" />
-    <ClCompile Include="src\Theme.cpp" />
-    <ClCompile Include="src\ThemeStyle.cpp" />
-    <ClCompile Include="src\Transform.cpp" />
-    <ClCompile Include="src\Vector2.cpp" />
-    <ClCompile Include="src\Vector3.cpp" />
-    <ClCompile Include="src\Vector4.cpp" />
-    <ClCompile Include="src\VertexAttributeBinding.cpp" />
-    <ClCompile Include="src\VertexFormat.cpp" />
-    <ClCompile Include="src\VerticalLayout.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\AbsoluteLayout.h" />
-    <ClInclude Include="src\AIAgent.h" />
-    <ClInclude Include="src\AIController.h" />
-    <ClInclude Include="src\AIMessage.h" />
-    <ClInclude Include="src\AIState.h" />
-    <ClInclude Include="src\AIStateMachine.h" />
-    <ClInclude Include="src\Animation.h" />
-    <ClInclude Include="src\AnimationClip.h" />
-    <ClInclude Include="src\AnimationController.h" />
-    <ClInclude Include="src\AnimationTarget.h" />
-    <ClInclude Include="src\AnimationValue.h" />
-    <ClInclude Include="src\AudioBuffer.h" />
-    <ClInclude Include="src\AudioController.h" />
-    <ClInclude Include="src\AudioListener.h" />
-    <ClInclude Include="src\AudioSource.h" />
-    <ClInclude Include="src\Base.h" />
-    <ClInclude Include="src\BoundingBox.h" />
-    <ClInclude Include="src\BoundingSphere.h" />
-    <ClInclude Include="src\Button.h" />
-    <ClInclude Include="src\Camera.h" />
-    <ClInclude Include="src\CheckBox.h" />
-    <ClInclude Include="src\Container.h" />
-    <ClInclude Include="src\Control.h" />
-    <ClInclude Include="src\Curve.h" />
-    <ClInclude Include="src\DebugNew.h" />
-    <ClInclude Include="src\DepthStencilTarget.h" />
-    <ClInclude Include="src\Effect.h" />
-    <ClInclude Include="src\FileSystem.h" />
-    <ClInclude Include="src\FlowLayout.h" />
-    <ClInclude Include="src\Font.h" />
-    <ClInclude Include="src\Form.h" />
-    <ClInclude Include="src\FrameBuffer.h" />
-    <ClInclude Include="src\Frustum.h" />
-    <ClInclude Include="src\Game.h" />
-    <ClInclude Include="src\Gamepad.h" />
-    <ClInclude Include="src\gameplay.h" />
-    <ClInclude Include="src\Gesture.h" />
-    <ClInclude Include="src\HeightField.h" />
-    <ClInclude Include="src\Image.h" />
-    <ClInclude Include="src\ImageControl.h" />
-    <ClInclude Include="src\Joint.h" />
-    <ClInclude Include="src\Joystick.h" />
-    <ClInclude Include="src\Keyboard.h" />
-    <ClInclude Include="src\Label.h" />
-    <ClInclude Include="src\Layout.h" />
-    <ClInclude Include="src\Light.h" />
-    <ClInclude Include="src\Logger.h" />
-    <ClInclude Include="src\lua\lua_AbsoluteLayout.h" />
-    <ClInclude Include="src\lua\lua_AIAgent.h" />
-    <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" />
-    <ClInclude Include="src\lua\lua_all_bindings.h" />
-    <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" />
-    <ClInclude Include="src\lua\lua_AudioBuffer.h" />
-    <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_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_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_Joystick.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" />
-    <ClInclude Include="src\lua\lua_PhysicsHingeConstraint.h" />
-    <ClInclude Include="src\lua\lua_PhysicsRigidBody.h" />
-    <ClInclude Include="src\lua\lua_PhysicsRigidBodyParameters.h" />
-    <ClInclude Include="src\lua\lua_PhysicsSocketConstraint.h" />
-    <ClInclude Include="src\lua\lua_PhysicsSpringConstraint.h" />
-    <ClInclude Include="src\lua\lua_PhysicsVehicle.h" />
-    <ClInclude Include="src\lua\lua_PhysicsVehicleWheel.h" />
-    <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_SceneDebugFlags.h" />
-    <ClInclude Include="src\lua\lua_ScreenDisplayer.h" />
-    <ClInclude Include="src\lua\lua_ScriptController.h" />
-    <ClInclude Include="src\lua\lua_ScriptTarget.h" />
-    <ClInclude Include="src\lua\lua_Slider.h" />
-    <ClInclude Include="src\lua\lua_SpriteBatch.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_TerrainListener.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_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" />
-    <ClInclude Include="src\lua\lua_Vector2.h" />
-    <ClInclude Include="src\lua\lua_Vector3.h" />
-    <ClInclude Include="src\lua\lua_Vector4.h" />
-    <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" />
-    <ClInclude Include="src\MeshBatch.h" />
-    <ClInclude Include="src\Mouse.h" />
-    <ClInclude Include="src\Pass.h" />
-    <ClInclude Include="src\MaterialParameter.h" />
-    <ClInclude Include="src\Matrix.h" />
-    <ClInclude Include="src\Mesh.h" />
-    <ClInclude Include="src\MeshPart.h" />
-    <ClInclude Include="src\MeshSkin.h" />
-    <ClInclude Include="src\Model.h" />
-    <ClInclude Include="src\Node.h" />
-    <ClInclude Include="src\Bundle.h" />
-    <ClInclude Include="src\ParticleEmitter.h" />
-    <ClInclude Include="src\PhysicsCharacter.h" />
-    <ClInclude Include="src\PhysicsCollisionObject.h" />
-    <ClInclude Include="src\PhysicsCollisionShape.h" />
-    <ClInclude Include="src\PhysicsConstraint.h" />
-    <ClInclude Include="src\PhysicsController.h" />
-    <ClInclude Include="src\PhysicsFixedConstraint.h" />
-    <ClInclude Include="src\PhysicsGenericConstraint.h" />
-    <ClInclude Include="src\PhysicsGhostObject.h" />
-    <ClInclude Include="src\PhysicsHingeConstraint.h" />
-    <ClInclude Include="src\PhysicsRigidBody.h" />
-    <ClInclude Include="src\PhysicsSocketConstraint.h" />
-    <ClInclude Include="src\PhysicsSpringConstraint.h" />
-    <ClInclude Include="src\PhysicsVehicle.h" />
-    <ClInclude Include="src\PhysicsVehicleWheel.h" />
-    <ClInclude Include="src\Plane.h" />
-    <ClInclude Include="src\Platform.h" />
-    <ClInclude Include="src\Properties.h" />
-    <ClInclude Include="src\Quaternion.h" />
-    <ClInclude Include="src\RadioButton.h" />
-    <ClInclude Include="src\Ray.h" />
-    <ClInclude Include="src\Rectangle.h" />
-    <ClInclude Include="src\Ref.h" />
-    <ClInclude Include="src\RenderState.h" />
-    <ClInclude Include="src\RenderTarget.h" />
-    <ClInclude Include="src\Scene.h" />
-    <ClInclude Include="src\SceneLoader.h" />
-    <ClInclude Include="src\ScreenDisplayer.h" />
-    <ClInclude Include="src\ScriptController.h" />
-    <ClInclude Include="src\ScriptTarget.h" />
-    <ClInclude Include="src\Slider.h" />
-    <ClInclude Include="src\SocialAchievement.h" />
-    <ClInclude Include="src\SocialChallenge.h" />
-    <ClInclude Include="src\SocialController.h" />
-    <ClInclude Include="src\SocialPlayer.h" />
-    <ClInclude Include="src\SocialScore.h" />
-    <ClInclude Include="src\SocialSession.h" />
-    <ClInclude Include="src\SocialSessionListener.h" />
-    <ClInclude Include="src\social\GoogleGamesSocialSession.h" />
-    <ClInclude Include="src\social\ScoreloopSocialSession.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\TextBox.h" />
-    <ClInclude Include="src\Texture.h" />
-    <ClInclude Include="src\Theme.h" />
-    <ClInclude Include="src\ThemeStyle.h" />
-    <ClInclude Include="src\TimeListener.h" />
-    <ClInclude Include="src\Touch.h" />
-    <ClInclude Include="src\Transform.h" />
-    <ClInclude Include="src\Vector2.h" />
-    <ClInclude Include="src\Vector3.h" />
-    <ClInclude Include="src\Vector4.h" />
-    <ClInclude Include="src\VertexAttributeBinding.h" />
-    <ClInclude Include="src\VertexFormat.h" />
-    <ClInclude Include="src\VerticalLayout.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="res\logo_black.png" />
-    <None Include="res\logo_powered_black.png" />
-    <None Include="res\logo_powered_white.png" />
-    <None Include="res\logo_white.png" />
-    <None Include="res\shaders\colored-unlit.frag" />
-    <None Include="res\shaders\colored-unlit.vert" />
-    <None Include="res\shaders\colored.frag" />
-    <None Include="res\shaders\colored.vert" />
-    <None Include="res\shaders\font.frag" />
-    <None Include="res\shaders\font.vert" />
-    <None Include="res\shaders\form.frag" />
-    <None Include="res\shaders\form.vert" />
-    <None Include="res\shaders\lighting-directional.frag" />
-    <None Include="res\shaders\lighting-directional.vert" />
-    <None Include="res\shaders\lighting-point.frag" />
-    <None Include="res\shaders\lighting-point.vert" />
-    <None Include="res\shaders\lighting-spot.frag" />
-    <None Include="res\shaders\lighting-spot.vert" />
-    <None Include="res\shaders\lighting.frag" />
-    <None Include="res\shaders\skinning-none.vert" />
-    <None Include="res\shaders\skinning.vert" />
-    <None Include="res\shaders\sprite.frag" />
-    <None Include="res\shaders\sprite.vert" />
-    <None Include="res\shaders\terrain.frag" />
-    <None Include="res\shaders\terrain.vert" />
-    <None Include="res\shaders\textured-bumped.frag" />
-    <None Include="res\shaders\textured-bumped.vert" />
-    <None Include="res\shaders\textured-unlit.frag" />
-    <None Include="res\shaders\textured-unlit.vert" />
-    <None Include="res\shaders\textured.frag" />
-    <None Include="res\shaders\textured.vert" />
-    <None Include="src\BoundingBox.inl" />
-    <None Include="src\BoundingSphere.inl" />
-    <None Include="src\Game.inl" />
-    <None Include="src\Image.inl" />
-    <None Include="src\MathUtil.inl" />
-    <None Include="src\MathUtilNeon.inl" />
-    <None Include="src\Joystick.inl" />
-    <None Include="src\Matrix.inl" />
-    <None Include="src\MeshBatch.inl" />
-    <None Include="src\Plane.inl" />
-    <None Include="src\Quaternion.inl" />
-    <None Include="src\Ray.inl" />
-    <None Include="src\ScriptController.inl" />
-    <None Include="src\Vector2.inl" />
-    <None Include="src\Vector3.inl" />
-    <None Include="src\Vector4.inl" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\PhysicsConstraint.inl" />
-    <None Include="src\PhysicsFixedConstraint.inl" />
-    <None Include="src\PhysicsGenericConstraint.inl" />
-    <None Include="src\PhysicsRigidBody.inl" />
-    <None Include="src\PhysicsSpringConstraint.inl" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1032BA4B-57EB-4348-9E03-29DD63E80E4A}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <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>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerrySimulator'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerrySimulator'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerrySimulator'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </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)'=='Debug|BlackBerry'" 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)'=='Debug|BlackBerrySimulator'" 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 Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" 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|BlackBerrySimulator'" 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>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" 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)'=='Release|BlackBerrySimulator'" 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)'=='Debug|BlackBerry'">
-    <OutDir>Device-$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerrySimulator'">
-    <OutDir>Simulator\</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)'=='DebugMem|BlackBerry'">
-    <OutDir>Device-$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerrySimulator'">
-    <OutDir>Simulator\</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)'=='Debug|BlackBerry'">
-    <IntDir>Device-$(Configuration)\</IntDir>
-    <TargetName>lib$(ProjectName)</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerrySimulator'">
-    <IntDir>Simulator\</IntDir>
-    <TargetName>lib$(ProjectName)</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'">
-    <IntDir>windows\x86\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'">
-    <IntDir>windows\x64\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'">
-    <IntDir>Device-$(Configuration)\</IntDir>
-    <TargetName>lib$(ProjectName)</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerrySimulator'">
-    <IntDir>Simulator\</IntDir>
-    <TargetName>lib$(ProjectName)</TargetName>
-  </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|BlackBerry'">
-    <OutDir>Device-$(Configuration)\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerrySimulator'">
-    <OutDir>Simulator\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IntDir>windows\x86\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IntDir>windows\x64\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'">
-    <IntDir>Device-$(Configuration)\</IntDir>
-    <TargetName>lib$(ProjectName)</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerrySimulator'">
-    <IntDir>Simulator\</IntDir>
-    <TargetName>lib$(ProjectName)</TargetName>
-  </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>MultiThreadedDLL</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>
-      <RuntimeTypeInfo>
-      </RuntimeTypeInfo>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;GP_USE_SOCIAL;%(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>MultiThreadedDLL</RuntimeLibrary>
-      <AdditionalOptions>-mfpu=neon %(AdditionalOptions)</AdditionalOptions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerrySimulator'">
-    <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>MultiThreadedDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </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>MultiThreadedDLL</RuntimeLibrary>
-      <DisableSpecificWarnings>
-      </DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <Verbose>
-      </Verbose>
-      <AdditionalDependencies>
-      </AdditionalDependencies>
-      <AdditionalLibraryDirectories>
-      </AdditionalLibraryDirectories>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'">
-    <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>MultiThreadedDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <Verbose>
-      </Verbose>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;WIN32;_DEBUG;_LIB;GP_USE_MEM_LEAK_DETECTION;GP_USE_SOCIAL;%(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>MultiThreadedDLL</RuntimeLibrary>
-      <AdditionalOptions>-mfpu=neon %(AdditionalOptions)</AdditionalOptions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <Verbose>
-      </Verbose>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerrySimulator'">
-    <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>MultiThreadedDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <Verbose>
-      </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>
-      <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>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;GP_USE_SOCIAL;%(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>
-      <AdditionalOptions>-mfpu=neon %(AdditionalOptions)</AdditionalOptions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerrySimulator'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;GP_USE_SOCIAL;%(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>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
+<?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>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="src\AbsoluteLayout.cpp" />
+    <ClCompile Include="src\AIAgent.cpp" />
+    <ClCompile Include="src\AIController.cpp" />
+    <ClCompile Include="src\AIMessage.cpp" />
+    <ClCompile Include="src\AIState.cpp" />
+    <ClCompile Include="src\AIStateMachine.cpp" />
+    <ClCompile Include="src\Animation.cpp" />
+    <ClCompile Include="src\AnimationClip.cpp" />
+    <ClCompile Include="src\AnimationController.cpp" />
+    <ClCompile Include="src\AnimationTarget.cpp" />
+    <ClCompile Include="src\AnimationValue.cpp" />
+    <ClCompile Include="src\AudioBuffer.cpp" />
+    <ClCompile Include="src\AudioController.cpp" />
+    <ClCompile Include="src\AudioListener.cpp" />
+    <ClCompile Include="src\AudioSource.cpp" />
+    <ClCompile Include="src\BoundingBox.cpp" />
+    <ClCompile Include="src\BoundingSphere.cpp" />
+    <ClCompile Include="src\Button.cpp" />
+    <ClCompile Include="src\Camera.cpp" />
+    <ClCompile Include="src\CheckBox.cpp" />
+    <ClCompile Include="src\Container.cpp" />
+    <ClCompile Include="src\Control.cpp" />
+    <ClCompile Include="src\Curve.cpp" />
+    <ClCompile Include="src\DebugNew.cpp" />
+    <ClCompile Include="src\DepthStencilTarget.cpp" />
+    <ClCompile Include="src\Effect.cpp" />
+    <ClCompile Include="src\FileSystem.cpp" />
+    <ClCompile Include="src\FlowLayout.cpp" />
+    <ClCompile Include="src\Font.cpp" />
+    <ClCompile Include="src\Form.cpp" />
+    <ClCompile Include="src\FrameBuffer.cpp" />
+    <ClCompile Include="src\Frustum.cpp" />
+    <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" />
+    <ClCompile Include="src\Image.cpp" />
+    <ClCompile Include="src\ImageControl.cpp" />
+    <ClCompile Include="src\Joint.cpp" />
+    <ClCompile Include="src\Joystick.cpp" />
+    <ClCompile Include="src\Label.cpp" />
+    <ClCompile Include="src\Layout.cpp" />
+    <ClCompile Include="src\Light.cpp" />
+    <ClCompile Include="src\Logger.cpp" />
+    <ClCompile Include="src\lua\lua_AbsoluteLayout.cpp" />
+    <ClCompile Include="src\lua\lua_AIAgent.cpp" />
+    <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" />
+    <ClCompile Include="src\lua\lua_all_bindings.cpp" />
+    <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" />
+    <ClCompile Include="src\lua\lua_AudioBuffer.cpp" />
+    <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_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_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_Joystick.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" />
+    <ClCompile Include="src\lua\lua_PhysicsHingeConstraint.cpp" />
+    <ClCompile Include="src\lua\lua_PhysicsRigidBody.cpp" />
+    <ClCompile Include="src\lua\lua_PhysicsRigidBodyParameters.cpp" />
+    <ClCompile Include="src\lua\lua_PhysicsSocketConstraint.cpp" />
+    <ClCompile Include="src\lua\lua_PhysicsSpringConstraint.cpp" />
+    <ClCompile Include="src\lua\lua_PhysicsVehicle.cpp" />
+    <ClCompile Include="src\lua\lua_PhysicsVehicleWheel.cpp" />
+    <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_SceneDebugFlags.cpp" />
+    <ClCompile Include="src\lua\lua_SceneRenderer.cpp" />
+    <ClCompile Include="src\lua\lua_SceneRendererForward.cpp" />
+    <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp" />
+    <ClCompile Include="src\lua\lua_ScriptController.cpp" />
+    <ClCompile Include="src\lua\lua_ScriptTarget.cpp" />
+    <ClCompile Include="src\lua\lua_Slider.cpp" />
+    <ClCompile Include="src\lua\lua_SpriteBatch.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_TerrainListener.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_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" />
+    <ClCompile Include="src\lua\lua_Vector2.cpp" />
+    <ClCompile Include="src\lua\lua_Vector3.cpp" />
+    <ClCompile Include="src\lua\lua_Vector4.cpp" />
+    <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\lua\lua_VisibleSet.cpp" />
+    <ClCompile Include="src\lua\lua_VisibleSetDefault.cpp" />
+    <ClCompile Include="src\Material.cpp" />
+    <ClCompile Include="src\MathUtil.cpp" />
+    <ClCompile Include="src\MeshBatch.cpp" />
+    <ClCompile Include="src\Pass.cpp" />
+    <ClCompile Include="src\MaterialParameter.cpp" />
+    <ClCompile Include="src\Matrix.cpp" />
+    <ClCompile Include="src\Mesh.cpp" />
+    <ClCompile Include="src\MeshPart.cpp" />
+    <ClCompile Include="src\MeshSkin.cpp" />
+    <ClCompile Include="src\Model.cpp" />
+    <ClCompile Include="src\Node.cpp" />
+    <ClCompile Include="src\Bundle.cpp" />
+    <ClCompile Include="src\ParticleEmitter.cpp" />
+    <ClCompile Include="src\PhysicsCharacter.cpp" />
+    <ClCompile Include="src\PhysicsCollisionObject.cpp" />
+    <ClCompile Include="src\PhysicsCollisionShape.cpp" />
+    <ClCompile Include="src\PhysicsConstraint.cpp" />
+    <ClCompile Include="src\PhysicsController.cpp" />
+    <ClCompile Include="src\PhysicsFixedConstraint.cpp" />
+    <ClCompile Include="src\PhysicsGenericConstraint.cpp" />
+    <ClCompile Include="src\PhysicsGhostObject.cpp" />
+    <ClCompile Include="src\PhysicsHingeConstraint.cpp" />
+    <ClCompile Include="src\PhysicsRigidBody.cpp" />
+    <ClCompile Include="src\PhysicsSocketConstraint.cpp" />
+    <ClCompile Include="src\PhysicsSpringConstraint.cpp" />
+    <ClCompile Include="src\PhysicsVehicle.cpp" />
+    <ClCompile Include="src\PhysicsVehicleWheel.cpp" />
+    <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" />
+    <ClCompile Include="src\Quaternion.cpp" />
+    <ClCompile Include="src\RadioButton.cpp" />
+    <ClCompile Include="src\Ray.cpp" />
+    <ClCompile Include="src\Rectangle.cpp" />
+    <ClCompile Include="src\Ref.cpp" />
+    <ClCompile Include="src\RenderState.cpp" />
+    <ClCompile Include="src\RenderTarget.cpp" />
+    <ClCompile Include="src\Scene.cpp" />
+    <ClCompile Include="src\SceneLoader.cpp" />
+    <ClCompile Include="src\SceneRenderer.cpp" />
+    <ClCompile Include="src\SceneRendererForward.cpp" />
+    <ClCompile Include="src\ScreenDisplayer.cpp" />
+    <ClCompile Include="src\ScriptController.cpp" />
+    <ClCompile Include="src\ScriptTarget.cpp" />
+    <ClCompile Include="src\Slider.cpp" />
+    <ClCompile Include="src\SocialAchievement.cpp" />
+    <ClCompile Include="src\SocialChallenge.cpp" />
+    <ClCompile Include="src\SocialController.cpp" />
+    <ClCompile Include="src\SocialPlayer.cpp" />
+    <ClCompile Include="src\SocialScore.cpp" />
+    <ClCompile Include="src\SocialSessionListener.cpp" />
+    <ClCompile Include="src\social\GooglePlaySocialSession.cpp" />
+    <ClCompile Include="src\social\ScoreloopSocialSession.cpp" />
+    <ClCompile Include="src\SpriteBatch.cpp" />
+    <ClCompile Include="src\Technique.cpp" />
+    <ClCompile Include="src\Terrain.cpp" />
+    <ClCompile Include="src\TerrainPatch.cpp" />
+    <ClCompile Include="src\TextBox.cpp" />
+    <ClCompile Include="src\Texture.cpp" />
+    <ClCompile Include="src\Theme.cpp" />
+    <ClCompile Include="src\ThemeStyle.cpp" />
+    <ClCompile Include="src\Transform.cpp" />
+    <ClCompile Include="src\Vector2.cpp" />
+    <ClCompile Include="src\Vector3.cpp" />
+    <ClCompile Include="src\Vector4.cpp" />
+    <ClCompile Include="src\VertexAttributeBinding.cpp" />
+    <ClCompile Include="src\VertexFormat.cpp" />
+    <ClCompile Include="src\VerticalLayout.cpp" />
+    <ClCompile Include="src\VisibleSetDefault.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="src\AbsoluteLayout.h" />
+    <ClInclude Include="src\AIAgent.h" />
+    <ClInclude Include="src\AIController.h" />
+    <ClInclude Include="src\AIMessage.h" />
+    <ClInclude Include="src\AIState.h" />
+    <ClInclude Include="src\AIStateMachine.h" />
+    <ClInclude Include="src\Animation.h" />
+    <ClInclude Include="src\AnimationClip.h" />
+    <ClInclude Include="src\AnimationController.h" />
+    <ClInclude Include="src\AnimationTarget.h" />
+    <ClInclude Include="src\AnimationValue.h" />
+    <ClInclude Include="src\AudioBuffer.h" />
+    <ClInclude Include="src\AudioController.h" />
+    <ClInclude Include="src\AudioListener.h" />
+    <ClInclude Include="src\AudioSource.h" />
+    <ClInclude Include="src\Base.h" />
+    <ClInclude Include="src\BoundingBox.h" />
+    <ClInclude Include="src\BoundingSphere.h" />
+    <ClInclude Include="src\Button.h" />
+    <ClInclude Include="src\Camera.h" />
+    <ClInclude Include="src\CheckBox.h" />
+    <ClInclude Include="src\Container.h" />
+    <ClInclude Include="src\Control.h" />
+    <ClInclude Include="src\Curve.h" />
+    <ClInclude Include="src\DebugNew.h" />
+    <ClInclude Include="src\DepthStencilTarget.h" />
+    <ClInclude Include="src\Effect.h" />
+    <ClInclude Include="src\FileSystem.h" />
+    <ClInclude Include="src\FlowLayout.h" />
+    <ClInclude Include="src\Font.h" />
+    <ClInclude Include="src\Form.h" />
+    <ClInclude Include="src\FrameBuffer.h" />
+    <ClInclude Include="src\Frustum.h" />
+    <ClInclude Include="src\Game.h" />
+    <ClInclude Include="src\Gamepad.h" />
+    <ClInclude Include="src\gameplay.h" />
+    <ClInclude Include="src\Gesture.h" />
+    <ClInclude Include="src\HeightField.h" />
+    <ClInclude Include="src\Image.h" />
+    <ClInclude Include="src\ImageControl.h" />
+    <ClInclude Include="src\Joint.h" />
+    <ClInclude Include="src\Joystick.h" />
+    <ClInclude Include="src\Keyboard.h" />
+    <ClInclude Include="src\Label.h" />
+    <ClInclude Include="src\Layout.h" />
+    <ClInclude Include="src\Light.h" />
+    <ClInclude Include="src\Logger.h" />
+    <ClInclude Include="src\lua\lua_AbsoluteLayout.h" />
+    <ClInclude Include="src\lua\lua_AIAgent.h" />
+    <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" />
+    <ClInclude Include="src\lua\lua_all_bindings.h" />
+    <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" />
+    <ClInclude Include="src\lua\lua_AudioBuffer.h" />
+    <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_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_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_Joystick.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" />
+    <ClInclude Include="src\lua\lua_PhysicsHingeConstraint.h" />
+    <ClInclude Include="src\lua\lua_PhysicsRigidBody.h" />
+    <ClInclude Include="src\lua\lua_PhysicsRigidBodyParameters.h" />
+    <ClInclude Include="src\lua\lua_PhysicsSocketConstraint.h" />
+    <ClInclude Include="src\lua\lua_PhysicsSpringConstraint.h" />
+    <ClInclude Include="src\lua\lua_PhysicsVehicle.h" />
+    <ClInclude Include="src\lua\lua_PhysicsVehicleWheel.h" />
+    <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_SceneDebugFlags.h" />
+    <ClInclude Include="src\lua\lua_SceneRenderer.h" />
+    <ClInclude Include="src\lua\lua_SceneRendererForward.h" />
+    <ClInclude Include="src\lua\lua_ScreenDisplayer.h" />
+    <ClInclude Include="src\lua\lua_ScriptController.h" />
+    <ClInclude Include="src\lua\lua_ScriptTarget.h" />
+    <ClInclude Include="src\lua\lua_Slider.h" />
+    <ClInclude Include="src\lua\lua_SpriteBatch.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_TerrainListener.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_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" />
+    <ClInclude Include="src\lua\lua_Vector2.h" />
+    <ClInclude Include="src\lua\lua_Vector3.h" />
+    <ClInclude Include="src\lua\lua_Vector4.h" />
+    <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\lua\lua_VisibleSet.h" />
+    <ClInclude Include="src\lua\lua_VisibleSetDefault.h" />
+    <ClInclude Include="src\Material.h" />
+    <ClInclude Include="src\MathUtil.h" />
+    <ClInclude Include="src\MeshBatch.h" />
+    <ClInclude Include="src\Mouse.h" />
+    <ClInclude Include="src\Pass.h" />
+    <ClInclude Include="src\MaterialParameter.h" />
+    <ClInclude Include="src\Matrix.h" />
+    <ClInclude Include="src\Mesh.h" />
+    <ClInclude Include="src\MeshPart.h" />
+    <ClInclude Include="src\MeshSkin.h" />
+    <ClInclude Include="src\Model.h" />
+    <ClInclude Include="src\Node.h" />
+    <ClInclude Include="src\Bundle.h" />
+    <ClInclude Include="src\ParticleEmitter.h" />
+    <ClInclude Include="src\PhysicsCharacter.h" />
+    <ClInclude Include="src\PhysicsCollisionObject.h" />
+    <ClInclude Include="src\PhysicsCollisionShape.h" />
+    <ClInclude Include="src\PhysicsConstraint.h" />
+    <ClInclude Include="src\PhysicsController.h" />
+    <ClInclude Include="src\PhysicsFixedConstraint.h" />
+    <ClInclude Include="src\PhysicsGenericConstraint.h" />
+    <ClInclude Include="src\PhysicsGhostObject.h" />
+    <ClInclude Include="src\PhysicsHingeConstraint.h" />
+    <ClInclude Include="src\PhysicsRigidBody.h" />
+    <ClInclude Include="src\PhysicsSocketConstraint.h" />
+    <ClInclude Include="src\PhysicsSpringConstraint.h" />
+    <ClInclude Include="src\PhysicsVehicle.h" />
+    <ClInclude Include="src\PhysicsVehicleWheel.h" />
+    <ClInclude Include="src\Plane.h" />
+    <ClInclude Include="src\Platform.h" />
+    <ClInclude Include="src\Properties.h" />
+    <ClInclude Include="src\Quaternion.h" />
+    <ClInclude Include="src\RadioButton.h" />
+    <ClInclude Include="src\Ray.h" />
+    <ClInclude Include="src\Rectangle.h" />
+    <ClInclude Include="src\Ref.h" />
+    <ClInclude Include="src\RenderState.h" />
+    <ClInclude Include="src\RenderTarget.h" />
+    <ClInclude Include="src\Scene.h" />
+    <ClInclude Include="src\SceneLoader.h" />
+    <ClInclude Include="src\SceneRenderer.h" />
+    <ClInclude Include="src\SceneRendererForward.h" />
+    <ClInclude Include="src\ScreenDisplayer.h" />
+    <ClInclude Include="src\ScriptController.h" />
+    <ClInclude Include="src\ScriptTarget.h" />
+    <ClInclude Include="src\Slider.h" />
+    <ClInclude Include="src\SocialAchievement.h" />
+    <ClInclude Include="src\SocialChallenge.h" />
+    <ClInclude Include="src\SocialController.h" />
+    <ClInclude Include="src\SocialPlayer.h" />
+    <ClInclude Include="src\SocialScore.h" />
+    <ClInclude Include="src\SocialSession.h" />
+    <ClInclude Include="src\SocialSessionListener.h" />
+    <ClInclude Include="src\social\GooglePlaySocialSession.h" />
+    <ClInclude Include="src\social\ScoreloopSocialSession.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\TextBox.h" />
+    <ClInclude Include="src\Texture.h" />
+    <ClInclude Include="src\Theme.h" />
+    <ClInclude Include="src\ThemeStyle.h" />
+    <ClInclude Include="src\TimeListener.h" />
+    <ClInclude Include="src\Touch.h" />
+    <ClInclude Include="src\Transform.h" />
+    <ClInclude Include="src\Vector2.h" />
+    <ClInclude Include="src\Vector3.h" />
+    <ClInclude Include="src\Vector4.h" />
+    <ClInclude Include="src\VertexAttributeBinding.h" />
+    <ClInclude Include="src\VertexFormat.h" />
+    <ClInclude Include="src\VerticalLayout.h" />
+    <ClInclude Include="src\VisibleSet.h" />
+    <ClInclude Include="src\VisibleSetDefault.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="res\logo_black.png" />
+    <None Include="res\logo_powered_black.png" />
+    <None Include="res\logo_powered_white.png" />
+    <None Include="res\logo_white.png" />
+    <None Include="res\shaders\colored.frag" />
+    <None Include="res\shaders\colored.vert" />
+    <None Include="res\shaders\font.frag" />
+    <None Include="res\shaders\font.vert" />
+    <None Include="res\shaders\form.frag" />
+    <None Include="res\shaders\form.vert" />
+    <None Include="res\shaders\lighting.frag" />
+    <None Include="res\shaders\lighting.vert" />
+    <None Include="res\shaders\skinning-none.vert" />
+    <None Include="res\shaders\skinning.vert" />
+    <None Include="res\shaders\sprite.frag" />
+    <None Include="res\shaders\sprite.vert" />
+    <None Include="res\shaders\terrain.frag" />
+    <None Include="res\shaders\terrain.vert" />
+    <None Include="res\shaders\textured.frag" />
+    <None Include="res\shaders\textured.vert" />
+    <None Include="src\BoundingBox.inl" />
+    <None Include="src\BoundingSphere.inl" />
+    <None Include="src\Game.inl" />
+    <None Include="src\Image.inl" />
+    <None Include="src\MathUtil.inl" />
+    <None Include="src\MathUtilNeon.inl" />
+    <None Include="src\Joystick.inl" />
+    <None Include="src\Matrix.inl" />
+    <None Include="src\MeshBatch.inl" />
+    <None Include="src\Plane.inl" />
+    <None Include="src\Quaternion.inl" />
+    <None Include="src\Ray.inl" />
+    <None Include="src\ScriptController.inl" />
+    <None Include="src\Vector2.inl" />
+    <None Include="src\Vector3.inl" />
+    <None Include="src\Vector4.inl" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="src\PhysicsConstraint.inl" />
+    <None Include="src\PhysicsFixedConstraint.inl" />
+    <None Include="src\PhysicsGenericConstraint.inl" />
+    <None Include="src\PhysicsRigidBody.inl" />
+    <None Include="src\PhysicsSpringConstraint.inl" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{1032BA4B-57EB-4348-9E03-29DD63E80E4A}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <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>
+    <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>
+  </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>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <IntDir>windows\x64\$(Configuration)\</IntDir>
+  </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>MultiThreadedDLL</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>
+      <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>MultiThreadedDLL</RuntimeLibrary>
+      <DisableSpecificWarnings>
+      </DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <Lib>
+      <Verbose>
+      </Verbose>
+      <AdditionalDependencies>
+      </AdditionalDependencies>
+      <AdditionalLibraryDirectories>
+      </AdditionalLibraryDirectories>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'">
+    <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>MultiThreadedDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <Lib>
+      <Verbose>
+      </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>
+      <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>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
 </Project>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 383 - 356
gameplay/gameplay.vcxproj.filters


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1835 - 1708
gameplay/gameplay.xcodeproj/project.pbxproj


+ 0 - 45
gameplay/res/shaders/colored-unlit.frag

@@ -1,45 +0,0 @@
-#ifdef OPENGL_ES
-precision highp float;
-#endif
-
-// Uniforms
-uniform vec4 u_diffuseColor;               	// Diffuse color
-#if defined(TEXTURE_LIGHTMAP)
-uniform sampler2D u_lightmapTexture;     	// Lightmap texture
-#endif
-#if defined(MODULATE_COLOR)
-uniform vec4 u_modulateColor;               // Modulation color
-#endif
-#if defined(MODULATE_ALPHA)
-uniform float u_modulateAlpha;              // Modulation alpha
-#endif
-
-// Varyings
-#if defined(VERTEX_COLOR)
-varying vec3 v_color;						// Input Vertex color ( r g b )
-#endif
-#if defined(TEXTURE_LIGHTMAP)
-varying vec2 v_texCoord;
-#endif
-
-
-void main()
-{
-    // Set base diffuse color
-    #if defined(VERTEX_COLOR)
-	gl_FragColor.rgb = v_color;
-	#else
-	gl_FragColor = u_diffuseColor;
-    #endif
-	#if defined(TEXTURE_LIGHTMAP)
-	vec4 lightColor = texture2D(u_lightmapTexture, v_texCoord);
-	gl_FragColor.rgb *= lightColor.rgb;
-	#endif
-	// Global color modulation
-	#if defined(MODULATE_COLOR)
-	gl_FragColor *= u_modulateColor;
-	#endif
-	#if defined(MODULATE_ALPHA)
-    gl_FragColor.a *= u_modulateAlpha;
-    #endif
-}

+ 0 - 53
gameplay/res/shaders/colored-unlit.vert

@@ -1,53 +0,0 @@
-// Attributes
-attribute vec4 a_position;									// Vertex Position							(x, y, z, w)
-#if defined(TEXTURE_LIGHTMAP)
-attribute vec2 a_texCoord;                                  // Texture Coordinate (for lightmapping)
-#endif
-#if defined(SKINNING)
-attribute vec4 a_blendWeights;								// Vertex blend weight, up to 4				(0, 1, 2, 3) 
-attribute vec4 a_blendIndices;								// Vertex blend index int u_matrixPalette	(0, 1, 2, 3)
-#endif
-#if defined(VERTEX_COLOR)
-attribute vec3 a_color;										// Vertex Color								(r, g, b)
-#endif
-
-// Uniforms
-uniform mat4 u_worldViewProjectionMatrix;					// Matrix to transform a position to clip space.
-#if defined(SKINNING)
-uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];		// Array of 4x3 matrices as an array of floats
-#endif
-
-// Varyings
-#if defined(TEXTURE_LIGHTMAP)
-varying vec2 v_texCoord;                                    // Output Texture Coordinate
-#endif
-#if defined(VERTEX_COLOR)
-varying vec3 v_color;										// Output Vertex color						(r, g, b)
-#endif
-
-// Skinning
-#if defined(SKINNING)
-#include "skinning.vert"
-#else
-#include "skinning-none.vert" 
-#endif
-
-
-void main()
-{
-    // Get the vertex position
-    vec4 position = getPosition();
-    
-    // Transform position to clip space.a
-    gl_Position = u_worldViewProjectionMatrix *  position;
-    
-    // Pass lightmap tex coord to fragment shader
-    #if defined(TEXTURE_LIGHTMAP)
-    v_texCoord0 = a_texCoord0;
-    #endif
-
-     // Pass on vertex color to fragment shader
-    #if defined(VERTEX_COLOR)
-	v_color = a_color;
-    #endif
-}

+ 93 - 38
gameplay/res/shaders/colored.frag

@@ -1,73 +1,128 @@
-#define LIGHTING
 #ifdef OPENGL_ES
 precision highp float;
 #endif
 
+#ifndef DIRECTIONAL_LIGHT_COUNT
+#define DIRECTIONAL_LIGHT_COUNT 0
+#endif
+#ifndef SPOT_LIGHT_COUNT
+#define SPOT_LIGHT_COUNT 0
+#endif
+#ifndef POINT_LIGHT_COUNT
+#define POINT_LIGHT_COUNT 0
+#endif
+#if (DIRECTIONAL_LIGHT_COUNT > 0) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0)
+#define LIGHTING
+#endif
+
+///////////////////////////////////////////////////////////
 // Uniforms
-uniform vec4 u_diffuseColor;               		// Diffuse color
-uniform vec3 u_ambientColor;                    // Ambient color
-uniform vec3 u_lightColor;                      // Light color
-uniform vec3 u_lightDirection;					// Light direction
+uniform vec3 u_ambientColor;
+uniform vec4 u_diffuseColor;
+
+#if defined(LIGHTMAP)
+uniform sampler2D u_lightmapTexture;
+#endif
+
+#if defined(LIGHTING)
+
+#if (DIRECTIONAL_LIGHT_COUNT > 0)
+uniform vec3 u_directionalLightColor[DIRECTIONAL_LIGHT_COUNT];
+uniform vec3 u_directionalLightDirection[DIRECTIONAL_LIGHT_COUNT];
+#endif
+
+#if (POINT_LIGHT_COUNT > 0)
+uniform vec3 u_pointLightColor[POINT_LIGHT_COUNT];
+uniform vec3 u_pointLightPosition[POINT_LIGHT_COUNT];
+uniform float u_pointLightRangeInverse[POINT_LIGHT_COUNT];
+#endif
+
+#if (SPOT_LIGHT_COUNT > 0)
+uniform vec3 u_spotLightColor[SPOT_LIGHT_COUNT];
+uniform vec3 u_spotLightDirection[SPOT_LIGHT_COUNT];
+uniform float u_spotLightRangeInverse[SPOT_LIGHT_COUNT];
+uniform float u_spotLightInnerAngleCos[SPOT_LIGHT_COUNT];
+uniform float u_spotLightOuterAngleCos[SPOT_LIGHT_COUNT];
+#endif
+
 #if defined(SPECULAR)
-uniform float u_specularExponent;				// Specular exponent
+uniform float u_specularExponent;
 #endif
-#if defined(SPOT_LIGHT)
-uniform float u_spotLightInnerAngleCos;			// The bright spot [0.0 - 1.0]
-uniform float u_spotLightOuterAngleCos;			// The soft outer part [0.0 - 1.0]
-uniform vec3 u_spotLightDirection;              // Direction of a spot light source
+
 #endif
+
 #if defined(MODULATE_COLOR)
-uniform vec4 u_modulateColor;					// Modulation color
+uniform vec4 u_modulateColor;
 #endif
+
 #if defined(MODULATE_ALPHA)
-uniform float u_modulateAlpha;					// Modulation alpha
+uniform float u_modulateAlpha;
 #endif
 
-// Inputs
-varying vec3 v_normalVector;					// Normal vector in view space
+///////////////////////////////////////////////////////////
+// Variables
+vec4 _baseColor;
+
+///////////////////////////////////////////////////////////
+// Varyings
 #if defined(VERTEX_COLOR)
-varying vec3 v_color;							// Vertex color
-#endif
-#if defined(POINT_LIGHT)
-varying vec3 v_vertexToPointLightDirection;		// Light direction w.r.t current vertex in tangent space
-varying float v_pointLightAttenuation;			// Attenuation of point light
-#elif defined(SPOT_LIGHT)
-varying vec3 v_spotLightDirection;				// Direction of spot light in tangent space.
-varying vec3 v_vertexToSpotLightDirection;		// Direction of the spot light w.r.t current vertex in tangent space
-varying float v_spotLightAttenuation;			// Attenuation of spot light
-#else
-varying vec3 v_lightDirection;					// Direction of light in tangent space
+varying vec3 v_color;
 #endif
+
+#if defined(LIGHTING)
+
+varying vec3 v_normalVector;
+
+#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
+
 #if defined(SPECULAR)
-varying vec3 v_cameraDirection;                 // Camera direction
+varying vec3 v_cameraDirection; 
 #endif
 
-// Lighting
 #include "lighting.frag"
-#if defined(POINT_LIGHT)
-#include "lighting-point.frag"
-#elif defined(SPOT_LIGHT)
-#include "lighting-spot.frag"
-#else
-#include "lighting-directional.frag"
+
 #endif
 
+
 void main()
 {
-    // Set base diffuse color
+    
+    #if defined(LIGHTING)
+
     #if defined(VERTEX_COLOR)
 	_baseColor.rgb = v_color;
-	#else
-	_baseColor = u_diffuseColor;
+    #else
+    _baseColor = u_diffuseColor;
 	#endif
-
-    // Light the pixel
+    
     gl_FragColor.a = _baseColor.a;
     gl_FragColor.rgb = getLitPixel();
     
+    #else
+    
+    #if defined(VERTEX_COLOR)
+    gl_FragColor.rgb = v_color;
+    #else
+    gl_FragColor = u_diffuseColor;
+    #endif
+    
+    #endif
+
+	#if defined(LIGHTMAP)
+	vec4 lightColor = texture2D(u_lightmapTexture, v_texCoord1);
+	gl_FragColor.rgb *= lightColor.rgb;
+	#endif
+
 	#if defined(MODULATE_COLOR)
     gl_FragColor *= u_modulateColor;
     #endif
+
 	#if defined(MODULATE_ALPHA)
     gl_FragColor.a *= u_modulateAlpha;
     #endif

+ 96 - 41
gameplay/res/shaders/colored.vert

@@ -1,57 +1,105 @@
+#ifndef DIRECTIONAL_LIGHT_COUNT
+#define DIRECTIONAL_LIGHT_COUNT 0
+#endif
+#ifndef SPOT_LIGHT_COUNT
+#define SPOT_LIGHT_COUNT 0
+#endif
+#ifndef POINT_LIGHT_COUNT
+#define POINT_LIGHT_COUNT 0
+#endif
+#if (DIRECTIONAL_LIGHT_COUNT > 0) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0)
 #define LIGHTING
+#endif
 
+///////////////////////////////////////////////////////////
 // Attributes
-attribute vec4 a_position;									// Vertex Position							(x, y, z, w)
-attribute vec3 a_normal;									// Vertex Normal							(x, y, z)
+attribute vec4 a_position;
+
 #if defined(SKINNING)
-attribute vec4 a_blendWeights;								// Vertex blend weight, up to 4				(0, 1, 2, 3) 
-attribute vec4 a_blendIndices;								// Vertex blend index int u_matrixPalette	(0, 1, 2, 3)
+attribute vec4 a_blendWeights;
+attribute vec4 a_blendIndices;
+#endif
+
+#if defined(LIGHTMAP)
+attribute vec2 a_texCoord1;
 #endif
+
+#if defined(LIGHTING)
+attribute vec3 a_normal;
+#endif
+
 #if defined(VERTEX_COLOR)
-attribute vec3 a_color;										// Output Vertex Color
-varying vec3 v_color;										// Output Vertex Color 
+attribute vec3 a_color;
 #endif
 
+///////////////////////////////////////////////////////////
 // Uniforms
-uniform mat4 u_worldViewProjectionMatrix;					// Matrix to transform a position to clip space.
-uniform mat4 u_inverseTransposeWorldViewMatrix;				// Matrix to transform a normal to view space
-uniform mat4 u_worldViewMatrix;								// Matrix to tranform a position to view space.
+uniform mat4 u_worldViewProjectionMatrix;
+
 #if defined(SKINNING)
-uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];		// Array of 4x3 matrices
+uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];
 #endif
+
+#if defined(LIGHTING)
+uniform mat4 u_inverseTransposeWorldViewMatrix;
+
+#if (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0) || defined(SPECULAR)
+uniform mat4 u_worldViewMatrix;
+#endif
+
+#if (DIRECTION_LIGHT_COUNT > 0)
+uniform vec3 u_directionalLightDirection[DIRECTION_LIGHT_COUNT];
+#endif
+
+#if (POINT_LIGHT_COUNT > 0) 
+uniform vec3 u_pointLightPosition[POINT_LIGHT_COUNT];
+#endif
+
+#if (SPOT_LIGHT_COUNT > 0)
+uniform vec3 u_spotLightPosition[SPOT_LIGHT_COUNT];
+uniform vec3 u_spotLightDirection[SPOT_LIGHT_COUNT];
+#endif
+
 #if defined(SPECULAR)
-uniform vec3 u_cameraPosition;                 				// Position of the camera in view space.
-#endif
-#if defined(POINT_LIGHT)
-uniform vec3 u_pointLightPosition;							// Position of light
-uniform float u_pointLightRangeInverse;						// Inverse of light range 
-#elif defined(SPOT_LIGHT)
-uniform vec3 u_spotLightPosition;							// Position of light
-uniform float u_spotLightRangeInverse;						// Inverse of light range.
-#else
+uniform vec3 u_cameraPosition;
 #endif
 
+#endif
+
+///////////////////////////////////////////////////////////
 // Varyings
-varying vec3 v_normalVector;								// Normal vector in view space.
+#if defined(LIGHTMAP)
+varying vec2 v_texCoord1;
+#endif
+
+#if defined(VERTEX_COLOR)
+varying vec3 v_color;
+#endif
+
+#if defined(LIGHTING)
+
+varying 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
+
 #if defined(SPECULAR)
-varying vec3 v_cameraDirection;								// Direction the camera is looking at in tangent space.
-#endif
-
-// Lighting
-#if defined(POINT_LIGHT)
-varying vec3 v_vertexToPointLightDirection;					// Direction of point light w.r.t current vertex in tangent space.
-varying float v_pointLightAttenuation;						// Attenuation of point light.
-#include "lighting-point.vert"
-#elif defined(SPOT_LIGHT)
-varying vec3 v_vertexToSpotLightDirection;					// Direction of the spot light w.r.t current vertex in tangent space.
-varying float v_spotLightAttenuation;						// Attenuation of spot light.
-#include "lighting-spot.vert"
-#else
-uniform vec3 u_lightDirection;								// Direction of light
-#include "lighting-directional.vert"
+varying vec3 v_cameraDirection;
+#endif
+
+#include "lighting.vert"
+
 #endif
 
-// Skinning
 #if defined(SKINNING)
 #include "skinning.vert"
 #else
@@ -61,21 +109,28 @@ uniform vec3 u_lightDirection;								// Direction of light
 
 void main()
 {
-    // Get the position and normal
     vec4 position = getPosition();
-    vec3 normal = getNormal();
-
-    // Transform position to clip space.
     gl_Position = u_worldViewProjectionMatrix * position;
 
+    #if defined (LIGHTING)
+
+    vec3 normal = getNormal();
+
     // Transform normal to view space.
     mat3 inverseTransposeWorldViewMatrix = mat3(u_inverseTransposeWorldViewMatrix[0].xyz, u_inverseTransposeWorldViewMatrix[1].xyz, u_inverseTransposeWorldViewMatrix[2].xyz);
     v_normalVector = inverseTransposeWorldViewMatrix * normal;
 
     // Apply light.
     applyLight(position);
+
+    #endif
+
+    // Pass the lightmap texture coordinate
+    #if defined(LIGHTMAP)
+    v_texCoord1 = a_texCoord1;
+    #endif
     
-    // Pass the vertex color to fragment shader
+    // Pass the vertex color
     #if defined(VERTEX_COLOR)
 	v_color = a_color;
     #endif

+ 10 - 4
gameplay/res/shaders/font.frag

@@ -3,12 +3,15 @@ precision highp float;
 #extension GL_OES_standard_derivatives : enable
 #endif
 
+///////////////////////////////////////////////////////////
 // Uniforms
 uniform sampler2D u_texture;
+
 #ifdef DISTANCE_FIELD
 uniform vec2 u_cutoff;
 #endif
 
+///////////////////////////////////////////////////////////
 // Varyings
 varying vec2 v_texCoord;
 varying vec4 v_color;
@@ -16,15 +19,18 @@ varying vec4 v_color;
 
 void main()
 { 
-#ifdef DISTANCE_FIELD
+    #ifdef DISTANCE_FIELD
+    
     gl_FragColor = v_color;
     float distance = texture2D(u_texture, v_texCoord).a;
     float smoothing = fwidth(distance);
     float alpha = smoothstep(0.5 - smoothing * u_cutoff.x, 0.5 + smoothing * u_cutoff.y, distance);
     gl_FragColor.a = alpha * v_color.a;
-
-#else
+    
+    #else
+    
     gl_FragColor = v_color;
     gl_FragColor.a = texture2D(u_texture, v_texCoord).a * v_color.a;
-#endif
+    
+    #endif
 }

+ 4 - 0
gameplay/res/shaders/font.vert

@@ -1,15 +1,19 @@
+///////////////////////////////////////////////////////////
 // Atttributes
 attribute vec3 a_position;
 attribute vec2 a_texCoord;
 attribute vec4 a_color;
 
+///////////////////////////////////////////////////////////
 // Uniforms
 uniform mat4 u_projectionMatrix;
 
+///////////////////////////////////////////////////////////
 // Varyings
 varying vec2 v_texCoord;
 varying vec4 v_color;
 
+
 void main()
 {
     gl_Position = u_projectionMatrix * vec4(a_position, 1);

+ 2 - 0
gameplay/res/shaders/form.frag

@@ -2,9 +2,11 @@
 precision highp float;
 #endif
 
+///////////////////////////////////////////////////////////
 // Uniforms
 uniform sampler2D u_texture;
 
+///////////////////////////////////////////////////////////
 // Varyings
 varying vec2 v_texCoord;
 

+ 3 - 0
gameplay/res/shaders/form.vert

@@ -1,10 +1,13 @@
+///////////////////////////////////////////////////////////
 // Attributes
 attribute vec3 a_position;
 attribute vec2 a_texCoord;
 
+///////////////////////////////////////////////////////////
 // Uniforms
 uniform mat4 u_worldViewProjectionMatrix;
 
+///////////////////////////////////////////////////////////
 // Varyings
 varying vec2 v_texCoord;
 

+ 0 - 41
gameplay/res/shaders/lighting-directional.frag

@@ -1,41 +0,0 @@
-#if defined(BUMPED)
-
-vec3 getLitPixel()
-{
-    // Fetch normals from the normal map
-    vec3 normalVector = normalize(texture2D(u_normalmapTexture, v_texCoord).rgb * 2.0 - 1.0);
-    vec3 lightDirection = normalize(v_lightDirection);
-    
-    #if defined(SPECULAR)
-    
-    vec3 cameraDirection = normalize(v_cameraDirection);
-    return computeLighting(normalVector, -lightDirection, 1.0, cameraDirection);
-    
-    #else
-    
-    return computeLighting(normalVector, -lightDirection, 1.0);
-    
-    #endif
-}
-
-#else
-
-vec3 getLitPixel()
-{
-    // Normalize the vectors.
-    vec3 normalVector = normalize(v_normalVector);
-    vec3 lightDirection = normalize(u_lightDirection);
-
-    #if defined(SPECULAR)
-    
-    vec3 cameraDirection = normalize(v_cameraDirection);
-    return computeLighting(normalVector, -lightDirection, 1.0, cameraDirection);
-    
-    #else
-    
-    return computeLighting(normalVector, -lightDirection, 1.0);
-    
-    #endif
-}
-
-#endif

+ 0 - 31
gameplay/res/shaders/lighting-directional.vert

@@ -1,31 +0,0 @@
-#if defined(BUMPED)
-
-void applyLight(mat3 tangentSpaceTransformMatrix)
-{
-    // Transform light direction to tangent space
-    v_lightDirection = tangentSpaceTransformMatrix * u_lightDirection;
-    
-    #if defined(SPECULAR)
-
-    // Compute the camera direction for specular lighting
-	vec4 positionWorldViewSpace = u_worldViewMatrix * a_position;
-    v_cameraDirection = u_cameraPosition - positionWorldViewSpace.xyz;
-
-    #endif
-}
-
-#else
-
-void applyLight(vec4 position)
-{
-    
-    #if defined(SPECULAR)
-
-    // Compute the camera direction for specular lighting
-	vec4 positionWorldViewSpace = u_worldViewMatrix * position;
-    v_cameraDirection = u_cameraPosition - positionWorldViewSpace.xyz;
-
-    #endif
-}
-
-#endif

+ 0 - 46
gameplay/res/shaders/lighting-point.frag

@@ -1,46 +0,0 @@
-#if defined(BUMPED)
-
-vec3 getLitPixel()
-{
-    // Fetch normals from the normal map and normalize the vectors
-    vec3 normalVector = normalize(texture2D(u_normalmapTexture, v_texCoord).rgb * 2.0 - 1.0);
-    vec3 vertexToPointLightDirection = normalize(v_vertexToPointLightDirection);
-    
-    float pointLightAttenuation = clamp(v_pointLightAttenuation, 0.0, 1.0);
-    
-    #if defined(SPECULAR)
-    
-    vec3 cameraDirection = normalize(v_cameraDirection);
-    return computeLighting(normalVector, vertexToPointLightDirection, pointLightAttenuation, cameraDirection);
-    
-    #else
-    
-    return computeLighting(normalVector, vertexToPointLightDirection, pointLightAttenuation);
-    
-    #endif
-}
-
-#else
-
-vec3 getLitPixel()
-{
-    // Normalize the vectors.
-    vec3 normalVector = normalize(v_normalVector);    
-    vec3 vertexToPointLightDirection = normalize(v_vertexToPointLightDirection);
-    
-    // Fetch point light attenuation.
-    float pointLightAttenuation = v_pointLightAttenuation;
-    
-    #if defined (SPECULAR)
-    
-    vec3 cameraDirection = normalize(v_cameraDirection);    
-    return computeLighting(normalVector, vertexToPointLightDirection, pointLightAttenuation, cameraDirection);
-    
-    #else
-    
-    return computeLighting(normalVector, vertexToPointLightDirection, pointLightAttenuation);
-    
-    #endif
-}
-
-#endif

+ 0 - 50
gameplay/res/shaders/lighting-point.vert

@@ -1,50 +0,0 @@
-#if defined(BUMPED)
-
-void applyLight(mat3 tangentSpaceTransformMatrix)
-{
-    vec4 positionWorldViewSpace = u_worldViewMatrix * a_position;
-    
-    // Compute the light direction with light position and the vertex position.
-    vec3 lightDirection = u_pointLightPosition - positionWorldViewSpace.xyz;
-    
-    // Transform current light direction to tangent space.
-    vec3 vertexToPointLightDirection = tangentSpaceTransformMatrix * lightDirection;
-
-    // Attenuation
-    v_pointLightAttenuation = 1.0 - dot(lightDirection * u_pointLightRangeInverse, lightDirection * u_pointLightRangeInverse);
-
-    // Output light direction.
-    v_vertexToPointLightDirection =  vertexToPointLightDirection;
-    
-    #if defined (SPECULAR)
- 
-    // Compute camera direction and transform it to tangent space.
-    v_cameraDirection = tangentSpaceTransformMatrix * (u_cameraPosition - positionWorldViewSpace.xyz);
-    
-    #endif
-}
-
-#else
-
-void applyLight(vec4 position)
-{
-    // World view space position.
-	vec4 positionWorldViewSpace = u_worldViewMatrix * position;
-    
-    // Compute the light direction with light position and the vertex position.
-	v_vertexToPointLightDirection = u_pointLightPosition - positionWorldViewSpace.xyz;
-   
-    // Attenuation
-    v_pointLightAttenuation = 1.0 - dot(v_vertexToPointLightDirection * u_pointLightRangeInverse, v_vertexToPointLightDirection * u_pointLightRangeInverse);
-
-    // Output light direction.
-    //v_vertexToPointLightDirection = lightDirection;
-   
-    #if defined (SPECULAR)  
-
-	v_cameraDirection = u_cameraPosition - positionWorldViewSpace.xyz;
-	
-    #endif
-}
-
-#endif

+ 0 - 63
gameplay/res/shaders/lighting-spot.frag

@@ -1,63 +0,0 @@
-float lerpstep( float lower, float upper, float s)
-{
-    return clamp( ( s - lower ) / ( upper - lower ), 0.0, 1.0 );
-}
-
-#if defined(BUMPED)
-
-vec3 getLitPixel()
-{
-    // Fetch normals from the normal map.
-    vec3 normalVector = normalize(texture2D(u_normalmapTexture, v_texCoord).rgb * 2.0 - 1.0);
-    vec3 spotLightDirection = normalize(v_spotLightDirection);
-    vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection);
-    
-    // "-lightDirection" because light direction points in opposite direction to to spot direction.
-    float spotCurrentAngleCos = dot(spotLightDirection, -vertexToSpotLightDirection);
-    
-    // Intensity of spot depends on the spot light attenuation and the part of the cone vertexToSpotLightDirection points to (inner or outer).
-    float spotLightAttenuation = clamp(v_spotLightAttenuation, 0.0, 1.0);
-    spotLightAttenuation *= lerpstep(u_spotLightOuterAngleCos, u_spotLightInnerAngleCos, spotCurrentAngleCos);
-
-    #if defined(SPECULAR)
-    
-    vec3 cameraDirection = normalize(v_cameraDirection);
-    return computeLighting(normalVector, vertexToSpotLightDirection, spotLightAttenuation, cameraDirection);
-    
-    #else
-    
-    return computeLighting(normalVector, vertexToSpotLightDirection, spotLightAttenuation);
-    
-    #endif
-}
-
-#else
-
-vec3 getLitPixel()
-{
-    // Normalize the vectors.
-    vec3 normalVector = normalize(v_normalVector);
-    vec3 spotLightDirection = normalize(u_spotLightDirection); 
-    vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection);
-
-    // "-lightDirection" is used because light direction points in opposite direction to spot direction.
-    float spotCurrentAngleCos = dot(spotLightDirection, -vertexToSpotLightDirection);
-    
-    // Intensity of spot depends on the spot light attenuation and the 
-    // part of the cone vertexToSpotLightDirection points to (inner or outer).
-    float spotLightAttenuation = clamp(v_spotLightAttenuation, 0.0, 1.0);
-    spotLightAttenuation *= lerpstep(u_spotLightOuterAngleCos, u_spotLightInnerAngleCos, spotCurrentAngleCos);
-
-    #if defined(SPECULAR)
-    
-    vec3 cameraDirection = normalize(v_cameraDirection);
-    return computeLighting(normalVector, vertexToSpotLightDirection, spotLightAttenuation, cameraDirection);
-    
-    #else
-    
-    return computeLighting(normalVector, vertexToSpotLightDirection, spotLightAttenuation);
-    
-    #endif
-}
-
-#endif

+ 0 - 52
gameplay/res/shaders/lighting-spot.vert

@@ -1,52 +0,0 @@
-#if defined(BUMPED)
-
-void applyLight(mat3 tangentSpaceTransformMatrix)
-{
-    //vec4 positionWorldSpace = u_worldMatrix * a_position;
-	vec4 positionWorldViewSpace = u_worldViewMatrix * a_position;
-
-    // Transform spot light direction to tangent space.
-    v_spotLightDirection = tangentSpaceTransformMatrix * u_spotLightDirection;
-
-    // Compute the light direction with light position and the vertex position.
-	vec3 lightDirection = u_spotLightPosition - positionWorldViewSpace.xyz;
-    
-    // Transform current light direction to tangent space.
-    lightDirection = tangentSpaceTransformMatrix * lightDirection;
-    
-    // Attenuation
-    v_spotLightAttenuation = 1.0 - dot(lightDirection * u_spotLightRangeInverse, lightDirection * u_spotLightRangeInverse);
-
-    // Output light direction.
-    v_vertexToSpotLightDirection = lightDirection;
-    
-    #if defined(SPECULAR)
-    
-    // Compute camera direction and transform it to tangent space.
-	v_cameraDirection = tangentSpaceTransformMatrix * (u_cameraPosition - positionWorldViewSpace.xyz);
-    
-    #endif
-}
-
-#else
-
-void applyLight(vec4 position)
-{
-    // World view space position.
-	vec4 positionWorldViewSpace = u_worldViewMatrix * position;
-
-    // Compute the light direction with light position and the vertex position.
-	v_vertexToSpotLightDirection = u_spotLightPosition - positionWorldViewSpace.xyz;
-    
-    // Attenuation
-    v_spotLightAttenuation = 1.0 - dot(v_vertexToSpotLightDirection * u_spotLightRangeInverse, v_vertexToSpotLightDirection * u_spotLightRangeInverse);
-  
-    // Compute camera direction and transform it to tangent space.
-	#if defined(SPECULAR)
-	
-	v_cameraDirection = u_cameraPosition - positionWorldViewSpace.xyz;
-	
-	#endif
-}
-
-#endif

+ 79 - 38
gameplay/res/shaders/lighting.frag

@@ -1,46 +1,87 @@
-vec4 _baseColor;
-vec3 _ambientColor;
-vec3 _diffuseColor;
 
-#if defined(SPECULAR)
+vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, float attenuation)
+{
+    float diffuse = clamp(dot(normalVector, lightDirection), 0.0, 1.0);
+    vec3 diffuseColor = lightColor * _baseColor.rgb * diffuse;
 
-vec3 _specularColor;
+    #if defined(SPECULAR)
 
-vec3 computeLighting(vec3 normalVector, vec3 lightDirection, float attenuation, vec3 cameraDirection)
-{
-    // Ambient
-    _ambientColor = _baseColor.rgb * u_ambientColor;
-
-    // Diffuse
-    float ddot = dot(normalVector, lightDirection);
-    float diffuseIntensity = attenuation * ddot;
-    diffuseIntensity = max(0.0, diffuseIntensity);
-    _diffuseColor = u_lightColor * _baseColor.rgb * diffuseIntensity;
-
-    // Specular
-    vec3 halfVector = normalize(lightDirection + cameraDirection);
-    float specularIntensity = attenuation * max(0.0, pow(dot(normalVector, halfVector), u_specularExponent));
-    specularIntensity = max(0.0, specularIntensity);
-    _specularColor = u_lightColor * _baseColor.rgb * specularIntensity;
-	
-	return _ambientColor + _diffuseColor + _specularColor;
-}
+	// Blinn-Phong shading
+    vec3 vertexToEye = normalize(v_cameraDirection); 
+    vec3 halfDirection = normalize(lightDirection + v_cameraDirection);
+    float specularAngle = max(dot(halfDirection, normalVector), 0.0);
+    vec3 specularColor = pow(specularAngle, u_specularExponent);
 
-#else
+    return (diffuseColor + specularColor) * attenuation;
 
-vec3 computeLighting(vec3 normalVector, vec3 lightDirection, float attenuation)
-{
-    // Ambient
-    _ambientColor = _baseColor.rgb * u_ambientColor;
-
-    // Diffuse
-	float ddot = dot(normalVector, lightDirection);
-    float diffuseIntensity = attenuation * ddot;
-    diffuseIntensity = max(0.0, diffuseIntensity);
-    _diffuseColor = u_lightColor * _baseColor.rgb * diffuseIntensity;
-	
-	return _ambientColor + _diffuseColor;
+    #else
+    
+        return diffuseColor * attenuation;
+    
+    #endif
 }
 
-#endif
+vec3 getLitPixel()
+{
+    #if defined(BUMPED)
+    
+    vec3 normalVector = normalize(texture2D(u_normalmapTexture, v_texCoord).rgb * 2.0 - 1.0);
+    
+    #else
+    
+    vec3 normalVector = normalize(v_normalVector);
+    
+    #endif
+    
+    vec3 ambientColor = _baseColor.rgb * u_ambientColor;
+    vec3 combinedColor = ambientColor;
+
+    // Directional light contribution
+    #if (DIRECTIONAL_LIGHT_COUNT > 0)
+    for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; ++i)
+    {
+        #if defined(BUMPED)
+        vec3 lightDirection = normalize(v_directionalLightDirection[i]);
+        #else
+        vec3 lightDirection = normalize(u_directionalLightDirection[i]);
+        #endif 
+        combinedColor += computeLighting(normalVector, -lightDirection, u_directionalLightColor[i], 1.0);
+    }
+    #endif
 
+    // Point light contribution
+    #if (POINT_LIGHT_COUNT > 0)
+    for (int i = 0; i < POINT_LIGHT_COUNT; ++i)
+    {
+        vec3 ldir = v_vertexToPointLightDirection[i] * u_pointLightRangeInverse[i];
+        float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0);
+        combinedColor += computeLighting(normalVector, normalize(v_vertexToPointLightDirection[i]), u_pointLightColor[i], attenuation);
+    }
+    #endif
+
+    // Spot light contribution
+    #if (SPOT_LIGHT_COUNT > 0)
+    for (int i = 0; i < SPOT_LIGHT_COUNT; ++i)
+    {
+        // Compute range attenuation
+        vec3 ldir = v_vertexToSpotLightDirection[i] * u_spotLightRangeInverse[i];
+        float att = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0);
+        vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection[i]);
+
+        // TODO: 
+        // Let app normalize this! Need Node::getForwardVectorViewNorm
+        // This needs to be in TANGENT SPACE for bump mapping
+        // and should always pass from vertex shader via v_spotLightDirection[i]
+        vec3 spotLightDirection = normalize(u_spotLightDirection[i]);
+
+        // "-lightDirection" is used because light direction points in opposite direction to spot direction.
+        float spotCurrentAngleCos = dot(spotLightDirection, -vertexToSpotLightDirection);
+
+		// Apply spot attenuation
+        att *= smoothstep(u_spotLightOuterAngleCos[i], u_spotLightInnerAngleCos[i], spotCurrentAngleCos);
+        combinedColor += computeLighting(normalVector, vertexToSpotLightDirection, u_spotLightColor[i], att);
+    }
+    #endif
+    
+    return combinedColor;
+}

+ 66 - 0
gameplay/res/shaders/lighting.vert

@@ -0,0 +1,66 @@
+
+#if defined(BUMPED)
+void applyLight(vec4 position, mat3 tangentSpaceTransformMatrix)
+{
+    #if (defined(SPECULAR) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0))
+    vec4 positionWorldViewSpace = u_worldViewMatrix * position;
+    #endif
+    
+    #if (DIRECTIONAL_LIGHT_COUNT > 0)
+    for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; ++i)
+    {
+        // Transform light direction to tangent space
+        v_directionalLightDirection[i] = tangentSpaceTransformMatrix * u_directionalLightDirection[i];
+    }
+    #endif
+    
+    #if (POINT_LIGHT_COUNT > 0)
+    for (int i = 0; i < POINT_LIGHT_COUNT; ++i)
+    {
+        // Compute the vertex to light direction, in tangent space
+        v_vertexToPointLightDirection[i] = tangentSpaceTransformMatrix * (u_pointLightPosition[i] - positionWorldViewSpace.xyz);
+    }
+    #endif
+    
+    #if (SPOT_LIGHT_COUNT > 0)
+    for (int i = 0; i < SPOT_LIGHT_COUNT; ++i)
+    {
+        // Compute the vertex to light direction, in tangent space
+	    v_vertexToSpotLightDirection[i] = tangentSpaceTransformMatrix * (u_spotLightPosition[i] - positionWorldViewSpace.xyz);
+    }
+    #endif
+    
+    #if defined(SPECULAR)
+    // Compute camera direction and transform it to tangent space.
+    v_cameraDirection = tangentSpaceTransformMatrix * (u_cameraPosition - positionWorldViewSpace.xyz);
+    #endif
+}
+#else
+void applyLight(vec4 position)
+{
+    #if defined(SPECULAR) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0)
+	vec4 positionWorldViewSpace = u_worldViewMatrix * position;
+    #endif
+    
+    #if (POINT_LIGHT_COUNT > 0)
+    for (int i = 0; i < POINT_LIGHT_COUNT; ++i)
+    {
+        // Compute the light direction with light position and the vertex position.
+        v_vertexToPointLightDirection[i] = u_pointLightPosition[i] - positionWorldViewSpace.xyz;
+    }
+    #endif
+    
+    #if (SPOT_LIGHT_COUNT > 0)
+    for (int i = 0; i < SPOT_LIGHT_COUNT; ++i)
+    {
+        // Compute the light direction with light position and the vertex position.
+	    v_vertexToSpotLightDirection[i] = u_spotLightPosition[i] - positionWorldViewSpace.xyz;
+    }
+    #endif
+
+    #if defined(SPECULAR)  
+	v_cameraDirection = u_cameraPosition - positionWorldViewSpace.xyz;
+    #endif
+}
+
+#endif

+ 0 - 2
gameplay/res/shaders/skinning-none.vert

@@ -11,7 +11,6 @@ vec3 getNormal()
 }
 
 #if defined(BUMPED)
-
 vec3 getTangent()
 {
     return a_tangent;
@@ -21,7 +20,6 @@ vec3 getBinormal()
 {
     return a_binormal;
 }
-
 #endif
 
 #endif

+ 33 - 15
gameplay/res/shaders/skinning.vert

@@ -1,7 +1,5 @@
+
 vec4 _skinnedPosition;
-#if defined(LIGHTING)
-vec3 _skinnedNormal;
-#endif
 
 void skinPosition(float blendWeight, int matrixIndex)
 {
@@ -16,29 +14,25 @@ void skinPosition(float blendWeight, int matrixIndex)
 vec4 getPosition()
 {
     _skinnedPosition = vec4(0.0);
-
-    // Transform position to view space using matrix palette with four matrices used to transform a vertex.
     float blendWeight = a_blendWeights[0];
     int matrixIndex = int (a_blendIndices[0]) * 3;
     skinPosition(blendWeight, matrixIndex);
-
     blendWeight = a_blendWeights[1];
     matrixIndex = int(a_blendIndices[1]) * 3;
     skinPosition(blendWeight, matrixIndex);
-
     blendWeight = a_blendWeights[2];
     matrixIndex = int(a_blendIndices[2]) * 3;
     skinPosition(blendWeight, matrixIndex);
-
     blendWeight = a_blendWeights[3];
     matrixIndex = int(a_blendIndices[3]) * 3;
     skinPosition(blendWeight, matrixIndex);
-
     return _skinnedPosition;    
 }
 
 #if defined(LIGHTING)
 
+vec3 _skinnedNormal;
+
 void skinTangentSpaceVector(vec3 vector, float blendWeight, int matrixIndex)
 {
     vec3 tmp;
@@ -51,24 +45,19 @@ void skinTangentSpaceVector(vec3 vector, float blendWeight, int matrixIndex)
 vec3 getTangentSpaceVector(vec3 vector)
 {
     _skinnedNormal = vec3(0.0);
-
     // Transform normal to view space using matrix palette with four matrices used to transform a vertex.
     float blendWeight = a_blendWeights[0];
     int matrixIndex = int (a_blendIndices[0]) * 3;
     skinTangentSpaceVector(vector, blendWeight, matrixIndex);
-
     blendWeight = a_blendWeights[1];
     matrixIndex = int(a_blendIndices[1]) * 3;
     skinTangentSpaceVector(vector, blendWeight, matrixIndex);
-
     blendWeight = a_blendWeights[2];
     matrixIndex = int(a_blendIndices[2]) * 3;
     skinTangentSpaceVector(vector, blendWeight, matrixIndex);
-
     blendWeight = a_blendWeights[3];
     matrixIndex = int(a_blendIndices[3]) * 3;
     skinTangentSpaceVector(vector, blendWeight, matrixIndex);
-
     return _skinnedNormal;
 }
 
@@ -90,4 +79,33 @@ vec3 getBinormal()
 }
 
 #endif
-#endif
+
+#endif
+
+#else
+
+vec4 getPosition()
+{
+    return a_position;    
+}
+
+#if defined(LIGHTING)
+
+vec3 getNormal()
+{
+    return a_normal;
+}
+
+#if defined(BUMPED)
+vec3 getTangent()
+{
+    return a_tangent;
+}
+
+vec3 getBinormal()
+{
+    return a_binormal;
+}
+#endif
+
+#endif

+ 2 - 0
gameplay/res/shaders/sprite.frag

@@ -2,9 +2,11 @@
 precision highp float;
 #endif
 
+///////////////////////////////////////////////////////////
 // Uniforms
 uniform sampler2D u_texture;
 
+///////////////////////////////////////////////////////////
 // Varyings
 varying vec2 v_texCoord;
 varying vec4 v_color;

+ 3 - 0
gameplay/res/shaders/sprite.vert

@@ -1,11 +1,14 @@
+///////////////////////////////////////////////////////////
 // Attributes
 attribute vec3 a_position;
 attribute vec2 a_texCoord;
 attribute vec4 a_color;
 
+///////////////////////////////////////////////////////////
 // Uniforms
 uniform mat4 u_projectionMatrix;
 
+///////////////////////////////////////////////////////////
 // Varyings
 varying vec2 v_texCoord;
 varying vec4 v_color;

+ 7 - 6
gameplay/res/shaders/terrain.vert

@@ -1,20 +1,21 @@
+///////////////////////////////////////////////////////////
 // Attributes
-attribute vec4 a_position;									// Vertex Position							(x, y, z, w)
+attribute vec4 a_position;
 #ifndef NORMAL_MAP
-attribute vec3 a_normal;									// Vertex Normal							(x, y, z)
+attribute vec3 a_normal;
 #endif
 attribute vec2 a_texCoord0;
 
 // Uniforms
-uniform mat4 u_worldViewProjectionMatrix;					// World view projection matrix
+uniform mat4 u_worldViewProjectionMatrix;
 #ifndef NORMAL_MAP
-uniform mat4 u_normalMatrix;					            // Matrix used for normal vector transformation
+uniform mat4 u_normalMatrix;
 #endif
-uniform vec3 u_lightDirection;								// Direction of light
+uniform vec3 u_lightDirection;
 
 // Varyings
 #ifndef NORMAL_MAP
-varying vec3 v_normalVector;								// Normal vector out
+varying vec3 v_normalVector;
 #endif
 varying vec2 v_texCoord0;
 #if LAYER_COUNT > 0

+ 0 - 76
gameplay/res/shaders/textured-bumped.frag

@@ -1,76 +0,0 @@
-#define LIGHTING
-#define BUMPED
-
-#ifdef OPENGL_ES
-precision highp float;
-#endif
-
-// Uniforms
-uniform sampler2D u_diffuseTexture;        		// Diffuse map texture
-uniform sampler2D u_normalmapTexture;       	// Normalmap texture
-uniform vec3 u_ambientColor;                    // Ambient color
-uniform vec3 u_lightColor;                      // Light color
-uniform vec3 u_lightDirection;					// Light direction
-#if defined(SPECULAR)
-uniform float u_specularExponent;				// Specular exponent.
-#endif
-#if defined (SPOT_LIGHT)
-uniform float u_spotLightInnerAngleCos;			// The bright spot [0.0 - 1.0]
-uniform float u_spotLightOuterAngleCos;			// The soft outer part [0.0 - 1.0]
-#endif
-#if defined(MODULATE_COLOR)
-uniform vec4 u_modulateColor;					// Modulation color
-#endif
-#if defined(MODULATE_ALPHA)
-uniform float u_modulateAlpha;					// Modulation alpha
-#endif
-
-// Varyings
-varying vec3 v_normalVector;					// Normal vector in view space
-varying vec2 v_texCoord;						// Texture Coordinate
-#if defined(POINT_LIGHT)
-varying vec3 v_vertexToPointLightDirection;		// Light direction w.r.t current vertex in tangent space.
-varying float v_pointLightAttenuation;			// Attenuation of point light.
-#elif defined(SPOT_LIGHT)
-varying vec3 v_spotLightDirection;				// Direction of spot light in tangent space.
-varying vec3 v_vertexToSpotLightDirection;		// Direction of the spot light w.r.t current vertex in tangent space.
-varying float v_spotLightAttenuation;			// Attenuation of spot light.
-#else
-varying vec3 v_lightDirection;					// Direction of light in tangent space.
-#endif
-#if defined(SPECULAR)
-varying vec3 v_cameraDirection;                 // Camera direction
-#endif
-
-// Lighting
-#include "lighting.frag"
-#if defined(POINT_LIGHT)
-#include "lighting-point.frag"
-#elif defined(SPOT_LIGHT)
-#include "lighting-spot.frag"
-#else
-#include "lighting-directional.frag"
-#endif
-
-
-void main()
-{
-    // Fetch diffuse color from texture.
-    _baseColor = texture2D(u_diffuseTexture, v_texCoord);
-
-    // Light the pixel
-    gl_FragColor.a = _baseColor.a;
-    #if defined(TEXTURE_DISCARD_ALPHA)
-    if (gl_FragColor.a < 0.5)
-        discard;
-    #endif
-    gl_FragColor.rgb = getLitPixel();
-
-    // Global color modulation
-    #if defined(MODULATE_COLOR)
-    gl_FragColor *= u_modulateColor;
-    #endif
-    #if defined(MODULATE_ALPHA)
-    gl_FragColor.a *= u_modulateAlpha;
-    #endif
-}

+ 0 - 106
gameplay/res/shaders/textured-bumped.vert

@@ -1,106 +0,0 @@
-#define LIGHTING
-#define BUMPED
-
-// Inputs
-attribute vec4 a_position;									// Vertex Position							(x, y, z, w)
-attribute vec3 a_normal;									// Vertex Normal							(x, y, z)
-attribute vec2 a_texCoord;									// Vertex Texture Coordinate				(u, v)
-attribute vec3 a_tangent;									// Vertex Tangent							(x, y, z)
-attribute vec3 a_binormal;									// Vertex Binormal/Bitangent				(x, y, z)
-#if defined(SKINNING)
-attribute vec4 a_blendWeights;								// Vertex blend weight, up to 4				(0, 1, 2, 3) 
-attribute vec4 a_blendIndices;								// Vertex blend index int u_matrixPalette	(0, 1, 2, 3)
-#endif
-
-// Uniforms
-uniform mat4 u_worldViewProjectionMatrix;					// Matrix to transform a position to clip space
-uniform mat4 u_inverseTransposeWorldViewMatrix;				// Matrix to transform a normal to view space
-#if defined(SPECULAR) || defined(SPOT_LIGHT) || defined(POINT_LIGHT)
-uniform mat4 u_worldViewMatrix;								// Matrix to tranform a position to view space
-uniform mat4 u_worldMatrix;								    // Matrix to tranform a position to world space
-#endif
-#if defined(SKINNING)
-uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];		// Array of 4x3 matrices
-#endif
-#if defined(SPECULAR)
-uniform vec3 u_cameraPosition;                 				// Position of the camera in view space
-#endif
-#if defined(TEXTURE_REPEAT)
-uniform vec2 u_textureRepeat;
-#endif
-#if defined(TEXTURE_OFFSET)
-uniform vec2 u_textureOffset;
-#endif
-#if defined(POINT_LIGHT)
-uniform vec3 u_pointLightPosition;							// Position of light
-uniform float u_pointLightRangeInverse;						// Inverse of light range
-#elif defined(SPOT_LIGHT)
-uniform vec3 u_spotLightPosition;							// Position of light
-uniform float u_spotLightRangeInverse;						// Inverse of light range
-uniform vec3 u_spotLightDirection;							// Direction of light
-#else
-uniform vec3 u_lightDirection;								// Direction of light
-#endif
-
-// Varyings
-varying vec3 v_normalVector;								// Normal vector in view space
-varying vec2 v_texCoord;									// Texture Coordinate
-#if defined(SPECULAR)
-varying vec3 v_cameraDirection;								// Direction the camera is looking at in tangent space
-#endif
-
-// Lighting
-#if defined(POINT_LIGHT)
-varying vec3 v_vertexToPointLightDirection;					// Direction of point light w.r.t current vertex in tangent space
-varying float v_pointLightAttenuation;						// Attenuation of point light
-#include "lighting-point.vert"
-#elif defined(SPOT_LIGHT)
-varying vec3 v_vertexToSpotLightDirection;					// Direction of the spot light w.r.t current vertex in tangent space
-varying float v_spotLightAttenuation;						// Attenuation of spot light
-varying vec3 v_spotLightDirection;							// Direction of spot light in tangent space
-#include "lighting-spot.vert"
-#else
-varying vec3 v_lightDirection;								// Direction of light
-#include "lighting-directional.vert"
-#endif
-
-// Skinning
-#if defined(SKINNING)
-#include "skinning.vert"
-#else
-#include "skinning-none.vert" 
-#endif
-
-
-void main()
-{
-    // Get the position, normal, tangents and binormals.
-    vec4 position = getPosition();
-    vec3 normal = getNormal();
-    vec3 tangent = getTangent();
-    vec3 binormal = getBinormal();
-    
-    // Transform position to clip space.
-    gl_Position = u_worldViewProjectionMatrix * position;
-
-    // Transform the normal, tangent and binormals to view space.
-	mat3 inverseTransposeWorldViewMatrix = mat3(u_inverseTransposeWorldViewMatrix[0].xyz, u_inverseTransposeWorldViewMatrix[1].xyz, u_inverseTransposeWorldViewMatrix[2].xyz);
-    vec3 normalVector = normalize(inverseTransposeWorldViewMatrix * normal);
-    
-    // Create a transform to convert a vector to tangent space.
-    vec3 tangentVector  = normalize(inverseTransposeWorldViewMatrix * tangent);
-    vec3 binormalVector = normalize(inverseTransposeWorldViewMatrix * binormal);
-    mat3 tangentSpaceTransformMatrix = mat3(tangentVector.x, binormalVector.x, normalVector.x, tangentVector.y, binormalVector.y, normalVector.y, tangentVector.z, binormalVector.z, normalVector.z);
-    
-    // Apply light.
-    applyLight(tangentSpaceTransformMatrix);
-    
-    // Texture transformation.
-    v_texCoord = a_texCoord;
-    #if defined(TEXTURE_REPEAT)
-    v_texCoord *= u_textureRepeat;
-    #endif
-    #if defined(TEXTURE_OFFSET)
-    v_texCoord += u_textureOffset;
-    #endif
-}

+ 0 - 47
gameplay/res/shaders/textured-unlit.frag

@@ -1,47 +0,0 @@
-#ifdef OPENGL_ES
-precision highp float;
-#endif
-
-// Uniforms
-uniform sampler2D u_diffuseTexture;     	// Diffuse texture
-#if defined(TEXTURE_LIGHTMAP)
-uniform sampler2D u_lightmapTexture;     	// Lightmap texture
-#endif
-#if defined(MODULATE_COLOR)
-uniform vec4 u_modulateColor;               // Modulation color
-#endif
-#if defined(MODULATE_ALPHA)
-uniform float u_modulateAlpha;              // Modulation alpha
-#endif
-
-// Varyings
-varying vec2 v_texCoord0;                	// Texture coordinate(u, v)
-#if defined(TEXCOORD1)
-varying vec2 v_texCoord1;                   // Second tex coord for multi-texturing
-#endif
-
-
-void main()
-{
-    // Sample the texture for the color
-    gl_FragColor = texture2D(u_diffuseTexture, v_texCoord0);
-    #if defined(TEXTURE_DISCARD_ALPHA)
-    if (gl_FragColor.a < 0.5)
-        discard;
-    #endif
-    #if defined(TEXTURE_LIGHTMAP)
-    #if defined(TEXCOORD1)
-    vec4 lightColor = texture2D(u_lightmapTexture, v_texCoord1);
-    #else
-    vec4 lightColor = texture2D(u_lightmapTexture, v_texCoord0);
-    #endif
-    gl_FragColor.rgb *= lightColor.rgb;
-    #endif
-    // Global color modulation
-    #if defined(MODULATE_COLOR)
-    gl_FragColor *= u_modulateColor;
-    #endif
-    #if defined(MODULATE_ALPHA)
-    gl_FragColor.a *= u_modulateAlpha;
-    #endif
-}

+ 0 - 57
gameplay/res/shaders/textured-unlit.vert

@@ -1,57 +0,0 @@
-// Attributes
-attribute vec4 a_position;									// Vertex Position							(x, y, z, w)
-attribute vec2 a_texCoord0;									// Vertex Texture Coordinate				(u, v)
-#if defined(TEXCOORD1)
-attribute vec2 a_texCoord1;                                 // Second tex coord for multi-texturing
-#endif
-#if defined(SKINNING)
-attribute vec4 a_blendWeights;								// Vertex blend weight, up to 4				(0, 1, 2, 3) 
-attribute vec4 a_blendIndices;								// Vertex blend index int u_matrixPalette	(0, 1, 2, 3)
-#endif
-
-// Uniforms
-uniform mat4 u_worldViewProjectionMatrix;					// Matrix to transform a position to clip space
-#if defined(SKINNING)
-uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];		// Array of 4x3 matrices
-#endif
-#if defined(TEXTURE_REPEAT)
-uniform vec2 u_textureRepeat;								// Texture repeat for tiling
-#endif
-#if defined(TEXTURE_OFFSET)
-uniform vec2 u_textureOffset;								// Texture offset
-#endif
-
-// Varyings
-varying vec2 v_texCoord0;									// Texture Coordinate
-#if defined(TEXCOORD1)
-varying vec2 v_texCoord1;                                   // Second tex coord for multi-texturing
-#endif
-
-// Skinning 
-#if defined(SKINNING)
-#include "skinning.vert"
-#else
-#include "skinning-none.vert" 
-#endif
-
-
-void main()
-{
-    // Get the vertex position
-    vec4 position = getPosition();
-
-    // Transform position to clip space.
-    gl_Position = u_worldViewProjectionMatrix * position;
-
-    // Texture transformation.
-    v_texCoord0 = a_texCoord0;
-    #if defined(TEXCOORD1)
-    v_texCoord1 = a_texCoord1;
-    #endif
-    #if defined(TEXTURE_REPEAT)
-    v_texCoord0 *= u_textureRepeat;
-    #endif
-    #if defined(TEXTURE_OFFSET)
-    v_texCoord0 += u_textureOffset;
-    #endif
-}

+ 102 - 39
gameplay/res/shaders/textured.frag

@@ -1,73 +1,136 @@
-#define LIGHTING
-
 #ifdef OPENGL_ES
 precision highp float;
 #endif
 
+#ifndef DIRECTIONAL_LIGHT_COUNT
+#define DIRECTIONAL_LIGHT_COUNT 0
+#endif
+#ifndef SPOT_LIGHT_COUNT
+#define SPOT_LIGHT_COUNT 0
+#endif
+#ifndef POINT_LIGHT_COUNT
+#define POINT_LIGHT_COUNT 0
+#endif
+#if (DIRECTIONAL_LIGHT_COUNT > 0) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0)
+#define LIGHTING
+#endif
+
+///////////////////////////////////////////////////////////
 // Uniforms
-uniform sampler2D u_diffuseTexture;             // Diffuse map texture
-uniform vec3 u_ambientColor;                    // Ambient color
-uniform vec3 u_lightColor;                      // Light color
-uniform vec3 u_lightDirection;					// Light direction
+uniform vec3 u_ambientColor;
+
+uniform sampler2D u_diffuseTexture;
+
+#if defined(LIGHTMAP)
+uniform sampler2D u_lightmapTexture;
+#endif
+
+#if defined(LIGHTING)
+
+#if defined(BUMPED)
+uniform sampler2D u_normalmapTexture;
+#endif
+
+#if (DIRECTIONAL_LIGHT_COUNT > 0)
+uniform vec3 u_directionalLightColor[DIRECTIONAL_LIGHT_COUNT];
+uniform vec3 u_directionalLightDirection[DIRECTIONAL_LIGHT_COUNT];
+#endif
+
+#if (POINT_LIGHT_COUNT > 0)
+uniform vec3 u_pointLightColor[POINT_LIGHT_COUNT];
+uniform vec3 u_pointLightPosition[POINT_LIGHT_COUNT];
+uniform float u_pointLightRangeInverse[POINT_LIGHT_COUNT];
+#endif
+
+#if (SPOT_LIGHT_COUNT > 0)
+uniform vec3 u_spotLightColor[SPOT_LIGHT_COUNT];
+uniform vec3 u_spotLightDirection[SPOT_LIGHT_COUNT];
+uniform float u_spotLightRangeInverse[SPOT_LIGHT_COUNT];
+uniform float u_spotLightInnerAngleCos[SPOT_LIGHT_COUNT];
+uniform float u_spotLightOuterAngleCos[SPOT_LIGHT_COUNT];
+#endif
+
 #if defined(SPECULAR)
-uniform float u_specularExponent;				// Specular exponent
+uniform float u_specularExponent;
 #endif
+
+#endif
+
 #if defined(MODULATE_COLOR)
-uniform vec4 u_modulateColor;               	// Modulation color
+uniform vec4 u_modulateColor;
 #endif
+
 #if defined(MODULATE_ALPHA)
-uniform float u_modulateAlpha;              	// Modulation alpha
+uniform float u_modulateAlpha;
 #endif
 
+///////////////////////////////////////////////////////////
+// Variables
+vec4 _baseColor;
+
+///////////////////////////////////////////////////////////
 // Varyings
-varying vec3 v_normalVector;                    // Normal vector in view space
-varying vec2 v_texCoord;                        // Texture coordinate
-#if defined(POINT_LIGHT)
-varying vec3 v_vertexToPointLightDirection;		// Light direction w.r.t current vertex in tangent space.
-varying float v_pointLightAttenuation;			// Attenuation of point light.
-#elif defined(SPOT_LIGHT)
-varying vec3 v_spotLightDirection;				// Direction of spot light in tangent space.
-varying vec3 v_vertexToSpotLightDirection;		// Direction of the spot light w.r.t current vertex in tangent space.
-varying float v_spotLightAttenuation;			// Attenuation of spot light.
-#else
-varying vec3 v_lightDirection;					// Direction of light in tangent space.
+varying vec2 v_texCoord;
+
+#if defined(LIGHTMAP)
+varying vec2 v_texCoord1;
+#endif
+
+#if defined(LIGHTING)
+
+#if !defined(BUMPED)
+varying vec3 v_normalVector;
+#endif
+
+#if (defined(BUMPED) && (DIRECTIONAL_LIGHT_COUNT > 0))
+varying vec3 v_directionalLightDirection[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
+
 #if defined(SPECULAR)
-varying vec3 v_cameraDirection;                 // Camera direction
+varying vec3 v_cameraDirection; 
 #endif
 
-// Lighting 
 #include "lighting.frag"
-#if defined(POINT_LIGHT)
-#include "lighting-point.frag"
-#elif defined(SPOT_LIGHT)
-uniform float u_spotLightInnerAngleCos;			// The bright spot [0.0 - 1.0]
-uniform float u_spotLightOuterAngleCos;			// The soft outer part [0.0 - 1.0]
-uniform vec3 u_spotLightDirection;              // Direction of a spot light source
-#include "lighting-spot.frag"
-#else
-#include "lighting-directional.frag"
+
 #endif
 
 
 void main()
 {
-    // Sample the diffuse texture for base color
     _baseColor = texture2D(u_diffuseTexture, v_texCoord);
-
-    // Light the pixel
+ 
     gl_FragColor.a = _baseColor.a;
+
     #if defined(TEXTURE_DISCARD_ALPHA)
     if (gl_FragColor.a < 0.5)
         discard;
     #endif
+
+    #if defined(LIGHTING)
+
     gl_FragColor.rgb = getLitPixel();
-	
-	// Global color modulation
-	#if defined(MODULATE_COLOR)
-	gl_FragColor *= u_modulateColor;
+    #else
+    gl_FragColor.rgb = _baseColor.rgb;
+    #endif
+
+	#if defined(LIGHTMAP)
+	vec4 lightColor = texture2D(u_lightmapTexture, v_texCoord1);
+	gl_FragColor.rgb *= lightColor.rgb;
 	#endif
-	#if defined(MODULATE_ALPHA)
+
+    #if defined(MODULATE_COLOR)
+    gl_FragColor *= u_modulateColor;
+    #endif
+
+    #if defined(MODULATE_ALPHA)
     gl_FragColor.a *= u_modulateAlpha;
     #endif
 }

+ 123 - 52
gameplay/res/shaders/textured.vert

@@ -1,63 +1,116 @@
+#ifndef DIRECTIONAL_LIGHT_COUNT
+#define DIRECTIONAL_LIGHT_COUNT 0
+#endif
+#ifndef SPOT_LIGHT_COUNT
+#define SPOT_LIGHT_COUNT 0
+#endif
+#ifndef POINT_LIGHT_COUNT
+#define POINT_LIGHT_COUNT 0
+#endif
+#if (DIRECTIONAL_LIGHT_COUNT > 0) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0)
 #define LIGHTING
+#endif
+
+///////////////////////////////////////////////////////////
+// Atributes
+attribute vec4 a_position;
 
-// Attributes
-attribute vec4 a_position;									// Vertex position							(x, y, z, w)
-attribute vec3 a_normal;									// Vertex normal							(x, y, z)
-attribute vec2 a_texCoord;									// Vertex texture coordinate				(u, v)
 #if defined(SKINNING)
-attribute vec4 a_blendWeights;								// Vertex blend weight, up to 4				(0, 1, 2, 3) 
-attribute vec4 a_blendIndices;								// Vertex blend index int u_matrixPalette	(0, 1, 2, 3)
+attribute vec4 a_blendWeights;
+attribute vec4 a_blendIndices;
 #endif
 
-// Uniforms
-uniform mat4 u_worldViewProjectionMatrix;					// Matrix to transform a position to clip space
-uniform mat4 u_inverseTransposeWorldViewMatrix;				// Matrix to transform a normal to view space
-#if defined(SPECULAR) || defined(SPOT_LIGHT) || defined(POINT_LIGHT)
-uniform mat4 u_worldViewMatrix;								// Matrix to tranform a position to view space
+attribute vec2 a_texCoord;
+
+#if defined(LIGHTMAP)
+attribute vec2 a_texCoord1; 
 #endif
+
+#if defined(LIGHTING)
+attribute vec3 a_normal;
+
+#if defined(BUMPED)
+attribute vec3 a_tangent;
+attribute vec3 a_binormal;
+#endif
+
+#endif
+
+///////////////////////////////////////////////////////////
+// Uniforms
+uniform mat4 u_worldViewProjectionMatrix;
 #if defined(SKINNING)
-uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];		// Array of 4x3 matrices
+uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];
+#endif
+
+#if defined(LIGHTING)
+uniform mat4 u_inverseTransposeWorldViewMatrix;
+
+#if defined(SPECULAR) || (POINT_LIGHT_COUNT > 0) || (SPOT_LIGHT_COUNT > 0)
+uniform mat4 u_worldViewMatrix;
 #endif
+
+#if (DIRECTIONAL_LIGHT_COUNT > 0)
+uniform vec3 u_directionalLightDirection[DIRECTIONAL_LIGHT_COUNT];
+#endif
+
+#if (POINT_LIGHT_COUNT > 0)
+uniform vec3 u_pointLightPosition[POINT_LIGHT_COUNT];
+#endif
+
+#if (SPOT_LIGHT_COUNT > 0) 
+uniform vec3 u_spotLightPosition[SPOT_LIGHT_COUNT];
+uniform vec3 u_spotLightDirection[SPOT_LIGHT_COUNT];
+#endif
+
 #if defined(SPECULAR)
-uniform vec3 u_cameraPosition;                 				// Position of the camera in view space
+uniform vec3 u_cameraPosition;
+#endif
+
 #endif
+
 #if defined(TEXTURE_REPEAT)
-uniform vec2 u_textureRepeat;								// Texture repeat for tiling
+uniform vec2 u_textureRepeat;
 #endif
+
 #if defined(TEXTURE_OFFSET)
-uniform vec2 u_textureOffset;								// Texture offset
-#endif
-#if defined(POINT_LIGHT)
-uniform vec3 u_pointLightPosition;							// Position of light
-uniform float u_pointLightRangeInverse;						// Inverse of light range 
-#elif defined(SPOT_LIGHT)
-uniform vec3 u_spotLightPosition;							// Position of light
-uniform float u_spotLightRangeInverse;						// Inverse of light range
-uniform vec3 u_spotLightDirection;                          // Direction of a spot light source
-#else
+uniform vec2 u_textureOffset;
 #endif
 
+///////////////////////////////////////////////////////////
 // Varyings
-varying vec3 v_normalVector;								// Normal vector in view space
-varying vec2 v_texCoord;									// Texture coordinate
+varying vec2 v_texCoord;
+
+#if defined(LIGHTMAP)
+varying vec2 v_texCoord1;
+#endif
+
+#if defined(LIGHTING)
+
+#if !defined(BUMPED)
+varying vec3 v_normalVector;
+#endif
+
+#if defined(BUMPED) && (DIRECTIONAL_LIGHT_COUNT > 0)
+varying vec3 v_directionalLightDirection[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
+
 #if defined(SPECULAR)
-varying vec3 v_cameraDirection;								// Direction the camera is looking at in tangent space
-#endif
-#if defined(POINT_LIGHT)
-varying vec3 v_vertexToPointLightDirection;					// Direction of point light w.r.t current vertex in tangent space
-varying float v_pointLightAttenuation;						// Attenuation of point light
-#include "lighting-point.vert"
-#elif defined(SPOT_LIGHT)
-varying vec3 v_vertexToSpotLightDirection;					// Direction of the spot light w.r.t current vertex in tangent space
-varying float v_spotLightAttenuation;						// Attenuation of spot light
-
-// Lighting
-#include "lighting-spot.vert"
-#else
-#include "lighting-directional.vert"
+varying vec3 v_cameraDirection;
+#endif
+
+#include "lighting.vert"
+
 #endif
 
-// Skinning
 #if defined(SKINNING)
 #include "skinning.vert"
 #else
@@ -67,26 +120,44 @@ varying float v_spotLightAttenuation;						// Attenuation of spot light
 
 void main()
 {
-    // Get the position and normal
     vec4 position = getPosition();
-    vec3 normal = getNormal();
-
-    // Transform position to clip space.
     gl_Position = u_worldViewProjectionMatrix * position;
 
-    // Transform normal to view space.
-	mat3 normalMatrix = mat3(u_inverseTransposeWorldViewMatrix[0].xyz, u_inverseTransposeWorldViewMatrix[1].xyz, u_inverseTransposeWorldViewMatrix[2].xyz);
-    v_normalVector = normalMatrix * normal;
-
-    // Apply light.
+    #if defined(LIGHTING)
+    vec3 normal = getNormal();
+    // Transform the normal, tangent and binormals to view space.
+    mat3 inverseTransposeWorldViewMatrix = mat3(u_inverseTransposeWorldViewMatrix[0].xyz, u_inverseTransposeWorldViewMatrix[1].xyz, u_inverseTransposeWorldViewMatrix[2].xyz);
+    vec3 normalVector = normalize(inverseTransposeWorldViewMatrix * normal);
+    
+    #if defined(BUMPED)
+    
+    vec3 tangent = getTangent();
+    vec3 binormal = getBinormal();
+    vec3 tangentVector  = normalize(inverseTransposeWorldViewMatrix * tangent);
+    vec3 binormalVector = normalize(inverseTransposeWorldViewMatrix * binormal);
+    mat3 tangentSpaceTransformMatrix = mat3(tangentVector.x, binormalVector.x, normalVector.x, tangentVector.y, binormalVector.y, normalVector.y, tangentVector.z, binormalVector.z, normalVector.z);
+    applyLight(position, tangentSpaceTransformMatrix);
+    
+    #else
+    
+    v_normalVector = normalVector;
     applyLight(position);
-
-    // Texture transformation
+    
+    #endif
+    
+    #endif 
+    
     v_texCoord = a_texCoord;
+    
     #if defined(TEXTURE_REPEAT)
     v_texCoord *= u_textureRepeat;
     #endif
+    
     #if defined(TEXTURE_OFFSET)
     v_texCoord += u_textureOffset;
     #endif
+    
+    #if defined(LIGHTMAP)
+    v_texCoord1 = a_texCoord1;
+    #endif
 }

+ 366 - 372
gameplay/src/Base.h

@@ -1,372 +1,366 @@
-#ifndef BASE_H_
-#define BASE_H_
-
-// C/C++
-#include <new>
-#include <memory>
-#include <cstdio>
-#include <cstdlib>
-#include <cassert>
-#include <cwchar>
-#include <cwctype>
-#include <cctype>
-#include <cmath>
-#include <cstdarg>
-#include <ctime>
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <cstring>
-#include <vector>
-#include <list>
-#include <set>
-#include <stack>
-#include <map>
-#include <queue>
-#include <algorithm>
-#include <limits>
-#include <functional>
-#include <bitset>
-#include <typeinfo>
-#include "Logger.h"
-
-// Bring common functions from C into global namespace
-using std::memcpy;
-using std::fabs;
-using std::sqrt;
-using std::cos;
-using std::sin;
-using std::tan;
-using std::isspace;
-using std::isdigit;
-using std::toupper;
-using std::tolower;
-using std::size_t;
-using std::min;
-using std::max;
-using std::modf;
-using std::atoi;
-
-// Common
-#ifndef NULL
-#define NULL     0
-#endif
-
-namespace gameplay
-{
-/**
- * Print logging (implemented per platform).
- * @script{ignore}
- */
-extern void print(const char* format, ...);
-}
-
-// Current function macro.
-#ifdef WIN32
-#define __current__func__ __FUNCTION__
-#else
-#define __current__func__ __func__
-#endif
-
-// Assert macros.
-#ifdef _DEBUG
-#define GP_ASSERT(expression) assert(expression)
-#else
-#define GP_ASSERT(expression)
-#endif
-
-// Error macro.
-#ifdef GP_ERRORS_AS_WARNINGS
-#define GP_ERROR GP_WARN
-#else
-#define GP_ERROR(...) do \
-    { \
-        gameplay::Logger::log(gameplay::Logger::LEVEL_ERROR, "%s -- ", __current__func__); \
-        gameplay::Logger::log(gameplay::Logger::LEVEL_ERROR, __VA_ARGS__); \
-        gameplay::Logger::log(gameplay::Logger::LEVEL_ERROR, "\n"); \
-        assert(0); \
-        std::exit(-1); \
-    } while (0)
-#endif
-
-// Warning macro.
-#define GP_WARN(...) do \
-    { \
-        gameplay::Logger::log(gameplay::Logger::LEVEL_WARN, "%s -- ", __current__func__); \
-        gameplay::Logger::log(gameplay::Logger::LEVEL_WARN, __VA_ARGS__); \
-        gameplay::Logger::log(gameplay::Logger::LEVEL_WARN, "\n"); \
-    } while (0)
-
-#if defined(WIN32)
-    #pragma warning( disable : 4005 )
-    #pragma warning( disable : 4172 )
-    #pragma warning( disable : 4244 )
-    #pragma warning( disable : 4267 )
-    #pragma warning( disable : 4311 )
-    #pragma warning( disable : 4390 )
-    #pragma warning( disable : 4800 )
-    #pragma warning( disable : 4996 )
-#endif
-
-// Bullet Physics
-#include <btBulletDynamicsCommon.h>
-#include <BulletCollision/CollisionDispatch/btGhostObject.h>
-#define BV(v) (btVector3((v).x, (v).y, (v).z))
-#define BQ(q) (btQuaternion((q).x, (q).y, (q).z, (q).w))
-
-// Debug new for memory leak detection
-#include "DebugNew.h"
-
-// Object deletion macro
-#define SAFE_DELETE(x) \
-    { \
-        delete x; \
-        x = NULL; \
-    }
-
-// Array deletion macro
-#define SAFE_DELETE_ARRAY(x) \
-    { \
-        delete[] x; \
-        x = NULL; \
-    }
-
-// Ref cleanup macro
-#define SAFE_RELEASE(x) \
-    if (x) \
-    { \
-        (x)->release(); \
-        x = NULL; \
-    }
-
-// Math
-#define MATH_DEG_TO_RAD(x)          ((x) * 0.0174532925f)
-#define MATH_RAD_TO_DEG(x)          ((x)* 57.29577951f)
-#define MATH_RANDOM_MINUS1_1()      ((2.0f*((float)rand()/RAND_MAX))-1.0f)      // Returns a random float between -1 and 1.
-#define MATH_RANDOM_0_1()           ((float)rand()/RAND_MAX)                    // Returns a random float between 0 and 1.
-#define MATH_FLOAT_SMALL            1.0e-37f
-#define MATH_TOLERANCE              2e-37f
-#define MATH_E                      2.71828182845904523536f
-#define MATH_LOG10E                 0.4342944819032518f
-#define MATH_LOG2E                  1.442695040888963387f
-#define MATH_PI                     3.14159265358979323846f
-#define MATH_PIOVER2                1.57079632679489661923f
-#define MATH_PIOVER4                0.785398163397448309616f
-#define MATH_PIX2                   6.28318530717958647693f
-#define MATH_EPSILON                0.000001f
-#define MATH_CLAMP(x, lo, hi)       ((x < lo) ? lo : ((x > hi) ? hi : x))
-#ifndef M_1_PI
-#define M_1_PI                      0.31830988618379067154
-#endif
-
-#ifdef WIN32
-    inline float round(float r)
-    {
-        return (r > 0.0f) ? floor(r + 0.5f) : ceil(r - 0.5f);
-    }
-#endif
-
-// NOMINMAX makes sure that windef.h doesn't add macros min and max
-#ifdef WIN32
-    #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>
-#elif WIN32
-#include <al.h>
-#include <alc.h>
-#elif __APPLE__
-#include <OpenAL/al.h>
-#include <OpenAL/alc.h>
-#endif
-#include <vorbis/vorbisfile.h>
-
-// Image
-#include <png.h>
-
-// Scripting
-using std::va_list;
-#include <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__
-    #include <EGL/egl.h>
-    #include <GLES2/gl2.h>
-    #include <GLES2/gl2ext.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
-#elif WIN32
-    #define WIN32_LEAN_AND_MEAN
-    #define GLEW_STATIC
-    #include <GL/glew.h>
-    #define USE_VAO
-#elif __linux__
-        #define GLEW_STATIC
-        #include <GL/glew.h>
-        #define USE_VAO
-#elif __APPLE__
-    #include "TargetConditionals.h"
-    #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
-        #include <OpenGLES/ES2/gl.h>
-        #include <OpenGLES/ES2/glext.h>
-        #define glBindVertexArray glBindVertexArrayOES
-        #define glDeleteVertexArrays glDeleteVertexArraysOES
-        #define glGenVertexArrays glGenVertexArraysOES
-        #define glIsVertexArray glIsVertexArrayOES
-        #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
-        #define glClearDepth glClearDepthf
-        #define OPENGL_ES
-        #define USE_VAO
-        #ifdef __arm__
-            #define USE_NEON
-        #endif
-    #elif TARGET_OS_MAC
-        #include <OpenGL/gl.h>
-        #include <OpenGL/glext.h>
-        #define glBindVertexArray glBindVertexArrayAPPLE
-        #define glDeleteVertexArrays glDeleteVertexArraysAPPLE
-        #define glGenVertexArrays glGenVertexArraysAPPLE
-        #define glIsVertexArray glIsVertexArrayAPPLE
-        #define USE_VAO
-    #else
-        #error "Unsupported Apple Device"
-    #endif
-#endif
-
-// Graphics (GLSL)
-#define VERTEX_ATTRIBUTE_POSITION_NAME              "a_position"
-#define VERTEX_ATTRIBUTE_NORMAL_NAME                "a_normal"
-#define VERTEX_ATTRIBUTE_COLOR_NAME                 "a_color"
-#define VERTEX_ATTRIBUTE_TANGENT_NAME               "a_tangent"
-#define VERTEX_ATTRIBUTE_BINORMAL_NAME              "a_binormal"
-#define VERTEX_ATTRIBUTE_BLENDWEIGHTS_NAME          "a_blendWeights"
-#define VERTEX_ATTRIBUTE_BLENDINDICES_NAME          "a_blendIndices"
-#define VERTEX_ATTRIBUTE_TEXCOORD_PREFIX_NAME       "a_texCoord"
-
-// Hardware buffer
-namespace gameplay
-{
-/** Vertex attribute. */
-typedef GLint VertexAttribute;
-/** Vertex buffer handle. */
-typedef GLuint VertexBufferHandle;
-/** Index buffer handle. */
-typedef GLuint IndexBufferHandle;
-/** Texture handle. */
-typedef GLuint TextureHandle;
-/** Frame buffer handle. */
-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;
-#else
-    typedef unsigned int GamepadHandle;
-#endif
-
-#if defined(__QNX__) && defined(GP_USE_SOCIAL)
-    typedef void* SocialPlayerHandle;
-    typedef void* SocialAchievementHandle;
-    typedef void* SocialScoreHandle;
-    typedef void* SocialChallengeHandle;
-#elif defined(WIN32)
-    typedef unsigned long SocialPlayerHandle;
-    typedef unsigned long SocialAchievementHandle;
-    typedef unsigned long SocialScoreHandle;
-    typedef unsigned long SocialChallengeHandle;
-#else
-    typedef unsigned int SocialPlayerHandle;
-    typedef unsigned int SocialAchievementHandle;
-    typedef unsigned int SocialScoreHandle;
-    typedef unsigned int SocialChallengeHandle;
-#endif
-
-}
-
-/**
- * GL assertion that can be used for any OpenGL function call.
- *
- * This macro will assert if an error is detected when executing
- * the specified GL code. This macro will do nothing in release
- * mode and is therefore safe to use for realtime/per-frame GL
- * function calls.
- */
-#ifdef NDEBUG
-#define GL_ASSERT( gl_code ) gl_code
-#else
-#define GL_ASSERT( gl_code ) do \
-    { \
-        gl_code; \
-        __gl_error_code = glGetError(); \
-        GP_ASSERT(__gl_error_code == GL_NO_ERROR); \
-    } while(0)
-#endif
-
-/** Global variable to hold GL errors
- * @script{ignore} */
-extern GLenum __gl_error_code;
-
-/**
- * Executes the specified AL code and checks the AL error afterwards
- * to ensure it succeeded.
- *
- * The AL_LAST_ERROR macro can be used afterwards to check whether a AL error was
- * encountered executing the specified code.
- */
-#define AL_CHECK( al_code ) do \
-    { \
-        while (alGetError() != AL_NO_ERROR) ; \
-        al_code; \
-        __al_error_code = alGetError(); \
-        if (__al_error_code != AL_NO_ERROR) \
-        { \
-            GP_ERROR(#al_code ": %d", (int)__al_error_code); \
-        } \
-    } while(0)
-
-/** Global variable to hold AL errors
- * @script{ignore} */
-extern ALenum __al_error_code;
-
-/**
- * Accesses the most recently set global AL error.
- */
-#define AL_LAST_ERROR() __al_error_code
-
-#endif
+#ifndef BASE_H_
+#define BASE_H_
+
+// C/C++
+#include <new>
+#include <memory>
+#include <cstdio>
+#include <cstdlib>
+#include <cassert>
+#include <cwchar>
+#include <cwctype>
+#include <cctype>
+#include <cmath>
+#include <cstdarg>
+#include <ctime>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <cstring>
+#include <vector>
+#include <list>
+#include <set>
+#include <stack>
+#include <map>
+#include <queue>
+#include <algorithm>
+#include <limits>
+#include <functional>
+#include <bitset>
+#include <typeinfo>
+#include "Logger.h"
+
+// Bring common functions from C into global namespace
+using std::memcpy;
+using std::fabs;
+using std::sqrt;
+using std::cos;
+using std::sin;
+using std::tan;
+using std::isspace;
+using std::isdigit;
+using std::toupper;
+using std::tolower;
+using std::size_t;
+using std::min;
+using std::max;
+using std::modf;
+using std::atoi;
+
+// Common
+#ifndef NULL
+#define NULL     0
+#endif
+
+namespace gameplay
+{
+/**
+ * Print logging (implemented per platform).
+ * @script{ignore}
+ */
+extern void print(const char* format, ...);
+}
+
+// Current function macro.
+#ifdef WIN32
+#define __current__func__ __FUNCTION__
+#else
+#define __current__func__ __func__
+#endif
+
+// Assert macros.
+#ifdef _DEBUG
+#define GP_ASSERT(expression) assert(expression)
+#else
+#define GP_ASSERT(expression)
+#endif
+
+// Error macro.
+#ifdef GP_ERRORS_AS_WARNINGS
+#define GP_ERROR GP_WARN
+#else
+#define GP_ERROR(...) do \
+    { \
+        gameplay::Logger::log(gameplay::Logger::LEVEL_ERROR, "%s -- ", __current__func__); \
+        gameplay::Logger::log(gameplay::Logger::LEVEL_ERROR, __VA_ARGS__); \
+        gameplay::Logger::log(gameplay::Logger::LEVEL_ERROR, "\n"); \
+        assert(0); \
+        std::exit(-1); \
+    } while (0)
+#endif
+
+// Warning macro.
+#define GP_WARN(...) do \
+    { \
+        gameplay::Logger::log(gameplay::Logger::LEVEL_WARN, "%s -- ", __current__func__); \
+        gameplay::Logger::log(gameplay::Logger::LEVEL_WARN, __VA_ARGS__); \
+        gameplay::Logger::log(gameplay::Logger::LEVEL_WARN, "\n"); \
+    } while (0)
+
+#if defined(WIN32)
+    #pragma warning( disable : 4005 )
+    #pragma warning( disable : 4172 )
+    #pragma warning( disable : 4244 )
+    #pragma warning( disable : 4267 )
+    #pragma warning( disable : 4311 )
+	#pragma warning( disable : 4316 )
+    #pragma warning( disable : 4390 )
+    #pragma warning( disable : 4800 )
+    #pragma warning( disable : 4996 )
+#endif
+
+// Bullet Physics
+#include <btBulletDynamicsCommon.h>
+#include <BulletCollision/CollisionDispatch/btGhostObject.h>
+#define BV(v) (btVector3((v).x, (v).y, (v).z))
+#define BQ(q) (btQuaternion((q).x, (q).y, (q).z, (q).w))
+
+// Debug new for memory leak detection
+#include "DebugNew.h"
+
+// Object deletion macro
+#define SAFE_DELETE(x) \
+    { \
+        delete x; \
+        x = NULL; \
+    }
+
+// Array deletion macro
+#define SAFE_DELETE_ARRAY(x) \
+    { \
+        delete[] x; \
+        x = NULL; \
+    }
+
+// Ref cleanup macro
+#define SAFE_RELEASE(x) \
+    if (x) \
+    { \
+        (x)->release(); \
+        x = NULL; \
+    }
+
+// Math
+#define MATH_DEG_TO_RAD(x)          ((x) * 0.0174532925f)
+#define MATH_RAD_TO_DEG(x)          ((x)* 57.29577951f)
+#define MATH_RANDOM_MINUS1_1()      ((2.0f*((float)rand()/RAND_MAX))-1.0f)      // Returns a random float between -1 and 1.
+#define MATH_RANDOM_0_1()           ((float)rand()/RAND_MAX)                    // Returns a random float between 0 and 1.
+#define MATH_FLOAT_SMALL            1.0e-37f
+#define MATH_TOLERANCE              2e-37f
+#define MATH_E                      2.71828182845904523536f
+#define MATH_LOG10E                 0.4342944819032518f
+#define MATH_LOG2E                  1.442695040888963387f
+#define MATH_PI                     3.14159265358979323846f
+#define MATH_PIOVER2                1.57079632679489661923f
+#define MATH_PIOVER4                0.785398163397448309616f
+#define MATH_PIX2                   6.28318530717958647693f
+#define MATH_EPSILON                0.000001f
+#define MATH_CLAMP(x, lo, hi)       ((x < lo) ? lo : ((x > hi) ? hi : x))
+#ifndef M_1_PI
+#define M_1_PI                      0.31830988618379067154
+#endif
+
+// NOMINMAX makes sure that windef.h doesn't add macros min and max
+#ifdef WIN32
+    #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>
+#elif WIN32
+#include <al.h>
+#include <alc.h>
+#elif __APPLE__
+#include <OpenAL/al.h>
+#include <OpenAL/alc.h>
+#endif
+#include <vorbis/vorbisfile.h>
+
+// Image
+#include <png.h>
+
+// Scripting
+using std::va_list;
+#include <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__
+    #include <EGL/egl.h>
+    #include <GLES2/gl2.h>
+    #include <GLES2/gl2ext.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
+#elif WIN32
+    #define WIN32_LEAN_AND_MEAN
+    #define GLEW_STATIC
+    #include <GL/glew.h>
+    #define USE_VAO
+#elif __linux__
+        #define GLEW_STATIC
+        #include <GL/glew.h>
+        #define USE_VAO
+#elif __APPLE__
+    #include "TargetConditionals.h"
+    #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
+        #include <OpenGLES/ES2/gl.h>
+        #include <OpenGLES/ES2/glext.h>
+        #define glBindVertexArray glBindVertexArrayOES
+        #define glDeleteVertexArrays glDeleteVertexArraysOES
+        #define glGenVertexArrays glGenVertexArraysOES
+        #define glIsVertexArray glIsVertexArrayOES
+        #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
+        #define glClearDepth glClearDepthf
+        #define OPENGL_ES
+        #define USE_VAO
+        #ifdef __arm__
+            #define USE_NEON
+        #endif
+    #elif TARGET_OS_MAC
+        #include <OpenGL/gl.h>
+        #include <OpenGL/glext.h>
+        #define glBindVertexArray glBindVertexArrayAPPLE
+        #define glDeleteVertexArrays glDeleteVertexArraysAPPLE
+        #define glGenVertexArrays glGenVertexArraysAPPLE
+        #define glIsVertexArray glIsVertexArrayAPPLE
+        #define USE_VAO
+    #else
+        #error "Unsupported Apple Device"
+    #endif
+#endif
+
+// Graphics (GLSL)
+#define VERTEX_ATTRIBUTE_POSITION_NAME              "a_position"
+#define VERTEX_ATTRIBUTE_NORMAL_NAME                "a_normal"
+#define VERTEX_ATTRIBUTE_COLOR_NAME                 "a_color"
+#define VERTEX_ATTRIBUTE_TANGENT_NAME               "a_tangent"
+#define VERTEX_ATTRIBUTE_BINORMAL_NAME              "a_binormal"
+#define VERTEX_ATTRIBUTE_BLENDWEIGHTS_NAME          "a_blendWeights"
+#define VERTEX_ATTRIBUTE_BLENDINDICES_NAME          "a_blendIndices"
+#define VERTEX_ATTRIBUTE_TEXCOORD_PREFIX_NAME       "a_texCoord"
+
+// Hardware buffer
+namespace gameplay
+{
+/** Vertex attribute. */
+typedef GLint VertexAttribute;
+/** Vertex buffer handle. */
+typedef GLuint VertexBufferHandle;
+/** Index buffer handle. */
+typedef GLuint IndexBufferHandle;
+/** Texture handle. */
+typedef GLuint TextureHandle;
+/** Frame buffer handle. */
+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;
+#else
+    typedef unsigned int GamepadHandle;
+#endif
+
+#if defined(__QNX__) && defined(GP_USE_SOCIAL)
+    typedef void* SocialPlayerHandle;
+    typedef void* SocialAchievementHandle;
+    typedef void* SocialScoreHandle;
+    typedef void* SocialChallengeHandle;
+#elif defined(WIN32)
+    typedef unsigned long SocialPlayerHandle;
+    typedef unsigned long SocialAchievementHandle;
+    typedef unsigned long SocialScoreHandle;
+    typedef unsigned long SocialChallengeHandle;
+#else
+    typedef unsigned int SocialPlayerHandle;
+    typedef unsigned int SocialAchievementHandle;
+    typedef unsigned int SocialScoreHandle;
+    typedef unsigned int SocialChallengeHandle;
+#endif
+
+}
+
+/**
+ * GL assertion that can be used for any OpenGL function call.
+ *
+ * This macro will assert if an error is detected when executing
+ * the specified GL code. This macro will do nothing in release
+ * mode and is therefore safe to use for realtime/per-frame GL
+ * function calls.
+ */
+#ifdef NDEBUG
+#define GL_ASSERT( gl_code ) gl_code
+#else
+#define GL_ASSERT( gl_code ) do \
+    { \
+        gl_code; \
+        __gl_error_code = glGetError(); \
+        GP_ASSERT(__gl_error_code == GL_NO_ERROR); \
+    } while(0)
+#endif
+
+/** Global variable to hold GL errors
+ * @script{ignore} */
+extern GLenum __gl_error_code;
+
+/**
+ * Executes the specified AL code and checks the AL error afterwards
+ * to ensure it succeeded.
+ *
+ * The AL_LAST_ERROR macro can be used afterwards to check whether a AL error was
+ * encountered executing the specified code.
+ */
+#define AL_CHECK( al_code ) do \
+    { \
+        while (alGetError() != AL_NO_ERROR) ; \
+        al_code; \
+        __al_error_code = alGetError(); \
+        if (__al_error_code != AL_NO_ERROR) \
+        { \
+            GP_ERROR(#al_code ": %d", (int)__al_error_code); \
+        } \
+    } while(0)
+
+/** Global variable to hold AL errors
+ * @script{ignore} */
+extern ALenum __al_error_code;
+
+/**
+ * Accesses the most recently set global AL error.
+ */
+#define AL_LAST_ERROR() __al_error_code
+
+#endif

+ 21 - 0
gameplay/src/Effect.cpp

@@ -476,6 +476,27 @@ VertexAttribute Effect::getVertexAttribute(const char* name) const
 Uniform* Effect::getUniform(const char* name) const
 {
     std::map<std::string, Uniform*>::const_iterator itr = _uniforms.find(name);
+
+    if (itr == _uniforms.end())
+    {
+        GLint uniformLocation;
+        GL_ASSERT( uniformLocation = glGetUniformLocation(_program, name) );
+        if (uniformLocation > -1)
+        {
+            Uniform* uniform = new Uniform();
+            uniform->_effect = const_cast<Effect*>(this);
+            uniform->_name = name;
+            uniform->_location = uniformLocation;
+            uniform->_index = 0;
+            GLchar uniformName[128];
+            GLint uniformSize;
+            GL_ASSERT( glGetActiveUniform(_program, uniformLocation, 128, NULL, &uniformSize, &uniform->_type, uniformName) );
+            _uniforms[name] = uniform;
+
+            return uniform;
+        }
+    }
+
     return (itr == _uniforms.end() ? NULL : itr->second);
 }
 

+ 1 - 1
gameplay/src/Effect.h

@@ -244,7 +244,7 @@ private:
     GLuint _program;
     std::string _id;
     std::map<std::string, VertexAttribute> _vertexAttributes;
-    std::map<std::string, Uniform*> _uniforms;
+    mutable std::map<std::string, Uniform*> _uniforms;
     static Uniform _emptyUniform;
 };
 

+ 1 - 1
gameplay/src/Font.cpp

@@ -99,7 +99,7 @@ Font* Font::create(const char* family, Style style, unsigned int size, Glyph* gl
     // Create the effect for the font's sprite batch.
     if (__fontEffect == NULL)
     {
-        char * defines = NULL;
+        char* defines = NULL;
         if (format == DISTANCE_FIELD)
             defines = "DISTANCE_FIELD";
         __fontEffect = Effect::createFromFile(FONT_VSH, FONT_FSH, defines);

+ 3 - 2
gameplay/src/Form.cpp

@@ -385,10 +385,10 @@ void Form::update(const Control* container, const Vector2& offset)
     }
 }
 
-void Form::draw()
+unsigned int Form::draw()
 {
     if (!_visible || !_frameBuffer)
-        return;
+        return 0;
 
     // The first time a form is drawn, its contents are rendered into a framebuffer.
     // The framebuffer will only be drawn into again when the contents of the form change.
@@ -435,6 +435,7 @@ void Form::draw()
         _spriteBatch->draw(_bounds.x, _bounds.y, 0, _bounds.width, _bounds.height, 0, _v1, _u2, 0, Vector4::one());
         _spriteBatch->finish();
     }
+    return 2;
 }
 
 const char* Form::getType() const

+ 1 - 1
gameplay/src/Form.h

@@ -112,7 +112,7 @@ public:
     /**
      * Draws this form.
      */
-    void draw();
+    unsigned int draw();
 
     /**
      * @see Control::getType

+ 58 - 38
gameplay/src/Model.cpp

@@ -10,7 +10,7 @@ namespace gameplay
 {
 
 Model::Model(Mesh* mesh) :
-    _mesh(mesh), _material(NULL), _partCount(0), _partMaterials(NULL), _node(NULL), _skin(NULL)
+    _mesh(mesh), _material(NULL), _partCount(0), _partMaterials(NULL), _node(NULL), _skin(NULL), _shadowCaster(true), _shadowReceiver(true)
 {
     GP_ASSERT(mesh);
     _partCount = mesh->getPartCount();
@@ -256,6 +256,26 @@ void Model::setNode(Node* node)
     }
 }
 
+void Model::setShadowCaster(bool casts)
+{
+    _shadowCaster = casts;
+}
+
+bool Model::isShadowCaster() const
+{
+    return _shadowCaster;
+}
+
+void Model::setShadowReceiver(bool receives)
+{
+    _shadowReceiver = receives;
+}
+
+bool Model::isShadowReceiver() const
+{
+    return _shadowReceiver;
+}
+
 static bool drawWireframe(Mesh* mesh)
 {
     switch (mesh->getPrimitiveType())
@@ -332,7 +352,7 @@ static bool drawWireframe(MeshPart* part)
     }
 }
 
-void Model::draw(bool wireframe)
+unsigned int Model::draw(bool wireframe)
 {
     GP_ASSERT(_mesh);
 
@@ -388,33 +408,34 @@ void Model::draw(bool wireframe)
             }
         }
     }
+    return partCount;
 }
 
-void Model::validatePartCount()
+void Model::setMaterialNodeBinding(Material *material)
 {
-    GP_ASSERT(_mesh);
-    unsigned int partCount = _mesh->getPartCount();
+    GP_ASSERT(material);
 
-    if (_partCount != partCount)
+    if (_node)
     {
-        // Allocate new arrays and copy old items to them.
-        if (_partMaterials)
+        material->setNodeBinding(_node);
+
+        unsigned int techniqueCount = material->getTechniqueCount();
+        for (unsigned int i = 0; i < techniqueCount; ++i)
         {
-            Material** oldArray = _partMaterials;
-            _partMaterials = new Material*[partCount];
-            memset(_partMaterials, 0, sizeof(Material*) * partCount);
-            if (oldArray)
+            Technique* technique = material->getTechniqueByIndex(i);
+            GP_ASSERT(technique);
+            
+            technique->setNodeBinding(_node);
+
+            unsigned int passCount = technique->getPassCount();
+            for (unsigned int j = 0; j < passCount; ++j)
             {
-                for (unsigned int i = 0; i < _partCount; ++i)
-                {
-                    _partMaterials[i] = oldArray[i];
-                }
+                Pass* pass = technique->getPassByIndex(j);
+                GP_ASSERT(pass);
+
+                pass->setNodeBinding(_node);
             }
-            SAFE_DELETE_ARRAY(oldArray);
         }
-
-        // Update local part count.
-        _partCount = _mesh->getPartCount();
     }
 }
 
@@ -458,31 +479,30 @@ Model* Model::clone(NodeCloneContext &context)
     return model;
 }
 
-void Model::setMaterialNodeBinding(Material *material)
+void Model::validatePartCount()
 {
-    GP_ASSERT(material);
+    GP_ASSERT(_mesh);
+    unsigned int partCount = _mesh->getPartCount();
 
-    if (_node)
+    if (_partCount != partCount)
     {
-        material->setNodeBinding(_node);
-
-        unsigned int techniqueCount = material->getTechniqueCount();
-        for (unsigned int i = 0; i < techniqueCount; ++i)
+        // Allocate new arrays and copy old items to them.
+        if (_partMaterials)
         {
-            Technique* technique = material->getTechniqueByIndex(i);
-            GP_ASSERT(technique);
-            
-            technique->setNodeBinding(_node);
-
-            unsigned int passCount = technique->getPassCount();
-            for (unsigned int j = 0; j < passCount; ++j)
+            Material** oldArray = _partMaterials;
+            _partMaterials = new Material*[partCount];
+            memset(_partMaterials, 0, sizeof(Material*) * partCount);
+            if (oldArray)
             {
-                Pass* pass = technique->getPassByIndex(j);
-                GP_ASSERT(pass);
-
-                pass->setNodeBinding(_node);
+                for (unsigned int i = 0; i < _partCount; ++i)
+                {
+                    _partMaterials[i] = oldArray[i];
+                }
             }
+            SAFE_DELETE_ARRAY(oldArray);
         }
+        // Update local part count.
+        _partCount = _mesh->getPartCount();
     }
 }
 

+ 44 - 5
gameplay/src/Model.h

@@ -14,8 +14,7 @@ class Node;
 class NodeCloneContext;
 
 /**
- * Defines a Model which is an instance of a Mesh that can be drawn
- * with the specified Materials.
+ * Defines a Model (MeshRenderer) which is an instance of a Mesh that can be drawn with the specified Materials.
  */
 class Model : public Ref
 {
@@ -145,6 +144,43 @@ public:
      */
     void setNode(Node* node);
 
+    /**
+     * Sets if this model cast shadows.
+     *
+     * Note: This is only applied to a SceneRenderer.
+     * 
+     * @param casts if this model casts shadows
+     * @see SceneRenderer
+     */
+    void setShadowCaster(bool casts);
+
+    /**
+     * Returns whether this model cast shadows.
+     *
+     * Note: This is only applied to a SceneRenderer.
+     *
+     * @return if this model casts shadows
+     * @see SceneRenderer
+     */
+    bool isShadowCaster() const;
+
+    /**
+     * Sets if this object receives shadows.
+     *
+     * @param bool if this object receives shadows
+     */
+    void setShadowReceiver(bool receives);
+
+    /**
+     * Returns whether this objects recieves shadows.
+     *
+     * Note: This is only applied to a SceneRenderer.
+     *
+     * @return if this object receives shadows
+     * @see SceneRenderer
+     */
+    bool isShadowReceiver() const;
+
     /**
      * Draws this mesh instance.
      *
@@ -154,8 +190,9 @@ public:
      * and so on, should be set up before calling this method.
      *
      * @param wireframe If true, draw the model in wireframe mode.
+     * @return The number of draw calls (mesh parts).
      */
-    void draw(bool wireframe = false);
+    unsigned int draw(bool wireframe = false);
 
 private:
 
@@ -186,8 +223,6 @@ private:
      */
     void setMaterialNodeBinding(Material *m);
 
-    void validatePartCount();
-
     /**
      * Clones the model and returns a new model.
      * 
@@ -196,12 +231,16 @@ private:
      */
     Model* clone(NodeCloneContext &context);
 
+    void validatePartCount();
+
     Mesh* _mesh;
     Material* _material;
     unsigned int _partCount;
     Material** _partMaterials;
     Node* _node;
     MeshSkin* _skin;
+    bool _shadowCaster;
+    bool _shadowReceiver;
 };
 
 }

+ 27 - 16
gameplay/src/Node.cpp

@@ -20,7 +20,7 @@ namespace gameplay
 {
 
 Node::Node(const char* id)
-    : _scene(NULL), _firstChild(NULL), _nextSibling(NULL), _prevSibling(NULL), _parent(NULL), _childCount(0),
+    : _scene(NULL), _firstChild(NULL), _nextSibling(NULL), _prevSibling(NULL), _parent(NULL), _childCount(0), _visible(true),
     _tags(NULL), _camera(NULL), _light(NULL), _model(NULL), _terrain(NULL), _form(NULL), _audioSource(NULL), _particleEmitter(NULL),
     _collisionObject(NULL), _agent(NULL), _dirtyBits(NODE_DIRTY_ALL), _notifyHierarchyChanged(true), _userData(NULL)
 {
@@ -292,6 +292,32 @@ void Node::setUserPointer(void* pointer, void (*cleanupCallback)(void*))
     }
 }
 
+void Node::setVisible(bool visible)
+{
+    if (_visible != visible)
+    {
+        _visible = visible;
+    }
+}
+
+bool Node::isVisible() const
+{
+    return _visible;
+}
+
+bool Node::isVisibleInHierarchy() const
+{
+   if (!_visible)
+       return false;
+   Node* node = _parent;
+   while (node)
+   {
+       if (!node->_visible)
+           return false;
+   }
+   return true;
+}
+
 unsigned int Node::getChildCount() const
 {
     return _childCount;
@@ -1235,21 +1261,6 @@ PhysicsCollisionObject* Node::setCollisionObject(Properties* properties)
     return _collisionObject;
 }
 
-unsigned int Node::getNumAdvertisedDescendants() const
-{
-    return (unsigned int)_advertisedDescendants.size();
-}
-
-Node* Node::getAdvertisedDescendant(unsigned int i) const
-{
-    return _advertisedDescendants.at(i);
-}
-
-void Node::addAdvertisedDescendant(Node* node)
-{
-    _advertisedDescendants.push_back(node);
-}
-
 AIAgent* Node::getAgent() const
 {
     return _agent;

+ 42 - 60
gameplay/src/Node.h

@@ -117,13 +117,19 @@ public:
     Node* getParent() const;
 
     /**
-     * Determines if a custom tag with the specified name is set.
+     * Sets a custom tag on this Node.
      *
-     * @param name Name of the tag to query.
+     * Custom tags can be used for a variety of purposes within a game. For example,
+     * a tag called "transparent" can be added to nodes, to indicate which nodes in
+     * a scene are transparent. This tag can then be read during rendering to sort
+     * transparent and opaque objects for correct drawing order. 
      *
-     * @return true if the tag is set, false otherwise.
+     * Setting a tag to NULL removes the tag from the Node.
+     *
+     * @param name Name of the tag to set.
+     * @param value Optional value of the tag (empty string by default).
      */
-    bool hasTag(const char* name) const;
+    void setTag(const char* name, const char* value = "");
 
     /**
      * Returns the value of the custom tag with the given name.
@@ -135,21 +141,13 @@ public:
     const char* getTag(const char* name) const;
 
     /**
-     * Sets a custom tag on this Node.
-     *
-     * Custom tags can be used for a variety of purposes within a game. For example,
-     * a tag called "transparent" can be added to nodes, to indicate which nodes in
-     * a scene are transparent. This tag can then be read during rendering to sort
-     * transparent and opaque objects for correct drawing order. Another example
-     * is using a "visible" tag to mark nodes as invisible to be skipped during
-     * rendering.
+     * Determines if a custom tag with the specified name is set.
      *
-     * Setting a tag to NULL removes the tag from the Node.
+     * @param name Name of the tag to query.
      *
-     * @param name Name of the tag to set.
-     * @param value Optional value of the tag (empty string by default).
+     * @return true if the tag is set, false otherwise.
      */
-    void setTag(const char* name, const char* value = "");
+    bool hasTag(const char* name) const;
 
     /**
      * Returns the user pointer for this node.
@@ -182,6 +180,28 @@ public:
      */
     void setUserPointer(void* pointer, void (*cleanupCallback)(void*) = NULL);
 
+    /**
+     * Sets if visual components themselves set as visible.
+     *
+     * @param visible if visual components themselves set as visible.
+     */
+    void setVisible(bool visible);
+
+    /**
+     * Gets if visual components themselves set as visible.
+     *
+     * @return if visual components themselves set as visible.
+     */
+    bool isVisible() const;
+
+    /**
+     * Gets if visual components are either inherited visible or they are themselves.
+     *
+     * @param inherit true if visible is based on inherited behaviour or false is its self is visible.
+     * @return if visual components attached on this node should be drawn.
+     */
+    bool isVisibleInHierarchy() const;
+
     /**
      * Returns the number of direct children of this item.
      *
@@ -230,7 +250,7 @@ public:
      * Gets the top level node in this node's parent hierarchy.
      */
     Node* getRootNode() const;
-    
+
     /**
      * Returns whether the transformation of this node is static.
      *
@@ -574,41 +594,6 @@ public:
      */
     PhysicsCollisionObject* setCollisionObject(Properties* properties);
 
-    /**
-     * Returns the number of advertised descendants held in this node.
-     *
-     * Descendant nodes can advertise themselves to others using this
-     * mechanism, such as how the wheels are bound to a physics vehicle
-     * via their common ancestor.
-     *
-     * @return the number of advertised descendants held in this node.
-     */
-    unsigned int getNumAdvertisedDescendants() const;
-
-    /**
-     * Returns the advertised descendant at the specified index.
-     *
-     * Descendant nodes can advertise themselves to others using this
-     * mechanism, such as how the wheels are bound to a physics vehicle
-     * via their common ancestor.
-     *
-     * @param i the index to look-up.
-     *
-     * @return the advertised descendant at the specified index.
-     */
-    Node* getAdvertisedDescendant(unsigned int i) const;
-
-    /**
-     * Adds the specified node to the list of advertised descendants.
-     *
-     * Descendant nodes can advertise themselves to others using this
-     * mechanism, such as how the wheels are bound to a physics vehicle
-     * via their common ancestor.
-     *
-     * @param node the node reference to add.
-     */
-    void addAdvertisedDescendant(Node* node);
-
     /**
      * Returns the AI agent assigned to this node.
      *
@@ -780,6 +765,11 @@ protected:
      */
     unsigned int _childCount;
 
+    /**
+     * If this node is visible. This may not be visiblein hierarchy if its parents are hidden
+     */
+    bool _visible;
+
     /**
      * List of custom tags for a node.
      */
@@ -854,14 +844,6 @@ protected:
      * Pointer to custom UserData and cleanup call back that can be stored in a Node.
      */
     UserData* _userData;
-
-    /**
-     * A linear collection of descendants who wish to advertise themselves, typically
-     * to other descendants. This allows nodes of common ancestry to bond. One example
-     * of this is a physics vehicle and its wheels, which are associated via their
-     * lowest common ancestor.
-     */
-    std::vector<Node*> _advertisedDescendants;
 };
 
 /**

+ 4 - 5
gameplay/src/ParticleEmitter.cpp

@@ -889,7 +889,7 @@ void ParticleEmitter::update(float elapsedTime)
         {
             if ((int)_timePerEmission > 0)
             {
-                _emitTime = fmod(_emitTime, (double)_timePerEmission);
+                _emitTime = fmod((double)_emitTime, (double)_timePerEmission);
             }
             emitOnce(emitCount);
         }
@@ -981,12 +981,10 @@ void ParticleEmitter::update(float elapsedTime)
     }
 }
 
-void ParticleEmitter::draw()
+unsigned int ParticleEmitter::draw()
 {
     if (!isActive())
-    {
-        return;
-    }
+        return 0;
 
     if (_particleCount > 0)
     {
@@ -1027,6 +1025,7 @@ void ParticleEmitter::draw()
         // Render.
         _spriteBatch->finish();
     }
+    return 1;
 }
 
 ParticleEmitter* ParticleEmitter::clone()

+ 1 - 1
gameplay/src/ParticleEmitter.h

@@ -700,7 +700,7 @@ public:
     /**
      * Draws the particles currently being emitted.
      */
-    void draw();
+    unsigned int draw();
 
     /**
      * Gets a TextureBlending enum from a corresponding string.

+ 0 - 7
gameplay/src/PhysicsVehicle.cpp

@@ -188,13 +188,6 @@ void PhysicsVehicle::initialize()
     body->setActivationState(DISABLE_DEACTIVATION);
     dynamicsWorld->addVehicle(_vehicle);
     _vehicle->setCoordinateSystem(0, 1, 2);
-
-    // Advertise self among ancestor nodes so that wheels can bind to self.
-    // See PhysicsVehicleWheel and Node for more details.
-    for (Node* n = getNode()->getParent(); n; n = n->getParent())
-    {
-        n->addAdvertisedDescendant(getNode());
-    }
 }
 
 PhysicsVehicle::~PhysicsVehicle()

+ 35 - 16
gameplay/src/PhysicsVehicleWheel.cpp

@@ -124,28 +124,31 @@ void PhysicsVehicleWheel::findAncestorAndBind()
 {
     GP_ASSERT(getNode());
 
-    // This is not an efficient algorithm if the number of advertised
-    // descendants gets large. In fact, this search is O(n*m) in the
-    // worst case with n nodes and m advertised descendants per node.
-    // But (1) we are only visiting ancestor nodes, and (2) the number
-    // of advertised descendants is expected to be small since this
-    // mechanism is currently only used for binding wheels onto a vehicle.
+    // Search for the first PhysicsVehicle that shares a common ancestor, and
+    // bind with it. The following code performs a naive search; nothing more
+    // sophisticated is deemed necessary because:
+    // (a) The root of the scene is NOT a node
+    // (b) Scene graphs tend to be relatively flat.
     //
-    // TODO: revisit if the advertised descendants mechanism becomes popular.
+    // The search ends when a vehicle is found or n is null:
+    // 1: Let n = this node
+    // 2: Visit each sibling of n and perform a breadth-first search of its descendants
+    // 3: Let n = the parent of n
+    // 4: Go to 2.
     PhysicsVehicle* host = NULL;
-    PhysicsCollisionObject* collisionObject;
     Node* m;
-    for (Node* n = getNode()->getParent(); n && !host; n = n->getParent())
+    for (Node* n = getNode(); n && !host; n = n->getParent())
     {
-        for (unsigned int i = 0; i < n->getNumAdvertisedDescendants() && !host; i++)
+        // Visit siblings before n
+        for (m = n->getPreviousSibling(); m && !host; m = m->getPreviousSibling())
         {
-            m = n->getAdvertisedDescendant(i);
+            host = findVehicle(m);
+        }
 
-            collisionObject = m->getCollisionObject();
-            if (collisionObject && collisionObject->getType() == PhysicsCollisionObject::VEHICLE)
-            {
-                host = static_cast<PhysicsVehicle*>(collisionObject);
-            }
+        // Visit siblings after n
+        for (m = n->getNextSibling(); m && !host; m = m->getNextSibling())
+        {
+            host = findVehicle(m);
         }
     }
 
@@ -157,6 +160,22 @@ void PhysicsVehicleWheel::findAncestorAndBind()
     }
 }
 
+PhysicsVehicle* PhysicsVehicleWheel::findVehicle(Node* node)
+{
+    PhysicsCollisionObject* collisionObject = node->getCollisionObject();
+    if (collisionObject && collisionObject->getType() == PhysicsCollisionObject::VEHICLE)
+    {
+        return static_cast<PhysicsVehicle*>(collisionObject);
+    }
+
+    PhysicsVehicle* result = NULL;
+    for (Node* p = node->getFirstChild(); p && !result; p = p->getNextSibling())
+    {
+        result = findVehicle(p);
+    }
+    return result;
+}
+
 void PhysicsVehicleWheel::setHost(PhysicsVehicle* host, unsigned int indexInHost)
 {
     _host = host;

+ 7 - 0
gameplay/src/PhysicsVehicleWheel.h

@@ -331,6 +331,13 @@ private:
     // Note: Currently this method is silent on failure to find a host.
     void findAncestorAndBind();
 
+    /**
+     * Depth-first search for the first vehicle starting from the specified node.
+     *
+     * @param node the starting node for the recursive search.
+     */
+    PhysicsVehicle* findVehicle(Node* node);
+
     /**
      * Sets the host vehicle for this wheel.
      *

+ 0 - 33
gameplay/src/RenderState.cpp

@@ -143,12 +143,6 @@ const char* autoBindingToString(RenderState::AutoBinding autoBinding)
     case RenderState::SCENE_AMBIENT_COLOR:
         return "SCENE_AMBIENT_COLOR";
 
-    case RenderState::SCENE_LIGHT_COLOR:
-        return "SCENE_LIGHT_COLOR";
-
-    case RenderState::SCENE_LIGHT_DIRECTION:
-        return "SCENE_LIGHT_DIRECTION";
-
     default:
         return "";
     }
@@ -304,14 +298,6 @@ void RenderState::applyAutoBinding(const char* uniformName, const char* autoBind
         {
             param->bindValue(this, &RenderState::autoBindingGetAmbientColor);
         }
-        else if (strcmp(autoBinding, "SCENE_LIGHT_COLOR") == 0)
-        {
-            param->bindValue(this, &RenderState::autoBindingGetLightColor);
-        }
-        else if (strcmp(autoBinding, "SCENE_LIGHT_DIRECTION") == 0)
-        {
-            param->bindValue(this, &RenderState::autoBindingGetLightDirection);
-        }
         else
         {
             bound = false;
@@ -397,25 +383,6 @@ const Vector3& RenderState::autoBindingGetAmbientColor() const
     return scene ? scene->getAmbientColor() : Vector3::zero();
 }
 
-const Vector3& RenderState::autoBindingGetLightColor() const
-{
-    Scene* scene = _nodeBinding ? _nodeBinding->getScene() : NULL;
-    return scene ? scene->getLightColor() : Vector3::one();
-}
-
-const Vector3& RenderState::autoBindingGetLightDirection() const
-{
-    static Vector3 down(0, -1, 0);
-    Scene* scene = _nodeBinding ? _nodeBinding->getScene() : NULL;
-    if (scene) {
-        static Vector3 lightDirection;
-        lightDirection.set(scene->getLightDirection());
-        _nodeBinding->getViewMatrix().transformVector(&lightDirection);
-        return lightDirection;
-    }
-    return down;
-}
-
 void RenderState::bind(Pass* pass)
 {
     GP_ASSERT(pass);

+ 1 - 15
gameplay/src/RenderState.h

@@ -91,21 +91,7 @@ public:
         /**
          * Binds the current scene's ambient color (Vector3).
          */
-        SCENE_AMBIENT_COLOR,
-
-        /**
-         * Binds the current scene's light color (Vector3).
-         *
-         * This is typically used for the main directional light in a scene, such as the Sun.
-         */
-        SCENE_LIGHT_COLOR,
-
-        /**
-         * Binds the current scene's light direction (Vector3).
-         *
-         * This is typically used for the main directional light in a scene, such as the Sun.
-         */
-        SCENE_LIGHT_DIRECTION
+        SCENE_AMBIENT_COLOR
     };
 
     /**

+ 1 - 22
gameplay/src/Scene.cpp

@@ -60,8 +60,7 @@ static bool endsWith(const char* str, const char* suffix, bool ignoreCase)
 
 
 Scene::Scene(const char* id)
-    : _id(id ? id : ""), _activeCamera(NULL), _firstNode(NULL), _lastNode(NULL), _nodeCount(0), 
-    _lightColor(1,1,1), _lightDirection(0,-1,0), _bindAudioListenerToCamera(true), _debugBatch(NULL)
+    : _id(id ? id : ""), _activeCamera(NULL), _firstNode(NULL), _lastNode(NULL), _nodeCount(0), _bindAudioListenerToCamera(true), _debugBatch(NULL)
 {
     __sceneList.push_back(this);
 }
@@ -383,26 +382,6 @@ void Scene::setAmbientColor(float red, float green, float blue)
     _ambientColor.set(red, green, blue);
 }
 
-const Vector3& Scene::getLightColor() const
-{
-    return _lightColor;
-}
-
-void Scene::setLightColor(float red, float green, float blue)
-{
-    _lightColor.set(red, green, blue);
-}
-
-const Vector3& Scene::getLightDirection() const
-{
-    return _lightDirection;
-}
-
-void Scene::setLightDirection(const Vector3& direction)
-{
-    _lightDirection = direction;
-}
-
 static Material* createDebugMaterial()
 {
     // Vertex shader for drawing colored lines.

+ 1 - 49
gameplay/src/Scene.h

@@ -181,55 +181,7 @@ public:
      * @see getAmbientColor()
      */
     void setAmbientColor(float red, float green, float blue);
-
-    /**
-     * Returns the light color of the scene.
-     *
-     * The default light color is white (1,1,1).
-     *
-     * This color is typically used to represent the color of the main directional light (i.e. the Sun) in a scene.
-     * The corresponding direction can be queried using Scene::getLightDirection().
-     *
-     * This value can be bound to materials using the SCENE_LIGHT_COLOR auto binding.
-     *
-     * @return The scene's light color.
-     */
-    const Vector3& getLightColor() const;
-
-    /**
-     * Sets the scene's light color.
-     *
-     * @param red The red channel between 0.0 and 1.0.
-     * @param green The green channel between 0.0 and 1.0.
-     * @param blue The blue channel between 0.0 and 1.0.
-     *
-     * @see getLightColor()
-     */
-    void setLightColor(float red, float green, float blue);
-
-    /**
-     * Returns the current light direction for the scene.
-     *
-     * The default value is (0,-1,0), which is a pointing directly down the Y-axis.
-     *
-     * This value is typically used to represent the the main directional lihgt (i.e. the Sun) in a scene.
-     * The corresponding light color can be queried using Scene::getLightColor().
-     *
-     * This value can be bound to materials using the SCENE_LIGHT_DIRECTION auto binding.
-     *
-     * @return The scene's light direction.
-     */
-    const Vector3& getLightDirection() const;
-
-    /**
-     * Sets the scene's light direction.
-     *
-     * @param direction The new light direction.
-     *
-     * @see getLightDirection()
-     */
-    void setLightDirection(const Vector3& direction);
-
+    
     /**
      * Visits each node in the scene and calls the specified method pointer.
      *

+ 0 - 4
gameplay/src/SceneLoader.cpp

@@ -113,10 +113,6 @@ Scene* SceneLoader::loadInternal(const char* url)
     Vector3 vec3;
     if (sceneProperties->getVector3("ambientColor", &vec3))
         _scene->setAmbientColor(vec3.x, vec3.y, vec3.z);
-    if (sceneProperties->getVector3("lightColor", &vec3))
-        _scene->setLightColor(vec3.x, vec3.y, vec3.z);
-    if (sceneProperties->getVector3("lightDirection", &vec3))
-        _scene->setLightDirection(vec3);
 
     // Create animations for scene
     createAnimations();

+ 26 - 0
gameplay/src/SceneRenderer.cpp

@@ -0,0 +1,26 @@
+#include "Base.h"
+#include "SceneRenderer.h"
+
+namespace gameplay
+{
+
+SceneRenderer::SceneRenderer()
+    : _wireframe(false)
+{
+}
+
+SceneRenderer::~SceneRenderer()
+{
+}
+
+void SceneRenderer::setWireframe(bool wireframe)
+{
+    _wireframe = wireframe;
+}
+
+bool SceneRenderer::isWireframe() const
+{
+    return _wireframe;
+}
+
+}

+ 62 - 0
gameplay/src/SceneRenderer.h

@@ -0,0 +1,62 @@
+#ifndef SCENERENDERER_H_
+#define SCENERENDERER_H_
+
+#include "Scene.h"
+#include "VisibleSet.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a class that support rendering of the active models in a scene 
+ * and that are visible to the camera. 
+ */
+class SceneRenderer
+{
+public:
+
+    /**
+     * Constructor.
+     *
+     * @param scene The scene to render.
+     * @param lighting The type of lighting system to use.
+     */
+    SceneRenderer();
+
+    /**
+     * Destructor.
+     */
+    virtual ~SceneRenderer();
+
+    /**
+     * Sets if the scene should be rendered in wireframe mode.
+     *
+     * @param wireframe if the scene should be rendered in wireframe mode.
+     */
+    void setWireframe(bool wireframe);
+
+    /**
+     * Determines if the scene should be rendered in wireframe mode.
+     *
+     * @return if the scene should be rendered in wireframe mode.
+     */
+    bool isWireframe() const;
+
+    /**
+     * Renders the scene with all the nodes visible from the active camera in the scene.
+     *
+     * @param scene
+     * param
+     * @return The number of nodes visited.
+     */
+    virtual unsigned int render(VisibleSet* set) = 0;
+
+protected:
+
+    bool _wireframe;
+
+};
+
+}
+
+#endif

+ 73 - 0
gameplay/src/SceneRendererForward.cpp

@@ -0,0 +1,73 @@
+#include "Base.h"
+#include "SceneRendererForward.h"
+#include "Terrain.h"
+#include "Model.h"
+#include "ParticleEmitter.h"
+#include "Form.h"
+
+namespace gameplay
+{
+
+SceneRendererForward::SceneRendererForward()
+    : SceneRenderer()
+{
+}
+
+SceneRendererForward::SceneRendererForward(const SceneRendererForward& copy)
+{
+}
+
+SceneRendererForward::~SceneRendererForward()
+{
+}
+
+SceneRendererForward* SceneRendererForward::create()
+{
+    return new SceneRendererForward();
+}
+
+unsigned int SceneRendererForward::render(VisibleSet* set)
+{
+    set->reset();
+    unsigned int drawCalls = 0;
+    Node* next = set->getNext();
+    do
+    {
+        drawCalls += drawNode(next);
+        next = set->getNext();
+
+    } while ( next != NULL);
+
+    return drawCalls;
+}
+
+unsigned int SceneRendererForward::drawNode(Node* node)
+{
+    unsigned int drawCalls = 0;
+
+    // Draw Terrain
+    Terrain* terrain = node->getTerrain();
+    if (terrain)
+        drawCalls += terrain->draw(isWireframe());
+
+    // Draw Models (Shadows) TODO:
+
+    // Draw Modes
+    Model* model = node->getModel();
+    if (model)
+        drawCalls += model->draw(isWireframe());
+
+    // Draw particles
+    ParticleEmitter* emitter = node->getParticleEmitter();
+    if (emitter)
+        drawCalls += emitter->draw();
+
+    // Draw forms
+    Form* form = node->getForm();
+    if (form)
+        drawCalls += form->draw();
+
+    return drawCalls;
+}
+
+}

+ 49 - 0
gameplay/src/SceneRendererForward.h

@@ -0,0 +1,49 @@
+#ifndef SCENERENDERERFORWARD_H_
+#define SCENERENDERERFORWARD_H_
+
+#include "SceneRenderer.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a class that support rendering of the active models in a scene 
+ * and that are visible to the camera. 
+ */
+class SceneRendererForward : public SceneRenderer
+{
+public:
+
+    /**
+     * Creates a forward scene renderer
+     */
+    static SceneRendererForward* create();
+
+    /**
+     * @see SceneRenderer#render
+     */
+    unsigned int render(VisibleSet* set);
+
+private:
+
+    /**
+     * Constructor.
+     */
+    SceneRendererForward();
+
+    /**
+     * Constructor.
+     */
+    SceneRendererForward(const SceneRendererForward& copy);
+
+    /**
+     * Destructor.
+     */
+    ~SceneRendererForward();
+
+    unsigned int drawNode(Node* node);
+};
+
+}
+
+#endif

+ 3 - 3
gameplay/src/SocialController.cpp

@@ -2,7 +2,7 @@
 #include "SocialController.h"
 #include "Game.h"
 #include "social/ScoreloopSocialSession.h"
-#include "social/GoogleGamesSocialSession.h"
+#include "social/GooglePlaySocialSession.h"
 
 namespace gameplay
 {
@@ -77,9 +77,9 @@ void SocialController::authenticate(SocialSessionListener* listener)
     	providerStr = socialProperties->getString("provider");
     }
 
-    if (strcmp(providerStr, "GoogleGames") == 0)
+    if (strcmp(providerStr, "GooglePlay") == 0)
     {
-        _session = GoogleGamesSocialSession::authenticate(listener, socialProperties);
+        _session = GooglePlaySocialSession::authenticate(listener, socialProperties);
     }
     else
     {

+ 1 - 1
gameplay/src/SocialController.h

@@ -18,7 +18,7 @@ namespace gameplay
   @verbatim
     social
     {
-         provider = Scoreloop
+         provider = Scoreloop | GooglePlay
          id  = d346c484-12aa-49a2-a0a0-de2f87492d72
          secret = aAa+DehBfyGO/CYaE3nWomgu7SIbWFczUih+Qwf3/n7u0y3nyq5Hag==
          version = 1.0

+ 2 - 1
gameplay/src/Terrain.cpp

@@ -509,12 +509,13 @@ float Terrain::getHeight(float x, float z) const
     return height;
 }
 
-void Terrain::draw(bool wireframe)
+unsigned int Terrain::draw(bool wireframe)
 {
     for (size_t i = 0, count = _patches.size(); i < count; ++i)
     {
         _patches[i]->draw(wireframe);
     }
+    return getVisiblePatchCount();
 }
 
 void Terrain::transformChanged(Transform* transform, long cookie)

+ 2 - 1
gameplay/src/Terrain.h

@@ -311,8 +311,9 @@ public:
      * Draws the terrain.
      *
      * @param wireframe True to draw the terrain as wireframe, false to draw it solid (default).
+     * @return The number of draw call taken to drawn the terrain
      */
-    void draw(bool wireframe = false);
+    unsigned int draw(bool wireframe = false);
 
     /**
      * @see Transform::Listener::transformChanged.

+ 7 - 25
gameplay/src/TerrainPatch.cpp

@@ -487,8 +487,8 @@ bool TerrainPatch::updateMaterial()
         else
             material->getParameter("u_normalMatrix")->bindValue(_terrain, &Terrain::getNormalMatrix);
         material->getParameter("u_ambientColor")->bindValue(this, &TerrainPatch::getAmbientColor);
-        material->getParameter("u_lightColor")->bindValue(this, &TerrainPatch::getLightColor);
-        material->getParameter("u_lightDirection")->bindValue(this, &TerrainPatch::getLightDirection);
+        material->getParameter("u_lightColor")->setValue(Vector3::one());
+        material->getParameter("u_lightDirection")->setValue(Vector3(0, -1, 0));
         if (_layers.size() > 0)
             material->getParameter("u_samplers")->setValue((const Texture::Sampler**)&_samplers[0], (unsigned int)_samplers.size());
 
@@ -513,28 +513,28 @@ bool TerrainPatch::updateMaterial()
     return true;
 }
 
-void TerrainPatch::draw(bool wireframe)
+unsigned int TerrainPatch::draw(bool wireframe)
 {
     Scene* scene = _terrain->_node ? _terrain->_node->getScene() : NULL;
     Camera* camera = scene ? scene->getActiveCamera() : NULL;
     if (!camera)
-        return;
+        return 0;
 
     // Get our world-space bounding box
     BoundingBox bounds = getBoundingBox(true);
 
     // If the box does not intersect the view frustum, cull it
     if (_terrain->isFlagSet(Terrain::FRUSTUM_CULLING) && !camera->getFrustum().intersects(bounds))
-        return;
+        return 0;
 
     if (!updateMaterial())
-        return;
+        return 0;
 
     // Compute the LOD level from the camera's perspective
     size_t lod = computeLOD(camera, bounds);
 
     // Draw the model for the current LOD
-    _levels[lod]->model->draw(wireframe);
+    return _levels[lod]->model->draw(wireframe);
 }
 
 bool TerrainPatch::isVisible() const
@@ -602,24 +602,6 @@ const Vector3& TerrainPatch::getAmbientColor() const
     return scene ? scene->getAmbientColor() : Vector3::zero();
 }
 
-const Vector3& TerrainPatch::getLightColor() const
-{
-    Scene* scene = _terrain->_node ? _terrain->_node->getScene() : NULL;
-    return scene ? scene->getLightColor() : Vector3::one();
-}
-
-const Vector3& TerrainPatch::getLightDirection() const
-{
-    Scene* scene = _terrain->_node ? _terrain->_node->getScene() : NULL;
-    if (!scene)
-    {
-        static Vector3 down(0, -1, 0);
-        return down;
-    }
-
-    return scene->getLightDirection();
-}
-
 size_t TerrainPatch::computeLOD(Camera* camera, const BoundingBox& worldBounds) const
 {
     if (!_terrain->isFlagSet(Terrain::LEVEL_OF_DETAIL) || _levels.size() == 0)

+ 1 - 5
gameplay/src/TerrainPatch.h

@@ -119,7 +119,7 @@ private:
     /**
      * Draws the terrain patch.
      */
-    void draw(bool wireframe);
+    unsigned int draw(bool wireframe);
 
     /**
      * Updates the material for the patch.
@@ -138,10 +138,6 @@ private:
 
     const Vector3& getAmbientColor() const;
 
-    const Vector3& getLightColor() const;
-
-    const Vector3& getLightDirection() const;
-
     Terrain* _terrain;
     std::vector<Level*> _levels;
     unsigned int _row;

+ 53 - 0
gameplay/src/VisibleSet.h

@@ -0,0 +1,53 @@
+#ifndef VISIBLESET_H_
+#define VISIBLESET_H_
+
+#include "Scene.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a set of nodes that are visible from the
+ * scenes active camera. This provides an enumerator
+ * to traverse the scene returning only visible nodes.
+ */
+class VisibleSet
+{
+public:
+    
+    /**
+     * Destructor.
+     */
+    virtual ~VisibleSet() { }
+
+    /**
+     * Sets the scene to determine the visible set from.
+     *
+     * @param scene The scene to determine the visible set from.
+     */
+    virtual void setScene(Scene* scene) = 0;
+
+    /**
+     * Gets the scene to determine the visible set from.
+     *
+     * @param scene The scene to determine the visible set from.
+     */
+    virtual Scene* getScene() = 0;
+
+    /**
+     * Resets the enumerator for enumerating the visible set.
+     */
+    virtual void reset() = 0;
+
+    /**
+     * Gets the next visible node in the set or NULL 
+     * onces you have reached the end of the set.
+     * 
+     * @return The next visible node in the set or NULL at end of set.
+     */
+    virtual Node* getNext() = 0;
+};
+
+}
+
+#endif

+ 89 - 0
gameplay/src/VisibleSetDefault.cpp

@@ -0,0 +1,89 @@
+#include "Base.h"
+#include "VisibleSetDefault.h"
+
+namespace gameplay
+{
+
+VisibleSetDefault* VisibleSetDefault::create(Scene* scene)
+{
+    return new VisibleSetDefault(scene);
+}
+
+VisibleSetDefault::VisibleSetDefault(Scene* scene) 
+    : _scene(NULL), _next(NULL)
+{
+    setScene(scene);
+}
+
+VisibleSetDefault::VisibleSetDefault(const VisibleSetDefault& copy)
+{
+}
+
+VisibleSetDefault::~VisibleSetDefault()
+{
+}
+
+void VisibleSetDefault::setScene(Scene* scene)
+{
+    _scene = scene;
+    reset();
+}
+
+Scene* VisibleSetDefault::getScene()
+{
+    return _scene;
+}
+
+void VisibleSetDefault::reset()
+{
+    _next = _scene->getFirstNode();
+    while (_next && !_next->isVisible())
+    {
+        _next = _next->getNextSibling();
+    }
+}
+
+Node* VisibleSetDefault::getNext()
+{
+    Node* node = _next;
+    if (_next)
+    {
+        Node* next = _next->getFirstChild();
+        if (!next || !isNodeVisible(next))
+        {
+            next = _next->getNextSibling();
+            if (!next || !isNodeVisible(next))
+            {
+                next = _next->getParent();
+                while (next && (!next->getNextSibling() || !isNodeVisible(next)))
+                {
+                    next = next->getParent();
+                }
+                if (next)
+                {
+                    next = next->getNextSibling();
+                }
+            }
+        }
+       _next = next;
+    }
+    return node;
+}
+
+bool VisibleSetDefault::isNodeVisible(Node* node)
+{
+    if (!node->isVisible())
+        return false;
+
+    if (node->getForm() || node->getParticleEmitter() || node->getTerrain() || node->getLight() || node->getCamera())
+    {
+        return true;
+    }
+    else
+    {
+       return node->getBoundingSphere().intersects(_scene->getActiveCamera()->getFrustum());
+    }
+    return false;
+}
+
+}

+ 73 - 0
gameplay/src/VisibleSetDefault.h

@@ -0,0 +1,73 @@
+#ifndef VISIBLESETDEFAULT_H_
+#define VISIBLESETDEFAULT_H_
+
+#include "VisibleSet.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a default implementation of a VisibleSet.
+ *
+ * All nodes visible to the active camera in the scene are returned.
+ * @see VisibleSet
+ */
+class VisibleSetDefault : public VisibleSet
+{
+public:
+
+    /**
+     * Creates a new default VisibleSet
+     *
+     * @param scene The scene to use for determining visible nodes.
+     */
+    static VisibleSetDefault* create(Scene* scene);
+
+    /**
+     * @see VisibleSet::setScene
+     */
+    void setScene(Scene* scene);
+
+    /**
+     * @see VisibleSet::getScene
+     */
+    Scene* getScene();
+
+    /**
+     * @see VisibleSet::reset
+     */
+    void reset();
+
+    /**
+     * @see VisibleSet::getNext
+     */
+    Node* getNext();
+
+private:
+    
+    /**
+     * Constructor.
+     */
+    VisibleSetDefault(Scene* scene);
+
+    /**
+     * Constructor.
+     */
+    VisibleSetDefault(const VisibleSetDefault& copy);
+
+    /**
+     * Destructor.
+     */
+    ~VisibleSetDefault();
+
+    bool isNodeVisible(Node* node);
+
+private:
+
+    Scene* _scene;
+    Node* _next;
+};
+
+}
+
+#endif

+ 5 - 1
gameplay/src/gameplay.h

@@ -40,9 +40,11 @@
 #include "Model.h"
 #include "Camera.h"
 #include "Light.h"
-#include "Scene.h"
 #include "Node.h"
 #include "Joint.h"
+#include "Scene.h"
+#include "SceneRenderer.h"
+#include "SceneRendererForward.h"
 #include "Font.h"
 #include "SpriteBatch.h"
 #include "ParticleEmitter.h"
@@ -52,6 +54,8 @@
 #include "ScreenDisplayer.h"
 #include "HeightField.h"
 #include "Terrain.h"
+#include "VisibleSet.h"
+#include "VisibleSetDefault.h"
 
 // Audio
 #include "AudioController.h"

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

@@ -784,9 +784,12 @@ int lua_Form_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Form* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Form_draw - Failed to match the given parameters to a valid function signature.");

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

@@ -112,6 +112,7 @@ void luaRegister_lua_Global()
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Material");
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Pass");
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Technique");
+    gameplay::ScriptUtil::setGlobalHierarchyPair("SceneRenderer", "SceneRendererForward");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIAgent");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIState");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Button");
@@ -139,6 +140,7 @@ void luaRegister_lua_Global()
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsGhostObject");
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsRigidBody");
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "Terrain");
+    gameplay::ScriptUtil::setGlobalHierarchyPair("VisibleSet", "VisibleSetDefault");
     gameplay::ScriptUtil::addStringFromEnumConversionFunction(&gameplay::lua_stringFromEnumGlobal);
 
     // Register enumeration AIMessage::ParameterType.
@@ -748,8 +750,6 @@ void luaRegister_lua_Global()
         gameplay::ScriptUtil::registerConstantString("CAMERA_VIEW_POSITION", "CAMERA_VIEW_POSITION", scopePath);
         gameplay::ScriptUtil::registerConstantString("MATRIX_PALETTE", "MATRIX_PALETTE", scopePath);
         gameplay::ScriptUtil::registerConstantString("SCENE_AMBIENT_COLOR", "SCENE_AMBIENT_COLOR", scopePath);
-        gameplay::ScriptUtil::registerConstantString("SCENE_LIGHT_COLOR", "SCENE_LIGHT_COLOR", scopePath);
-        gameplay::ScriptUtil::registerConstantString("SCENE_LIGHT_DIRECTION", "SCENE_LIGHT_DIRECTION", scopePath);
     }
 
     // Register enumeration RenderState::Blend.

+ 109 - 128
gameplay/src/lua/lua_Joint.cpp

@@ -31,7 +31,6 @@ void luaRegister_Joint()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addAdvertisedDescendant", lua_Joint_addAdvertisedDescendant},
         {"addChild", lua_Joint_addChild},
         {"addListener", lua_Joint_addListener},
         {"addRef", lua_Joint_addRef},
@@ -44,7 +43,6 @@ void luaRegister_Joint()
         {"findNode", lua_Joint_findNode},
         {"getActiveCameraTranslationView", lua_Joint_getActiveCameraTranslationView},
         {"getActiveCameraTranslationWorld", lua_Joint_getActiveCameraTranslationWorld},
-        {"getAdvertisedDescendant", lua_Joint_getAdvertisedDescendant},
         {"getAgent", lua_Joint_getAgent},
         {"getAnimation", lua_Joint_getAnimation},
         {"getAnimationPropertyComponentCount", lua_Joint_getAnimationPropertyComponentCount},
@@ -72,7 +70,6 @@ void luaRegister_Joint()
         {"getMatrix", lua_Joint_getMatrix},
         {"getModel", lua_Joint_getModel},
         {"getNextSibling", lua_Joint_getNextSibling},
-        {"getNumAdvertisedDescendants", lua_Joint_getNumAdvertisedDescendants},
         {"getParent", lua_Joint_getParent},
         {"getParticleEmitter", lua_Joint_getParticleEmitter},
         {"getPreviousSibling", lua_Joint_getPreviousSibling},
@@ -105,6 +102,8 @@ void luaRegister_Joint()
         {"getWorldViewProjectionMatrix", lua_Joint_getWorldViewProjectionMatrix},
         {"hasTag", lua_Joint_hasTag},
         {"isStatic", lua_Joint_isStatic},
+        {"isVisible", lua_Joint_isVisible},
+        {"isVisibleInHierarchy", lua_Joint_isVisibleInHierarchy},
         {"release", lua_Joint_release},
         {"removeAllChildren", lua_Joint_removeAllChildren},
         {"removeChild", lua_Joint_removeChild},
@@ -141,6 +140,7 @@ void luaRegister_Joint()
         {"setTranslationX", lua_Joint_setTranslationX},
         {"setTranslationY", lua_Joint_setTranslationY},
         {"setTranslationZ", lua_Joint_setTranslationZ},
+        {"setVisible", lua_Joint_setVisible},
         {"transformPoint", lua_Joint_transformPoint},
         {"transformVector", lua_Joint_transformVector},
         {"translate", lua_Joint_translate},
@@ -224,48 +224,6 @@ int lua_Joint__gc(lua_State* state)
     return 0;
 }
 
-int lua_Joint_addAdvertisedDescendant(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                gameplay::ScriptUtil::LuaArray<Node> param1 = gameplay::ScriptUtil::getObjectPointer<Node>(2, "Node", false, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Node'.");
-                    lua_error(state);
-                }
-
-                Joint* instance = getInstance(state);
-                instance->addAdvertisedDescendant(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Joint_addAdvertisedDescendant - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Joint_addChild(lua_State* state)
 {
     // Get the number of parameters.
@@ -1091,54 +1049,6 @@ int lua_Joint_getActiveCameraTranslationWorld(lua_State* state)
     return 0;
 }
 
-int lua_Joint_getAdvertisedDescendant(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
-
-                Joint* instance = getInstance(state);
-                void* returnPtr = (void*)instance->getAdvertisedDescendant(param1);
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "Node");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Joint_getAdvertisedDescendant - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Joint_getAgent(lua_State* state)
 {
     // Get the number of parameters.
@@ -2444,41 +2354,6 @@ int lua_Joint_getNextSibling(lua_State* state)
     return 0;
 }
 
-int lua_Joint_getNumAdvertisedDescendants(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                Joint* instance = getInstance(state);
-                unsigned int result = instance->getNumAdvertisedDescendants();
-
-                // Push the return value onto the stack.
-                lua_pushunsigned(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Joint_getNumAdvertisedDescendants - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Joint_getParent(lua_State* state)
 {
     // Get the number of parameters.
@@ -3970,6 +3845,76 @@ int lua_Joint_isStatic(lua_State* state)
     return 0;
 }
 
+int lua_Joint_isVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joint* instance = getInstance(state);
+                bool result = instance->isVisible();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joint_isVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Joint_isVisibleInHierarchy(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joint* instance = getInstance(state);
+                bool result = instance->isVisibleInHierarchy();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joint_isVisibleInHierarchy - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joint_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -6070,6 +6015,42 @@ int lua_Joint_setTranslationZ(lua_State* state)
     return 0;
 }
 
+int lua_Joint_setVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Joint* instance = getInstance(state);
+                instance->setVisible(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joint_setVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joint_static_ANIMATE_ROTATE(lua_State* state)
 {
     // Validate the number of parameters.

+ 3 - 3
gameplay/src/lua/lua_Joint.h

@@ -6,7 +6,6 @@ namespace gameplay
 
 // Lua bindings for Joint.
 int lua_Joint__gc(lua_State* state);
-int lua_Joint_addAdvertisedDescendant(lua_State* state);
 int lua_Joint_addChild(lua_State* state);
 int lua_Joint_addListener(lua_State* state);
 int lua_Joint_addRef(lua_State* state);
@@ -19,7 +18,6 @@ int lua_Joint_destroyAnimation(lua_State* state);
 int lua_Joint_findNode(lua_State* state);
 int lua_Joint_getActiveCameraTranslationView(lua_State* state);
 int lua_Joint_getActiveCameraTranslationWorld(lua_State* state);
-int lua_Joint_getAdvertisedDescendant(lua_State* state);
 int lua_Joint_getAgent(lua_State* state);
 int lua_Joint_getAnimation(lua_State* state);
 int lua_Joint_getAnimationPropertyComponentCount(lua_State* state);
@@ -47,7 +45,6 @@ int lua_Joint_getLight(lua_State* state);
 int lua_Joint_getMatrix(lua_State* state);
 int lua_Joint_getModel(lua_State* state);
 int lua_Joint_getNextSibling(lua_State* state);
-int lua_Joint_getNumAdvertisedDescendants(lua_State* state);
 int lua_Joint_getParent(lua_State* state);
 int lua_Joint_getParticleEmitter(lua_State* state);
 int lua_Joint_getPreviousSibling(lua_State* state);
@@ -80,6 +77,8 @@ int lua_Joint_getWorldViewMatrix(lua_State* state);
 int lua_Joint_getWorldViewProjectionMatrix(lua_State* state);
 int lua_Joint_hasTag(lua_State* state);
 int lua_Joint_isStatic(lua_State* state);
+int lua_Joint_isVisible(lua_State* state);
+int lua_Joint_isVisibleInHierarchy(lua_State* state);
 int lua_Joint_release(lua_State* state);
 int lua_Joint_removeAllChildren(lua_State* state);
 int lua_Joint_removeChild(lua_State* state);
@@ -116,6 +115,7 @@ int lua_Joint_setTranslation(lua_State* state);
 int lua_Joint_setTranslationX(lua_State* state);
 int lua_Joint_setTranslationY(lua_State* state);
 int lua_Joint_setTranslationZ(lua_State* state);
+int lua_Joint_setVisible(lua_State* state);
 int lua_Joint_static_ANIMATE_ROTATE(lua_State* state);
 int lua_Joint_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state);
 int lua_Joint_static_ANIMATE_SCALE(lua_State* state);

+ 158 - 6
gameplay/src/lua/lua_Model.cpp

@@ -27,9 +27,13 @@ void luaRegister_Model()
         {"getRefCount", lua_Model_getRefCount},
         {"getSkin", lua_Model_getSkin},
         {"hasMaterial", lua_Model_hasMaterial},
+        {"isShadowCaster", lua_Model_isShadowCaster},
+        {"isShadowReceiver", lua_Model_isShadowReceiver},
         {"release", lua_Model_release},
         {"setMaterial", lua_Model_setMaterial},
         {"setNode", lua_Model_setNode},
+        {"setShadowCaster", lua_Model_setShadowCaster},
+        {"setShadowReceiver", lua_Model_setShadowReceiver},
         {NULL, NULL}
     };
     const luaL_Reg lua_statics[] = 
@@ -132,9 +136,12 @@ int lua_Model_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Model* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
@@ -150,9 +157,12 @@ int lua_Model_draw(lua_State* state)
                 bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
                 Model* instance = getInstance(state);
-                instance->draw(param1);
-                
-                return 0;
+                unsigned int result = instance->draw(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
@@ -484,6 +494,76 @@ int lua_Model_hasMaterial(lua_State* state)
     return 0;
 }
 
+int lua_Model_isShadowCaster(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Model* instance = getInstance(state);
+                bool result = instance->isShadowCaster();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Model_isShadowCaster - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Model_isShadowReceiver(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Model* instance = getInstance(state);
+                bool result = instance->isShadowReceiver();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Model_isShadowReceiver - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Model_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -803,6 +883,78 @@ int lua_Model_setNode(lua_State* state)
     return 0;
 }
 
+int lua_Model_setShadowCaster(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Model* instance = getInstance(state);
+                instance->setShadowCaster(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Model_setShadowCaster - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Model_setShadowReceiver(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Model* instance = getInstance(state);
+                instance->setShadowReceiver(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Model_setShadowReceiver - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Model_static_create(lua_State* state)
 {
     // Get the number of parameters.

+ 4 - 0
gameplay/src/lua/lua_Model.h

@@ -15,9 +15,13 @@ int lua_Model_getNode(lua_State* state);
 int lua_Model_getRefCount(lua_State* state);
 int lua_Model_getSkin(lua_State* state);
 int lua_Model_hasMaterial(lua_State* state);
+int lua_Model_isShadowCaster(lua_State* state);
+int lua_Model_isShadowReceiver(lua_State* state);
 int lua_Model_release(lua_State* state);
 int lua_Model_setMaterial(lua_State* state);
 int lua_Model_setNode(lua_State* state);
+int lua_Model_setShadowCaster(lua_State* state);
+int lua_Model_setShadowReceiver(lua_State* state);
 int lua_Model_static_create(lua_State* state);
 
 void luaRegister_Model();

+ 109 - 128
gameplay/src/lua/lua_Node.cpp

@@ -30,7 +30,6 @@ void luaRegister_Node()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addAdvertisedDescendant", lua_Node_addAdvertisedDescendant},
         {"addChild", lua_Node_addChild},
         {"addListener", lua_Node_addListener},
         {"addRef", lua_Node_addRef},
@@ -43,7 +42,6 @@ void luaRegister_Node()
         {"findNode", lua_Node_findNode},
         {"getActiveCameraTranslationView", lua_Node_getActiveCameraTranslationView},
         {"getActiveCameraTranslationWorld", lua_Node_getActiveCameraTranslationWorld},
-        {"getAdvertisedDescendant", lua_Node_getAdvertisedDescendant},
         {"getAgent", lua_Node_getAgent},
         {"getAnimation", lua_Node_getAnimation},
         {"getAnimationPropertyComponentCount", lua_Node_getAnimationPropertyComponentCount},
@@ -70,7 +68,6 @@ void luaRegister_Node()
         {"getMatrix", lua_Node_getMatrix},
         {"getModel", lua_Node_getModel},
         {"getNextSibling", lua_Node_getNextSibling},
-        {"getNumAdvertisedDescendants", lua_Node_getNumAdvertisedDescendants},
         {"getParent", lua_Node_getParent},
         {"getParticleEmitter", lua_Node_getParticleEmitter},
         {"getPreviousSibling", lua_Node_getPreviousSibling},
@@ -103,6 +100,8 @@ void luaRegister_Node()
         {"getWorldViewProjectionMatrix", lua_Node_getWorldViewProjectionMatrix},
         {"hasTag", lua_Node_hasTag},
         {"isStatic", lua_Node_isStatic},
+        {"isVisible", lua_Node_isVisible},
+        {"isVisibleInHierarchy", lua_Node_isVisibleInHierarchy},
         {"release", lua_Node_release},
         {"removeAllChildren", lua_Node_removeAllChildren},
         {"removeChild", lua_Node_removeChild},
@@ -139,6 +138,7 @@ void luaRegister_Node()
         {"setTranslationX", lua_Node_setTranslationX},
         {"setTranslationY", lua_Node_setTranslationY},
         {"setTranslationZ", lua_Node_setTranslationZ},
+        {"setVisible", lua_Node_setVisible},
         {"transformPoint", lua_Node_transformPoint},
         {"transformVector", lua_Node_transformVector},
         {"translate", lua_Node_translate},
@@ -223,48 +223,6 @@ int lua_Node__gc(lua_State* state)
     return 0;
 }
 
-int lua_Node_addAdvertisedDescendant(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                gameplay::ScriptUtil::LuaArray<Node> param1 = gameplay::ScriptUtil::getObjectPointer<Node>(2, "Node", false, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Node'.");
-                    lua_error(state);
-                }
-
-                Node* instance = getInstance(state);
-                instance->addAdvertisedDescendant(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Node_addAdvertisedDescendant - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Node_addChild(lua_State* state)
 {
     // Get the number of parameters.
@@ -1090,54 +1048,6 @@ int lua_Node_getActiveCameraTranslationWorld(lua_State* state)
     return 0;
 }
 
-int lua_Node_getAdvertisedDescendant(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
-
-                Node* instance = getInstance(state);
-                void* returnPtr = (void*)instance->getAdvertisedDescendant(param1);
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "Node");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Node_getAdvertisedDescendant - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Node_getAgent(lua_State* state)
 {
     // Get the number of parameters.
@@ -2399,41 +2309,6 @@ int lua_Node_getNextSibling(lua_State* state)
     return 0;
 }
 
-int lua_Node_getNumAdvertisedDescendants(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                Node* instance = getInstance(state);
-                unsigned int result = instance->getNumAdvertisedDescendants();
-
-                // Push the return value onto the stack.
-                lua_pushunsigned(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Node_getNumAdvertisedDescendants - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Node_getParent(lua_State* state)
 {
     // Get the number of parameters.
@@ -3925,6 +3800,76 @@ int lua_Node_isStatic(lua_State* state)
     return 0;
 }
 
+int lua_Node_isVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Node* instance = getInstance(state);
+                bool result = instance->isVisible();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Node_isVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Node_isVisibleInHierarchy(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Node* instance = getInstance(state);
+                bool result = instance->isVisibleInHierarchy();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Node_isVisibleInHierarchy - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Node_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -6025,6 +5970,42 @@ int lua_Node_setTranslationZ(lua_State* state)
     return 0;
 }
 
+int lua_Node_setVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Node* instance = getInstance(state);
+                instance->setVisible(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Node_setVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Node_static_ANIMATE_ROTATE(lua_State* state)
 {
     // Validate the number of parameters.

+ 3 - 3
gameplay/src/lua/lua_Node.h

@@ -6,7 +6,6 @@ namespace gameplay
 
 // Lua bindings for Node.
 int lua_Node__gc(lua_State* state);
-int lua_Node_addAdvertisedDescendant(lua_State* state);
 int lua_Node_addChild(lua_State* state);
 int lua_Node_addListener(lua_State* state);
 int lua_Node_addRef(lua_State* state);
@@ -19,7 +18,6 @@ int lua_Node_destroyAnimation(lua_State* state);
 int lua_Node_findNode(lua_State* state);
 int lua_Node_getActiveCameraTranslationView(lua_State* state);
 int lua_Node_getActiveCameraTranslationWorld(lua_State* state);
-int lua_Node_getAdvertisedDescendant(lua_State* state);
 int lua_Node_getAgent(lua_State* state);
 int lua_Node_getAnimation(lua_State* state);
 int lua_Node_getAnimationPropertyComponentCount(lua_State* state);
@@ -46,7 +44,6 @@ int lua_Node_getLight(lua_State* state);
 int lua_Node_getMatrix(lua_State* state);
 int lua_Node_getModel(lua_State* state);
 int lua_Node_getNextSibling(lua_State* state);
-int lua_Node_getNumAdvertisedDescendants(lua_State* state);
 int lua_Node_getParent(lua_State* state);
 int lua_Node_getParticleEmitter(lua_State* state);
 int lua_Node_getPreviousSibling(lua_State* state);
@@ -79,6 +76,8 @@ int lua_Node_getWorldViewMatrix(lua_State* state);
 int lua_Node_getWorldViewProjectionMatrix(lua_State* state);
 int lua_Node_hasTag(lua_State* state);
 int lua_Node_isStatic(lua_State* state);
+int lua_Node_isVisible(lua_State* state);
+int lua_Node_isVisibleInHierarchy(lua_State* state);
 int lua_Node_release(lua_State* state);
 int lua_Node_removeAllChildren(lua_State* state);
 int lua_Node_removeChild(lua_State* state);
@@ -115,6 +114,7 @@ int lua_Node_setTranslation(lua_State* state);
 int lua_Node_setTranslationX(lua_State* state);
 int lua_Node_setTranslationY(lua_State* state);
 int lua_Node_setTranslationZ(lua_State* state);
+int lua_Node_setVisible(lua_State* state);
 int lua_Node_static_ANIMATE_ROTATE(lua_State* state);
 int lua_Node_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state);
 int lua_Node_static_ANIMATE_SCALE(lua_State* state);

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

@@ -235,9 +235,12 @@ int lua_ParticleEmitter_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 ParticleEmitter* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_ParticleEmitter_draw - Failed to match the given parameters to a valid function signature.");

+ 0 - 10
gameplay/src/lua/lua_RenderStateAutoBinding.cpp

@@ -19,8 +19,6 @@ static const char* luaEnumString_RenderStateAutoBinding_CAMERA_WORLD_POSITION =
 static const char* luaEnumString_RenderStateAutoBinding_CAMERA_VIEW_POSITION = "CAMERA_VIEW_POSITION";
 static const char* luaEnumString_RenderStateAutoBinding_MATRIX_PALETTE = "MATRIX_PALETTE";
 static const char* luaEnumString_RenderStateAutoBinding_SCENE_AMBIENT_COLOR = "SCENE_AMBIENT_COLOR";
-static const char* luaEnumString_RenderStateAutoBinding_SCENE_LIGHT_COLOR = "SCENE_LIGHT_COLOR";
-static const char* luaEnumString_RenderStateAutoBinding_SCENE_LIGHT_DIRECTION = "SCENE_LIGHT_DIRECTION";
 
 RenderState::AutoBinding lua_enumFromString_RenderStateAutoBinding(const char* s)
 {
@@ -50,10 +48,6 @@ RenderState::AutoBinding lua_enumFromString_RenderStateAutoBinding(const char* s
         return RenderState::MATRIX_PALETTE;
     if (strcmp(s, luaEnumString_RenderStateAutoBinding_SCENE_AMBIENT_COLOR) == 0)
         return RenderState::SCENE_AMBIENT_COLOR;
-    if (strcmp(s, luaEnumString_RenderStateAutoBinding_SCENE_LIGHT_COLOR) == 0)
-        return RenderState::SCENE_LIGHT_COLOR;
-    if (strcmp(s, luaEnumString_RenderStateAutoBinding_SCENE_LIGHT_DIRECTION) == 0)
-        return RenderState::SCENE_LIGHT_DIRECTION;
     return RenderState::NONE;
 }
 
@@ -85,10 +79,6 @@ const char* lua_stringFromEnum_RenderStateAutoBinding(RenderState::AutoBinding e
         return luaEnumString_RenderStateAutoBinding_MATRIX_PALETTE;
     if (e == RenderState::SCENE_AMBIENT_COLOR)
         return luaEnumString_RenderStateAutoBinding_SCENE_AMBIENT_COLOR;
-    if (e == RenderState::SCENE_LIGHT_COLOR)
-        return luaEnumString_RenderStateAutoBinding_SCENE_LIGHT_COLOR;
-    if (e == RenderState::SCENE_LIGHT_DIRECTION)
-        return luaEnumString_RenderStateAutoBinding_SCENE_LIGHT_DIRECTION;
     return enumStringEmpty;
 }
 

+ 0 - 178
gameplay/src/lua/lua_Scene.cpp

@@ -28,8 +28,6 @@ void luaRegister_Scene()
         {"getAmbientColor", lua_Scene_getAmbientColor},
         {"getFirstNode", lua_Scene_getFirstNode},
         {"getId", lua_Scene_getId},
-        {"getLightColor", lua_Scene_getLightColor},
-        {"getLightDirection", lua_Scene_getLightDirection},
         {"getNodeCount", lua_Scene_getNodeCount},
         {"getRefCount", lua_Scene_getRefCount},
         {"release", lua_Scene_release},
@@ -38,8 +36,6 @@ void luaRegister_Scene()
         {"setActiveCamera", lua_Scene_setActiveCamera},
         {"setAmbientColor", lua_Scene_setAmbientColor},
         {"setId", lua_Scene_setId},
-        {"setLightColor", lua_Scene_setLightColor},
-        {"setLightDirection", lua_Scene_setLightDirection},
         {"visit", lua_Scene_visit},
         {NULL, NULL}
     };
@@ -589,94 +585,6 @@ int lua_Scene_getId(lua_State* state)
     return 0;
 }
 
-int lua_Scene_getLightColor(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                Scene* instance = getInstance(state);
-                void* returnPtr = (void*)&(instance->getLightColor());
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "Vector3");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Scene_getLightColor - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Scene_getLightDirection(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                Scene* instance = getInstance(state);
-                void* returnPtr = (void*)&(instance->getLightDirection());
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "Vector3");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Scene_getLightDirection - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Scene_getNodeCount(lua_State* state)
 {
     // Get the number of parameters.
@@ -975,92 +883,6 @@ int lua_Scene_setId(lua_State* state)
     return 0;
 }
 
-int lua_Scene_setLightColor(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 4:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER &&
-                lua_type(state, 3) == LUA_TNUMBER &&
-                lua_type(state, 4) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                float param1 = (float)luaL_checknumber(state, 2);
-
-                // Get parameter 2 off the stack.
-                float param2 = (float)luaL_checknumber(state, 3);
-
-                // Get parameter 3 off the stack.
-                float param3 = (float)luaL_checknumber(state, 4);
-
-                Scene* instance = getInstance(state);
-                instance->setLightColor(param1, param2, param3);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Scene_setLightColor - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 4).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Scene_setLightDirection(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
-                    lua_error(state);
-                }
-
-                Scene* instance = getInstance(state);
-                instance->setLightDirection(*param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Scene_setLightDirection - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Scene_static_create(lua_State* state)
 {
     // Get the number of parameters.

+ 0 - 4
gameplay/src/lua/lua_Scene.h

@@ -15,8 +15,6 @@ int lua_Scene_getActiveCamera(lua_State* state);
 int lua_Scene_getAmbientColor(lua_State* state);
 int lua_Scene_getFirstNode(lua_State* state);
 int lua_Scene_getId(lua_State* state);
-int lua_Scene_getLightColor(lua_State* state);
-int lua_Scene_getLightDirection(lua_State* state);
 int lua_Scene_getNodeCount(lua_State* state);
 int lua_Scene_getRefCount(lua_State* state);
 int lua_Scene_release(lua_State* state);
@@ -25,8 +23,6 @@ int lua_Scene_removeNode(lua_State* state);
 int lua_Scene_setActiveCamera(lua_State* state);
 int lua_Scene_setAmbientColor(lua_State* state);
 int lua_Scene_setId(lua_State* state);
-int lua_Scene_setLightColor(lua_State* state);
-int lua_Scene_setLightDirection(lua_State* state);
 int lua_Scene_static_create(lua_State* state);
 int lua_Scene_static_getScene(lua_State* state);
 int lua_Scene_static_load(lua_State* state);

+ 186 - 0
gameplay/src/lua/lua_SceneRenderer.cpp

@@ -0,0 +1,186 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_SceneRenderer.h"
+#include "Base.h"
+#include "SceneRenderer.h"
+
+namespace gameplay
+{
+
+void luaRegister_SceneRenderer()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"isWireframe", lua_SceneRenderer_isWireframe},
+        {"render", lua_SceneRenderer_render},
+        {"setWireframe", lua_SceneRenderer_setWireframe},
+        {NULL, NULL}
+    };
+    const luaL_Reg* lua_statics = NULL;
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("SceneRenderer", lua_members, NULL, lua_SceneRenderer__gc, lua_statics, scopePath);
+}
+
+static SceneRenderer* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "SceneRenderer");
+    luaL_argcheck(state, userdata != NULL, 1, "'SceneRenderer' expected.");
+    return (SceneRenderer*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_SceneRenderer__gc(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                void* userdata = luaL_checkudata(state, 1, "SceneRenderer");
+                luaL_argcheck(state, userdata != NULL, 1, "'SceneRenderer' expected.");
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
+                if (object->owns)
+                {
+                    SceneRenderer* instance = (SceneRenderer*)object->instance;
+                    SAFE_DELETE(instance);
+                }
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer__gc - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRenderer_isWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                SceneRenderer* instance = getInstance(state);
+                bool result = instance->isWireframe();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer_isWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRenderer_render(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
+                    lua_error(state);
+                }
+
+                SceneRenderer* instance = getInstance(state);
+                unsigned int result = instance->render(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer_render - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRenderer_setWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                SceneRenderer* instance = getInstance(state);
+                instance->setWireframe(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer_setWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 17 - 0
gameplay/src/lua/lua_SceneRenderer.h

@@ -0,0 +1,17 @@
+#ifndef LUA_SCENERENDERER_H_
+#define LUA_SCENERENDERER_H_
+
+namespace gameplay
+{
+
+// Lua bindings for SceneRenderer.
+int lua_SceneRenderer__gc(lua_State* state);
+int lua_SceneRenderer_isWireframe(lua_State* state);
+int lua_SceneRenderer_render(lua_State* state);
+int lua_SceneRenderer_setWireframe(lua_State* state);
+
+void luaRegister_SceneRenderer();
+
+}
+
+#endif

+ 194 - 0
gameplay/src/lua/lua_SceneRendererForward.cpp

@@ -0,0 +1,194 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_SceneRendererForward.h"
+#include "Base.h"
+#include "Form.h"
+#include "Model.h"
+#include "ParticleEmitter.h"
+#include "SceneRenderer.h"
+#include "SceneRendererForward.h"
+#include "Terrain.h"
+
+namespace gameplay
+{
+
+void luaRegister_SceneRendererForward()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"isWireframe", lua_SceneRendererForward_isWireframe},
+        {"render", lua_SceneRendererForward_render},
+        {"setWireframe", lua_SceneRendererForward_setWireframe},
+        {NULL, NULL}
+    };
+    const luaL_Reg lua_statics[] = 
+    {
+        {"create", lua_SceneRendererForward_static_create},
+        {NULL, NULL}
+    };
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("SceneRendererForward", lua_members, NULL, NULL, lua_statics, scopePath);
+}
+
+static SceneRendererForward* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "SceneRendererForward");
+    luaL_argcheck(state, userdata != NULL, 1, "'SceneRendererForward' expected.");
+    return (SceneRendererForward*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_SceneRendererForward_isWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                SceneRendererForward* instance = getInstance(state);
+                bool result = instance->isWireframe();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRendererForward_isWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRendererForward_render(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
+                    lua_error(state);
+                }
+
+                SceneRendererForward* instance = getInstance(state);
+                unsigned int result = instance->render(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRendererForward_render - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRendererForward_setWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                SceneRendererForward* instance = getInstance(state);
+                instance->setWireframe(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_SceneRendererForward_setWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRendererForward_static_create(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 0:
+        {
+            void* returnPtr = (void*)SceneRendererForward::create();
+            if (returnPtr)
+            {
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                object->instance = returnPtr;
+                object->owns = false;
+                luaL_getmetatable(state, "SceneRendererForward");
+                lua_setmetatable(state, -2);
+            }
+            else
+            {
+                lua_pushnil(state);
+            }
+
+            return 1;
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 0).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 17 - 0
gameplay/src/lua/lua_SceneRendererForward.h

@@ -0,0 +1,17 @@
+#ifndef LUA_SCENERENDERERFORWARD_H_
+#define LUA_SCENERENDERERFORWARD_H_
+
+namespace gameplay
+{
+
+// Lua bindings for SceneRendererForward.
+int lua_SceneRendererForward_isWireframe(lua_State* state);
+int lua_SceneRendererForward_render(lua_State* state);
+int lua_SceneRendererForward_setWireframe(lua_State* state);
+int lua_SceneRendererForward_static_create(lua_State* state);
+
+void luaRegister_SceneRendererForward();
+
+}
+
+#endif

+ 12 - 6
gameplay/src/lua/lua_Terrain.cpp

@@ -188,9 +188,12 @@ int lua_Terrain_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Terrain* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Terrain_draw - Failed to match the given parameters to a valid function signature.");
@@ -206,9 +209,12 @@ int lua_Terrain_draw(lua_State* state)
                 bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
                 Terrain* instance = getInstance(state);
-                instance->draw(param1);
-                
-                return 0;
+                unsigned int result = instance->draw(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Terrain_draw - Failed to match the given parameters to a valid function signature.");

+ 232 - 0
gameplay/src/lua/lua_VisibleSet.cpp

@@ -0,0 +1,232 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_VisibleSet.h"
+#include "VisibleSet.h"
+
+namespace gameplay
+{
+
+void luaRegister_VisibleSet()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"getNext", lua_VisibleSet_getNext},
+        {"getScene", lua_VisibleSet_getScene},
+        {"reset", lua_VisibleSet_reset},
+        {"setScene", lua_VisibleSet_setScene},
+        {NULL, NULL}
+    };
+    const luaL_Reg* lua_statics = NULL;
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("VisibleSet", lua_members, NULL, lua_VisibleSet__gc, lua_statics, scopePath);
+}
+
+static VisibleSet* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "VisibleSet");
+    luaL_argcheck(state, userdata != NULL, 1, "'VisibleSet' expected.");
+    return (VisibleSet*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_VisibleSet__gc(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                void* userdata = luaL_checkudata(state, 1, "VisibleSet");
+                luaL_argcheck(state, userdata != NULL, 1, "'VisibleSet' expected.");
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
+                if (object->owns)
+                {
+                    VisibleSet* instance = (VisibleSet*)object->instance;
+                    SAFE_DELETE(instance);
+                }
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet__gc - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_getNext(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSet* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getNext();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Node");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_getNext - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_getScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSet* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getScene();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Scene");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_getScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_reset(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSet* instance = getInstance(state);
+                instance->reset();
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_reset - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_setScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Scene> param1 = gameplay::ScriptUtil::getObjectPointer<Scene>(2, "Scene", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Scene'.");
+                    lua_error(state);
+                }
+
+                VisibleSet* instance = getInstance(state);
+                instance->setScene(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_setScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 18 - 0
gameplay/src/lua/lua_VisibleSet.h

@@ -0,0 +1,18 @@
+#ifndef LUA_VISIBLESET_H_
+#define LUA_VISIBLESET_H_
+
+namespace gameplay
+{
+
+// Lua bindings for VisibleSet.
+int lua_VisibleSet__gc(lua_State* state);
+int lua_VisibleSet_getNext(lua_State* state);
+int lua_VisibleSet_getScene(lua_State* state);
+int lua_VisibleSet_reset(lua_State* state);
+int lua_VisibleSet_setScene(lua_State* state);
+
+void luaRegister_VisibleSet();
+
+}
+
+#endif

+ 251 - 0
gameplay/src/lua/lua_VisibleSetDefault.cpp

@@ -0,0 +1,251 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_VisibleSetDefault.h"
+#include "Base.h"
+#include "VisibleSetDefault.h"
+
+namespace gameplay
+{
+
+void luaRegister_VisibleSetDefault()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"getNext", lua_VisibleSetDefault_getNext},
+        {"getScene", lua_VisibleSetDefault_getScene},
+        {"reset", lua_VisibleSetDefault_reset},
+        {"setScene", lua_VisibleSetDefault_setScene},
+        {NULL, NULL}
+    };
+    const luaL_Reg lua_statics[] = 
+    {
+        {"create", lua_VisibleSetDefault_static_create},
+        {NULL, NULL}
+    };
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("VisibleSetDefault", lua_members, NULL, NULL, lua_statics, scopePath);
+}
+
+static VisibleSetDefault* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "VisibleSetDefault");
+    luaL_argcheck(state, userdata != NULL, 1, "'VisibleSetDefault' expected.");
+    return (VisibleSetDefault*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_VisibleSetDefault_getNext(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSetDefault* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getNext();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Node");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_getNext - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_getScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSetDefault* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getScene();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Scene");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_getScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_reset(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSetDefault* instance = getInstance(state);
+                instance->reset();
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_reset - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_setScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Scene> param1 = gameplay::ScriptUtil::getObjectPointer<Scene>(2, "Scene", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Scene'.");
+                    lua_error(state);
+                }
+
+                VisibleSetDefault* instance = getInstance(state);
+                instance->setScene(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_setScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_static_create(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Scene> param1 = gameplay::ScriptUtil::getObjectPointer<Scene>(1, "Scene", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Scene'.");
+                    lua_error(state);
+                }
+
+                void* returnPtr = (void*)VisibleSetDefault::create(param1);
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "VisibleSetDefault");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_static_create - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 18 - 0
gameplay/src/lua/lua_VisibleSetDefault.h

@@ -0,0 +1,18 @@
+#ifndef LUA_VISIBLESETDEFAULT_H_
+#define LUA_VISIBLESETDEFAULT_H_
+
+namespace gameplay
+{
+
+// Lua bindings for VisibleSetDefault.
+int lua_VisibleSetDefault_getNext(lua_State* state);
+int lua_VisibleSetDefault_getScene(lua_State* state);
+int lua_VisibleSetDefault_reset(lua_State* state);
+int lua_VisibleSetDefault_setScene(lua_State* state);
+int lua_VisibleSetDefault_static_create(lua_State* state);
+
+void luaRegister_VisibleSetDefault();
+
+}
+
+#endif

+ 4 - 0
gameplay/src/lua/lua_all_bindings.cpp

@@ -103,6 +103,8 @@ void lua_RegisterAllBindings()
     luaRegister_RenderStateStateBlock();
     luaRegister_RenderTarget();
     luaRegister_Scene();
+    luaRegister_SceneRenderer();
+    luaRegister_SceneRendererForward();
     luaRegister_ScreenDisplayer();
     luaRegister_ScriptController();
     luaRegister_ScriptTarget();
@@ -130,6 +132,8 @@ void lua_RegisterAllBindings()
     luaRegister_VertexFormat();
     luaRegister_VertexFormatElement();
     luaRegister_VerticalLayout();
+    luaRegister_VisibleSet();
+    luaRegister_VisibleSetDefault();
     luaRegister_lua_Global();
 }
 

+ 4 - 0
gameplay/src/lua/lua_all_bindings.h

@@ -98,6 +98,8 @@
 #include "lua_RenderStateStateBlock.h"
 #include "lua_RenderTarget.h"
 #include "lua_Scene.h"
+#include "lua_SceneRenderer.h"
+#include "lua_SceneRendererForward.h"
 #include "lua_ScreenDisplayer.h"
 #include "lua_ScriptController.h"
 #include "lua_ScriptTarget.h"
@@ -125,6 +127,8 @@
 #include "lua_VertexFormat.h"
 #include "lua_VertexFormatElement.h"
 #include "lua_VerticalLayout.h"
+#include "lua_VisibleSet.h"
+#include "lua_VisibleSetDefault.h"
 #include "lua_Global.h"
 
 namespace gameplay

+ 26 - 37
gameplay/src/social/GoogleGamesSocialSession.cpp → gameplay/src/social/GooglePlaySocialSession.cpp

@@ -1,7 +1,7 @@
 #if defined(__ANDROID__) && defined(GP_USE_SOCIAL)
 
 #include "Base.h"
-#include "GoogleGamesSocialSession.h"
+#include "GooglePlaySocialSession.h"
 #include <android_native_app_glue.h>
 #include <android/log.h>
 
@@ -10,9 +10,9 @@ namespace gameplay
 
 extern struct android_app* __state;
 
-GoogleGamesSocialSession* GoogleGamesSocialSession::_session = NULL;
+GooglePlaySocialSession* GooglePlaySocialSession::_session = NULL;
 
-GoogleGamesSocialSession::GoogleGamesSocialSession()
+GooglePlaySocialSession::GooglePlaySocialSession()
     : SocialSession(),
       _listener(NULL), _properties(NULL), _pendingUserResponse(false), _pendingFriendsResponse(false),
       _pendingScoresResponse(false), _pendingSubmitScoreResponse(false), _pendingAchievementResponse(false),
@@ -22,20 +22,20 @@ GoogleGamesSocialSession::GoogleGamesSocialSession()
     _userOp = USEROP_GET_LOCALUSER;
 }
 
-GoogleGamesSocialSession::~GoogleGamesSocialSession()
+GooglePlaySocialSession::~GooglePlaySocialSession()
 {
 }
 
-SocialSessionListener* GoogleGamesSocialSession::getListener()
+SocialSessionListener* GooglePlaySocialSession::getListener()
 {
     return _listener;
 }
 
-SocialSession *GoogleGamesSocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
+SocialSession *GooglePlaySocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
 {
     if (!_session)
     {
-		_session = new GoogleGamesSocialSession();
+		_session = new GooglePlaySocialSession();
 		_session->_listener = listener;
 		_session->_properties = properties;
 
@@ -75,7 +75,7 @@ SocialSession *GoogleGamesSocialSession::authenticate(SocialSessionListener* lis
     return _session;
 }
 
-const SocialPlayer& GoogleGamesSocialSession::getUser() const
+const SocialPlayer& GooglePlaySocialSession::getUser() const
 {
 	return _user;
 }
@@ -83,108 +83,97 @@ const SocialPlayer& GoogleGamesSocialSession::getUser() const
 /**
  * @see SocialSession::loadFriends
  */
-void GoogleGamesSocialSession::loadFriends()
+void GooglePlaySocialSession::loadFriends()
 {
-
 }
 
 /**
  * @see SocialSession::loadAchievements
  */
-void GoogleGamesSocialSession::loadAchievements()
+void GooglePlaySocialSession::loadAchievements()
 {
-
 }
 
 /**
  * @see SocialSession::submitAchievement
  */
-void GoogleGamesSocialSession::submitAchievement(const char* achievementId, unsigned int value, bool achieved=false)
+void GooglePlaySocialSession::submitAchievement(const char* achievementId, unsigned int value, bool achieved=false)
 {
-
 }
 
 /**
  * @see SocialSession::incrementAchievement
  */
-void GoogleGamesSocialSession::incrementAchievement(const char* achievementId, unsigned int increment=1)
+void GooglePlaySocialSession::incrementAchievement(const char* achievementId, unsigned int increment=1)
 {
-
 }
 
 /**
-  * @see SocialSession::syncAchievements
+  * @see SocialSession::synchronizeAchievements
   */
-void GoogleGamesSocialSession::synchronizeAchievements()
+void GooglePlaySocialSession::synchronizeAchievements()
 {
-
 }
 
 /**
  * @see SocialSession::loadScores
  */
-void GoogleGamesSocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, const SocialPlayer& player, unsigned int count)
+void GooglePlaySocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, const SocialPlayer& player, unsigned int count)
 {
-
 }
 
 /**
  * @see SocialSession::loadScores
  */
-void GoogleGamesSocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, unsigned int start, unsigned int count)
+void GooglePlaySocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, unsigned int start, unsigned int count)
 {
-
 }
 
 /**
  * @see SocialSession::submitScore
  */
-void GoogleGamesSocialSession::submitScore(const char* leaderboardId, float score)
+void GooglePlaySocialSession::submitScore(const char* leaderboardId, float score)
 {
-
 }
 
 /**
   * @see SocialSession::submitChallenge
   */
-void GoogleGamesSocialSession::submitChallenge(const SocialPlayer *player, unsigned int wager, float score, const char* leaderboardId=0)
+void GooglePlaySocialSession::submitChallenge(const SocialPlayer *player, unsigned int wager, float score, const char* leaderboardId=0)
 {
-
 }
 
 /**
   * @see SocialSession::loadChallenges
   */
-void GoogleGamesSocialSession::loadChallenges(bool showOpenChallengesOnly=true)
+void GooglePlaySocialSession::loadChallenges(bool showOpenChallengesOnly=true)
 {
-
 }
 
 /**
   * @see SocialSession::acceptChallenge
   */
-void GoogleGamesSocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
+void GooglePlaySocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
 {
-
 }
 
 /**
  * @see SocialSession::requestSavedData
  */
-void GoogleGamesSocialSession::loadSavedData(const char* key) {}
+void GooglePlaySocialSession::loadSavedData(const char* key) {}
 
 /**
  * @see SocialSession::submitSavedData
  */
-void GoogleGamesSocialSession::submitSavedData(const char* key, std::string data) {}
+void GooglePlaySocialSession::submitSavedData(const char* key, std::string data) {}
 
-void GoogleGamesSocialSession::displayLeaderboard(const char* leaderboardId) {}
+void GooglePlaySocialSession::displayLeaderboard(const char* leaderboardId) {}
 
-void GoogleGamesSocialSession::displayAchievements() {}
+void GooglePlaySocialSession::displayAchievements() {}
 
-void GoogleGamesSocialSession::displayChallenges() {}
+void GooglePlaySocialSession::displayChallenges() {}
 
-void GoogleGamesSocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) {}
+void GooglePlaySocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) {}
 
 
 }

+ 8 - 8
gameplay/src/social/GoogleGamesSocialSession.h → gameplay/src/social/GooglePlaySocialSession.h

@@ -1,7 +1,7 @@
 #if defined(__ANDROID__) && defined(GP_USE_SOCIAL)
 
-#ifndef GOOGLEGAMESSOCIALSESSION_H_
-#define GOOGLEGAMESSOCIALSESSION_H_
+#ifndef GOOGLEPLAYSOCIALSESSION_H_
+#define GOOGLEPLAYSOCIALSESSION_H_
 
 #include "SocialSession.h"
 
@@ -9,14 +9,14 @@ namespace gameplay
 {
 
 /**
- * Google Games implementation of SocialSession
+ * Google Play (game services) implementation of SocialSession
  *
  * Note: ensure game.config has the following properties
  *
   @verbatim
     social
     {
-         provider = GoogleGames
+         provider = GooglePlay
          id = d346c484-12aa-49a2-a0a0-de2f87492d72
          secret = aAa+DehBfyGO/CYaE3nWomgu7SIbWFczUih+Qwf3/n7u0y3nyq5Hag==
          version = 1.0
@@ -37,7 +37,7 @@ namespace gameplay
  *
  * @script{ignore}
  */
-class GoogleGamesSocialSession : public SocialSession
+class GooglePlaySocialSession : public SocialSession
 {
     friend class SocialController;
 
@@ -142,12 +142,12 @@ private:
     /**
      * Contructor
      */
-    GoogleGamesSocialSession();
+    GooglePlaySocialSession();
 
     /**
      * Destructor
      */
-    virtual ~GoogleGamesSocialSession();
+    virtual ~GooglePlaySocialSession();
 #if 0
 
     static void userCallback(void* cookie, unsigned int result);
@@ -168,7 +168,7 @@ private:
 
     SocialChallenge &addChallenge(SC_Challenge_h challenge);
 #endif
-    static GoogleGamesSocialSession* _session;
+    static GooglePlaySocialSession* _session;
 
     enum UserOp
     {

+ 2 - 2
samples/browser/res/common/box.material

@@ -7,15 +7,15 @@ material box
             // shaders
             vertexShader = res/shaders/textured.vert
             fragmentShader = res/shaders/textured.frag
-            defines = SPECULAR
+            defines = SPECULAR;DIRECTIONAL_LIGHT_COUNT 1
             
             // uniforms
             u_worldViewProjectionMatrix = WORLD_VIEW_PROJECTION_MATRIX
             u_inverseTransposeWorldViewMatrix = INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX
             u_cameraPosition = CAMERA_WORLD_POSITION
             u_ambientColor = 0.2, 0.2, 0.2
-            u_lightColor = 0.75, 0.75, 0.75
             u_specularExponent = 50
+            u_directionalLightColor[0] = 0.75, 0.75, 0.75
             
             // samplers
             sampler u_diffuseTexture

+ 3 - 3
samples/browser/res/common/duck.material

@@ -7,15 +7,15 @@ material duck
             // shaders
             vertexShader = res/shaders/textured.vert
             fragmentShader = res/shaders/textured.frag
-            defines = SPECULAR
+            defines = SPECULAR;DIRECTIONAL_LIGHT_COUNT 1
             
             // uniforms
             u_worldViewProjectionMatrix = WORLD_VIEW_PROJECTION_MATRIX
             u_inverseTransposeWorldViewMatrix = INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX
             u_cameraPosition = CAMERA_WORLD_POSITION
-            u_ambientColor = 0.2, 0.2, 0.2
-            u_lightColor = 0.75, 0.75, 0.75
+            u_ambientColor = SCENE_AMBIENT_COLOR
             u_specularExponent = 50
+            u_directionalLightColor[0] = 0.75, 0.75, 0.75
             
             // samplers
             sampler u_diffuseTexture

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно