Kaynağa Gözat

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

Adam Blake 13 yıl önce
ebeveyn
işleme
65fd7185e9
41 değiştirilmiş dosya ile 491 ekleme ve 334 silme
  1. 8 2
      CHANGES.md
  2. 4 5
      README.md
  3. 2 3
      gameplay-encoder/README.md
  4. 20 0
      gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj
  5. 4 0
      gameplay-template/gameplay-template.xcodeproj/project.pbxproj
  6. 3 5
      gameplay/gameplay.xcodeproj/project.pbxproj
  7. 2 2
      gameplay/src/Animation.cpp
  8. 4 4
      gameplay/src/AnimationClip.cpp
  9. 1 1
      gameplay/src/AnimationController.cpp
  10. 6 6
      gameplay/src/AnimationTarget.cpp
  11. 1 1
      gameplay/src/AudioSource.cpp
  12. 1 1
      gameplay/src/Bundle.cpp
  13. 1 1
      gameplay/src/Bundle.h
  14. 1 3
      gameplay/src/FileSystem.cpp
  15. 2 2
      gameplay/src/Font.cpp
  16. 1 2
      gameplay/src/Form.cpp
  17. 8 1
      gameplay/src/Game.h
  18. 5 0
      gameplay/src/Game.inl
  19. 5 1
      gameplay/src/PhysicsVehicle.cpp
  20. 1 1
      gameplay/src/PhysicsVehicleWheel.h
  21. 8 0
      gameplay/src/Platform.h
  22. 5 0
      gameplay/src/PlatformAndroid.cpp
  23. 8 1
      gameplay/src/PlatformLinux.cpp
  24. 11 6
      gameplay/src/PlatformMacOSX.mm
  25. 6 1
      gameplay/src/PlatformQNX.cpp
  26. 5 0
      gameplay/src/PlatformWin32.cpp
  27. 6 1
      gameplay/src/PlatformiOS.mm
  28. 2 2
      gameplay/src/Properties.cpp
  29. 5 5
      gameplay/src/SceneLoader.cpp
  30. 4 4
      gameplay/src/ScriptController.cpp
  31. 4 4
      gameplay/src/lua/lua_Bundle.cpp
  32. 1 1
      gameplay/src/lua/lua_Bundle.h
  33. 38 0
      gameplay/src/lua/lua_Container.cpp
  34. 1 0
      gameplay/src/lua/lua_Container.h
  35. 38 0
      gameplay/src/lua/lua_Form.cpp
  36. 1 0
      gameplay/src/lua/lua_Form.h
  37. 3 3
      gameplay/src/lua/lua_Global.cpp
  38. 195 195
      gameplay/src/lua/lua_Logger.cpp
  39. 17 17
      gameplay/src/lua/lua_Logger.h
  40. 38 38
      gameplay/src/lua/lua_LoggerLevel.cpp
  41. 15 15
      gameplay/src/lua/lua_LoggerLevel.h

+ 8 - 2
CHANGES.md

@@ -1,12 +1,17 @@
 ## v1.5.0
 
-- Linux x64 support tested on Ubuntu 12+.
+- Linux support. (tested on Ubuntu 12)
 - CMake support for Linux makefile generation.
 - Gamepad controllers support for desktops.
 - Touch gesture support for tap, swipe and pinch.
 - Vehicle phyics support via new PhysicsVehicle and PhysicsVehicleWheel classes.
-- Adds gameplay-tests project as a test app for various engine features with initial basic tests.
+- 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 documenation for game.config .scene, .material, .animation, .physics, .particle
 - Web community forums at http://www.gameplay3d.org/forums
 - 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 texture that are non-power of two.
@@ -16,6 +21,7 @@
 - Fixes Lua errors to be treated as runtime warnings.
 - Fixes setVertexData to pointers instead of constant data.
 - Fixed AudioSource so that it doesn't loop by default.
+- Fixes minor UI scrolling issues.
 
 ## v1.4.0
 

+ 4 - 5
README.md

@@ -1,20 +1,19 @@
-## gameplay v1.4.0
+## gameplay v1.5.0
 An open-source, cross-platform 3D native C++ game framework making it easy to learn and write mobile and desktop games. 
 
 ## Supported Mobile Platforms
 - BlackBerry 10 and PlayBook 2.0 (using BlackBerry Native SDK)
-- Google Android 2.3+ (using Google Android NDK, SDK API level 9+)
 - Apple iOS 5.1 (using Apple XCode 4.3.2)
+- Google Android 2.3+ (using Google Android NDK, SDK API level 9+)
 
 ## Supported Desktop Platforms
 - Microsoft Windows 7 (using Microsoft Visual Studio 2010)
 - Apple MacOS X (using Apple XCode 4.3.2)
+- Linux
 
 ## Roadmap for 'next' branch
-- Linux support
-- Vehicle physics
-- Shadows
 - AI pathfinding
+- Asset pipeline improvements
 
 ## Licence
 The project is open sourced under the Apache 2.0 license.

+ 2 - 3
gameplay-encoder/README.md

@@ -2,7 +2,7 @@
 Command-line tool for encoding games assets like true-type fonts and 3D scene files
 into a simple binary-based bundle file format for the gameplay 3D game framework runtime. 
 The 'bin' folder contains pre-built versions of the gameplay-encoder executables for 
-Windows 7, MacOS X and Linux x64 (tested on Ubuntu 12+) with support built-in support for:
+Windows 7, MacOS X and Linux (tested on Ubuntu 12) with support built-in support for:
 
 ## TrueType Font
 TrueType Fonts represent a standard in defining outline fonts and has become the 
@@ -47,10 +47,9 @@ Uncomment the root CMakeList.txt for the gameplay-encoder and run standard cmake
   * Example: "/Applications/Autodesk/FBX SDK/2013.3/include" (Use quotes due to additional space in path)
 - Add the FBX library and dependency Library/Frameworks: (Build Phases -> Link Binary with Libraries)
   * Example: /Applications/Autodesk/FBX SDK/2013.3/lib/gcc4/ub/libfbxsdk-2013.3-static.a  (Add Other)
-  * Example: libiconv.dylib, Cocoa.framework, SystemConfiguration.framework
 - Build gameplay-encoder
 
-### Building with FBX Support on Linux x64
+### Building with FBX Support on Linux
 - Download and install the FBX SDK for Mac OS X (http://www.autodesk.com/fbx)
 - Edit the gameplay-encoder/CMakeLists.txt adding the following:
 - Add the FBX include directory to Header Search Paths: (Build Settings)

+ 20 - 0
gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj

@@ -7,6 +7,9 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		4228A3FF1620A5A300955433 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4228A3FE1620A5A300955433 /* Cocoa.framework */; };
+		4228A4011620A5EC00955433 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4228A4001620A5EC00955433 /* SystemConfiguration.framework */; };
+		4228A4031620A63F00955433 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4228A4021620A63F00955433 /* libiconv.dylib */; };
 		42475D7C14720ECE00610A6A /* libdom.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42475D7B14720ECE00610A6A /* libdom.a */; };
 		4251B12C152D044B002F6199 /* Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4251B128152D044B002F6199 /* Curve.cpp */; };
 		42783423148D6F7500A6E27F /* FBXSceneEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4278341E148D6F7500A6E27F /* FBXSceneEncoder.cpp */; };
@@ -74,6 +77,9 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+		4228A3FE1620A5A300955433 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+		4228A4001620A5EC00955433 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+		4228A4021620A63F00955433 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = ../../../../../usr/lib/libiconv.dylib; sourceTree = "<group>"; };
 		42475CE6147208A000610A6A /* gameplay-encoder */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "gameplay-encoder"; sourceTree = BUILT_PRODUCTS_DIR; };
 		42475D7B14720ECE00610A6A /* libdom.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdom.a; path = "../external-deps/collada-dom/lib/macosx/libdom.a"; sourceTree = "<group>"; };
 		4251B128152D044B002F6199 /* Curve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Curve.cpp; path = src/Curve.cpp; sourceTree = SOURCE_ROOT; };
@@ -191,17 +197,30 @@
 				42C8EE391472DAA300E43619 /* libz.dylib in Frameworks */,
 				42C8EE371472D7E700E43619 /* libxml2.dylib in Frameworks */,
 				5BCD0643152CFC3C0071FAB5 /* libpng.a in Frameworks */,
+				4228A3FF1620A5A300955433 /* Cocoa.framework in Frameworks */,
+				4228A4011620A5EC00955433 /* SystemConfiguration.framework in Frameworks */,
+				4228A4031620A63F00955433 /* libiconv.dylib in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		4228A3FD1620A58000955433 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				4228A4001620A5EC00955433 /* SystemConfiguration.framework */,
+				4228A3FE1620A5A300955433 /* Cocoa.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 		42475CDB147208A000610A6A = {
 			isa = PBXGroup;
 			children = (
 				42475CE9147208A000610A6A /* src */,
 				427D4F44147DC9080076760E /* Libraries */,
+				4228A3FD1620A58000955433 /* Frameworks */,
 				42475CE7147208A000610A6A /* Products */,
 			);
 			sourceTree = "<group>";
@@ -326,6 +345,7 @@
 				42C8EE361472D7E700E43619 /* libxml2.dylib */,
 				42C8EE341472B60100E43619 /* libfreetype.a */,
 				42475D7B14720ECE00610A6A /* libdom.a */,
+				4228A4021620A63F00955433 /* libiconv.dylib */,
 			);
 			name = Libraries;
 			sourceTree = "<group>";

+ 4 - 0
gameplay-template/gameplay-template.xcodeproj/project.pbxproj

@@ -9,6 +9,7 @@
 /* Begin PBXBuildFile section */
 		42438B531491AD2000D218B8 /* libgameplay.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42438B521491AD2000D218B8 /* libgameplay.a */; };
 		428F7BDE15CB131A009ED24C /* game.config in Resources */ = {isa = PBXBuildFile; fileRef = 428F7BDD15CB131A009ED24C /* game.config */; };
+		424CC03C161FCBDD00577827 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 424CC03B161FCBDD00577827 /* IOKit.framework */; };
 		42C932C11491A0DB0098216A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C932C01491A0DB0098216A /* Cocoa.framework */; };
 		42C932EE1491A4CB0098216A /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 42C932ED1491A4CB0098216A /* icon.png */; };
 		42C932F11491A5160098216A /* TemplateGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C932EF1491A5160098216A /* TemplateGame.cpp */; };
@@ -45,6 +46,7 @@
 /* Begin PBXFileReference section */
 		428F7BDD15CB131A009ED24C /* game.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = game.config; sourceTree = "<group>"; };
 		42438B521491AD2000D218B8 /* libgameplay.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgameplay.a; path = "~/Library/Developer/Xcode/DerivedData/gameplay-exiunaubxxjndaapmcqkaoeboiob/Build/Products/Debug/libgameplay.a"; sourceTree = "<group>"; };
+		424CC03B161FCBDD00577827 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
 		42C932BC1491A0DB0098216A /* TEMPLATE_PROJECT-macosx.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TEMPLATE_PROJECT-macosx.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		42C932C01491A0DB0098216A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
 		42C932ED1491A4CB0098216A /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
@@ -87,6 +89,7 @@
 				42C933291491A6E50098216A /* libvorbisfile.a in Frameworks */,
 				42C9332C1491A7680098216A /* libpng.a in Frameworks */,
 				42C9332F1491A78D0098216A /* libz.dylib in Frameworks */,
+				424CC03C161FCBDD00577827 /* IOKit.framework in Frameworks */,
 				42C932C11491A0DB0098216A /* Cocoa.framework in Frameworks */,
 				42C9331D1491A6750098216A /* QuartzCore.framework in Frameworks */,
 				42C933171491A5EB0098216A /* OpenGL.framework in Frameworks */,
@@ -192,6 +195,7 @@
 		5B61613A14CCC3590073B857 /* MacOSX */ = {
 			isa = PBXGroup;
 			children = (
+				424CC03B161FCBDD00577827 /* IOKit.framework */,
 				42C932C01491A0DB0098216A /* Cocoa.framework */,
 				42C9331C1491A6750098216A /* QuartzCore.framework */,
 				42C933161491A5EB0098216A /* OpenGL.framework */,

+ 3 - 5
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -2567,7 +2567,6 @@
 		5B2BC75E1512514500D176CD /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
 		5B2BC7611512514D00D176CD /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
 		5B2BC7631512516B00D176CD /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
-		5B2BC768151251EB00D176CD /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; };
 		5B5DB92D14C25B7B007755DB /* libbullet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbullet.a; path = "../external-deps/bullet/lib/ios/i386/libbullet.a"; sourceTree = "<group>"; };
 		5B5DB92F14C25B94007755DB /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../external-deps/libpng/lib/ios/armv7/libpng.a"; sourceTree = "<group>"; };
 		5B5DB93114C25BA5007755DB /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "../external-deps/oggvorbis/lib/ios/armv7/libogg.a"; sourceTree = "<group>"; };
@@ -3609,9 +3608,8 @@
 		42CCD4AF146D811D00353661 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-				5B21E99516153890006EBEAC /* IOKit.framework */,
-				5B04C5FD14BFE52300EB0071 /* iOS */,
 				5B04C5FE14BFE52F00EB0071 /* MacOSX */,
+				5B04C5FD14BFE52300EB0071 /* iOS */,
 			);
 			name = Frameworks;
 			sourceTree = "<group>";
@@ -3619,7 +3617,6 @@
 		5B04C5FD14BFE52300EB0071 /* iOS */ = {
 			isa = PBXGroup;
 			children = (
-				5BAF201E152F2A6D003E2AC3 /* libz.dylib */,
 				5BAF2020152F2AF0003E2AC3 /* CoreGraphics.framework */,
 				5BAF2021152F2AF0003E2AC3 /* CoreMotion.framework */,
 				5BAF2022152F2AF0003E2AC3 /* Foundation.framework */,
@@ -3634,6 +3631,7 @@
 		5B04C5FE14BFE52F00EB0071 /* MacOSX */ = {
 			isa = PBXGroup;
 			children = (
+				5B21E99516153890006EBEAC /* IOKit.framework */,
 				5B2BC7611512514D00D176CD /* QuartzCore.framework */,
 				5B2BC75D1512514500D176CD /* OpenAL.framework */,
 				5B2BC75E1512514500D176CD /* OpenGL.framework */,
@@ -3652,7 +3650,7 @@
 				5B5DB93314C25BA5007755DB /* libvorbisenc.a */,
 				5B5DB93414C25BA5007755DB /* libvorbisfile.a */,
 				5B5DB92F14C25B94007755DB /* libpng.a */,
-				5B2BC768151251EB00D176CD /* libz.dylib */,
+				5BAF201E152F2A6D003E2AC3 /* libz.dylib */,
 			);
 			name = iOS;
 			sourceTree = "<group>";

+ 2 - 2
gameplay/src/Animation.cpp

@@ -296,8 +296,8 @@ AnimationClip* Animation::findClip(const char* id) const
     if (_clips)
     {
         AnimationClip* clip = NULL;
-        unsigned int clipCount = _clips->size();
-        for (unsigned int i = 0; i < clipCount; i++)
+        size_t clipCount = _clips->size();
+        for (size_t i = 0; i < clipCount; i++)
         {
             clip = _clips->at(i);
             GP_ASSERT(clip);

+ 4 - 4
gameplay/src/AnimationClip.cpp

@@ -43,7 +43,7 @@ AnimationClip::~AnimationClip()
 
     if (_scriptListeners)
     {
-        for (unsigned int i = 0; i < _scriptListeners->size(); i++)
+        for (size_t i = 0; i < _scriptListeners->size(); i++)
         {
             SAFE_DELETE((*_scriptListeners)[i]);
         }
@@ -498,8 +498,8 @@ bool AnimationClip::update(float elapsedTime)
     Animation::Channel* channel = NULL;
     AnimationValue* value = NULL;
     AnimationTarget* target = NULL;
-    unsigned int channelCount = _animation->_channels.size();
-    for (unsigned int i = 0; i < channelCount; i++)
+    size_t channelCount = _animation->_channels.size();
+    for (size_t i = 0; i < channelCount; i++)
     {
         channel = _animation->_channels[i];
         GP_ASSERT(channel);
@@ -627,4 +627,4 @@ void AnimationClip::ScriptListener::animationEvent(AnimationClip* clip, EventTyp
 }
 
 
-}
+}

+ 1 - 1
gameplay/src/AnimationController.cpp

@@ -97,7 +97,7 @@ void AnimationController::update(float elapsedTime)
 {
     if (_state != RUNNING)
         return;
-
+    
     Transform::suspendTransformChanged();
 
     // Loop through running clips and call update() on them.

+ 6 - 6
gameplay/src/AnimationTarget.cpp

@@ -164,11 +164,11 @@ Animation* AnimationTarget::createAnimation(const char* id, Properties* animatio
     }
     
     char delimeter = ' ';
-    unsigned int startOffset = 0;
-    unsigned int endOffset = (unsigned int)std::string::npos;
+    size_t startOffset = 0;
+    size_t endOffset = std::string::npos;
     
     unsigned long* keyTimes = new unsigned long[keyCount];
-    for (unsigned int i = 0; i < keyCount; i++)
+    for (size_t i = 0; i < keyCount; i++)
     {
         endOffset = static_cast<std::string>(keyTimesStr).find_first_of(delimeter, startOffset);
         if (endOffset != std::string::npos)
@@ -183,7 +183,7 @@ Animation* AnimationTarget::createAnimation(const char* id, Properties* animatio
     }
 
     startOffset = 0;
-    endOffset = (unsigned int)std::string::npos;
+    endOffset = std::string::npos;
     
     int componentCount = getAnimationPropertyComponentCount(propertyId);
     GP_ASSERT(componentCount > 0);
@@ -211,7 +211,7 @@ Animation* AnimationTarget::createAnimation(const char* id, Properties* animatio
     {
         keyIn = new float[components];
         startOffset = 0;
-        endOffset = (unsigned int)std::string::npos;
+        endOffset = std::string::npos;
         for (unsigned int i = 0; i < components; i++)
         {
             endOffset = static_cast<std::string>(keyInStr).find_first_of(delimeter, startOffset);
@@ -233,7 +233,7 @@ Animation* AnimationTarget::createAnimation(const char* id, Properties* animatio
     {   
         keyOut = new float[components];
         startOffset = 0;
-        endOffset = (unsigned int)std::string::npos;
+        endOffset = std::string::npos;
         for (unsigned int i = 0; i < components; i++)
         {
             endOffset = static_cast<std::string>(keyOutStr).find_first_of(delimeter, startOffset);

+ 1 - 1
gameplay/src/AudioSource.cpp

@@ -34,7 +34,7 @@ AudioSource* AudioSource::create(const char* url)
 {
     // Load from a .audio file.
     std::string pathStr = url;
-    if (pathStr.find(".audio") != pathStr.npos)
+    if (pathStr.find(".audio") != std::string::npos)
     {
         Properties* properties = Properties::create(url);
         if (properties == NULL)

+ 1 - 1
gameplay/src/Bundle.cpp

@@ -1749,7 +1749,7 @@ unsigned int Bundle::getObjectCount() const
     return _referenceCount;
 }
 
-const char* Bundle::getObjectID(unsigned int index) const
+const char* Bundle::getObjectId(unsigned int index) const
 {
     GP_ASSERT(_references);
     return (index >= _referenceCount ? NULL : _references[index].id.c_str());

+ 1 - 1
gameplay/src/Bundle.h

@@ -95,7 +95,7 @@ public:
      * 
      * @return The ID of the object at the given index, or NULL if index is invalid.
      */
-    const char* getObjectID(unsigned int index) const;
+    const char* getObjectId(unsigned int index) const;
 
 private:
 

+ 1 - 3
gameplay/src/FileSystem.cpp

@@ -134,7 +134,6 @@ const char* FileSystem::resolvePath(const char* path)
 
 bool FileSystem::listFiles(const char* dirPath, std::vector<std::string>& files)
 {
-    // TODO make this method work with absolute and relative paths.
 #ifdef WIN32
     std::string path(FileSystem::getResourcePath());
     if (dirPath && strlen(dirPath) > 0)
@@ -211,7 +210,7 @@ bool FileSystem::fileExists(const char* filePath)
     createFileFromAsset(filePath);
 
     gp_stat_struct s;
-// Win32 doesn't support an asset or bundle definitions.
+
 #ifdef WIN32
     if (stat(fullPath.c_str(), &s) != 0)
     {
@@ -246,7 +245,6 @@ FILE* FileSystem::openFile(const char* path, const char* mode)
     
     FILE* fp = fopen(fullPath.c_str(), mode);
     
-// Win32 doesn't support an asset or bundle definitions.
 #ifdef WIN32
     if (fp == NULL)
     {

+ 2 - 2
gameplay/src/Font.cpp

@@ -89,14 +89,14 @@ Font* Font::create(const char* path, const char* id)
     {
         // Get the ID of the first object in the bundle (assume it's a Font).
         const char* id;
-        if ((id = bundle->getObjectID(0)) == NULL)
+        if ((id = bundle->getObjectId(0)) == NULL)
         {
             GP_ERROR("Failed to load font without explicit id; the first object in the font bundle has a null id.");
             return NULL;
         }
 
         // Load the font using the ID of the first object in the bundle.
-        font = bundle->loadFont(bundle->getObjectID(0));
+        font = bundle->loadFont(bundle->getObjectId(0));
     }
     else
     {

+ 1 - 2
gameplay/src/Form.cpp

@@ -657,8 +657,7 @@ bool Form::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelt
 {
     bool eventConsumed = false;
 
-    size_t size = __forms.size();
-    for (size_t i = 0; i < size; ++i)
+    for (size_t i = 0; i < __forms.size(); ++i)
     {
         Form* form = __forms[i];
         GP_ASSERT(form);

+ 8 - 1
gameplay/src/Game.h

@@ -475,10 +475,17 @@ public:
     /**
      * Is multi-touch mode enabled.
      *
-     * @return true is multi-touch is enabled.
+     * @return true if multi-touch is enabled.
      */
     inline bool isMultiTouch() const;
 
+    /**
+     * Whether this game is allowed to exit programmatically.
+     *
+     * @return true if a programmatic exit is allowed.
+     */
+    inline bool canExit() const;
+
     /**
      * Gets the current accelerometer values.
      *

+ 5 - 0
gameplay/src/Game.inl

@@ -106,6 +106,11 @@ inline bool Game::isMultiTouch() const
     return Platform::isMultiTouch();
 }
 
+inline bool Game::canExit() const
+{
+    return Platform::canExit();
+}
+
 inline void Game::getAccelerometerValues(float* pitch, float* roll)
 {
     Platform::getAccelerometerValues(pitch, roll);

+ 5 - 1
gameplay/src/PhysicsVehicle.cpp

@@ -263,7 +263,11 @@ void PhysicsVehicle::update(float elapsedTime, float steering, float braking, fl
 {
     float v = getSpeedKph();
     MathUtil::smooth(&_speedSmoothed, v, elapsedTime, 0, 1200);
-    applyDownforce();
+    if (elapsedTime > 0)
+    {
+        // Avoid accumulation of downforce while paused (zero elapsedTime)
+        applyDownforce();
+    }
 
     // Adjust control inputs based on vehicle speed.
     steering = getSteering(v, steering);

+ 1 - 1
gameplay/src/PhysicsVehicleWheel.h

@@ -22,7 +22,7 @@ class PhysicsVehicle;
         type                     = VEHICLE_WHEEL
 
         steerable                = <bool>                // indicates whether wheel is steerable
-        wheelDirection           = <float, float, float> // direction strut extension, in chassis space
+        wheelDirection           = <float, float, float> // direction of strut extension, in chassis space
         wheelAxle                = <float, float, float> // direction of axle (spin axis), in chassis space
         strutConnectionOffset    = <float, float, float> // offset from default strut connection point
         strutRestLength          = <float>               // strut rest length

+ 8 - 0
gameplay/src/Platform.h

@@ -55,6 +55,14 @@ public:
      * This function is called automatically when the game shutdown function is called
      */
     static void signalShutdown();
+
+    /**
+     * Indicates whether a programmatic exit is allowed on this platform.
+     * Some platforms (eg. iOS) do not allow apps to exit programmatically.
+     *
+     * @return whether a programmatic exit is allowed on this platform.
+     */
+    static bool canExit();
     
     /**
      * Gets the display width.

+ 5 - 0
gameplay/src/PlatformAndroid.cpp

@@ -1037,6 +1037,11 @@ void Platform::signalShutdown()
 {
     // nothing to do  
 }
+
+bool Platform::canExit()
+{
+    return true;
+}
    
 unsigned int Platform::getDisplayWidth()
 {

+ 8 - 1
gameplay/src/PlatformLinux.cpp

@@ -687,7 +687,9 @@ int Platform::enterMessagePump()
             }
         }
 
-        _game->frame();
+        if (_game)
+            _game->frame();
+
         glXSwapBuffers(__display, __window);
     }
 
@@ -700,6 +702,11 @@ void Platform::signalShutdown()
 { 
     // nothing to do  
 }
+
+bool Platform::canExit()
+{
+    return true;
+}
     
 unsigned int Platform::getDisplayWidth()
 {

+ 11 - 6
gameplay/src/PlatformMacOSX.mm

@@ -659,7 +659,7 @@ double getMachTimeInMilliseconds()
 
     [[self openGLContext] makeCurrentContext];
     CGLLockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
-    if (_game && _game->getState() == Game::RUNNING)
+    if (_game)
     {
         _game->frame();
     }
@@ -861,7 +861,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
         CGDisplayMoveCursorToPoint(CGDisplayPrimaryDisplay(NULL), centerPoint);
     }
     
-    gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, point.y, 0);
+    gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, __height - point.y, 0);
 }
 
 - (void) mouseDragged: (NSEvent*) event
@@ -914,21 +914,21 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, __height - point.y, 0);
 }
 
-- (void)otherMouseDown: (NSEvent *) event 
+- (void)otherMouseDown: (NSEvent*) event 
 {
     __otherMouseDown = true;
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_PRESS_MIDDLE_BUTTON, point.x, __height - point.y, 0);
 }
 
-- (void)otherMouseUp: (NSEvent *) event 
+- (void)otherMouseUp: (NSEvent*) event 
 {
     __otherMouseDown = false;
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_RELEASE_MIDDLE_BUTTON, point.x, __height - point.y, 0);
 }
 
-- (void)otherMouseDragged: (NSEvent *) event 
+- (void)otherMouseDragged: (NSEvent*) event 
 {
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, __height - point.y, 0);
@@ -939,7 +939,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     __hasMouse = true;
 }
 
-- (void)scrollWheel: (NSEvent *) event 
+- (void)scrollWheel: (NSEvent*) event 
 {
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_WHEEL, point.x, __height - point.y, (int)([event deltaY] * 10.0f));
@@ -1397,6 +1397,11 @@ void Platform::signalShutdown()
     NSApplication* app = [NSApplication sharedApplication];
     [app performSelectorOnMainThread:@selector(terminate:) withObject:nil waitUntilDone:NO];
 }
+
+bool Platform::canExit()
+{
+    return true;
+}
     
 unsigned int Platform::getDisplayWidth()
 {

+ 6 - 1
gameplay/src/PlatformQNX.cpp

@@ -1141,7 +1141,12 @@ void Platform::signalShutdown()
 {
     // nothing to do  
 }
-    
+
+bool Platform::canExit()
+{
+    return true;
+}
+
 unsigned int Platform::getDisplayWidth()
 {
     return __screenWindowSize[0];

+ 5 - 0
gameplay/src/PlatformWin32.cpp

@@ -1083,6 +1083,11 @@ void Platform::signalShutdown()
     // nothing to do  
 }
 
+bool Platform::canExit()
+{
+    return true;
+}
+
 unsigned int Platform::getDisplayWidth()
 {
     static RECT rect;

+ 6 - 1
gameplay/src/PlatformiOS.mm

@@ -453,7 +453,7 @@ int getKey(unichar keyCode);
         GL_ASSERT( glViewport(0, 0, framebufferWidth, framebufferHeight) );
         
         // Execute a single game frame
-        if (game && game->getState() == Game::RUNNING)
+        if (game)
             game->frame();
         
         // Present the contents of the color buffer
@@ -1094,6 +1094,11 @@ void Platform::signalShutdown()
     [__view stopUpdating];
     exit(0);
 }
+
+bool Platform::canExit()
+{
+    return false;
+}
 
 unsigned int Platform::getDisplayWidth()
 {

+ 2 - 2
gameplay/src/Properties.cpp

@@ -976,11 +976,11 @@ void calculateNamespacePath(const std::string& urlString, std::string& fileStrin
     // If the url references a specific namespace within the file,
     // calculate the full namespace path to the final namespace.
     size_t loc = urlString.rfind("#");
-    if (loc != urlString.npos)
+    if (loc != std::string::npos)
     {
         fileString = urlString.substr(0, loc);
         std::string namespacePathString = urlString.substr(loc + 1);
-        while ((loc = namespacePathString.find("/")) != namespacePathString.npos)
+        while ((loc = namespacePathString.find("/")) != std::string::npos)
         {
             namespacePath.push_back(namespacePathString.substr(0, loc));
             namespacePathString = namespacePathString.substr(loc + 1);

+ 5 - 5
gameplay/src/SceneLoader.cpp

@@ -135,7 +135,7 @@ void SceneLoader::addSceneNodeProperty(SceneNode& sceneNode, SceneNodeProperty::
 
     // If there is a non-GPB file that needs to be loaded later, add an 
     // empty entry to the properties table to signify it.
-    if (urlStr.length() > 0 && urlStr.find(".") != urlStr.npos && urlStr.find(".gpb") == urlStr.npos && _properties.count(urlStr) == 0)
+    if (urlStr.length() > 0 && urlStr.find(".") != std::string::npos && urlStr.find(".gpb") == std::string::npos && _properties.count(urlStr) == 0)
         _properties[urlStr] = NULL;
 
     SceneNodeProperty prop(type, urlStr, index);
@@ -420,7 +420,7 @@ void SceneLoader::applyNodeUrls(Scene* scene)
                         unsigned int matchCount = 0;
                         for (unsigned int k = 0; k < objectCount; ++k)
                         {
-                            const char* objid = tmpBundle->getObjectID(k);
+                            const char* objid = tmpBundle->getObjectId(k);
                             if (strstr(objid, id.c_str()) == objid)
                             {
                                 // This object ID matches (starts with).
@@ -1071,14 +1071,14 @@ void splitURL(const std::string& url, std::string* file, std::string* id)
     }
 
     // Check if the url references a file (otherwise, it only references a node within the main GPB).
-    unsigned int loc = url.rfind(".");
-    if (loc != url.npos)
+    size_t loc = url.rfind(".");
+    if (loc != std::string::npos)
     {
         // If the url references a specific namespace within the file,
         // set the id out parameter appropriately. Otherwise, set the id out
         // parameter to the empty string so we know to load the first namespace.
         loc = url.rfind("#");
-        if (loc != url.npos)
+        if (loc != std::string::npos)
         {
             *file = url.substr(0, loc);
             *id = url.substr(loc + 1);

+ 4 - 4
gameplay/src/ScriptController.cpp

@@ -172,7 +172,7 @@ void ScriptUtil::registerClass(const char* name, const luaL_Reg* members, lua_CF
         // Strip off the scope path part of the name.
         lua_getglobal(sc->_lua, scopePath[0].c_str());
         std::size_t index = tablename.find(scopePath[0]);
-        if (index != tablename.npos)
+        if (index != std::string::npos)
             tablename = tablename.substr(index + scopePath[0].size());
         
         for (unsigned int i = 1; i < scopePath.size(); i++)
@@ -181,7 +181,7 @@ void ScriptUtil::registerClass(const char* name, const luaL_Reg* members, lua_CF
             lua_gettable(sc->_lua, -2);
 
             index = tablename.find(scopePath[i]);
-            if (index != tablename.npos)
+            if (index != std::string::npos)
                 tablename = tablename.substr(index + scopePath[i].size());
         }
 
@@ -544,7 +544,7 @@ static const char* lua_print_function =
     "    ScriptController.print(table.concat({...},\"\\t\"), \"\\n\")\n"
     "end\n";
 
-#ifndef WIN32
+#ifndef WIN32 
 static const char* lua_loadfile_function = 
     "do\n"
     "    local oldLoadfile = loadfile\n"
@@ -746,7 +746,7 @@ void ScriptController::executeFunctionHelper(int resultCount, const char* func,
 
                 // Calculate the unique Lua type name.
                 size_t i = type.find("::");
-                while (i != type.npos)
+                while (i != std::string::npos)
                 {
                     // We use "" as the replacement here-this must match the preprocessor
                     // define SCOPE_REPLACEMENT from the gameplay-luagen project.

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

@@ -20,7 +20,7 @@ void luaRegister_Bundle()
         {"addRef", lua_Bundle_addRef},
         {"contains", lua_Bundle_contains},
         {"getObjectCount", lua_Bundle_getObjectCount},
-        {"getObjectID", lua_Bundle_getObjectID},
+        {"getObjectId", lua_Bundle_getObjectId},
         {"getRefCount", lua_Bundle_getRefCount},
         {"loadFont", lua_Bundle_loadFont},
         {"loadMesh", lua_Bundle_loadMesh},
@@ -198,7 +198,7 @@ int lua_Bundle_getObjectCount(lua_State* state)
     return 0;
 }
 
-int lua_Bundle_getObjectID(lua_State* state)
+int lua_Bundle_getObjectId(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -215,7 +215,7 @@ int lua_Bundle_getObjectID(lua_State* state)
                 unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
 
                 Bundle* instance = getInstance(state);
-                const char* result = instance->getObjectID(param1);
+                const char* result = instance->getObjectId(param1);
 
                 // Push the return value onto the stack.
                 lua_pushstring(state, result);
@@ -224,7 +224,7 @@ int lua_Bundle_getObjectID(lua_State* state)
             }
             else
             {
-                lua_pushstring(state, "lua_Bundle_getObjectID - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Bundle_getObjectId - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 1 - 1
gameplay/src/lua/lua_Bundle.h

@@ -9,7 +9,7 @@ int lua_Bundle__gc(lua_State* state);
 int lua_Bundle_addRef(lua_State* state);
 int lua_Bundle_contains(lua_State* state);
 int lua_Bundle_getObjectCount(lua_State* state);
-int lua_Bundle_getObjectID(lua_State* state);
+int lua_Bundle_getObjectId(lua_State* state);
 int lua_Bundle_getRefCount(lua_State* state);
 int lua_Bundle_loadFont(lua_State* state);
 int lua_Bundle_loadMesh(lua_State* state);

+ 38 - 0
gameplay/src/lua/lua_Container.cpp

@@ -92,6 +92,7 @@ void luaRegister_Container()
         {"isContainer", lua_Container_isContainer},
         {"isEnabled", lua_Container_isEnabled},
         {"isScrollBarsAutoHide", lua_Container_isScrollBarsAutoHide},
+        {"isScrolling", lua_Container_isScrolling},
         {"release", lua_Container_release},
         {"removeControl", lua_Container_removeControl},
         {"removeScriptCallback", lua_Container_removeScriptCallback},
@@ -3013,6 +3014,43 @@ int lua_Container_isScrollBarsAutoHide(lua_State* state)
     return 0;
 }
 
+int lua_Container_isScrolling(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Container* instance = getInstance(state);
+                bool result = instance->isScrolling();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Container_isScrolling - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Container_release(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_Container.h

@@ -61,6 +61,7 @@ int lua_Container_insertControl(lua_State* state);
 int lua_Container_isContainer(lua_State* state);
 int lua_Container_isEnabled(lua_State* state);
 int lua_Container_isScrollBarsAutoHide(lua_State* state);
+int lua_Container_isScrolling(lua_State* state);
 int lua_Container_release(lua_State* state);
 int lua_Container_removeControl(lua_State* state);
 int lua_Container_removeScriptCallback(lua_State* state);

+ 38 - 0
gameplay/src/lua/lua_Form.cpp

@@ -97,6 +97,7 @@ void luaRegister_Form()
         {"isContainer", lua_Form_isContainer},
         {"isEnabled", lua_Form_isEnabled},
         {"isScrollBarsAutoHide", lua_Form_isScrollBarsAutoHide},
+        {"isScrolling", lua_Form_isScrolling},
         {"release", lua_Form_release},
         {"removeControl", lua_Form_removeControl},
         {"removeScriptCallback", lua_Form_removeScriptCallback},
@@ -3101,6 +3102,43 @@ int lua_Form_isScrollBarsAutoHide(lua_State* state)
     return 0;
 }
 
+int lua_Form_isScrolling(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Form* instance = getInstance(state);
+                bool result = instance->isScrolling();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Form_isScrolling - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Form_release(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_Form.h

@@ -63,6 +63,7 @@ int lua_Form_insertControl(lua_State* state);
 int lua_Form_isContainer(lua_State* state);
 int lua_Form_isEnabled(lua_State* state);
 int lua_Form_isScrollBarsAutoHide(lua_State* state);
+int lua_Form_isScrolling(lua_State* state);
 int lua_Form_release(lua_State* state);
 int lua_Form_removeControl(lua_State* state);
 int lua_Form_removeScriptCallback(lua_State* state);

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

@@ -569,9 +569,9 @@ void luaRegister_lua_Global()
     {
         std::vector<std::string> scopePath;
         scopePath.push_back("Logger");
-        ScriptUtil::registerConstantString("INFO", "INFO", scopePath);
-        ScriptUtil::registerConstantString("WARN", "WARN", scopePath);
-        ScriptUtil::registerConstantString("ERROR", "ERROR", scopePath);
+        ScriptUtil::registerConstantString("LEVEL_INFO", "LEVEL_INFO", scopePath);
+        ScriptUtil::registerConstantString("LEVEL_WARN", "LEVEL_WARN", scopePath);
+        ScriptUtil::registerConstantString("LEVEL_ERROR", "LEVEL_ERROR", scopePath);
     }
 
     // Register enumeration Mesh::IndexFormat.

+ 195 - 195
gameplay/src/lua/lua_Logger.cpp

@@ -1,195 +1,195 @@
-#include "Base.h"
-#include "ScriptController.h"
-#include "lua_Logger.h"
-#include "Base.h"
-#include "Game.h"
-#include "Logger.h"
-#include "ScriptController.h"
-#include "lua_LoggerLevel.h"
-
-namespace gameplay
-{
-
-void luaRegister_Logger()
-{
-    const luaL_Reg* lua_members = NULL;
-    const luaL_Reg lua_statics[] = 
-    {
-        {"isEnabled", lua_Logger_static_isEnabled},
-        {"log", lua_Logger_static_log},
-        {"set", lua_Logger_static_set},
-        {"setEnabled", lua_Logger_static_setEnabled},
-        {NULL, NULL}
-    };
-    std::vector<std::string> scopePath;
-
-    ScriptUtil::registerClass("Logger", lua_members, NULL, NULL, lua_statics, scopePath);
-}
-
-static Logger* getInstance(lua_State* state)
-{
-    void* userdata = luaL_checkudata(state, 1, "Logger");
-    luaL_argcheck(state, userdata != NULL, 1, "'Logger' expected.");
-    return (Logger*)((ScriptUtil::LuaObject*)userdata)->instance;
-}
-
-int lua_Logger_static_isEnabled(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
-
-                bool result = Logger::isEnabled(param1);
-
-                // Push the return value onto the stack.
-                lua_pushboolean(state, result);
-
-                return 1;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Logger_static_isEnabled - 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_Logger_static_log(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
-
-                // Get parameter 2 off the stack.
-                ScriptUtil::LuaArray<const char> param2 = ScriptUtil::getString(2, false);
-
-                Logger::log(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Logger_static_log - 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_Logger_static_set(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
-
-                // Get parameter 2 off the stack.
-                ScriptUtil::LuaArray<const char> param2 = ScriptUtil::getString(2, false);
-
-                Logger::set(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Logger_static_set - 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_Logger_static_setEnabled(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
-
-                // Get parameter 2 off the stack.
-                bool param2 = ScriptUtil::luaCheckBool(state, 2);
-
-                Logger::setEnabled(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Logger_static_setEnabled - 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;
-}
-
-}
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_Logger.h"
+#include "Logger.h"
+#include "Base.h"
+#include "Game.h"
+#include "ScriptController.h"
+#include "lua_LoggerLevel.h"
+
+namespace gameplay
+{
+
+void luaRegister_Logger()
+{
+    const luaL_Reg* lua_members = NULL;
+    const luaL_Reg lua_statics[] = 
+    {
+        {"isEnabled", lua_Logger_static_isEnabled},
+        {"log", lua_Logger_static_log},
+        {"set", lua_Logger_static_set},
+        {"setEnabled", lua_Logger_static_setEnabled},
+        {NULL, NULL}
+    };
+    std::vector<std::string> scopePath;
+
+    ScriptUtil::registerClass("Logger", lua_members, NULL, NULL, lua_statics, scopePath);
+}
+
+static Logger* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "Logger");
+    luaL_argcheck(state, userdata != NULL, 1, "'Logger' expected.");
+    return (Logger*)((ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_Logger_static_isEnabled(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
+
+                bool result = Logger::isEnabled(param1);
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Logger_static_isEnabled - 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_Logger_static_log(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
+
+                // Get parameter 2 off the stack.
+                ScriptUtil::LuaArray<const char> param2 = ScriptUtil::getString(2, false);
+
+                Logger::log(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Logger_static_log - 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_Logger_static_set(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
+
+                // Get parameter 2 off the stack.
+                ScriptUtil::LuaArray<const char> param2 = ScriptUtil::getString(2, false);
+
+                Logger::set(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Logger_static_set - 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_Logger_static_setEnabled(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                Logger::Level param1 = (Logger::Level)lua_enumFromString_LoggerLevel(luaL_checkstring(state, 1));
+
+                // Get parameter 2 off the stack.
+                bool param2 = ScriptUtil::luaCheckBool(state, 2);
+
+                Logger::setEnabled(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Logger_static_setEnabled - 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 - 17
gameplay/src/lua/lua_Logger.h

@@ -1,17 +1,17 @@
-#ifndef LUA_LOGGER_H_
-#define LUA_LOGGER_H_
-
-namespace gameplay
-{
-
-// Lua bindings for Logger.
-int lua_Logger_static_isEnabled(lua_State* state);
-int lua_Logger_static_log(lua_State* state);
-int lua_Logger_static_set(lua_State* state);
-int lua_Logger_static_setEnabled(lua_State* state);
-
-void luaRegister_Logger();
-
-}
-
-#endif
+#ifndef LUA_LOGGER_H_
+#define LUA_LOGGER_H_
+
+namespace gameplay
+{
+
+// Lua bindings for Logger.
+int lua_Logger_static_isEnabled(lua_State* state);
+int lua_Logger_static_log(lua_State* state);
+int lua_Logger_static_set(lua_State* state);
+int lua_Logger_static_setEnabled(lua_State* state);
+
+void luaRegister_Logger();
+
+}
+
+#endif

+ 38 - 38
gameplay/src/lua/lua_LoggerLevel.cpp

@@ -1,38 +1,38 @@
-#include "Base.h"
-#include "lua_LoggerLevel.h"
-
-namespace gameplay
-{
-
-static const char* enumStringEmpty = "";
-
-static const char* luaEnumString_LoggerLevel_LEVEL_INFO = "LEVEL_INFO";
-static const char* luaEnumString_LoggerLevel_LEVEL_WARN = "LEVEL_WARN";
-static const char* luaEnumString_LoggerLevel_LEVEL_ERROR = "LEVEL_ERROR";
-
-Logger::Level lua_enumFromString_LoggerLevel(const char* s)
-{
-    if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_INFO) == 0)
-        return Logger::LEVEL_INFO;
-    if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_WARN) == 0)
-        return Logger::LEVEL_WARN;
-    if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_ERROR) == 0)
-        return Logger::LEVEL_ERROR;
-    GP_ERROR("Invalid enumeration value '%s' for enumeration Logger::Level.", s);
-    return Logger::LEVEL_INFO;
-}
-
-const char* lua_stringFromEnum_LoggerLevel(Logger::Level e)
-{
-    if (e == Logger::LEVEL_INFO)
-        return luaEnumString_LoggerLevel_LEVEL_INFO;
-    if (e == Logger::LEVEL_WARN)
-        return luaEnumString_LoggerLevel_LEVEL_WARN;
-    if (e == Logger::LEVEL_ERROR)
-        return luaEnumString_LoggerLevel_LEVEL_ERROR;
-    GP_ERROR("Invalid enumeration value '%d' for enumeration Logger::Level.", e);
-    return enumStringEmpty;
-}
-
-}
-
+#include "Base.h"
+#include "lua_LoggerLevel.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_LoggerLevel_LEVEL_INFO = "LEVEL_INFO";
+static const char* luaEnumString_LoggerLevel_LEVEL_WARN = "LEVEL_WARN";
+static const char* luaEnumString_LoggerLevel_LEVEL_ERROR = "LEVEL_ERROR";
+
+Logger::Level lua_enumFromString_LoggerLevel(const char* s)
+{
+    if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_INFO) == 0)
+        return Logger::LEVEL_INFO;
+    if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_WARN) == 0)
+        return Logger::LEVEL_WARN;
+    if (strcmp(s, luaEnumString_LoggerLevel_LEVEL_ERROR) == 0)
+        return Logger::LEVEL_ERROR;
+    GP_ERROR("Invalid enumeration value '%s' for enumeration Logger::Level.", s);
+    return Logger::LEVEL_INFO;
+}
+
+const char* lua_stringFromEnum_LoggerLevel(Logger::Level e)
+{
+    if (e == Logger::LEVEL_INFO)
+        return luaEnumString_LoggerLevel_LEVEL_INFO;
+    if (e == Logger::LEVEL_WARN)
+        return luaEnumString_LoggerLevel_LEVEL_WARN;
+    if (e == Logger::LEVEL_ERROR)
+        return luaEnumString_LoggerLevel_LEVEL_ERROR;
+    GP_ERROR("Invalid enumeration value '%d' for enumeration Logger::Level.", e);
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 15
gameplay/src/lua/lua_LoggerLevel.h

@@ -1,15 +1,15 @@
-#ifndef LUA_LOGGERLEVEL_H_
-#define LUA_LOGGERLEVEL_H_
-
-#include "Logger.h"
-
-namespace gameplay
-{
-
-// Lua bindings for enum conversion functions for Logger::Level.
-Logger::Level lua_enumFromString_LoggerLevel(const char* s);
-const char* lua_stringFromEnum_LoggerLevel(Logger::Level e);
-
-}
-
-#endif
+#ifndef LUA_LOGGERLEVEL_H_
+#define LUA_LOGGERLEVEL_H_
+
+#include "Logger.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for Logger::Level.
+Logger::Level lua_enumFromString_LoggerLevel(const char* s);
+const char* lua_stringFromEnum_LoggerLevel(Logger::Level e);
+
+}
+
+#endif