فهرست منبع

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

Conflicts:
	gameplay/gameplay.vcxproj.filters
Steve Grenier 14 سال پیش
والد
کامیت
7bd06601ab

+ 4 - 4
gameplay-encoder/gameplay-encoder.vcxproj

@@ -145,16 +145,16 @@
       </PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../external-deps/freetype2/include;../external-deps/collada-dom/include;../external-deps/collada-dom/include/1.4;../external-deps/libpng/include;../external-deps/zlib/include</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;USE_FBX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>../external-deps/freetype2/include;../external-deps/collada-dom/include;../external-deps/collada-dom/include/1.4;../external-deps/libpng/include;../external-deps/zlib/include;C:/Program Files/Autodesk/FBX/FbxSdk/2012.2/include</AdditionalIncludeDirectories>
       <DisableLanguageExtensions>
       </DisableLanguageExtensions>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>../external-deps/freetype2/lib/win32;../external-deps/collada-dom/lib/win32;../external-deps/libpng/lib/win32;../external-deps/zlib/lib/win32</AdditionalLibraryDirectories>
-      <AdditionalDependencies>freetype245.lib;libcollada14dom22-d.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>../external-deps/freetype2/lib/win32;../external-deps/collada-dom/lib/win32;../external-deps/libpng/lib/win32;../external-deps/zlib/lib/win32;C:/Program Files/Autodesk/FBX/FbxSdk/2012.2/lib/vs2010/x86</AdditionalLibraryDirectories>
+      <AdditionalDependencies>freetype245.lib;libcollada14dom22-d.lib;libpng14.lib;zlib.lib;fbxsdk-2012.2-mdd.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries>
     </Link>
     <PostBuildEvent>

+ 9 - 2
gameplay/gameplay.vcxproj

@@ -29,15 +29,16 @@
     <ClCompile Include="src\Camera.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\Font.cpp" />
+    <ClCompile Include="src\FrameBuffer.cpp" />
     <ClCompile Include="src\Frustum.cpp" />
     <ClCompile Include="src\Game.cpp" />
     <ClCompile Include="src\gameplay-main-qnx.cpp" />
     <ClCompile Include="src\gameplay-main-win32.cpp" />
     <ClCompile Include="src\Image.cpp" />
-    <ClCompile Include="src\Input.cpp" />
     <ClCompile Include="src\Joint.cpp" />
     <ClCompile Include="src\Light.cpp" />
     <ClCompile Include="src\Material.cpp" />
@@ -70,6 +71,7 @@
     <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\SpriteBatch.cpp" />
@@ -99,15 +101,17 @@
     <ClInclude Include="src\Camera.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\Font.h" />
+    <ClInclude Include="src\FrameBuffer.h" />
     <ClInclude Include="src\Frustum.h" />
     <ClInclude Include="src\Game.h" />
     <ClInclude Include="src\gameplay.h" />
     <ClInclude Include="src\Image.h" />
-    <ClInclude Include="src\Input.h" />
     <ClInclude Include="src\Joint.h" />
+    <ClInclude Include="src\Keyboard.h" />
     <ClInclude Include="src\Light.h" />
     <ClInclude Include="src\Material.h" />
     <ClInclude Include="src\MeshBatch.h" />
@@ -138,11 +142,13 @@
     <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\SpriteBatch.h" />
     <ClInclude Include="src\Technique.h" />
     <ClInclude Include="src\Texture.h" />
+    <ClInclude Include="src\Touch.h" />
     <ClInclude Include="src\Transform.h" />
     <ClInclude Include="src\Vector2.h" />
     <ClInclude Include="src\Vector3.h" />
@@ -175,6 +181,7 @@
     <None Include="res\textures\particle-default.png" />
     <None Include="src\BoundingBox.inl" />
     <None Include="src\BoundingSphere.inl" />
+    <None Include="src\Curve.inl" />
     <None Include="src\Game.inl" />
     <None Include="src\gameplay-main-macos.mm" />
     <None Include="src\Image.inl" />

+ 27 - 6
gameplay/gameplay.vcxproj.filters

@@ -54,9 +54,6 @@
     <ClCompile Include="src\Game.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\Input.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
     <ClCompile Include="src\Light.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -213,6 +210,15 @@
     <ClCompile Include="src\Image.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\RenderTarget.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\FrameBuffer.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\DepthStencilTarget.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\MeshBatch.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -266,9 +272,6 @@
     <ClInclude Include="src\gameplay.h">
       <Filter>src</Filter>
     </ClInclude>
-    <ClInclude Include="src\Input.h">
-      <Filter>src</Filter>
-    </ClInclude>
     <ClInclude Include="src\Light.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -413,6 +416,21 @@
     <ClInclude Include="src\Image.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\RenderTarget.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\FrameBuffer.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\DepthStencilTarget.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Keyboard.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Touch.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\MeshBatch.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -487,6 +505,9 @@
     <None Include="res\textures\particle-default.png">
       <Filter>res\textures</Filter>
     </None>
+    <None Include="src\Curve.inl">
+      <Filter>src</Filter>
+    </None>
     <None Include="src\Game.inl">
       <Filter>src</Filter>
     </None>

+ 20 - 8
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -7,6 +7,10 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		4208DEE914A4079F00D3C511 /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4208DEE614A4079F00D3C511 /* Image.cpp */; };
+		4208DEEA14A4079F00D3C511 /* Image.h in Headers */ = {isa = PBXBuildFile; fileRef = 4208DEE714A4079F00D3C511 /* Image.h */; };
+		4208DEEC14A407B900D3C511 /* Keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4208DEEB14A407B900D3C511 /* Keyboard.h */; };
+		4208DEEE14A407D500D3C511 /* Touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 4208DEED14A407D500D3C511 /* Touch.h */; };
 		4220A6E8146B122B00CAEB3A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4220A6E7146B122B00CAEB3A /* QuartzCore.framework */; };
 		4234D99E14686C52003031B3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4234D99D14686C52003031B3 /* Cocoa.framework */; };
 		428390991489D6E800E2B2F5 /* SceneLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 428390971489D6E800E2B2F5 /* SceneLoader.cpp */; };
@@ -67,8 +71,6 @@
 		42CD0E72147D8FF60000361E /* gameplay-main-qnx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DDF147D8FF50000361E /* gameplay-main-qnx.cpp */; };
 		42CD0E73147D8FF60000361E /* gameplay-main-win32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DE0147D8FF50000361E /* gameplay-main-win32.cpp */; };
 		42CD0E74147D8FF60000361E /* gameplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DE1147D8FF50000361E /* gameplay.h */; };
-		42CD0E75147D8FF60000361E /* Input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DE2147D8FF50000361E /* Input.cpp */; };
-		42CD0E76147D8FF60000361E /* Input.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DE3147D8FF50000361E /* Input.h */; };
 		42CD0E77147D8FF60000361E /* Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DE4147D8FF50000361E /* Joint.cpp */; };
 		42CD0E78147D8FF60000361E /* Joint.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DE5147D8FF50000361E /* Joint.h */; };
 		42CD0E79147D8FF60000361E /* Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DE6147D8FF50000361E /* Light.cpp */; };
@@ -158,6 +160,12 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		4208DEE514A4078100D3C511 /* Curve.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Curve.inl; path = src/Curve.inl; sourceTree = SOURCE_ROOT; };
+		4208DEE614A4079F00D3C511 /* Image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Image.cpp; path = src/Image.cpp; sourceTree = SOURCE_ROOT; };
+		4208DEE714A4079F00D3C511 /* Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Image.h; path = src/Image.h; sourceTree = SOURCE_ROOT; };
+		4208DEE814A4079F00D3C511 /* Image.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Image.inl; path = src/Image.inl; sourceTree = SOURCE_ROOT; };
+		4208DEEB14A407B900D3C511 /* Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Keyboard.h; path = src/Keyboard.h; sourceTree = SOURCE_ROOT; };
+		4208DEED14A407D500D3C511 /* Touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Touch.h; path = src/Touch.h; sourceTree = SOURCE_ROOT; };
 		4220A6E7146B122B00CAEB3A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
 		4234D99A14686C52003031B3 /* libgameplay.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgameplay.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		4234D99D14686C52003031B3 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@@ -222,8 +230,6 @@
 		42CD0DDF147D8FF50000361E /* gameplay-main-qnx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gameplay-main-qnx.cpp"; path = "src/gameplay-main-qnx.cpp"; sourceTree = SOURCE_ROOT; };
 		42CD0DE0147D8FF50000361E /* gameplay-main-win32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gameplay-main-win32.cpp"; path = "src/gameplay-main-win32.cpp"; sourceTree = SOURCE_ROOT; };
 		42CD0DE1147D8FF50000361E /* gameplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gameplay.h; path = src/gameplay.h; sourceTree = SOURCE_ROOT; };
-		42CD0DE2147D8FF50000361E /* Input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Input.cpp; path = src/Input.cpp; sourceTree = SOURCE_ROOT; };
-		42CD0DE3147D8FF50000361E /* Input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Input.h; path = src/Input.h; sourceTree = SOURCE_ROOT; };
 		42CD0DE4147D8FF50000361E /* Joint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Joint.cpp; path = src/Joint.cpp; sourceTree = SOURCE_ROOT; };
 		42CD0DE5147D8FF50000361E /* Joint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Joint.h; path = src/Joint.h; sourceTree = SOURCE_ROOT; };
 		42CD0DE6147D8FF50000361E /* Light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Light.cpp; path = src/Light.cpp; sourceTree = SOURCE_ROOT; };
@@ -396,6 +402,7 @@
 				42CD0DCB147D8FF50000361E /* Camera.h */,
 				42CD0DCC147D8FF50000361E /* Curve.cpp */,
 				42CD0DCD147D8FF50000361E /* Curve.h */,
+				4208DEE514A4078100D3C511 /* Curve.inl */,
 				42CD0DCE147D8FF50000361E /* DebugNew.cpp */,
 				42CD0DCF147D8FF50000361E /* DebugNew.h */,
 				42CD0DD0147D8FF50000361E /* DepthStencilTarget.cpp */,
@@ -417,10 +424,12 @@
 				42CD0DDF147D8FF50000361E /* gameplay-main-qnx.cpp */,
 				42CD0DE0147D8FF50000361E /* gameplay-main-win32.cpp */,
 				42CD0DE1147D8FF50000361E /* gameplay.h */,
-				42CD0DE2147D8FF50000361E /* Input.cpp */,
-				42CD0DE3147D8FF50000361E /* Input.h */,
+				4208DEE614A4079F00D3C511 /* Image.cpp */,
+				4208DEE714A4079F00D3C511 /* Image.h */,
+				4208DEE814A4079F00D3C511 /* Image.inl */,
 				42CD0DE4147D8FF50000361E /* Joint.cpp */,
 				42CD0DE5147D8FF50000361E /* Joint.h */,
+				4208DEEB14A407B900D3C511 /* Keyboard.h */,
 				42CD0DE6147D8FF50000361E /* Light.cpp */,
 				42CD0DE7147D8FF50000361E /* Light.h */,
 				42CD0DE8147D8FF50000361E /* Material.cpp */,
@@ -502,6 +511,7 @@
 				42CD0E32147D8FF50000361E /* Technique.h */,
 				42CD0E33147D8FF50000361E /* Texture.cpp */,
 				42CD0E34147D8FF50000361E /* Texture.h */,
+				4208DEED14A407D500D3C511 /* Touch.h */,
 				42CD0E35147D8FF50000361E /* Transform.cpp */,
 				42CD0E36147D8FF50000361E /* Transform.h */,
 				42CD0E37147D8FF50000361E /* Vector2.cpp */,
@@ -579,7 +589,6 @@
 				42CD0E6E147D8FF60000361E /* Frustum.h in Headers */,
 				42CD0E70147D8FF60000361E /* Game.h in Headers */,
 				42CD0E74147D8FF60000361E /* gameplay.h in Headers */,
-				42CD0E76147D8FF60000361E /* Input.h in Headers */,
 				42CD0E78147D8FF60000361E /* Joint.h in Headers */,
 				42CD0E7A147D8FF60000361E /* Light.h in Headers */,
 				42CD0E7C147D8FF60000361E /* Material.h in Headers */,
@@ -623,6 +632,9 @@
 				42CD0ECA147D8FF60000361E /* VertexFormat.h in Headers */,
 				42CD0ECC147D8FF60000361E /* Viewport.h in Headers */,
 				4283909A1489D6E800E2B2F5 /* SceneLoader.h in Headers */,
+				4208DEEA14A4079F00D3C511 /* Image.h in Headers */,
+				4208DEEC14A407B900D3C511 /* Keyboard.h in Headers */,
+				4208DEEE14A407D500D3C511 /* Touch.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -700,7 +712,6 @@
 				42CD0E71147D8FF60000361E /* gameplay-main-macos.mm in Sources */,
 				42CD0E72147D8FF60000361E /* gameplay-main-qnx.cpp in Sources */,
 				42CD0E73147D8FF60000361E /* gameplay-main-win32.cpp in Sources */,
-				42CD0E75147D8FF60000361E /* Input.cpp in Sources */,
 				42CD0E77147D8FF60000361E /* Joint.cpp in Sources */,
 				42CD0E79147D8FF60000361E /* Light.cpp in Sources */,
 				42CD0E7B147D8FF60000361E /* Material.cpp in Sources */,
@@ -746,6 +757,7 @@
 				42CD0EC9147D8FF60000361E /* VertexFormat.cpp in Sources */,
 				42CD0ECB147D8FF60000361E /* Viewport.cpp in Sources */,
 				428390991489D6E800E2B2F5 /* SceneLoader.cpp in Sources */,
+				4208DEE914A4079F00D3C511 /* Image.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 88 - 93
gameplay/src/Animation.cpp

@@ -7,7 +7,6 @@
 #include "Transform.h"
 #include "Properties.h"
 
-#define ANIMATION_DEFAULT_CLIP_SUFFIX "__default__clip"
 #define ANIMATION_INDEFINITE_STR "INDEFINITE"
 #define ANIMATION_DEFAULT_CLIP 0
 #define ANIMATION_ROTATE_OFFSET 0
@@ -30,7 +29,13 @@ Animation::Animation(const char* id, AnimationTarget* target, int propertyId, un
 
 Animation::~Animation()
 {
-    if (_clips != NULL)
+    if (_defaultClip)
+    {
+        _defaultClip->stop();
+        SAFE_RELEASE(_defaultClip);
+    }
+
+    if (_clips)
     {
         std::vector<AnimationClip*>::iterator clipIter = _clips->begin();
     
@@ -44,18 +49,6 @@ Animation::~Animation()
         _clips->clear();
     }
     SAFE_DELETE(_clips);
-
-    SAFE_DELETE(_defaultClip);
-
-    /*vector<Channel*>::iterator channelIter = _channels.begin();
-    while (channelIter != _channels.end())
-    {
-        Animation::Channel* channel = *channelIter;
-        channel->_target->removeChannel(channel);
-        SAFE_RELEASE(channel);
-        channelIter++;
-    }*/
-    _channels.clear();
 }
 
 Animation::Channel::Channel(Animation* animation, AnimationTarget* target, int propertyId, Curve* curve, unsigned long duration)
@@ -71,9 +64,9 @@ Animation::Channel::Channel(Animation* animation, AnimationTarget* target, int p
 
 Animation::Channel::~Channel()
 {
+    SAFE_DELETE(_curve);
     _animation->removeChannel(this);
     SAFE_RELEASE(_animation);
-    SAFE_DELETE(_curve);
 }
 
 const char* Animation::getId() const
@@ -90,60 +83,24 @@ void Animation::createClips(const char* animationFile)
 {
     assert(animationFile);
 
-    Properties* pAnim = Properties::create(animationFile);
-    assert(pAnim);
-
-    Properties* animation = pAnim->getNextNamespace();
-    int frameCount = animation->getInt("frameCount");
-
-    const Properties* pClip = animation->getNextNamespace();
-    while (pClip != NULL)
-    {
-        int begin = pClip->getInt("begin");
-        int end = pClip->getInt("end");
-
-        AnimationClip* clip = createClip(pClip->getId(), ((float) begin / frameCount) * _duration, ((float) end / frameCount) * _duration);
-
-        const char* repeat = pClip->getString("repeatCount");
-        if (repeat)
-        {
-            if (strcmp(repeat, ANIMATION_INDEFINITE_STR) == 0)
-            {
-                clip->setRepeatCount(AnimationClip::REPEAT_INDEFINITE);
-            }
-            else
-            {
-                float value;
-                sscanf(repeat, "%f", &value);
-                clip->setRepeatCount(value);
-            }
-        }
+    Properties* properties = Properties::create(animationFile);
+    assert(properties);
 
-        const char* speed = pClip->getString("speed");
-        if (speed)
-        {
-            float value;
-            sscanf(speed, "%f", &value);
-            clip->setSpeed(value);
-        }
+    Properties* pAnimation = properties->getNextNamespace();
+    assert(pAnimation);
+    
+    int frameCount = pAnimation->getInt("frameCount");
+    assert(frameCount > 0);
 
-        pClip = animation->getNextNamespace();
-    }
+    createClips(pAnimation, (unsigned int)frameCount);
 
-    SAFE_DELETE(pAnim);
+    SAFE_DELETE(properties);
 }
 
 AnimationClip* Animation::createClip(const char* id, unsigned long start, unsigned long end)
 {
-    if (_clips != NULL && findClip(id) != NULL)
-    {
-        return NULL;
-    }
-    
     AnimationClip* clip = new AnimationClip(id, this, start, end);
-
     addClip(clip);
-
     return clip;
 }
 
@@ -205,6 +162,77 @@ void Animation::stop(const char* id)
     }
 }
 
+void Animation::createDefaultClip()
+{
+    _defaultClip = new AnimationClip("default_clip", this, 0.0f, _duration);
+}
+
+void Animation::createClips(Properties* animationProperties, unsigned int frameCount)
+{   
+    assert(animationProperties);
+    
+    Properties* pClip = animationProperties->getNextNamespace();
+    
+    while (pClip != NULL && std::strcmp(pClip->getNamespace(), "clip") == 0)
+    {
+        int begin = pClip->getInt("begin");
+        int end = pClip->getInt("end");
+
+        AnimationClip* clip = createClip(pClip->getId(), ((float) begin / frameCount) * _duration, ((float) end / frameCount) * _duration);
+
+        const char* repeat = pClip->getString("repeatCount");
+        if (repeat)
+        {
+            if (strcmp(repeat, ANIMATION_INDEFINITE_STR) == 0)
+            {
+                clip->setRepeatCount(AnimationClip::REPEAT_INDEFINITE);
+            }
+            else
+            {
+                float value;
+                sscanf(repeat, "%f", &value);
+                clip->setRepeatCount(value);
+            }
+        }
+
+        const char* speed = pClip->getString("speed");
+        if (speed)
+        {
+            float value;
+            sscanf(speed, "%f", &value);
+            clip->setSpeed(value);
+        }
+
+        pClip = animationProperties->getNextNamespace();
+    }
+}
+
+void Animation::addClip(AnimationClip* clip)
+{
+    if (_clips == NULL)
+        _clips = new std::vector<AnimationClip*>;
+
+    _clips->push_back(clip);
+}
+
+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++)
+        {
+            clip = _clips->at(i);
+            if (clip->_id.compare(id) == 0)
+            {
+                return _clips->at(i);
+            }
+        }
+    }
+    return NULL;
+}
+
 Animation::Channel* Animation::createChannel(AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, unsigned int type)
 {
     unsigned int propertyComponentCount = target->getAnimationPropertyComponentCount(propertyId);
@@ -328,37 +356,4 @@ void Animation::removeChannel(Channel* channel)
         _controller->destroyAnimation(this);
 }
 
-void Animation::createDefaultClip()
-{
-    std::string clipId = _id + ANIMATION_DEFAULT_CLIP_SUFFIX;
-
-    _defaultClip = new AnimationClip(clipId.c_str(), this, 0.0f, _duration);
-}
-
-void Animation::addClip(AnimationClip* clip)
-{
-    if (_clips == NULL)
-        _clips = new std::vector<AnimationClip*>;
-
-    _clips->push_back(clip);
-}
-
-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++)
-        {
-            clip = _clips->at(i);
-            if (clip->_id.compare(id) == 0)
-            {
-                return _clips->at(i);
-            }
-        }
-    }
-    return NULL;
-}
-
 }

+ 11 - 5
gameplay/src/Animation.h

@@ -2,6 +2,7 @@
 #define ANIMATION_H_
 
 #include "Ref.h"
+#include "Properties.h"
 
 namespace gameplay
 {
@@ -133,6 +134,16 @@ private:
      */
     ~Animation();
 
+    /**
+     * Creates the default clip.
+     */
+    void createDefaultClip();
+
+    /**
+     * Creates AnimationClip's for this Animation from the specified Property object.
+     */
+    void createClips(Properties* animationProperties, unsigned int frameCount);
+
     /**
      * Adds a clip to this Animation.
      */
@@ -143,11 +154,6 @@ private:
      */
     AnimationClip* findClip(const char* id) const;
 
-    /**
-     * Creates the default clip.
-     */
-    void createDefaultClip();
-
     /**
      * Creates a channel within this animation.
      */ 

+ 2 - 6
gameplay/src/AnimationClip.cpp

@@ -11,18 +11,15 @@ namespace gameplay
 AnimationClip::AnimationClip(const char* id, Animation* animation, unsigned long startTime, unsigned long endTime)
     : _id(id), _animation(animation), _startTime(startTime), _endTime(endTime), _duration(_endTime - _startTime), _repeatCount(1.0f), 
       _activeDuration(_duration * _repeatCount), _speed(1.0f), _isPlaying(false), _timeStarted(0), _elapsedTime(0), _runningTime(0), 
-      _channelPriority(NULL), _crossFadeToClip(NULL), _crossFadeStart(0), _crossFadeOutElapsed(0), _crossFadeOutDuration(0), _blendWeight(1.0f), 
+      _crossFadeToClip(NULL), _crossFadeStart(0), _crossFadeOutElapsed(0), _crossFadeOutDuration(0), _blendWeight(1.0f), 
       _isFadingOutStarted(false), _isFadingOut(false), _isFadingIn(false), _beginListeners(NULL), _endListeners(NULL)
 {
     assert(0 <= startTime && startTime <= animation->_duration && 0 <= endTime && endTime <= animation->_duration);
     
-    unsigned int channelCount = _animation->_channels.size();
-    _channelPriority = new unsigned int[channelCount];
-    
+    unsigned int channelCount = _animation->_channels.size();    
     for (unsigned int i = 0; i < channelCount; i++)
     {
         _values.push_back(new AnimationValue(_animation->_channels[i]->_curve->getComponentCount()));
-        _channelPriority[i] = 0;
     }
 }
 
@@ -37,7 +34,6 @@ AnimationClip::~AnimationClip()
     _values.clear();
 
     SAFE_RELEASE(_crossFadeToClip);
-    SAFE_DELETE(_channelPriority);
     SAFE_DELETE(_beginListeners);
     SAFE_DELETE(_endListeners);
 }

+ 0 - 1
gameplay/src/AnimationClip.h

@@ -239,7 +239,6 @@ private:
     unsigned long _timeStarted;               // The game time when this clip was actually started.
     unsigned long _elapsedTime;               // Time elapsed while the clip is running.
     long _runningTime;                        // Keeps track of the Animation's relative time in respect to the active duration.
-    unsigned int* _channelPriority;           // Keeps track of each channel's priority.
     AnimationClip* _crossFadeToClip;          // The clip to cross fade to
     unsigned long _crossFadeStart;            // The time at which the cross fade started.
     unsigned long _crossFadeOutElapsed;       // The amount of time that has elapsed for the crossfade.

+ 160 - 32
gameplay/src/AnimationController.cpp

@@ -19,13 +19,9 @@ AnimationController::~AnimationController()
 Animation* AnimationController::createAnimation(const char* id, AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, Curve::InterpolationType type)
 {
     assert(type != Curve::BEZIER && type != Curve::HERMITE);
-    assert(id && keyCount >= 2 && keyTimes && keyValues);
-    Animation* animation = getAnimation(id);
+    assert(keyCount >= 2 && keyTimes && keyValues && target);
 
-    if (animation != NULL)
-        return NULL;
-
-    animation = new Animation(id, target, propertyId, keyCount, keyTimes, keyValues, type);
+    Animation* animation = new Animation(id, target, propertyId, keyCount, keyTimes, keyValues, type);
 
     addAnimation(animation);
     
@@ -34,34 +30,24 @@ Animation* AnimationController::createAnimation(const char* id, AnimationTarget*
 
 Animation* AnimationController::createAnimation(const char* id, AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, float* keyInValue, float* keyOutValue, Curve::InterpolationType type)
 {
-    assert(id && keyCount >= 2 && keyTimes && keyValues && keyInValue && keyOutValue);
-    Animation* animation = getAnimation(id);
-
-    if (animation != NULL)
-        return NULL;
-    
-    animation = new Animation(id, target, propertyId, keyCount, keyTimes, keyValues, keyInValue, keyOutValue, type);
+    assert(target && keyCount >= 2 && keyTimes && keyValues && keyInValue && keyOutValue);
+    Animation* animation = new Animation(id, target, propertyId, keyCount, keyTimes, keyValues, keyInValue, keyOutValue, type);
 
     addAnimation(animation);
 
     return animation;
 }
 
-Animation* AnimationController::createAnimation(const char* id, AnimationTarget* target, Properties* p)
+Animation* AnimationController::createAnimation(const char* id, AnimationTarget* target, const char* animationFile)
 {
-    Animation* animation = getAnimation(id);
-
-    if (animation != NULL)
-        return NULL;
+    assert(target && animationFile);
     
-    // TODO: Implement loading from a properties object here.
-    /*
-    animation = new Animation(id, target, p);
+    Properties* p = Properties::create(animationFile);
+    assert(p);
 
-    addAnimation(animation);
+    Animation* animation = createAnimation(id, target, p->getNextNamespace());
 
-    target->addAnimation(animation);
-    */
+    SAFE_DELETE(p);
 
     return animation;
 }
@@ -125,7 +111,6 @@ void AnimationController::stopAllAnimations()
         AnimationClip* clip = *clipIter;
         clip->_isPlaying = false;
         clip->onEnd();
-        clipIter = _runningClips.erase(clipIter);
         SAFE_RELEASE(clip);
     }
     _runningClips.clear();
@@ -133,6 +118,144 @@ void AnimationController::stopAllAnimations()
     _state = IDLE;
 }
 
+Animation* AnimationController::createAnimation(const char* id, AnimationTarget* target, Properties* animationProperties)
+{
+    assert(target && animationProperties);
+    assert(std::strcmp(animationProperties->getNamespace(), "animation") == 0);
+    
+    const char* propertyIdStr = animationProperties->getString("property");
+    assert(propertyIdStr);
+    
+    // Get animation target property id
+    int propertyId = AnimationTarget::getPropertyId(target->_targetType, propertyIdStr);
+    assert(propertyId != -1);
+    
+    unsigned int keyCount = animationProperties->getInt("keyCount");
+    assert(keyCount > 0);
+
+    const char* keyTimesStr = animationProperties->getString("keyTimes");
+    assert(keyTimesStr);
+    
+    const char* keyValuesStr = animationProperties->getString("keyValues");
+    assert(keyValuesStr);
+    
+    const char* curveStr = animationProperties->getString("curve");
+    assert(curveStr);
+    
+    char delimeter = ' ';
+    unsigned int startOffset = 0;
+    unsigned int endOffset = std::string::npos;
+    
+    unsigned long* keyTimes = new unsigned long[keyCount];
+    for (unsigned int i = 0; i < keyCount; i++)
+    {
+        endOffset = static_cast<std::string>(keyTimesStr).find_first_of(delimeter, startOffset);
+        if (endOffset != std::string::npos)
+        {
+            keyTimes[i] = std::strtoul(static_cast<std::string>(keyTimesStr).substr(startOffset, endOffset - startOffset).c_str(), NULL, 0);
+        }
+        else
+        {
+            keyTimes[i] = std::strtoul(static_cast<std::string>(keyTimesStr).substr(startOffset, static_cast<std::string>(keyTimesStr).length()).c_str(), NULL, 0);
+        }
+        startOffset = endOffset + 1;
+    }
+
+    startOffset = 0;
+    endOffset = std::string::npos;
+    
+    int componentCount = target->getAnimationPropertyComponentCount(propertyId);
+    assert(componentCount > 0);
+    
+    unsigned int components = keyCount * componentCount;
+    
+    float* keyValues = new float[components];
+    for (unsigned int i = 0; i < components; i++)
+    {
+        endOffset = static_cast<std::string>(keyValuesStr).find_first_of(delimeter, startOffset);
+        if (endOffset != std::string::npos)
+        {   
+            keyValues[i] = std::atof(static_cast<std::string>(keyValuesStr).substr(startOffset, endOffset - startOffset).c_str());
+        }
+        else
+        {
+            keyValues[i] = std::atof(static_cast<std::string>(keyValuesStr).substr(startOffset, static_cast<std::string>(keyValuesStr).length()).c_str());
+        }
+        startOffset = endOffset + 1;
+    }
+
+    const char* keyInStr = animationProperties->getString("keyIn");
+    float* keyIn = NULL;
+    if (keyInStr)
+    {
+        keyIn = new float[components];
+        startOffset = 0;
+        endOffset = std::string::npos;
+        for (unsigned int i = 0; i < components; i++)
+        {
+            endOffset = static_cast<std::string>(keyInStr).find_first_of(delimeter, startOffset);
+            if (endOffset != std::string::npos)
+            {   
+                keyIn[i] = std::atof(static_cast<std::string>(keyInStr).substr(startOffset, endOffset - startOffset).c_str());
+            }
+            else
+            {
+                keyIn[i] = std::atof(static_cast<std::string>(keyInStr).substr(startOffset, static_cast<std::string>(keyInStr).length()).c_str());
+            }
+            startOffset = endOffset + 1;
+        }
+    }
+    
+    const char* keyOutStr = animationProperties->getString("keyOut");
+    float* keyOut = NULL;
+    if(keyOutStr)
+    {   
+        keyOut = new float[components];
+        startOffset = 0;
+        endOffset = std::string::npos;
+        for (unsigned int i = 0; i < components; i++)
+        {
+            endOffset = static_cast<std::string>(keyOutStr).find_first_of(delimeter, startOffset);
+            if (endOffset != std::string::npos)
+            {   
+                keyOut[i] = std::atof(static_cast<std::string>(keyOutStr).substr(startOffset, endOffset - startOffset).c_str());
+            }
+            else
+            {
+                keyOut[i] = std::atof(static_cast<std::string>(keyOutStr).substr(startOffset, static_cast<std::string>(keyOutStr).length()).c_str());
+            }
+            startOffset = endOffset + 1;
+        }
+    }
+
+    int curve = Curve::getInterpolationType(curveStr);
+
+    Animation* animation = NULL;
+    if (keyIn && keyOut)
+    {
+        animation = createAnimation(id, target, propertyId, keyCount, keyTimes, keyValues, keyIn, keyOut, (Curve::InterpolationType)curve);
+    }
+    else
+    {
+        animation = createAnimation(id, target, propertyId, keyCount, keyTimes, keyValues, (Curve::InterpolationType) curve);
+    }
+
+    SAFE_DELETE(keyOut);
+    SAFE_DELETE(keyIn);
+    SAFE_DELETE(keyValues);
+    SAFE_DELETE(keyTimes);
+
+    Properties* pClip = animationProperties->getNextNamespace();
+    if (pClip && std::strcmp(pClip->getNamespace(), "clip") == 0)
+    {
+        int frameCount = animationProperties->getInt("frameCount");
+        assert(frameCount > 0);
+        animation->createClips(animationProperties, (unsigned int) frameCount);
+    }
+
+    return animation;
+}
+
 AnimationController::State AnimationController::getState() const
 {
     return _state;
@@ -185,10 +308,17 @@ void AnimationController::schedule(AnimationClip* clip)
 
 void AnimationController::unschedule(AnimationClip* clip)
 {
-    if (clip->_isPlaying)
+    std::list<AnimationClip*>::iterator clipItr = _runningClips.begin();
+    while (clipItr != _runningClips.end())
     {
-        _runningClips.remove(clip);
-        SAFE_RELEASE(clip);
+        AnimationClip* rClip = (*clipItr);
+        if (rClip == clip)
+        {
+            _runningClips.erase(clipItr);
+            SAFE_RELEASE(clip);
+            break;
+        }
+        clipItr++;
     }
 
     if (_runningClips.empty())
@@ -201,20 +331,18 @@ void AnimationController::update(long elapsedTime)
         return;
 
     std::list<AnimationClip*>::iterator clipIter = _runningClips.begin();
-    unsigned int clipCount = 0;
     while (clipIter != _runningClips.end())
     {
         AnimationClip* clip = (*clipIter);
         if (clip->update(elapsedTime))
         {
-            clipIter = _runningClips.erase(clipIter);
             SAFE_RELEASE(clip);
+            clipIter = _runningClips.erase(clipIter);
         }
         else
         {
             clipIter++;
         }
-        clipCount++;
     }
     
     if (_runningClips.empty())
@@ -235,8 +363,8 @@ void AnimationController::destroyAnimation(Animation* animation)
         if (animation == *itr)
         {
             Animation* animation = *itr;
-            SAFE_RELEASE(animation);
             _animations.erase(itr);
+            SAFE_RELEASE(animation);
             return;
         }
         itr++;

+ 20 - 8
gameplay/src/AnimationController.h

@@ -17,6 +17,7 @@ class AnimationController
     friend class Game;
     friend class Animation;
     friend class AnimationClip;
+    friend class SceneLoader;
 
 public:
 
@@ -32,7 +33,7 @@ public:
      * @param keyValues The list of key values for the animation.
      * @param type The curve interpolation type.
      *
-     * @return The newly created animation, or NULL if an animation with the given ID already exists.
+     * @return The newly created animation.
      */
     Animation* createAnimation(const char* id, AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, Curve::InterpolationType type);
 
@@ -49,7 +50,7 @@ public:
      * @param keyOutValue The list of key out values for the animation.
      * @param type The curve interpolation type.
      *
-     * @return The newly created animation, or NULL if an animation with the given ID already exists.
+     * @return The newly created animation.
      */
     Animation* createAnimation(const char* id, AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, float* keyInValue, float* keyOutValue, Curve::InterpolationType type);
 
@@ -58,11 +59,11 @@ public:
      * 
      * @param id The ID of the animation.
      * @param target The animation target.
-     * @param properties The properties object defining the animation data.
+     * @param animationFile The animation file defining the animation data.
      *
-     * @return The newly created animation, or NULL if an animation with the given ID already exists.
+     * @return The newly created animation.
      */
-    Animation* createAnimation(const char* id, AnimationTarget* target, Properties* p);
+    Animation* createAnimation(const char* id, AnimationTarget* target, const char* animationFile);
 
     /**
      * Creates a simple two keyframe from-to animation.
@@ -76,7 +77,7 @@ public:
      * @param type The curve interpolation type.
      * @param duration The duration of the animation (in milliseconds).
      *
-     * @return The newly created animation, or NULL if an animation with the given ID already exists.
+     * @return The newly created animation.
      */
     Animation* createAnimationFromTo(const char* id, AnimationTarget* target, int propertyId, float* from, float* to, Curve::InterpolationType type, unsigned long duration);
 
@@ -92,7 +93,7 @@ public:
      * @param type The curve interpolation type.
      * @param duration The duration of the animation (in milliseconds).
      *
-     * @return The newly created animation, or NULL if an animation with the given ID already exists.
+     * @return The newly created animation.
      */
     Animation* createAnimationFromBy(const char* id, AnimationTarget* target, int propertyId, float* from, float* by, Curve::InterpolationType type, unsigned long duration);
 
@@ -134,6 +135,17 @@ private:
      */
     ~AnimationController();
     
+    /**
+     * Creates an animation on this target using the data from the given properties object. 
+     * 
+     * @param id The ID of the animation.
+     * @param target The animation target.
+     * @param properties The properties object defining the animation data.
+     *
+     * @return The newly created animation.
+     */
+    Animation* createAnimation(const char* id, AnimationTarget* target, Properties* animationProperties);
+
     /**
      * Gets the controller's state.
      *
@@ -175,7 +187,7 @@ private:
      * Callback for when the controller receives a frame update event.
      */
     void update(long elapsedTime);
-    
+
     /**
      * Adds an animation on this AnimationTarget.
      */ 

+ 63 - 1
gameplay/src/AnimationTarget.cpp

@@ -19,9 +19,11 @@ AnimationTarget::~AnimationTarget()
         std::vector<Animation::Channel*>::iterator itr = _animationChannels->begin();
         while (itr != _animationChannels->end())
         {
-            SAFE_DELETE((*itr));
+            Animation::Channel* channel = (*itr);
+            SAFE_DELETE(channel);
             itr++;
         }
+        _animationChannels->clear();
         SAFE_DELETE(_animationChannels);
     }
 }
@@ -34,6 +36,66 @@ void AnimationTarget::addChannel(Animation::Channel* channel)
     _animationChannels->push_back(channel);
 }
 
+int AnimationTarget::getPropertyId(TargetType type, const char* propertyIdStr)
+{
+    if (type == AnimationTarget::TRANSFORM)
+    {
+        if (strcmp(propertyIdStr, "ANIMATE_SCALE") == 0)
+        {
+            return Transform::ANIMATE_SCALE;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_SCALE_X") == 0)
+        {
+            return Transform::ANIMATE_SCALE_X;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_SCALE_Y") == 0)
+        {
+            return Transform::ANIMATE_SCALE_Y;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_SCALE_Z") == 0)
+        {
+            return Transform::ANIMATE_SCALE_Z;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_ROTATE") == 0)
+        {
+            return Transform::ANIMATE_ROTATE;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_TRANSLATE") == 0)
+        {
+            return Transform::ANIMATE_TRANSLATE;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_TRANSLATE_X") == 0)
+        {
+            return Transform::ANIMATE_TRANSLATE_X;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_TRANSLATE_Y") == 0)
+        {
+            return Transform::ANIMATE_TRANSLATE_Y;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_TRANSLATE_Z") == 0)
+        {
+            return Transform::ANIMATE_TRANSLATE_Z;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_ROTATE_TRANSLATE") == 0)
+        {
+            return Transform::ANIMATE_ROTATE_TRANSLATE;
+        }
+        else if (strcmp(propertyIdStr, "ANIMATE_SCALE_ROTATE_TRANSLATE") == 0)
+        {
+            return Transform::ANIMATE_SCALE_ROTATE_TRANSLATE;
+        }
+    }
+    else
+    {
+        if (strcmp(propertyIdStr, "ANIMATE_UNIFORM") == 0)
+        {
+            return MaterialParameter::ANIMATE_UNIFORM;
+        }
+    }
+
+    return -1;
+}
+
 }
 
 

+ 10 - 0
gameplay/src/AnimationTarget.h

@@ -76,6 +76,16 @@ private:
      */
     AnimationTarget(const AnimationTarget& copy);
 
+    /**
+     * Gets the TargetType's property ID value for the specified property ID string.
+     * 
+     * @param type The TargetType of the AnimationTarget.
+     * @param propertyIdStr The property ID string.
+     * @return The property ID value for teh property ID string; -1 if the propertyIdStr does not exist
+     *    for the TargetType.
+     */
+    static int getPropertyId(TargetType type, const char* propertyIdStr);
+
     Animation::Channel* _highestPriority;
     std::vector<Animation::Channel*>* _animationChannels;   // Collection of all animation channels that target the AnimationTarget
 

+ 59 - 2
gameplay/src/AudioSource.cpp

@@ -31,6 +31,22 @@ AudioSource* AudioSource::create(const char* path)
 {
     assert(path);
 
+    // Load from a .audio file.
+    std::string pathStr = path;
+    if (pathStr.find(".audio") != pathStr.npos)
+    {
+        Properties* properties = Properties::create(path);
+        assert(properties);
+        if (properties == NULL)
+        {
+            return NULL;
+        }
+
+        AudioSource* audioSource = create(properties->getNextNamespace());
+        SAFE_DELETE(properties);
+        return audioSource;
+    }
+
     // Create an audio buffer from this path.
     AudioBuffer* buffer = AudioBuffer::create(path);
     if (buffer == NULL)
@@ -51,8 +67,49 @@ AudioSource* AudioSource::create(const char* path)
 
 AudioSource* AudioSource::create(Properties* properties)
 {
-    // TODO: Implement this!
-    return NULL;
+    // Check if the properties is valid and has a valid namespace.
+    assert(properties);
+    if (!properties || !(strcmp(properties->getNamespace(), "audio") == 0))
+    {
+        WARN("Failed to load audio source from properties object: must be non-null object and have namespace equal to \'audio\'.");
+        return NULL;
+    }
+
+    const char* path = properties->getString("path");
+    if (path == NULL)
+    {
+        WARN("Audio file failed to load; the file path was not specified.");
+        return NULL;
+    }
+
+    // Create the audio source.
+    AudioSource* audio = AudioSource::create(path);
+    if (audio == NULL)
+    {
+        WARN_VARG("Audio file '%s' failed to load properly.", path);
+        return NULL;
+    }
+
+    // Set any properties that the user specified in the .audio file.
+    if (properties->getString("looped") != NULL)
+    {
+        audio->setLooped(properties->getBool("looped"));
+    }
+    if (properties->getString("gain") != NULL)
+    {
+        audio->setGain(properties->getFloat("gain"));
+    }
+    if (properties->getString("pitch") != NULL)
+    {
+        audio->setPitch(properties->getFloat("pitch"));
+    }
+    Vector3 v;
+    if (properties->getVector3("velocity", &v))
+    {
+        audio->setVelocity(v);
+    }
+
+    return audio;
 }
 
 AudioSource::State AudioSource::getState() const

+ 3 - 3
gameplay/src/AudioSource.h

@@ -33,11 +33,11 @@ public:
     };
 
     /**
-     * Create an audio source. This is used to instantiate an Audio Source. Currently only wav, au and raw files are supported.
+     * Create an audio source. This is used to instantiate an Audio Source. Currently only wav, au, raw and .audio files are supported.
      *
-     * @param path The relative location on disk of the sound file.
+     * @param path The relative location on disk of the sound file or .audio file.
      * 
-     * @return The newly created audio source, or NULL if an audio source with the given ID already exists.
+     * @return The newly created audio source, or NULL if an audio source cannot be created.
      */
     static AudioSource* create(const char* path);
 

+ 1 - 0
gameplay/src/Base.h

@@ -37,6 +37,7 @@ using std::tolower;
 using std::size_t;
 using std::min;
 using std::max;
+using std::modf;
 
 // Common
 #ifndef NULL

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 645 - 71
gameplay/src/Curve.cpp


+ 246 - 10
gameplay/src/Curve.h

@@ -11,53 +11,267 @@ class Curve
 {
     friend class Animation;
     friend class AnimationClip;
+    friend class AnimationController;
 
 public:
 
     /**
-     * Defines the type of interpolation.
+     * Types of interpolation.
+     *
+     * Defines how the points in the curve are connected.
      *
      * Note: InterpolationType::BEZIER requires control points and InterpolationType::HERMITE requires tangents.
      */
     enum InterpolationType
     {
         /**
-         * Bezier interpolation. Requires that two control points are set for each segment.
+         * Bezier Interpolation. 
+         *
+         * Requires that two control points are set for each segment.
          */
         BEZIER,
 
         /**
-         * B-Spline interpolation. Uses the points as control points, and the curve is guaranteed to only pass through the
+         * B-Spline Interpolation. 
+         *
+         * Uses the points as control points, and the curve is guaranteed to only pass through the
          * first and last point.
          */
         BSPLINE,
 
         /**
-         * Flat. A form of Hermite interpolation that generates flat tangents for you. The tangents have a value equal to 0.
+         * Flat Interpolation. 
+         * 
+         * A form of Hermite interpolation that generates flat tangents for you. The tangents have a value equal to 0.
          */
         FLAT,
 
         /**
-         * Hermite interpolation. Requires that two tangents for each segment.
+         * Hermite Interpolation. 
+         *
+         * Requires that two tangents for each segment.
          */
         HERMITE,
 
         /**
-         * Linear interpolation.
+         * Linear Interpolation.
          */
         LINEAR,
 
         /** 
-         * Smooth. A form of Hermite interpolation that generates tangents for each segment based on the points prior to and after the segment.
+         * Smooth Interpolation. 
+         *
+         * A form of Hermite interpolation that generates tangents for each segment based on the points prior to and after the segment.
          */
         SMOOTH,
 
         /**
-         * Discrete interpolation.
+         * Discrete Interpolation.
          */ 
-        STEP
+        STEP,
+
+        /**
+         * Quadratic-In Interpolation.
+         */
+        QUADRATIC_IN, 
+        
+        /**
+         * Quadratic-Out Interpolation.
+         */
+        QUADRATIC_OUT,
+
+        /**
+         * Quadratic-In-Out Interpolation.
+         */
+        QUADRATIC_IN_OUT,
+
+        /**
+         * Quadratic-Out-In Interpolation.
+         */
+        QUADRATIC_OUT_IN,
+
+        /**
+         * Cubic-In Interpolation.
+         */
+        CUBIC_IN,
+        
+        /**
+         * Cubic-Out Interpolation.
+         */
+        CUBIC_OUT,
+        
+        /**
+         * Cubic-In-Out Interpolation.
+         */
+        CUBIC_IN_OUT,
+        
+        /**
+         * Cubic-Out-In Interpolation.
+         */
+        CUBIC_OUT_IN,
+
+        /**
+         * Quartic-In Interpolation.
+         */
+        QUARTIC_IN,
+
+        /**
+         * Quartic-Out Interpolation.
+         */
+        QUARTIC_OUT,
+
+        /**
+         * Quartic-In-Out Interpolation.
+         */
+        QUARTIC_IN_OUT,
+
+        /**
+         * Quartic-Out-In Interpolation.
+         */
+        QUARTIC_OUT_IN,
+
+        /**
+         * Quintic-In Interpolation.
+         */
+        QUINTIC_IN,
+        
+        /**
+         * Quintic-Out Interpolation.
+         */
+        QUINTIC_OUT,
+        
+        /**
+         * Quintic-In-Out Interpolation.
+         */
+        QUINTIC_IN_OUT,
+        
+        /**
+         * Quintic-Out-In Interpolation.
+         */
+        QUINTIC_OUT_IN,
+        
+        /**
+         * Sine-In Interpolation.
+         */
+        SINE_IN,
+        
+        /**
+         * Sine-Out Interpolation.
+         */
+        SINE_OUT,
+        
+        /**
+         * Sine-In-Out Interpolation.
+         */
+        SINE_IN_OUT,
+        
+        /**
+         * Sine-Out-In Interpolation.
+         */
+        SINE_OUT_IN,
+
+        /**
+         * Exponential-In Interpolation.
+         */
+        EXPONENTIAL_IN,
+
+        /**
+         * Exponential-Out Interpolation.
+         */
+        EXPONENTIAL_OUT,
+
+        /**
+         * Exponential-In-Out Interpolation.
+         */
+        EXPONENTIAL_IN_OUT,
+
+        /**
+         * Exponential-Out-In Interpolation.
+         */
+        EXPONENTIAL_OUT_IN,
+
+        /**
+         * Circular-In Interpolation.
+         */
+        CIRCULAR_IN,
+
+        /**
+         * Circular-Out Interpolation.
+         */
+        CIRCULAR_OUT,
+
+        /**
+         * Circular-In-Out Interpolation.
+         */
+        CIRCULAR_IN_OUT,
+
+        /**
+         * Circular-Out-In Interpolation.
+         */
+        CIRCULAR_OUT_IN,
+
+        /**
+         * Elastic-In Interpolation.
+         */
+        ELASTIC_IN,
+
+        /**
+         * Elastic-Out Interpolation.
+         */
+        ELASTIC_OUT,
+
+        /**
+         * Elastic-In-Out Interpolation.
+         */
+        ELASTIC_IN_OUT,
+
+        /**
+         * Elastic-Out-In Interpolation.
+         */
+        ELASTIC_OUT_IN,
+
+        /**
+         * Overshoot-In Interpolation.
+         */
+        OVERSHOOT_IN,
+
+        /**
+         * Overshoot-Out Interpolation.
+         */
+        OVERSHOOT_OUT,
+
+        /**
+         * Overshoot-In-Out Interpolation.
+         */
+        OVERSHOOT_IN_OUT,
+
+        /**
+         * Overshoot-Out-In Interpolation.
+         */
+        OVERSHOOT_OUT_IN,
+
+        /**
+         * Bounce-In Interpolation.
+         */
+        BOUNCE_IN,
+
+        /**
+         * Bounce-Out Interpolation.
+         */
+        BOUNCE_OUT,
+
+        /**
+         * Bounce-In-Out Interpolation.
+         */
+        BOUNCE_IN_OUT,
+
+        /**
+         * Bounce-Out-In Interpolation.
+         */
+        BOUNCE_OUT_IN
     };
 
+
     /**
      * Constructs a new curve and the specified parameters.
      *
@@ -226,12 +440,20 @@ private:
      * Quaternion interpolation function.
      */
     void interpolateQuaternion(float s, float* from, float* to, float* dst) const;
-
+    
     /**
      * Determines the current keyframe to interpolate from based on the specified time.
      */ 
     int determineIndex(float time) const;
 
+    /**
+     * Gets the InterpolationType value for the given string ID
+     *
+     * @param interpolationId The string representation of the InterpolationType
+     * @return the InterpolationType value; -1 if the string does not represent an InterpolationType.
+     */
+    static int getInterpolationType(const char* interpolationId);
+
     unsigned int _pointCount;           // Number of points on the curve.
     unsigned int _componentCount;       // Number of components on the curve.
     unsigned int _componentSize;        // The component size (in bytes).
@@ -240,6 +462,20 @@ private:
     Point* _points;                     // The points on the curve.
 };
 
+inline float bezier(float eq0, float eq1, float eq2, float eq3, float from, float out, float to, float in);
+
+inline float bspline(float eq0, float eq1, float eq2, float eq3, float c0, float c1, float c2, float c3);
+
+inline float hermite(float h00, float h01, float h10, float h11, float from, float out, float to, float in);
+
+inline float hermiteFlat(float h00, float h01, float from, float to);
+
+inline float hermiteSmooth(float h00, float h01, float h10, float h11, float from, float out, float to, float in);
+
+inline float lerp(float s, float from, float to);
+
 }
 
+#include "Curve.inl"
+
 #endif

+ 36 - 0
gameplay/src/Curve.inl

@@ -0,0 +1,36 @@
+#include "Curve.h"
+
+namespace gameplay
+{
+
+inline float bezier(float eq0, float eq1, float eq2, float eq3, float from, float out, float to, float in)
+{
+    return from * eq0 + out * eq1 + in * eq2 + to * eq3;
+}
+
+inline float bspline(float eq0, float eq1, float eq2, float eq3, float c0, float c1, float c2, float c3)
+{
+    return c0 * eq0 + c1 * eq1 + c2 * eq2 + c3 * eq3;
+}
+
+inline float hermite(float h00, float h01, float h10, float h11, float from, float out, float to, float in)
+{
+    return h00 * from + h01 * to + h10 * out + h11 * in;
+}
+
+inline float hermiteFlat(float h00, float h01, float from, float to)
+{
+    return h00 * from + h01 * to;
+}
+
+inline float hermiteSmooth(float h00, float h01, float h10, float h11, float from, float out, float to, float in)
+{
+    return h00 * from + h01 * to + h10 * out + h11 * in;
+}
+
+inline float lerp(float s, float from, float to)
+{
+    return from + (to - from) * s;
+}
+
+}

+ 5 - 7
gameplay/src/Game.cpp

@@ -161,8 +161,10 @@ void Game::frame()
     else
     {
         if (!_initialized)
+        {
             initialize();
-        _initialized = true;
+            _initialized = true;
+        }
     }
 
     // Update Time.
@@ -240,15 +242,11 @@ void Game::menu()
 {
 }
 
-void Game::keyChar(char key)
-{
-}
-
-void Game::keyPress(int key, int keyEvent)
+void Game::keyEvent(Keyboard::KeyEvent evt, int key)
 {
 }
 
-void Game::touch(int x, int y, int touchEvent)
+void Game::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
 {
 }
 

+ 31 - 18
gameplay/src/Game.h

@@ -1,7 +1,8 @@
 #ifndef GAME_H_
 #define GAME_H_
 
-#include "Input.h"
+#include "Keyboard.h"
+#include "Touch.h"
 #include "AudioController.h"
 #include "AnimationController.h"
 #include "PhysicsController.h"
@@ -185,33 +186,45 @@ public:
     virtual void menu();
 
     /**
-     * Input callback on keyChar events.
+     * Keyboard callback on keyPress events.
      *
-     * @param key The key code pressed.
+     * @param evt The key event that occured.
+     * @param key The key code that was pressed, released or repeated.
+     * 
+     * @see Keyboard::Key
      */
-    virtual void keyChar(char key);
+    virtual void keyEvent(Keyboard::KeyEvent evt, int key);
 
     /**
-     * Input callback on keyPress events.
+     * Touch callback on touch events.
      *
-     * @param key The key code pressed.
-     * @param keyEvent The key event that occured.
-     * 
-     * @see Input::Key
-     * @see Input::KeyEvent
+     * @param evt The touch event that occurred.
+     *
+     * @see Touch::TouchEvent
      */
-    virtual void keyPress(int key, int keyEvent);
+    virtual void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
 
     /**
-     * Input callback on touch events.
+     * Sets muli-touch is to be enabled/disabled. Default is disabled.
      *
-     * @param x The x position of the touch.
-     * @param y The y position of the touch.
-     * @param touchEvent The touch event that occurred.
-     * 
-     * @see Input::TouchEvent
+     * @param enabled true sets multi-touch is enabled, false to be disabled.
+     */
+    inline void setMultiTouch(bool enabled);
+
+    /**
+     * Is multi-touch mode enabled.
+     *
+     * @return true is multi-touch is enabled.
+     */
+    inline bool isMultiTouch() const;
+
+    /**
+     * Gets the current accelerometer values.
+     *
+     * @param pitch The pitch angle returned (in degrees). If NULL then not returned.
+     * @param roll The roll angle returned (in degrees). If NULL then not returned.
      */
-    virtual void touch(int x, int y, int touchEvent);
+    inline void getAccelerometerValues(float* pitch, float* roll);
 
 protected:
 

+ 15 - 0
gameplay/src/Game.inl

@@ -46,4 +46,19 @@ void  Game::renderOnce(T* instance, void (T::*method)(void*), void* cookie)
     Platform::swapBuffers();
 }
 
+inline void Game::setMultiTouch(bool enabled)
+{
+    Platform::setMultiTouch(enabled);
+}
+
+inline bool isMultiTouch()
+{
+    return Platform::isMultiTouch();
+}
+
+inline void Game::getAccelerometerValues(float* pitch, float* roll)
+{
+    Platform::getAccelerometerValues(pitch, roll);
+}
+
 }

+ 2 - 2
gameplay/src/Image.cpp

@@ -65,11 +65,11 @@ Image* Image::create(const char* path)
     switch (colorType)
     {
     case PNG_COLOR_TYPE_RGBA:
-        image->_format = RGBA;
+        image->_format = Image::RGBA;
         break;
 
     case PNG_COLOR_TYPE_RGB:
-        image->_format = RGB;
+        image->_format = Image::RGB;
         break;
 
     default:

+ 0 - 23
gameplay/src/Input.cpp

@@ -1,23 +0,0 @@
-#include "Base.h"
-#include "Input.h"
-#include "Platform.h"
-#include "Game.h"
-
-namespace gameplay
-{
-
-Input::Input()
-{
-}
-
-bool Input::isAccelerometerSupported()
-{
-    return Platform::isAccelerometerSupported();
-}
-
-void Input::getAccelerometerPitchAndRoll(float* pitch, float* roll)
-{
-    Platform::getAccelerometerPitchAndRoll(pitch, roll);
-}
-
-}

+ 12 - 34
gameplay/src/Input.h → gameplay/src/Keyboard.h

@@ -1,33 +1,26 @@
-#ifndef INPUT_H_
-#define INPUT_H_
+
+#ifndef KEYBOARD_H_
+#define KEYBOARD_H_
 
 namespace gameplay
 {
 
 /**
- * Defines an input class for requesting input.
+ * Keyboard key event and key definitions.
  */
-class Input
+class Keyboard
 {
-public:
+    friend class Platform;
 
-    /**
-     * The touch event.
-     */
-    enum TouchEvent
-    {
-        TOUCHEVENT_PRESS,
-        TOUCHEVENT_RELEASE,
-        TOUCHEVENT_MOVE
-    };
+public:
 
-    /**
-     * The key event.
+   /**
+     * The keyboard event.
      */
     enum KeyEvent
     {
-        KEYEVENT_DOWN,
-        KEYEVENT_UP
+        KEY_PRESS,
+        KEY_RELEASE
     };
 
     /**
@@ -192,27 +185,12 @@ public:
         KEY_TILDE
     };
 
-    /**
-     * Indicates if the game device supports accelerometer.
-     * 
-     * @return true if the accelerometer is supported; false otherwise.
-     */
-    static bool isAccelerometerSupported();
-
-    /**
-     * Gets the current accelerometer pitch and roll angles.
-     *
-     * @param pitch The pitch angle returned (in degrees). If NULL then not returned.
-     * @param roll The roll angle returned (in degrees). If NULL then not returned.
-     */
-    static void getAccelerometerPitchAndRoll(float* pitch, float* roll);
-
 private:
 
     /**
      * Constructor. Private for static.
      */
-    Input();
+    Keyboard() { }
 };
 
 }

+ 11 - 9
gameplay/src/Platform.h

@@ -73,22 +73,25 @@ public:
     static int getOrientationAngle();
 
     /**
-     * Indicates whether the platform supports an accelerometer.
-     * 
-     * @return true if the accelerometer is supported, false otherwise.
+     * Set if multi-touch is enabled on the platform
      */
-    static bool isAccelerometerSupported();
+    static void setMultiTouch(bool enabled);
+
+   /**
+    * Is multi-touch mode enabled.
+    */
+    static bool isMultiTouch();
 
     /**
-     * Gets the platform accelerometer pitch and roll.
+     * Gets the platform accelerometer values.
      * 
      * @param pitch The accelerometer pitch.
      * @param roll The accelerometer roll.
      */
-    static void getAccelerometerPitchAndRoll(float* pitch, float* roll);
+    static void getAccelerometerValues(float* pitch, float* roll);
 
     /**
-     * Swaps the 
+     * Swaps the frame buffer on the device.
      */
     static void swapBuffers();
 
@@ -104,8 +107,7 @@ private:
      */
     Platform(const Platform& copy);
 
-    Game* _game;
-
+    Game* _game;                // The game this platform is interfacing with.
 };
 
 }

+ 110 - 117
gameplay/src/PlatformMacOS.mm

@@ -4,7 +4,6 @@
 #include "Platform.h"
 #include "FileSystem.h"
 #include "Game.h"
-#include "Input.h"
 
 #import <Cocoa/Cocoa.h>
 #import <QuartzCore/CVDisplayLink.h>
@@ -179,14 +178,14 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
 {
     NSPoint point = [event locationInWindow];
     __leftMouseDown = true;
-    _game->touch(point.x, WINDOW_HEIGHT - point.y, Input::TOUCHEVENT_PRESS);
+    _game->touchEvent(Touch::TOUCH_PRESS, point.x, WINDOW_HEIGHT - point.y, 0);
 }
 
 - (void) mouseUp: (NSEvent*) event
 {
     NSPoint point = [event locationInWindow];
     __leftMouseDown = false;
-    _game->touch(point.x, WINDOW_HEIGHT - point.y, Input::TOUCHEVENT_RELEASE);
+    _game->touchEvent(Touch::TOUCH_RELEASE, point.x, WINDOW_HEIGHT - point.y, 0);
 }
 
 - (void) mouseDragged: (NSEvent*) event
@@ -194,7 +193,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     NSPoint point = [event locationInWindow];
     if (__leftMouseDown)
     {
-        _game->touch(point.x, WINDOW_HEIGHT - point.y, Input::TOUCHEVENT_MOVE);
+        _game->touchEvent(Touch::TOUCH_MOVE, point.x, WINDOW_HEIGHT - point.y, 0);
     }
 }
 
@@ -253,194 +252,194 @@ int getKey(unsigned short keyCode, unsigned int modifierFlags)
     switch(keyCode)
     {
         case 0x69:
-            return Input::KEY_PRINT;
+            return Keyboard::KEY_PRINT;
         case 0x35:
-            return Input::KEY_ESCAPE;
+            return Keyboard::KEY_ESCAPE;
         case 0x33:
-            return Input::KEY_BACKSPACE;
+            return Keyboard::KEY_BACKSPACE;
         case 0x30:
-            return Input::KEY_TAB;
+            return Keyboard::KEY_TAB;
         case 0x24:
-            return Input::KEY_RETURN;
+            return Keyboard::KEY_RETURN;
         case 0x72:
-            return Input::KEY_INSERT;
+            return Keyboard::KEY_INSERT;
         case 0x73:
-            return Input::KEY_HOME;
+            return Keyboard::KEY_HOME;
         case 0x74:
-            return Input::KEY_PG_UP;
+            return Keyboard::KEY_PG_UP;
         case 0x79:
-            return Input::KEY_PG_DOWN;
+            return Keyboard::KEY_PG_DOWN;
         case 0x75:
-            return Input::KEY_DELETE;
+            return Keyboard::KEY_DELETE;
         case 0x77:
-            return Input::KEY_END;
+            return Keyboard::KEY_END;
         case 0x7B:
-            return Input::KEY_LEFT_ARROW;
+            return Keyboard::KEY_LEFT_ARROW;
         case 0x7C:
-            return Input::KEY_RIGHT_ARROW;
+            return Keyboard::KEY_RIGHT_ARROW;
         case 0x7E:
-            return Input::KEY_UP_ARROW;
+            return Keyboard::KEY_UP_ARROW;
         case 0x7D:
-            return Input::KEY_DOWN_ARROW;
+            return Keyboard::KEY_DOWN_ARROW;
         case 0x47:
-            return Input::KEY_NUM_LOCK;
+            return Keyboard::KEY_NUM_LOCK;
         case 0x45:
-            return Input::KEY_KP_PLUS;
+            return Keyboard::KEY_KP_PLUS;
         case 0x4E:
-            return Input::KEY_KP_MINUS;
+            return Keyboard::KEY_KP_MINUS;
         case 0x43:
-            return Input::KEY_KP_MULTIPLY;
+            return Keyboard::KEY_KP_MULTIPLY;
         case 0x4B:
-            return Input::KEY_KP_DIVIDE;
+            return Keyboard::KEY_KP_DIVIDE;
         case 0x59:
-            return Input::KEY_KP_HOME;
+            return Keyboard::KEY_KP_HOME;
         case 0x5B:
-            return Input::KEY_KP_UP;
+            return Keyboard::KEY_KP_UP;
         case 0x5C:
-            return Input::KEY_KP_PG_UP;
+            return Keyboard::KEY_KP_PG_UP;
         case 0x56:
-            return Input::KEY_KP_LEFT;
+            return Keyboard::KEY_KP_LEFT;
         case 0x57:
-            return Input::KEY_KP_FIVE;
+            return Keyboard::KEY_KP_FIVE;
         case 0x58:
-            return Input::KEY_KP_RIGHT;
+            return Keyboard::KEY_KP_RIGHT;
         case 0x53:
-            return Input::KEY_KP_END;
+            return Keyboard::KEY_KP_END;
         case 0x54:
-            return Input::KEY_KP_DOWN;
+            return Keyboard::KEY_KP_DOWN;
         case 0x55:
-            return Input::KEY_KP_PG_DOWN;
+            return Keyboard::KEY_KP_PG_DOWN;
         case 0x52:
-            return Input::KEY_KP_INSERT;
+            return Keyboard::KEY_KP_INSERT;
         case 0x41:
-            return Input::KEY_KP_DELETE;
+            return Keyboard::KEY_KP_DELETE;
         case 0x7A:
-            return Input::KEY_F1;
+            return Keyboard::KEY_F1;
         case 0x78:
-            return Input::KEY_F2;
+            return Keyboard::KEY_F2;
         case 0x63:
-            return Input::KEY_F3;
+            return Keyboard::KEY_F3;
         case 0x76:
-            return Input::KEY_F4;
+            return Keyboard::KEY_F4;
         case 0x60:
-            return Input::KEY_F5;
+            return Keyboard::KEY_F5;
         case 0x61:
-            return Input::KEY_F6;
+            return Keyboard::KEY_F6;
         case 0x62:
-            return Input::KEY_F7;
+            return Keyboard::KEY_F7;
         case 0x64:
-            return Input::KEY_F8;
+            return Keyboard::KEY_F8;
         case 0x65:
-            return Input::KEY_F9;
+            return Keyboard::KEY_F9;
         case 0x6D:
-            return Input::KEY_F10;
+            return Keyboard::KEY_F10;
         
         // MACOS reserved:
-        //return Input::KEY_F11;
-        //return Input::KEY_F12;
-        // return Input::KEY_PAUSE;
-        // return Input::KEY_SCROLL_LOCK;
+        //return Keyboard::KEY_F11;
+        //return Keyboard::KEY_F12;
+        // return Keyboard::KEY_PAUSE;
+        // return Keyboard::KEY_SCROLL_LOCK;
             
         case 0x31:
-            return Input::KEY_SPACE;
+            return Keyboard::KEY_SPACE;
         case 0x1D:
-            return __shiftDown ? Input::KEY_RIGHT_PARENTHESIS : Input::KEY_ZERO;
+            return __shiftDown ? Keyboard::KEY_RIGHT_PARENTHESIS : Keyboard::KEY_ZERO;
         case 0x12:
-            return __shiftDown ? Input::KEY_EXCLAM : Input::KEY_ONE;
+            return __shiftDown ? Keyboard::KEY_EXCLAM : Keyboard::KEY_ONE;
         case 0x13:
-            return __shiftDown ? Input::KEY_AT : Input::KEY_TWO;
+            return __shiftDown ? Keyboard::KEY_AT : Keyboard::KEY_TWO;
         case 0x14:
-            return __shiftDown ? Input::KEY_NUMBER : Input::KEY_THREE;
+            return __shiftDown ? Keyboard::KEY_NUMBER : Keyboard::KEY_THREE;
         case 0x15:
-            return __shiftDown ? Input::KEY_DOLLAR : Input::KEY_FOUR;
+            return __shiftDown ? Keyboard::KEY_DOLLAR : Keyboard::KEY_FOUR;
         case 0x17:
-            return __shiftDown ? Input::KEY_PERCENT : Input::KEY_FIVE;
+            return __shiftDown ? Keyboard::KEY_PERCENT : Keyboard::KEY_FIVE;
         case 0x16:
-            return __shiftDown ? Input::KEY_CIRCUMFLEX : Input::KEY_SIX;
+            return __shiftDown ? Keyboard::KEY_CIRCUMFLEX : Keyboard::KEY_SIX;
         case 0x1A:
-            return __shiftDown ? Input::KEY_AMPERSAND : Input::KEY_SEVEN;
+            return __shiftDown ? Keyboard::KEY_AMPERSAND : Keyboard::KEY_SEVEN;
         case 0x1C:
-            return __shiftDown ? Input::KEY_ASTERISK : Input::KEY_EIGHT;
+            return __shiftDown ? Keyboard::KEY_ASTERISK : Keyboard::KEY_EIGHT;
         case 0x19:
-            return __shiftDown ? Input::KEY_LEFT_PARENTHESIS : Input::KEY_NINE;
+            return __shiftDown ? Keyboard::KEY_LEFT_PARENTHESIS : Keyboard::KEY_NINE;
         case 0x18:
-            return __shiftDown ? Input::KEY_EQUAL : Input::KEY_PLUS;
+            return __shiftDown ? Keyboard::KEY_EQUAL : Keyboard::KEY_PLUS;
         case 0x2B:
-            return __shiftDown ? Input::KEY_LESS_THAN : Input::KEY_COMMA;
+            return __shiftDown ? Keyboard::KEY_LESS_THAN : Keyboard::KEY_COMMA;
         case 0x1B:
-            return __shiftDown ? Input::KEY_UNDERSCORE : Input::KEY_MINUS;
+            return __shiftDown ? Keyboard::KEY_UNDERSCORE : Keyboard::KEY_MINUS;
         case 0x2F:
-            return __shiftDown ? Input::KEY_GREATER_THAN : Input::KEY_PERIOD;
+            return __shiftDown ? Keyboard::KEY_GREATER_THAN : Keyboard::KEY_PERIOD;
         case 0x29:
-            return __shiftDown ? Input::KEY_COLON : Input::KEY_SEMICOLON;
+            return __shiftDown ? Keyboard::KEY_COLON : Keyboard::KEY_SEMICOLON;
         case 0x2C:
-            return __shiftDown ? Input::KEY_QUESTION : Input::KEY_SLASH;
+            return __shiftDown ? Keyboard::KEY_QUESTION : Keyboard::KEY_SLASH;
         case 0x32:
-            return __shiftDown ? Input::KEY_GRAVE : Input::KEY_TILDE;
+            return __shiftDown ? Keyboard::KEY_GRAVE : Keyboard::KEY_TILDE;
         case 0x21:
-            return __shiftDown ? Input::KEY_LEFT_BRACE : Input::KEY_LEFT_BRACKET;
+            return __shiftDown ? Keyboard::KEY_LEFT_BRACE : Keyboard::KEY_LEFT_BRACKET;
         case 0x2A:
-            return __shiftDown ? Input::KEY_BAR : Input::KEY_BACK_SLASH;
+            return __shiftDown ? Keyboard::KEY_BAR : Keyboard::KEY_BACK_SLASH;
         case 0x1E:
-            return __shiftDown ? Input::KEY_RIGHT_BRACE : Input::KEY_RIGHT_BRACKET;
+            return __shiftDown ? Keyboard::KEY_RIGHT_BRACE : Keyboard::KEY_RIGHT_BRACKET;
         case 0x27:
-            return __shiftDown ? Input::KEY_QUOTE : Input::KEY_APOSTROPHE;
+            return __shiftDown ? Keyboard::KEY_QUOTE : Keyboard::KEY_APOSTROPHE;
             
         case 0x00:
-             return __shiftDown ? Input::KEY_CAPITAL_A : Input::KEY_A;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_A : Keyboard::KEY_A;
         case 0x0B:
-             return __shiftDown ? Input::KEY_CAPITAL_B : Input::KEY_B;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_B : Keyboard::KEY_B;
         case 0x08:
-             return __shiftDown ? Input::KEY_CAPITAL_C : Input::KEY_C;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_C : Keyboard::KEY_C;
         case 0x02:
-             return __shiftDown ? Input::KEY_CAPITAL_D : Input::KEY_D;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_D : Keyboard::KEY_D;
         case 0x0E:
-             return __shiftDown ? Input::KEY_CAPITAL_E : Input::KEY_E;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_E : Keyboard::KEY_E;
         case 0x03:
-             return __shiftDown ? Input::KEY_CAPITAL_F : Input::KEY_F;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_F : Keyboard::KEY_F;
         case 0x05:
-             return __shiftDown ? Input::KEY_CAPITAL_G : Input::KEY_G;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_G : Keyboard::KEY_G;
         case 0x04:
-             return __shiftDown ? Input::KEY_CAPITAL_H : Input::KEY_H;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_H : Keyboard::KEY_H;
         case 0x22:
-             return __shiftDown ? Input::KEY_CAPITAL_I : Input::KEY_I;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_I : Keyboard::KEY_I;
         case 0x26:
-             return __shiftDown ? Input::KEY_CAPITAL_J : Input::KEY_J;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_J : Keyboard::KEY_J;
         case 0x28:
-             return __shiftDown ? Input::KEY_CAPITAL_K : Input::KEY_K;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_K : Keyboard::KEY_K;
         case 0x25:
-             return __shiftDown ? Input::KEY_CAPITAL_L : Input::KEY_L;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_L : Keyboard::KEY_L;
         case 0x2E:
-             return __shiftDown ? Input::KEY_CAPITAL_M : Input::KEY_M;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_M : Keyboard::KEY_M;
         case 0x2D:
-             return __shiftDown ? Input::KEY_CAPITAL_N : Input::KEY_N;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_N : Keyboard::KEY_N;
         case 0x1F:
-             return __shiftDown ? Input::KEY_CAPITAL_O : Input::KEY_O;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_O : Keyboard::KEY_O;
         case 0x23:
-             return __shiftDown ? Input::KEY_CAPITAL_P : Input::KEY_P;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_P : Keyboard::KEY_P;
         case 0x0C:
-             return __shiftDown ? Input::KEY_CAPITAL_Q : Input::KEY_Q;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_Q : Keyboard::KEY_Q;
         case 0x0F:
-             return __shiftDown ? Input::KEY_CAPITAL_R : Input::KEY_R;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_R : Keyboard::KEY_R;
         case 0x01:
-             return __shiftDown ? Input::KEY_CAPITAL_S : Input::KEY_S;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_S : Keyboard::KEY_S;
         case 0x11:
-             return __shiftDown ? Input::KEY_CAPITAL_T : Input::KEY_T;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_T : Keyboard::KEY_T;
         case 0x20:
-             return __shiftDown ? Input::KEY_CAPITAL_U : Input::KEY_U;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_U : Keyboard::KEY_U;
         case 0x09:
-             return __shiftDown ? Input::KEY_CAPITAL_V : Input::KEY_V;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_V : Keyboard::KEY_V;
         case 0x0D:
-             return __shiftDown ? Input::KEY_CAPITAL_W : Input::KEY_W;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_W : Keyboard::KEY_W;
         case 0x07:
-             return __shiftDown ? Input::KEY_CAPITAL_X : Input::KEY_X;
+             return __shiftDown ? Keyboard::KEY_CAPITAL_X : Keyboard::KEY_X;
         case 0x10:
-            return __shiftDown ? Input::KEY_CAPITAL_Y : Input::KEY_Y;
+            return __shiftDown ? Keyboard::KEY_CAPITAL_Y : Keyboard::KEY_Y;
         case 0x06:
-            return __shiftDown ? Input::KEY_CAPITAL_Z : Input::KEY_Z;
+            return __shiftDown ? Keyboard::KEY_CAPITAL_Z : Keyboard::KEY_Z;
 
         default:
-            return Input::KEY_NONE;
+            return Keyboard::KEY_NONE;
     }
 }
 
@@ -448,47 +447,46 @@ int getKey(unsigned short keyCode, unsigned int modifierFlags)
 {
     unsigned int keyCode = [event keyCode];
     unsigned int flags = [event modifierFlags];
-    
     switch (keyCode) 
     {
         case 0x39:
-            _game->keyPress(Input::KEY_CAPS_LOCK, (flags & NSAlphaShiftKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSAlphaShiftKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_CAPS_LOCK);
             break;
         case 0x38:
-            _game->keyPress(Input::KEY_LEFT_SHIFT, (flags & NSShiftKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSShiftKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_LEFT_SHIFT);
             break;
         case 0x3C:
-            _game->keyPress(Input::KEY_RIGHT_SHIFT, (flags & NSShiftKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSShiftKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_RIGHT_SHIFT);
             break;
         case 0x3A:
-            _game->keyPress(Input::KEY_LEFT_ALT, (flags & NSAlternateKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSAlternateKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_LEFT_ALT);
             break;
         case 0x3D:
-            _game->keyPress(Input::KEY_RIGHT_ALT, (flags & NSAlternateKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSAlternateKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_RIGHT_ALT);
             break;
         case 0x3B:
-            _game->keyPress(Input::KEY_LEFT_CTRL, (flags & NSControlKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSControlKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_LEFT_CTRL);
             break;
         case 0x3E:
-            _game->keyPress(Input::KEY_RIGHT_CTRL, (flags & NSControlKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSControlKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_RIGHT_CTRL);
             break;
         case 0x37:
-            _game->keyPress(Input::KEY_LEFT_HYPER, (flags & NSCommandKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSCommandKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_LEFT_HYPER);
             break;
         case 0x36:
-            _game->keyPress(Input::KEY_RIGHT_HYPER, (flags & NSCommandKeyMask) ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP);
+            _game->keyEvent((flags & NSCommandKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_RIGHT_HYPER);
             break;
     }
 }
 
 - (void) keyDown: (NSEvent*) event
 {    
-    _game->keyPress(getKey([event keyCode], [event modifierFlags]), Input::KEYEVENT_DOWN);
+    _game->keyEvent(Keyboard::KEY_PRESS, getKey([event keyCode], [event modifierFlags]));
 }
 
 - (void) keyUp: (NSEvent*) event
 {    
-    _game->keyPress(getKey([event keyCode], [event modifierFlags]), Input::KEYEVENT_UP);
+    _game->keyEvent(Keyboard::KEY_RELEASE, getKey([event keyCode], [event modifierFlags]));
 }
 
 @end
@@ -584,12 +582,7 @@ int Platform::getOrientationAngle()
     return 0;
 }
 
-bool Platform::isAccelerometerSupported()
-{
-    return true;
-}
-
-void Platform::getAccelerometerPitchAndRoll(float* pitch, float* roll)
+void Platform::getAccelerometerValues(float* pitch, float* roll)
 {
     *pitch = __pitch;
     *roll = __roll;
@@ -600,7 +593,7 @@ void Platform::swapBuffers()
     if (__view)
         CGLFlushDrawable((CGLContextObj)[[__view openGLContext] CGLContextObj]);
 }
-    
+
 }
 
 #endif

+ 214 - 172
gameplay/src/PlatformQNX.cpp

@@ -4,9 +4,9 @@
 #include "Platform.h"
 #include "FileSystem.h"
 #include "Game.h"
-#include "Input.h"
 #include <sys/keycodes.h>
 #include <screen/screen.h>
+#include <input/screen_helpers.h>
 #include <bps/bps.h>
 #include <bps/event.h>
 #include <bps/screen.h>
@@ -14,6 +14,8 @@
 #include <bps/accelerometer.h>
 #include <bps/orientation.h>
 
+#define TOUCH_COUNT_MAX     4
+
 using namespace std;
 
 struct timespec __timespec;
@@ -29,6 +31,7 @@ static EGLContext __eglContext = EGL_NO_CONTEXT;
 static EGLSurface __eglSurface = EGL_NO_SURFACE;
 static EGLConfig __eglConfig = 0;
 static int __orientationAngle;
+static bool __multiTouch = false;
 
 static const char* __glExtensions;
 PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL;
@@ -39,321 +42,321 @@ PFNGLISVERTEXARRAYOESPROC glIsVertexArray = NULL;
 namespace gameplay
 {
 
-// Gets the Input::Key enumeration constant that corresponds to the given QNX key code.
-static Input::Key getGameplayInputKey(int qnxKeycode)
+// Gets the Keyboard::Key enumeration constant that corresponds to the given QNX key code.
+static Keyboard::Key getKey(int qnxKeycode)
 {
     switch (qnxKeycode)
     {
     case KEYCODE_SYSREQ:
-        return Input::KEY_SYSREQ;
+        return Keyboard::KEY_SYSREQ;
     case KEYCODE_BREAK:
-        return Input::KEY_BREAK;
+        return Keyboard::KEY_BREAK;
     case KEYCODE_MENU:
-        return Input::KEY_MENU;
+        return Keyboard::KEY_MENU;
     case KEYCODE_KP_ENTER:
-        return Input::KEY_KP_ENTER;
+        return Keyboard::KEY_KP_ENTER;
     case KEYCODE_PAUSE:
-        return Input::KEY_PAUSE;
+        return Keyboard::KEY_PAUSE;
     case KEYCODE_SCROLL_LOCK:
-        return Input::KEY_SCROLL_LOCK;
+        return Keyboard::KEY_SCROLL_LOCK;
     case KEYCODE_PRINT:
-        return Input::KEY_PRINT;
+        return Keyboard::KEY_PRINT;
     case KEYCODE_ESCAPE:
-        return Input::KEY_ESCAPE;
+        return Keyboard::KEY_ESCAPE;
     case KEYCODE_BACKSPACE:
-        return Input::KEY_BACKSPACE;
+        return Keyboard::KEY_BACKSPACE;
     case KEYCODE_BACK_TAB:
-        return Input::KEY_BACK_TAB;
+        return Keyboard::KEY_BACK_TAB;
     case KEYCODE_TAB:
-        return Input::KEY_TAB;
+        return Keyboard::KEY_TAB;
     case KEYCODE_RETURN:
-        return Input::KEY_RETURN;
+        return Keyboard::KEY_RETURN;
     case KEYCODE_CAPS_LOCK:
-        return Input::KEY_CAPS_LOCK;
+        return Keyboard::KEY_CAPS_LOCK;
     case KEYCODE_LEFT_SHIFT:
-        return Input::KEY_LEFT_SHIFT;
+        return Keyboard::KEY_LEFT_SHIFT;
     case KEYCODE_RIGHT_SHIFT:
-        return Input::KEY_RIGHT_SHIFT;
+        return Keyboard::KEY_RIGHT_SHIFT;
     case KEYCODE_LEFT_CTRL:
-        return Input::KEY_LEFT_CTRL;
+        return Keyboard::KEY_LEFT_CTRL;
     case KEYCODE_RIGHT_CTRL:
-        return Input::KEY_RIGHT_CTRL;
+        return Keyboard::KEY_RIGHT_CTRL;
     case KEYCODE_LEFT_ALT:
-        return Input::KEY_LEFT_ALT;
+        return Keyboard::KEY_LEFT_ALT;
     case KEYCODE_RIGHT_ALT:
-        return Input::KEY_RIGHT_ALT;
+        return Keyboard::KEY_RIGHT_ALT;
     case KEYCODE_LEFT_HYPER:
-        return Input::KEY_LEFT_HYPER;
+        return Keyboard::KEY_LEFT_HYPER;
     case KEYCODE_RIGHT_HYPER:
-        return Input::KEY_RIGHT_HYPER;
+        return Keyboard::KEY_RIGHT_HYPER;
     case KEYCODE_INSERT:
-        return Input::KEY_INSERT;
+        return Keyboard::KEY_INSERT;
     case KEYCODE_HOME:
-        return Input::KEY_HOME;
+        return Keyboard::KEY_HOME;
     case KEYCODE_PG_UP:
-        return Input::KEY_PG_UP;
+        return Keyboard::KEY_PG_UP;
     case KEYCODE_DELETE:
-        return Input::KEY_DELETE;
+        return Keyboard::KEY_DELETE;
     case KEYCODE_END:
-        return Input::KEY_END;
+        return Keyboard::KEY_END;
     case KEYCODE_PG_DOWN:
-        return Input::KEY_PG_DOWN;
+        return Keyboard::KEY_PG_DOWN;
     case KEYCODE_LEFT:
-        return Input::KEY_LEFT_ARROW;
+        return Keyboard::KEY_LEFT_ARROW;
     case KEYCODE_RIGHT:
-        return Input::KEY_RIGHT_ARROW;
+        return Keyboard::KEY_RIGHT_ARROW;
     case KEYCODE_UP:
-        return Input::KEY_UP_ARROW;
+        return Keyboard::KEY_UP_ARROW;
     case KEYCODE_DOWN:
-        return Input::KEY_DOWN_ARROW;
+        return Keyboard::KEY_DOWN_ARROW;
     case KEYCODE_NUM_LOCK:
-        return Input::KEY_NUM_LOCK;
+        return Keyboard::KEY_NUM_LOCK;
     case KEYCODE_KP_PLUS:
-        return Input::KEY_KP_PLUS;
+        return Keyboard::KEY_KP_PLUS;
     case KEYCODE_KP_MINUS:
-        return Input::KEY_KP_MINUS;
+        return Keyboard::KEY_KP_MINUS;
     case KEYCODE_KP_MULTIPLY:
-        return Input::KEY_KP_MULTIPLY;
+        return Keyboard::KEY_KP_MULTIPLY;
     case KEYCODE_KP_DIVIDE:
-        return Input::KEY_KP_DIVIDE;
+        return Keyboard::KEY_KP_DIVIDE;
     case KEYCODE_KP_HOME:
-        return Input::KEY_KP_HOME;
+        return Keyboard::KEY_KP_HOME;
     case KEYCODE_KP_UP:
-        return Input::KEY_KP_UP;
+        return Keyboard::KEY_KP_UP;
     case KEYCODE_KP_PG_UP:
-        return Input::KEY_KP_PG_UP;
+        return Keyboard::KEY_KP_PG_UP;
     case KEYCODE_KP_LEFT:
-        return Input::KEY_KP_LEFT;
+        return Keyboard::KEY_KP_LEFT;
     case KEYCODE_KP_FIVE:
-        return Input::KEY_KP_FIVE;
+        return Keyboard::KEY_KP_FIVE;
     case KEYCODE_KP_RIGHT:
-        return Input::KEY_KP_RIGHT;
+        return Keyboard::KEY_KP_RIGHT;
     case KEYCODE_KP_END:
-        return Input::KEY_KP_END;
+        return Keyboard::KEY_KP_END;
     case KEYCODE_KP_DOWN:
-        return Input::KEY_KP_DOWN;
+        return Keyboard::KEY_KP_DOWN;
     case KEYCODE_KP_PG_DOWN:
-        return Input::KEY_KP_PG_DOWN;
+        return Keyboard::KEY_KP_PG_DOWN;
     case KEYCODE_KP_INSERT:
-        return Input::KEY_KP_INSERT;
+        return Keyboard::KEY_KP_INSERT;
     case KEYCODE_KP_DELETE:
-        return Input::KEY_KP_DELETE;
+        return Keyboard::KEY_KP_DELETE;
     case KEYCODE_F1:
-        return Input::KEY_F1;
+        return Keyboard::KEY_F1;
     case KEYCODE_F2:
-        return Input::KEY_F2;
+        return Keyboard::KEY_F2;
     case KEYCODE_F3:
-        return Input::KEY_F3;
+        return Keyboard::KEY_F3;
     case KEYCODE_F4:
-        return Input::KEY_F4;
+        return Keyboard::KEY_F4;
     case KEYCODE_F5:
-        return Input::KEY_F5;
+        return Keyboard::KEY_F5;
     case KEYCODE_F6:
-        return Input::KEY_F6;
+        return Keyboard::KEY_F6;
     case KEYCODE_F7:
-        return Input::KEY_F7;
+        return Keyboard::KEY_F7;
     case KEYCODE_F8:
-        return Input::KEY_F8;
+        return Keyboard::KEY_F8;
     case KEYCODE_F9:
-        return Input::KEY_F9;
+        return Keyboard::KEY_F9;
     case KEYCODE_F10:
-        return Input::KEY_F10;
+        return Keyboard::KEY_F10;
     case KEYCODE_F11:
-        return Input::KEY_F11;
+        return Keyboard::KEY_F11;
     case KEYCODE_F12:
-        return Input::KEY_F12;
+        return Keyboard::KEY_F12;
     case KEYCODE_SPACE:
-        return Input::KEY_SPACE;
+        return Keyboard::KEY_SPACE;
     case KEYCODE_RIGHT_PAREN:
-        return Input::KEY_RIGHT_PARENTHESIS;
+        return Keyboard::KEY_RIGHT_PARENTHESIS;
     case KEYCODE_ZERO:
-        return Input::KEY_ZERO;
+        return Keyboard::KEY_ZERO;
     case KEYCODE_EXCLAM:
-        return Input::KEY_EXCLAM;
+        return Keyboard::KEY_EXCLAM;
     case KEYCODE_ONE:
-        return Input::KEY_ONE;
+        return Keyboard::KEY_ONE;
     case KEYCODE_AT:
-        return Input::KEY_AT;
+        return Keyboard::KEY_AT;
     case KEYCODE_TWO:
-        return Input::KEY_TWO;
+        return Keyboard::KEY_TWO;
     case KEYCODE_NUMBER:
-        return Input::KEY_NUMBER;
+        return Keyboard::KEY_NUMBER;
     case KEYCODE_THREE:
-        return Input::KEY_THREE;
+        return Keyboard::KEY_THREE;
     case KEYCODE_DOLLAR:
-        return Input::KEY_DOLLAR;
+        return Keyboard::KEY_DOLLAR;
     case KEYCODE_FOUR:
-        return Input::KEY_FOUR;
+        return Keyboard::KEY_FOUR;
     case KEYCODE_PERCENT:
-        return Input::KEY_PERCENT;
+        return Keyboard::KEY_PERCENT;
     case KEYCODE_FIVE:
-        return Input::KEY_FIVE;
+        return Keyboard::KEY_FIVE;
     case KEYCODE_CIRCUMFLEX:
-        return Input::KEY_CIRCUMFLEX;
+        return Keyboard::KEY_CIRCUMFLEX;
     case KEYCODE_SIX:
-        return Input::KEY_SIX;
+        return Keyboard::KEY_SIX;
     case KEYCODE_AMPERSAND:
-        return Input::KEY_AMPERSAND;
+        return Keyboard::KEY_AMPERSAND;
     case KEYCODE_SEVEN:
-        return Input::KEY_SEVEN;
+        return Keyboard::KEY_SEVEN;
     case KEYCODE_ASTERISK:
-        return Input::KEY_ASTERISK;
+        return Keyboard::KEY_ASTERISK;
     case KEYCODE_EIGHT:
-        return Input::KEY_EIGHT;
+        return Keyboard::KEY_EIGHT;
     case KEYCODE_LEFT_PAREN:
-        return Input::KEY_LEFT_PARENTHESIS;
+        return Keyboard::KEY_LEFT_PARENTHESIS;
     case KEYCODE_NINE:
-        return Input::KEY_NINE;
+        return Keyboard::KEY_NINE;
     case KEYCODE_EQUAL:
-        return Input::KEY_EQUAL;
+        return Keyboard::KEY_EQUAL;
     case KEYCODE_PLUS:
-        return Input::KEY_PLUS;
+        return Keyboard::KEY_PLUS;
     case KEYCODE_LESS_THAN:
-        return Input::KEY_LESS_THAN;
+        return Keyboard::KEY_LESS_THAN;
     case KEYCODE_COMMA:
-        return Input::KEY_COMMA;
+        return Keyboard::KEY_COMMA;
     case KEYCODE_UNDERSCORE:
-        return Input::KEY_UNDERSCORE;
+        return Keyboard::KEY_UNDERSCORE;
     case KEYCODE_MINUS:
-        return Input::KEY_MINUS;
+        return Keyboard::KEY_MINUS;
     case KEYCODE_GREATER_THAN:
-        return Input::KEY_GREATER_THAN;
+        return Keyboard::KEY_GREATER_THAN;
     case KEYCODE_PERIOD:
-        return Input::KEY_PERIOD;
+        return Keyboard::KEY_PERIOD;
     case KEYCODE_COLON:
-        return Input::KEY_COLON;
+        return Keyboard::KEY_COLON;
     case KEYCODE_SEMICOLON:
-        return Input::KEY_SEMICOLON;
+        return Keyboard::KEY_SEMICOLON;
     case KEYCODE_QUESTION:
-        return Input::KEY_QUESTION;
+        return Keyboard::KEY_QUESTION;
     case KEYCODE_SLASH:
-        return Input::KEY_SLASH;
+        return Keyboard::KEY_SLASH;
     case KEYCODE_GRAVE:
-        return Input::KEY_GRAVE;
+        return Keyboard::KEY_GRAVE;
     case KEYCODE_TILDE:
-        return Input::KEY_TILDE;
+        return Keyboard::KEY_TILDE;
     case KEYCODE_LEFT_BRACE:
-        return Input::KEY_LEFT_BRACE;
+        return Keyboard::KEY_LEFT_BRACE;
     case KEYCODE_LEFT_BRACKET:
-        return Input::KEY_LEFT_BRACKET;
+        return Keyboard::KEY_LEFT_BRACKET;
     case KEYCODE_BAR:
-        return Input::KEY_BAR;
+        return Keyboard::KEY_BAR;
     case KEYCODE_BACK_SLASH:
-        return Input::KEY_BACK_SLASH;
+        return Keyboard::KEY_BACK_SLASH;
     case KEYCODE_RIGHT_BRACE:
-        return Input::KEY_RIGHT_BRACE;
+        return Keyboard::KEY_RIGHT_BRACE;
     case KEYCODE_RIGHT_BRACKET:
-        return Input::KEY_RIGHT_BRACKET;
+        return Keyboard::KEY_RIGHT_BRACKET;
     case KEYCODE_QUOTE:
-        return Input::KEY_QUOTE;
+        return Keyboard::KEY_QUOTE;
     case KEYCODE_APOSTROPHE:
-        return Input::KEY_APOSTROPHE;
+        return Keyboard::KEY_APOSTROPHE;
     case KEYCODE_CAPITAL_A:
-        return Input::KEY_CAPITAL_A;
+        return Keyboard::KEY_CAPITAL_A;
     case KEYCODE_A:
-        return Input::KEY_A;
+        return Keyboard::KEY_A;
     case KEYCODE_CAPITAL_B:
-        return Input::KEY_CAPITAL_B;
+        return Keyboard::KEY_CAPITAL_B;
     case KEYCODE_B:
-        return Input::KEY_B;
+        return Keyboard::KEY_B;
     case KEYCODE_CAPITAL_C:
-        return Input::KEY_CAPITAL_C;
+        return Keyboard::KEY_CAPITAL_C;
     case KEYCODE_C:
-        return Input::KEY_C;
+        return Keyboard::KEY_C;
     case KEYCODE_CAPITAL_D:
-        return Input::KEY_CAPITAL_D;
+        return Keyboard::KEY_CAPITAL_D;
     case KEYCODE_D:
-        return Input::KEY_D;
+        return Keyboard::KEY_D;
     case KEYCODE_CAPITAL_E:
-        return Input::KEY_CAPITAL_E;
+        return Keyboard::KEY_CAPITAL_E;
     case KEYCODE_E:
-        return Input::KEY_E;
+        return Keyboard::KEY_E;
     case KEYCODE_CAPITAL_F:
-        return Input::KEY_CAPITAL_F;
+        return Keyboard::KEY_CAPITAL_F;
     case KEYCODE_F:
-        return Input::KEY_F;
+        return Keyboard::KEY_F;
     case KEYCODE_CAPITAL_G:
-        return Input::KEY_CAPITAL_G;
+        return Keyboard::KEY_CAPITAL_G;
     case KEYCODE_G:
-        return Input::KEY_G;
+        return Keyboard::KEY_G;
     case KEYCODE_CAPITAL_H:
-        return Input::KEY_CAPITAL_H;
+        return Keyboard::KEY_CAPITAL_H;
     case KEYCODE_H:
-        return Input::KEY_H;
+        return Keyboard::KEY_H;
     case KEYCODE_CAPITAL_I:
-        return Input::KEY_CAPITAL_I;
+        return Keyboard::KEY_CAPITAL_I;
     case KEYCODE_I:
-        return Input::KEY_I;
+        return Keyboard::KEY_I;
     case KEYCODE_CAPITAL_J:
-        return Input::KEY_CAPITAL_J;
+        return Keyboard::KEY_CAPITAL_J;
     case KEYCODE_J:
-        return Input::KEY_J;
+        return Keyboard::KEY_J;
     case KEYCODE_CAPITAL_K:
-        return Input::KEY_CAPITAL_K;
+        return Keyboard::KEY_CAPITAL_K;
     case KEYCODE_K:
-        return Input::KEY_K;
+        return Keyboard::KEY_K;
     case KEYCODE_CAPITAL_L:
-        return Input::KEY_CAPITAL_L;
+        return Keyboard::KEY_CAPITAL_L;
     case KEYCODE_L:
-        return Input::KEY_L;
+        return Keyboard::KEY_L;
     case KEYCODE_CAPITAL_M:
-        return Input::KEY_CAPITAL_M;
+        return Keyboard::KEY_CAPITAL_M;
     case KEYCODE_M:
-        return Input::KEY_M;
+        return Keyboard::KEY_M;
     case KEYCODE_CAPITAL_N:
-        return Input::KEY_CAPITAL_N;
+        return Keyboard::KEY_CAPITAL_N;
     case KEYCODE_N:
-        return Input::KEY_N;
+        return Keyboard::KEY_N;
     case KEYCODE_CAPITAL_O:
-        return Input::KEY_CAPITAL_O;
+        return Keyboard::KEY_CAPITAL_O;
     case KEYCODE_O:
-        return Input::KEY_O;
+        return Keyboard::KEY_O;
     case KEYCODE_CAPITAL_P:
-        return Input::KEY_CAPITAL_P;
+        return Keyboard::KEY_CAPITAL_P;
     case KEYCODE_P:
-        return Input::KEY_P;
+        return Keyboard::KEY_P;
     case KEYCODE_CAPITAL_Q:
-        return Input::KEY_CAPITAL_Q;
+        return Keyboard::KEY_CAPITAL_Q;
     case KEYCODE_Q:
-        return Input::KEY_Q;
+        return Keyboard::KEY_Q;
     case KEYCODE_CAPITAL_R:
-        return Input::KEY_CAPITAL_R;
+        return Keyboard::KEY_CAPITAL_R;
     case KEYCODE_R:
-        return Input::KEY_R;
+        return Keyboard::KEY_R;
     case KEYCODE_CAPITAL_S:
-        return Input::KEY_CAPITAL_S;
+        return Keyboard::KEY_CAPITAL_S;
     case KEYCODE_S:
-        return Input::KEY_S;
+        return Keyboard::KEY_S;
     case KEYCODE_CAPITAL_T:
-        return Input::KEY_CAPITAL_T;
+        return Keyboard::KEY_CAPITAL_T;
     case KEYCODE_T:
-        return Input::KEY_T;
+        return Keyboard::KEY_T;
     case KEYCODE_CAPITAL_U:
-        return Input::KEY_CAPITAL_U;
+        return Keyboard::KEY_CAPITAL_U;
     case KEYCODE_U:
-        return Input::KEY_U;
+        return Keyboard::KEY_U;
     case KEYCODE_CAPITAL_V:
-        return Input::KEY_CAPITAL_V;
+        return Keyboard::KEY_CAPITAL_V;
     case KEYCODE_V:
-        return Input::KEY_V;
+        return Keyboard::KEY_V;
     case KEYCODE_CAPITAL_W:
-        return Input::KEY_CAPITAL_W;
+        return Keyboard::KEY_CAPITAL_W;
     case KEYCODE_W:
-        return Input::KEY_W;
+        return Keyboard::KEY_W;
     case KEYCODE_CAPITAL_X:
-        return Input::KEY_CAPITAL_X;
+        return Keyboard::KEY_CAPITAL_X;
     case KEYCODE_X:
-        return Input::KEY_X;
+        return Keyboard::KEY_X;
     case KEYCODE_CAPITAL_Y:
-        return Input::KEY_CAPITAL_Y;
+        return Keyboard::KEY_CAPITAL_Y;
     case KEYCODE_Y:
-        return Input::KEY_Y;
+        return Keyboard::KEY_Y;
     case KEYCODE_CAPITAL_Z:
-        return Input::KEY_CAPITAL_Z;
+        return Keyboard::KEY_CAPITAL_Z;
     case KEYCODE_Z:
-        return Input::KEY_Z;
+        return Keyboard::KEY_Z;
     default:
-        return Input::KEY_NONE;
+        return Keyboard::KEY_NONE;
     }
 }
 
@@ -671,6 +674,8 @@ int Platform::enterMessagePump()
     int visible = 1;
     int position[2];
     int domain;
+    mtouch_event_t touchEvent;
+    int touchId = 0;
 
     // Get the initial time.
     clock_gettime(CLOCK_REALTIME, &__timespec);
@@ -686,7 +691,7 @@ int Platform::enterMessagePump()
         
         while (true)
         {
-            rc = bps_get_event(&event, 1);  // 1 = Hack for now until bps is fixed. Soon.
+            rc = bps_get_event(&event, 1);
             assert(rc == BPS_SUCCESS);
 
             if (event == NULL)
@@ -701,25 +706,57 @@ int Platform::enterMessagePump()
                 switch (eventType)
                 {
                     case SCREEN_EVENT_MTOUCH_TOUCH:
-                        screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_POSITION, position);
-                        Game::getInstance()->touch(position[0], position[1], Input::TOUCHEVENT_PRESS);
+                    {
+                        if (!__multiTouch)
+                        {
+                            screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_POSITION, position);
+                           Game::getInstance()->touchEvent(Touch::TOUCH_PRESS, position[0], position[1], 0);
+                        }
+                        else
+                        {
+                            screen_get_mtouch_event(__screenEvent, &touchEvent, 0);
+                            Game::getInstance()->touchEvent(Touch::TOUCH_PRESS, touchEvent.x, touchEvent.y, touchEvent.contact_id);
+                        }
+                        break;
+                    }
+
+                    case SCREEN_EVENT_MTOUCH_RELEASE:
+                    {
+                        if (!__multiTouch)
+                        {
+                            screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_POSITION, position);
+                           Game::getInstance()->touchEvent(Touch::TOUCH_RELEASE, position[0], position[1], 0);
+                        }
+                        else
+                        {
+                            screen_get_mtouch_event(__screenEvent, &touchEvent, 0);
+                            Game::getInstance()->touchEvent(Touch::TOUCH_RELEASE, touchEvent.x, touchEvent.y, touchEvent.contact_id);
+                        }
                         break;
+                    }
+
                     case SCREEN_EVENT_MTOUCH_MOVE:
-                        screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_POSITION, position);
-                        Game::getInstance()->touch(position[0], position[1], Input::TOUCHEVENT_MOVE);
+                    {
+                        if (!__multiTouch)
+                        {
+                            screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_POSITION, position);
+                           Game::getInstance()->touchEvent(Touch::TOUCH_MOVE, position[0], position[1], 0);
+                        }
+                        else
+                        {
+                            screen_get_mtouch_event(__screenEvent, &touchEvent, 0);
+                            Game::getInstance()->touchEvent(Touch::TOUCH_MOVE, touchEvent.x, touchEvent.y, touchEvent.contact_id);
+                        }
                         break;
-                    case SCREEN_EVENT_MTOUCH_RELEASE:
-                        screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_POSITION, position);
-                        Game::getInstance()->touch(position[0], position[1], Input::TOUCHEVENT_RELEASE);
                         break;
+                    }
 
                     case SCREEN_EVENT_KEYBOARD:
                     {
-                        // Keyboard event.
                         screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_KEY_FLAGS, &flags);
                         screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_KEY_SYM, &value);
-                        int keyEvent = flags & KEY_DOWN ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP;
-                        Game::getInstance()->keyPress(getGameplayInputKey(value), keyEvent);
+                        gameplay::Keyboard::KeyEvent evt = (flags & KEY_DOWN) ? gameplay::Keyboard::KEY_PRESS :  gameplay::Keyboard::KEY_RELEASE;
+                        Game::getInstance()->keyEvent(evt, getKey(value));
                         break;
                     }
                 }
@@ -808,12 +845,17 @@ int Platform::getOrientationAngle()
     return __orientationAngle;
 }
 
-bool Platform::isAccelerometerSupported()
+void Platform::setMultiTouch(bool enabled)
+{
+    __multiTouch = enabled;
+}
+
+bool Platform::isMultiTouch()
 {
-    return accelerometer_is_supported();
+    return __multiTouch;
 }
 
-void Platform::getAccelerometerPitchAndRoll(float* pitch, float* roll)
+void Platform::getAccelerometerValues(float* pitch, float* roll)
 {
     double tx, ty, tz;
     accelerometer_read_forces(&tx, &ty, &tz);

+ 121 - 117
gameplay/src/PlatformWin32.cpp

@@ -17,224 +17,224 @@ static HWND __hwnd = 0;
 static HDC __hdc = 0;
 static HGLRC __hrc = 0;
 
-// Gets the gameplay::Input::Key enumeration constant that corresponds
+// Gets the gameplay::Keyboard::Key enumeration constant that corresponds
 // to the given key and shift modifier combination.
-static gameplay::Input::Key getGameplayInputKey(WPARAM win32KeyCode, bool shiftDown)
+static gameplay::Keyboard::Key getKey(WPARAM win32KeyCode, bool shiftDown)
 {
     // TODO: Handle the following keys
-    //gameplay::Input::KEY_SYSREQ
-    //gameplay::Input::KEY_BREAK
-    //gameplay::Input::KEY_MENU
-    //gameplay::Input::KEY_KP_ENTER
+    //gameplay::Keyboard::KEY_SYSREQ
+    //gameplay::Keyboard::KEY_BREAK
+    //gameplay::Keyboard::KEY_MENU
+    //gameplay::Keyboard::KEY_KP_ENTER
 
     switch (win32KeyCode)
     {
     case VK_PAUSE:
-        return gameplay::Input::KEY_PAUSE;
+        return gameplay::Keyboard::KEY_PAUSE;
     case VK_SCROLL:
-        return gameplay::Input::KEY_SCROLL_LOCK;
+        return gameplay::Keyboard::KEY_SCROLL_LOCK;
     case VK_PRINT:
-        return gameplay::Input::KEY_PRINT;
+        return gameplay::Keyboard::KEY_PRINT;
     case VK_ESCAPE:
-        return gameplay::Input::KEY_ESCAPE;
+        return gameplay::Keyboard::KEY_ESCAPE;
     case VK_BACK:
-        return gameplay::Input::KEY_BACKSPACE;
+        return gameplay::Keyboard::KEY_BACKSPACE;
     case VK_TAB:
-        return shiftDown ? gameplay::Input::KEY_BACK_TAB : gameplay::Input::KEY_TAB;
+        return shiftDown ? gameplay::Keyboard::KEY_BACK_TAB : gameplay::Keyboard::KEY_TAB;
     case VK_RETURN:
-        return gameplay::Input::KEY_RETURN;
+        return gameplay::Keyboard::KEY_RETURN;
     case VK_CAPITAL:
-        return gameplay::Input::KEY_CAPS_LOCK;
+        return gameplay::Keyboard::KEY_CAPS_LOCK;
     case VK_LSHIFT:
-        return gameplay::Input::KEY_LEFT_SHIFT;
+        return gameplay::Keyboard::KEY_LEFT_SHIFT;
     case VK_RSHIFT:
-        return gameplay::Input::KEY_RIGHT_SHIFT;
+        return gameplay::Keyboard::KEY_RIGHT_SHIFT;
     case VK_LCONTROL:
-        return gameplay::Input::KEY_LEFT_CTRL;
+        return gameplay::Keyboard::KEY_LEFT_CTRL;
     case VK_RCONTROL:
-        return gameplay::Input::KEY_RIGHT_CTRL;
+        return gameplay::Keyboard::KEY_RIGHT_CTRL;
     case VK_LMENU:
-        return gameplay::Input::KEY_LEFT_ALT;
+        return gameplay::Keyboard::KEY_LEFT_ALT;
     case VK_RMENU:
-        return gameplay::Input::KEY_RIGHT_ALT;
+        return gameplay::Keyboard::KEY_RIGHT_ALT;
     case VK_LWIN:
-        return gameplay::Input::KEY_LEFT_HYPER;
+        return gameplay::Keyboard::KEY_LEFT_HYPER;
     case VK_RWIN:
-        return gameplay::Input::KEY_RIGHT_HYPER;
+        return gameplay::Keyboard::KEY_RIGHT_HYPER;
     case VK_INSERT:
-        return gameplay::Input::KEY_INSERT;
+        return gameplay::Keyboard::KEY_INSERT;
     case VK_HOME:
-        return gameplay::Input::KEY_HOME;
+        return gameplay::Keyboard::KEY_HOME;
     case VK_PRIOR:
-        return gameplay::Input::KEY_PG_UP;
+        return gameplay::Keyboard::KEY_PG_UP;
     case VK_DELETE:
-        return gameplay::Input::KEY_DELETE;
+        return gameplay::Keyboard::KEY_DELETE;
     case VK_END:
-        return gameplay::Input::KEY_END;
+        return gameplay::Keyboard::KEY_END;
     case VK_NEXT:
-        return gameplay::Input::KEY_PG_DOWN;
+        return gameplay::Keyboard::KEY_PG_DOWN;
     case VK_LEFT:
-        return gameplay::Input::KEY_LEFT_ARROW;
+        return gameplay::Keyboard::KEY_LEFT_ARROW;
     case VK_RIGHT:
-        return gameplay::Input::KEY_RIGHT_ARROW;
+        return gameplay::Keyboard::KEY_RIGHT_ARROW;
     case VK_UP:
-        return gameplay::Input::KEY_UP_ARROW;
+        return gameplay::Keyboard::KEY_UP_ARROW;
     case VK_DOWN:
-        return gameplay::Input::KEY_DOWN_ARROW;
+        return gameplay::Keyboard::KEY_DOWN_ARROW;
     case VK_NUMLOCK:
-        return gameplay::Input::KEY_NUM_LOCK;
+        return gameplay::Keyboard::KEY_NUM_LOCK;
     case VK_ADD:
-        return gameplay::Input::KEY_KP_PLUS;
+        return gameplay::Keyboard::KEY_KP_PLUS;
     case VK_SUBTRACT:
-        return gameplay::Input::KEY_KP_MINUS;
+        return gameplay::Keyboard::KEY_KP_MINUS;
     case VK_MULTIPLY:
-        return gameplay::Input::KEY_KP_MULTIPLY;
+        return gameplay::Keyboard::KEY_KP_MULTIPLY;
     case VK_DIVIDE:
-        return gameplay::Input::KEY_KP_DIVIDE;
+        return gameplay::Keyboard::KEY_KP_DIVIDE;
     case VK_NUMPAD7:
-        return gameplay::Input::KEY_KP_HOME;
+        return gameplay::Keyboard::KEY_KP_HOME;
     case VK_NUMPAD8:
-        return gameplay::Input::KEY_KP_UP;
+        return gameplay::Keyboard::KEY_KP_UP;
     case VK_NUMPAD9:
-        return gameplay::Input::KEY_KP_PG_UP;
+        return gameplay::Keyboard::KEY_KP_PG_UP;
     case VK_NUMPAD4:
-        return gameplay::Input::KEY_KP_LEFT;
+        return gameplay::Keyboard::KEY_KP_LEFT;
     case VK_NUMPAD5:
-        return gameplay::Input::KEY_KP_FIVE;
+        return gameplay::Keyboard::KEY_KP_FIVE;
     case VK_NUMPAD6:
-        return gameplay::Input::KEY_KP_RIGHT;
+        return gameplay::Keyboard::KEY_KP_RIGHT;
     case VK_NUMPAD1:
-        return gameplay::Input::KEY_KP_END;
+        return gameplay::Keyboard::KEY_KP_END;
     case VK_NUMPAD2:
-        return gameplay::Input::KEY_KP_DOWN;
+        return gameplay::Keyboard::KEY_KP_DOWN;
     case VK_NUMPAD3:
-        return gameplay::Input::KEY_KP_PG_DOWN;
+        return gameplay::Keyboard::KEY_KP_PG_DOWN;
     case VK_NUMPAD0:
-        return gameplay::Input::KEY_KP_INSERT;
+        return gameplay::Keyboard::KEY_KP_INSERT;
     case VK_DECIMAL:
-        return gameplay::Input::KEY_KP_DELETE;
+        return gameplay::Keyboard::KEY_KP_DELETE;
     case VK_F1:
-        return gameplay::Input::KEY_F1;
+        return gameplay::Keyboard::KEY_F1;
     case VK_F2:
-        return gameplay::Input::KEY_F2;
+        return gameplay::Keyboard::KEY_F2;
     case VK_F3:
-        return gameplay::Input::KEY_F3;
+        return gameplay::Keyboard::KEY_F3;
     case VK_F4:
-        return gameplay::Input::KEY_F4;
+        return gameplay::Keyboard::KEY_F4;
     case VK_F5:
-        return gameplay::Input::KEY_F5;
+        return gameplay::Keyboard::KEY_F5;
     case VK_F6:
-        return gameplay::Input::KEY_F6;
+        return gameplay::Keyboard::KEY_F6;
     case VK_F7:
-        return gameplay::Input::KEY_F7;
+        return gameplay::Keyboard::KEY_F7;
     case VK_F8:
-        return gameplay::Input::KEY_F8;
+        return gameplay::Keyboard::KEY_F8;
     case VK_F9:
-        return gameplay::Input::KEY_F9;
+        return gameplay::Keyboard::KEY_F9;
     case VK_F10:
-        return gameplay::Input::KEY_F10;
+        return gameplay::Keyboard::KEY_F10;
     case VK_F11:
-        return gameplay::Input::KEY_F11;
+        return gameplay::Keyboard::KEY_F11;
     case VK_F12:
-        return gameplay::Input::KEY_F12;
+        return gameplay::Keyboard::KEY_F12;
     case VK_SPACE:
-        return gameplay::Input::KEY_SPACE;
+        return gameplay::Keyboard::KEY_SPACE;
     case 0x30:
-        return shiftDown ? gameplay::Input::KEY_RIGHT_PARENTHESIS : gameplay::Input::KEY_ZERO;
+        return shiftDown ? gameplay::Keyboard::KEY_RIGHT_PARENTHESIS : gameplay::Keyboard::KEY_ZERO;
     case 0x31:
-        return shiftDown ? gameplay::Input::KEY_EXCLAM : gameplay::Input::KEY_ONE;
+        return shiftDown ? gameplay::Keyboard::KEY_EXCLAM : gameplay::Keyboard::KEY_ONE;
     case 0x32:
-        return shiftDown ? gameplay::Input::KEY_AT : gameplay::Input::KEY_TWO;
+        return shiftDown ? gameplay::Keyboard::KEY_AT : gameplay::Keyboard::KEY_TWO;
     case 0x33:
-        return shiftDown ? gameplay::Input::KEY_NUMBER : gameplay::Input::KEY_THREE;
+        return shiftDown ? gameplay::Keyboard::KEY_NUMBER : gameplay::Keyboard::KEY_THREE;
     case 0x34:
-        return shiftDown ? gameplay::Input::KEY_DOLLAR : gameplay::Input::KEY_FOUR;
+        return shiftDown ? gameplay::Keyboard::KEY_DOLLAR : gameplay::Keyboard::KEY_FOUR;
     case 0x35:
-        return shiftDown ? gameplay::Input::KEY_PERCENT : gameplay::Input::KEY_FIVE;
+        return shiftDown ? gameplay::Keyboard::KEY_PERCENT : gameplay::Keyboard::KEY_FIVE;
     case 0x36:
-        return shiftDown ? gameplay::Input::KEY_CIRCUMFLEX : gameplay::Input::KEY_SIX;
+        return shiftDown ? gameplay::Keyboard::KEY_CIRCUMFLEX : gameplay::Keyboard::KEY_SIX;
     case 0x37:
-        return shiftDown ? gameplay::Input::KEY_AMPERSAND : gameplay::Input::KEY_SEVEN;
+        return shiftDown ? gameplay::Keyboard::KEY_AMPERSAND : gameplay::Keyboard::KEY_SEVEN;
     case 0x38:
-        return shiftDown ? gameplay::Input::KEY_ASTERISK : gameplay::Input::KEY_EIGHT;
+        return shiftDown ? gameplay::Keyboard::KEY_ASTERISK : gameplay::Keyboard::KEY_EIGHT;
     case 0x39:
-        return shiftDown ? gameplay::Input::KEY_LEFT_PARENTHESIS : gameplay::Input::KEY_NINE;
+        return shiftDown ? gameplay::Keyboard::KEY_LEFT_PARENTHESIS : gameplay::Keyboard::KEY_NINE;
     case VK_OEM_PLUS:
-        return shiftDown ? gameplay::Input::KEY_EQUAL : gameplay::Input::KEY_PLUS;
+        return shiftDown ? gameplay::Keyboard::KEY_EQUAL : gameplay::Keyboard::KEY_PLUS;
     case VK_OEM_COMMA:
-        return shiftDown ? gameplay::Input::KEY_LESS_THAN : gameplay::Input::KEY_COMMA;
+        return shiftDown ? gameplay::Keyboard::KEY_LESS_THAN : gameplay::Keyboard::KEY_COMMA;
     case VK_OEM_MINUS:
-        return shiftDown ? gameplay::Input::KEY_UNDERSCORE : gameplay::Input::KEY_MINUS;
+        return shiftDown ? gameplay::Keyboard::KEY_UNDERSCORE : gameplay::Keyboard::KEY_MINUS;
     case VK_OEM_PERIOD:
-        return shiftDown ? gameplay::Input::KEY_GREATER_THAN : gameplay::Input::KEY_PERIOD;
+        return shiftDown ? gameplay::Keyboard::KEY_GREATER_THAN : gameplay::Keyboard::KEY_PERIOD;
     case VK_OEM_1:
-        return shiftDown ? gameplay::Input::KEY_COLON : gameplay::Input::KEY_SEMICOLON;
+        return shiftDown ? gameplay::Keyboard::KEY_COLON : gameplay::Keyboard::KEY_SEMICOLON;
     case VK_OEM_2:
-        return shiftDown ? gameplay::Input::KEY_QUESTION : gameplay::Input::KEY_SLASH;
+        return shiftDown ? gameplay::Keyboard::KEY_QUESTION : gameplay::Keyboard::KEY_SLASH;
     case VK_OEM_3:
-        return shiftDown ? gameplay::Input::KEY_GRAVE : gameplay::Input::KEY_TILDE;
+        return shiftDown ? gameplay::Keyboard::KEY_GRAVE : gameplay::Keyboard::KEY_TILDE;
     case VK_OEM_4:
-        return shiftDown ? gameplay::Input::KEY_LEFT_BRACE : gameplay::Input::KEY_LEFT_BRACKET;
+        return shiftDown ? gameplay::Keyboard::KEY_LEFT_BRACE : gameplay::Keyboard::KEY_LEFT_BRACKET;
     case VK_OEM_5:
-        return shiftDown ? gameplay::Input::KEY_BAR : gameplay::Input::KEY_BACK_SLASH;
+        return shiftDown ? gameplay::Keyboard::KEY_BAR : gameplay::Keyboard::KEY_BACK_SLASH;
     case VK_OEM_6:
-        return shiftDown ? gameplay::Input::KEY_RIGHT_BRACE : gameplay::Input::KEY_RIGHT_BRACKET;
+        return shiftDown ? gameplay::Keyboard::KEY_RIGHT_BRACE : gameplay::Keyboard::KEY_RIGHT_BRACKET;
     case VK_OEM_7:
-        return shiftDown ? gameplay::Input::KEY_QUOTE : gameplay::Input::KEY_APOSTROPHE;
+        return shiftDown ? gameplay::Keyboard::KEY_QUOTE : gameplay::Keyboard::KEY_APOSTROPHE;
     case 0x41:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_A : gameplay::Input::KEY_A;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_A : gameplay::Keyboard::KEY_A;
     case 0x42:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_B : gameplay::Input::KEY_B;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_B : gameplay::Keyboard::KEY_B;
     case 0x43:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_C : gameplay::Input::KEY_C;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_C : gameplay::Keyboard::KEY_C;
     case 0x44:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_D : gameplay::Input::KEY_D;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_D : gameplay::Keyboard::KEY_D;
     case 0x45:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_E : gameplay::Input::KEY_E;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_E : gameplay::Keyboard::KEY_E;
     case 0x46:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_F : gameplay::Input::KEY_F;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_F : gameplay::Keyboard::KEY_F;
     case 0x47:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_G : gameplay::Input::KEY_G;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_G : gameplay::Keyboard::KEY_G;
     case 0x48:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_H : gameplay::Input::KEY_H;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_H : gameplay::Keyboard::KEY_H;
     case 0x49:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_I : gameplay::Input::KEY_I;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_I : gameplay::Keyboard::KEY_I;
     case 0x4A:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_J : gameplay::Input::KEY_J;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_J : gameplay::Keyboard::KEY_J;
     case 0x4B:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_K : gameplay::Input::KEY_K;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_K : gameplay::Keyboard::KEY_K;
     case 0x4C:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_L : gameplay::Input::KEY_L;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_L : gameplay::Keyboard::KEY_L;
     case 0x4D:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_M : gameplay::Input::KEY_M;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_M : gameplay::Keyboard::KEY_M;
     case 0x4E:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_N : gameplay::Input::KEY_N;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_N : gameplay::Keyboard::KEY_N;
     case 0x4F:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_O : gameplay::Input::KEY_O;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_O : gameplay::Keyboard::KEY_O;
     case 0x50:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_P : gameplay::Input::KEY_P;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_P : gameplay::Keyboard::KEY_P;
     case 0x51:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_Q : gameplay::Input::KEY_Q;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_Q : gameplay::Keyboard::KEY_Q;
     case 0x52:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_R : gameplay::Input::KEY_R;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_R : gameplay::Keyboard::KEY_R;
     case 0x53:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_S : gameplay::Input::KEY_S;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_S : gameplay::Keyboard::KEY_S;
     case 0x54:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_T : gameplay::Input::KEY_T;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_T : gameplay::Keyboard::KEY_T;
     case 0x55:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_U : gameplay::Input::KEY_U;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_U : gameplay::Keyboard::KEY_U;
     case 0x56:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_V : gameplay::Input::KEY_V;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_V : gameplay::Keyboard::KEY_V;
     case 0x57:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_W : gameplay::Input::KEY_W;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_W : gameplay::Keyboard::KEY_W;
     case 0x58:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_X : gameplay::Input::KEY_X;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_X : gameplay::Keyboard::KEY_X;
     case 0x59:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_Y : gameplay::Input::KEY_Y;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_Y : gameplay::Keyboard::KEY_Y;
     case 0x5A:
-        return shiftDown ? gameplay::Input::KEY_CAPITAL_Z : gameplay::Input::KEY_Z;
+        return shiftDown ? gameplay::Keyboard::KEY_CAPITAL_Z : gameplay::Keyboard::KEY_Z;
     default:
-        return gameplay::Input::KEY_NONE;
+        return gameplay::Keyboard::KEY_NONE;
     }
 }
 
@@ -267,13 +267,13 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         return 0;
 
     case WM_LBUTTONDOWN:
-        gameplay::Game::getInstance()->touch(LOWORD(lParam), HIWORD(lParam), gameplay::Input::TOUCHEVENT_PRESS);
+        gameplay::Game::getInstance()->touchEvent(gameplay::Touch::TOUCH_PRESS, LOWORD(lParam), HIWORD(lParam), 0);
         lMouseDown = true;
         return 0;
 
     case WM_LBUTTONUP:
         lMouseDown = false;
-        gameplay::Game::getInstance()->touch(LOWORD(lParam), HIWORD(lParam), gameplay::Input::TOUCHEVENT_RELEASE);
+        gameplay::Game::getInstance()->touchEvent(gameplay::Touch::TOUCH_RELEASE, LOWORD(lParam), HIWORD(lParam), 0);
         return 0;
 
     case WM_RBUTTONDOWN:
@@ -301,7 +301,7 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
         if (lMouseDown)
         {
-            gameplay::Game::getInstance()->touch(LOWORD(lParam), HIWORD(lParam), gameplay::Input::TOUCHEVENT_MOVE);
+            gameplay::Game::getInstance()->touchEvent(gameplay::Touch::TOUCH_MOVE, LOWORD(lParam), HIWORD(lParam), 0);
             return 0;
         }
         else if (rMouseDown)
@@ -330,14 +330,14 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         if (wParam == VK_LSHIFT || wParam == VK_RSHIFT)
             shiftDown = true;
 
-        gameplay::Game::getInstance()->keyPress(getGameplayInputKey(wParam, shiftDown), gameplay::Input::KEYEVENT_DOWN);
+        gameplay::Game::getInstance()->keyEvent(gameplay::Keyboard::KEY_PRESS, getKey(wParam, shiftDown));
         break;
 
     case WM_KEYUP:
         if (wParam == VK_LSHIFT || wParam == VK_RSHIFT)
             shiftDown = false;
 
-        gameplay::Game::getInstance()->keyPress(getGameplayInputKey(wParam, shiftDown), gameplay::Input::KEYEVENT_UP);
+        gameplay::Game::getInstance()->keyEvent(gameplay::Keyboard::KEY_RELEASE, getKey(wParam, shiftDown));
         break;
 
     case WM_SETFOCUS:
@@ -565,12 +565,16 @@ int Platform::getOrientationAngle()
     return 0;
 }
 
-bool Platform::isAccelerometerSupported()
+void Platform::setMultiTouch(bool enabled)
 {
-    return true;
 }
 
-void Platform::getAccelerometerPitchAndRoll(float* pitch, float* roll)
+bool Platform::isMultiTouch()
+{
+    return false;
+}
+
+void Platform::getAccelerometerValues(float* pitch, float* roll)
 {
     *pitch = __pitch;
     *roll = __roll;

+ 1 - 1
gameplay/src/RenderTarget.cpp

@@ -26,7 +26,7 @@ RenderTarget::~RenderTarget()
 RenderTarget* RenderTarget::create(const char* id, unsigned int width, unsigned int height)
 {
     // Create a new texture with the given width
-    Texture* texture = Texture::create(Texture::RGBA8888, width, height, NULL, false);
+    Texture* texture = Texture::create(Texture::RGBA, width, height, NULL, false);
     if (texture == NULL)
     {
         return NULL;

+ 2 - 2
gameplay/src/Texture.cpp

@@ -95,9 +95,9 @@ Texture* Texture::create(Image* image, bool generateMipmaps)
     switch (image->getFormat())
     {
     case Image::RGB:
-        return create(RGB888, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
+        return create(Texture::RGB, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
     case Image::RGBA:
-        return create(RGBA8888, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
+        return create(Texture::RGBA, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
     }
     
     return NULL;

+ 4 - 4
gameplay/src/Texture.h

@@ -22,10 +22,10 @@ public:
      */
     enum Format
     {
-        ALPHA = GL_ALPHA,
-        RGB888 = GL_RGB,
-        RGBA8888 = GL_RGBA,
-        DEPTH = GL_DEPTH_COMPONENT
+        RGB     = GL_RGB,
+        RGBA    = GL_RGBA,
+        ALPHA   = GL_ALPHA,
+        DEPTH   = GL_DEPTH_COMPONENT
     };
 
     /**

+ 35 - 0
gameplay/src/Touch.h

@@ -0,0 +1,35 @@
+#ifndef TOUCH_H_
+#define TOUCH_H_
+
+namespace gameplay
+{
+
+/**
+ * Touch event
+ */
+class Touch
+{
+public:
+
+    /**
+     * The touch event type.
+     */
+    enum TouchEvent
+    {
+        TOUCH_PRESS,
+        TOUCH_RELEASE,
+        TOUCH_MOVE
+    };
+
+
+private:
+
+    /**
+     * Constructor. Used internally.
+     */
+    Touch();
+};
+
+}
+
+#endif

+ 0 - 55
gameplay/src/Transform.cpp

@@ -558,13 +558,6 @@ unsigned int Transform::getAnimationPropertyComponentCount(int propertyId) const
         case ANIMATE_TRANSLATE_Y:
         case ANIMATE_TRANSLATE_Z:
             return 1;
-        case ANIMATE_SCALE_XY:
-        case ANIMATE_SCALE_XZ:
-        case ANIMATE_SCALE_YZ:
-        case ANIMATE_TRANSLATE_XY:
-        case ANIMATE_TRANSLATE_XZ:
-        case ANIMATE_TRANSLATE_YZ:
-            return 2;
         case ANIMATE_SCALE:
         case ANIMATE_TRANSLATE:
             return 3;
@@ -597,18 +590,6 @@ void Transform::getAnimationPropertyValue(int propertyId, AnimationValue* value)
         case ANIMATE_SCALE_Z:
             value->setFloat(0, _scale.z);
             break;
-        case ANIMATE_SCALE_XY:
-            value->setFloat(0, _scale.x);
-            value->setFloat(1, _scale.y);
-            break;
-        case ANIMATE_SCALE_XZ:
-            value->setFloat(0, _scale.x);
-            value->setFloat(1, _scale.z);
-            break;
-        case ANIMATE_SCALE_YZ:
-            value->setFloat(0, _scale.y);
-            value->setFloat(1, _scale.z);
-            break;
         case ANIMATE_ROTATE:
             value->setFloat(0, _rotation.x);
             value->setFloat(1, _rotation.y);
@@ -629,18 +610,6 @@ void Transform::getAnimationPropertyValue(int propertyId, AnimationValue* value)
         case ANIMATE_TRANSLATE_Z:
             value->setFloat(0, _translation.z);
             break;
-        case ANIMATE_TRANSLATE_XY:
-            value->setFloat(0, _translation.x);
-            value->setFloat(1, _translation.y);
-            break;
-        case ANIMATE_TRANSLATE_XZ:
-            value->setFloat(0, _translation.x);
-            value->setFloat(1, _translation.z);
-            break;
-        case ANIMATE_TRANSLATE_YZ:
-            value->setFloat(0, _translation.y);
-            value->setFloat(1, _translation.z);
-            break;
         case ANIMATE_ROTATE_TRANSLATE:
             value->setFloat(0, _rotation.x);
             value->setFloat(1, _rotation.y);
@@ -683,18 +652,6 @@ void Transform::setAnimationPropertyValue(int propertyId, AnimationValue* value)
         case ANIMATE_SCALE_Z:
             setScaleZ(value->getFloat(0));
             break;
-        case ANIMATE_SCALE_XY:
-            setScaleX(value->getFloat(0));
-            setScaleY(value->getFloat(1));
-            break;
-        case ANIMATE_SCALE_XZ:
-            setScaleX(value->getFloat(0));
-            setScaleZ(value->getFloat(1));
-            break;
-        case ANIMATE_SCALE_YZ:
-            setScaleY(value->getFloat(0));
-            setScaleZ(value->getFloat(1));
-            break;
         case ANIMATE_ROTATE:
             setRotation(value->getFloat(0), value->getFloat(1), value->getFloat(2), value->getFloat(3));
             break;
@@ -710,18 +667,6 @@ void Transform::setAnimationPropertyValue(int propertyId, AnimationValue* value)
         case ANIMATE_TRANSLATE_Z:
             setTranslationZ(value->getFloat(0));
             break;
-        case ANIMATE_TRANSLATE_XY:
-            setTranslationX(value->getFloat(0));
-            setTranslationY(value->getFloat(1));
-            break;
-        case ANIMATE_TRANSLATE_XZ:
-            setTranslationX(value->getFloat(0));
-            setTranslationZ(value->getFloat(1));
-            break;
-        case ANIMATE_TRANSLATE_YZ:
-            setTranslationY(value->getFloat(0));
-            setTranslationZ(value->getFloat(1));
-            break;
         case ANIMATE_ROTATE_TRANSLATE:
             setRotation(value->getFloat(0), value->getFloat(1), value->getFloat(2), value->getFloat(3));
             setTranslation(value->getFloat(4), value->getFloat(5), value->getFloat(6));

+ 0 - 30
gameplay/src/Transform.h

@@ -50,21 +50,6 @@ public:
      */
     static const int ANIMATE_SCALE_Z = 4;
 
-    /**
-     * Scale xy animation property. Data=sx,sy
-     */
-    static const int ANIMATE_SCALE_XY = 5;
-
-    /**
-     * Scale xz animation property. Data=sx,sz
-     */
-    static const int ANIMATE_SCALE_XZ = 6;
-
-    /**
-     * Scale yz animation property. Data=sy,sz
-     */
-    static const int ANIMATE_SCALE_YZ = 7;
-
     /**
      * Rotation animation property. Data=qx,qy,qz,qw (as quaternion).
      */
@@ -90,21 +75,6 @@ public:
      */
     static const int ANIMATE_TRANSLATE_Z = 12;
 
-    /**
-     * Translate xy animation property. Data=tx,ty
-     */
-    static const int ANIMATE_TRANSLATE_XY = 13;
-
-    /**
-     * Translate xz animation property. Data=tx,tz
-     */
-    static const int ANIMATE_TRANSLATE_XZ = 14;
-
-    /**
-     * Translate yz animation property. Data=ty,tz
-     */
-    static const int ANIMATE_TRANSLATE_YZ = 15;
-
     /**
      * Rotation + Translation animation property (Rigid Body). Data=qx,qy,qz,qw,tx,ty,tz
      */

+ 2 - 1
gameplay/src/gameplay.h

@@ -2,7 +2,8 @@
 #include "Base.h"
 #include "Platform.h"
 #include "Game.h"
-#include "Input.h"
+#include "Keyboard.h"
+#include "Touch.h"
 #include "FileSystem.h"
 #include "Package.h"
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است