Jelajahi Sumber

Merge pull request #363 from blackberry/master

Minor fixes for iOS
Sean Paul Taylor 13 tahun lalu
induk
melakukan
8b81cc4d59

+ 9 - 8
gameplay-newproject.bat

@@ -177,10 +177,15 @@ call:replace %projPath%\%projName%.xcodeproj\project.pbxproj GAMEPLAY_PATH "%gpP
 call:replace %projPath%\%projName%.xcodeproj\project.pbxproj TemplateGame "%className%"
 call:replace %projPath%\%projName%.xcodeproj\project.pbxproj TEMPLATE_PROJECT "%projName%"
 
-copy gameplay-template\gameplay-template-macosx.plist %projPath%\%projName%-macosx.plist
+copy gameplay-template\TEMPLATE_PROJECT-macosx.plist %projPath%\%projName%-macosx.plist
 call:replace %projPath%\%projName%-macosx.plist TEMPLATE_UUID "%uuid%"
 call:replace %projPath%\%projName%-macosx.plist TEMPLATE_AUTHOR "%author%"
 
+copy gameplay-template\TEMPLATE_PROJECT-ios.plist %projPath%\%projName%-ios.plist
+call:replace %projPath%\%projName%-ios.plist TEMPLATE_TITLE "%title%"
+call:replace %projPath%\%projName%-ios.plist TEMPLATE_UUID "%uuid%"
+call:replace %projPath%\%projName%-ios.plist TEMPLATE_AUTHOR "%author%"
+
 REM Copy BlackBerry NDK project files
 copy gameplay-template\template.cproject %projPath%\.cproject
 call:replace %projPath%\.cproject TEMPLATE_PROJECT "%projName%"
@@ -207,11 +212,6 @@ call:replace %projPath%\android\AndroidManifest.xml TEMPLATE_UUID "%uuid%"
 copy gameplay-template\android\template.build.xml %projPath%\android\build.xml
 call:replace %projPath%\android\build.xml TEMPLATE_PROJECT "%projName%"
 
-copy gameplay-template\android\template.project %projPath%\android\.project
-call:replace %projPath%\android\.project TEMPLATE_PROJECT "%projName%"
-
-copy gameplay-template\android\template.classpath %projPath%\android\.classpath
-
 mkdir %projPath%\android\jni
 
 copy gameplay-template\android\jni\Application.mk %projPath%\android\jni\Application.mk
@@ -220,7 +220,9 @@ copy gameplay-template\android\jni\template.Android.mk %projPath%\android\jni\An
 call:replace %projPath%\android\jni\Android.mk TemplateGame "%className%"
 call:replace %projPath%\android\jni\Android.mk TEMPLATE_PROJECT "%projName%"
 
-copy gameplay-template\android\jni\main.cpp %projPath%\android\jni\main.cpp
+mkdir %projPath%\android\res\drawable
+
+copy gameplay-template\icon.png %projPath%\android\res\drawable\icon.png
 
 mkdir %projPath%\android\res\values
 
@@ -236,7 +238,6 @@ call:replace %projPath%\src\%className%.cpp TemplateGame "%className%"
 
 REM Copy resource files
 copy gameplay-template\res\* %projPath%\res\
-copy gameplay\res\shaders\colored.* %projPath%\res\
 
 REM Copy icon
 copy gameplay-template\icon.png %projPath%\icon.png

+ 3 - 2
gameplay-newproject.sh

@@ -158,7 +158,7 @@ fi
 # sed "s/TEMPLATE_PROJECT/$projectName/g" "gameplay-template/gameplay-template.vcxproj" > "$projPath/$projName.vcxproj"
 
 #############################################
-# Copy Microsoft Virtual Studio project files
+# Copy Visual Studio project files
 cp "gameplay-template/gameplay-template.vcxproj" "$projPath/$projName.vcxproj"
 sed -i "" "s*TEMPLATE_PROJECT*$projectName*g" "$projPath/$projName.vcxproj"
 sed -i "" "s*TemplateGame*$className*g" "$projPath/$projName.vcxproj"
@@ -172,7 +172,7 @@ sed -i "" "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/$projName.vcxproj.user"
 
 
 #############################################
-# Copy Apple XCode project files
+# Copy XCode project files
 mkdir -p "$projPath/$projName.xcodeproj"
 cp "gameplay-template/gameplay-template.xcodeproj/project.pbxproj" "$projPath/$projName.xcodeproj/project.pbxproj"
 sed -i "" "s*TEMPLATE_PROJECT*$projName*g" "$projPath/$projName.xcodeproj/project.pbxproj"
@@ -184,6 +184,7 @@ sed -i "" "s*TEMPLATE_UUID*$uuid*g" "$projPath/$projName-macosx.plist"
 sed -i "" "s*TEMPLATE_AUTHOR*$author*g" "$projPath/$projName-macosx.plist"
 
 cp "gameplay-template/TEMPLATE_PROJECT-ios.plist" "$projPath/$projName-ios.plist"
+sed -i "" "s*TEMPLATE_TITLE*$title*g" "$projPath/$projName-ios.plist"
 sed -i "" "s*TEMPLATE_UUID*$uuid*g" "$projPath/$projName-ios.plist"
 sed -i "" "s*TEMPLATE_AUTHOR*$author*g" "$projPath/$projName-ios.plist"
 

+ 4 - 2
gameplay-template/TEMPLATE_PROJECT-ios.plist

@@ -4,10 +4,10 @@
 <dict>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
+    <key>CFBundleDisplayName</key>
+	<string>TEMPLATE_TITLE</string>
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
-	<key>CFBundleIconFile</key>
-	<string>icon.png</string>
 	<key>CFBundleIdentifier</key>
 	<string>TEMPLATE_UUID</string>
 	<key>CFBundleInfoDictionaryVersion</key>
@@ -28,5 +28,7 @@
 	<array>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+    <key>CFBundleIconFile</key>
+	<string>icon.png</string>
 </dict>
 </plist>

+ 1 - 1
gameplay-template/TEMPLATE_PROJECT-macosx.plist

@@ -27,7 +27,7 @@
 	<key>LSMinimumSystemVersion</key>
 	<string>${MACOSX_DEPLOYMENT_TARGET}</string>
 	<key>NSHumanReadableCopyright</key>
-	<string>Copyright © 2011 TEMPLATE_AUTHOR. All rights reserved.</string>
+	<string>Copyright © 2012 TEMPLATE_AUTHOR. All rights reserved.</string>
 	<key>NSPrincipalClass</key>
 	<string>NSApplication</string>
 </dict>

+ 1 - 1
gameplay-template/android/template.AndroidManifest.xml

@@ -10,7 +10,7 @@
     <uses-sdk android:minSdkVersion="9" />
 	<uses-feature android:glEsVersion="0x00020000"/>
 
-    <application android:label="@string/app_name" android:hasCode="true">
+    <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
 
         <!-- Our activity is the built-in NativeActivity framework class.
              This will take care of integrating with our NDK code. -->

+ 11 - 0
gameplay-template/gameplay-template.vcxproj

@@ -159,6 +159,17 @@
       </Outputs>
     </CustomBuildStep>
   </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="bar-descriptor.xml" >
+        <SubType>Designer</SubType>
+    </None>
+    <None Include="icon.png" />
+    <None Include="res\box.dae" />
+    <None Include="res\box.gpb" />
+    <None Include="res\box.material" />
+    <None Include="res\colored.fsh" />
+    <None Include="res\colored.vsh" />
+  </ItemGroup> 
   <ItemGroup>
     <ClCompile Include="src\TemplateGame.cpp" />
   </ItemGroup>

+ 21 - 0
gameplay-template/gameplay-template.vcxproj.filters

@@ -1,9 +1,30 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
+    <Filter Include="res">
+    </Filter>
     <Filter Include="src">
     </Filter>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="icon.png" />
+    <None Include="bar-descriptor.xml" />
+    <None Include="res\box.dae">
+      <Filter>res</Filter>
+    </None>
+    <None Include="res\box.gpb">
+      <Filter>res</Filter>
+    </None>
+    <None Include="res\box.material">
+      <Filter>res</Filter>
+    </None>
+    <None Include="res\colored.fsh">
+      <Filter>res</Filter>
+    </None>
+    <None Include="res\colored.vsh">
+      <Filter>res</Filter>
+    </None>
+  </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\TemplateGame.h">
       <Filter>src</Filter>

+ 8 - 2
gameplay-template/gameplay-template.xcodeproj/project.pbxproj

@@ -70,7 +70,6 @@
 		5BAF206C152F2DDD003E2AC3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
 		5BC4E77F150F879E00CBE1C0 /* gameplay.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = gameplay.xcodeproj; path = GAMEPLAY_PATH/gameplay/gameplay.xcodeproj; sourceTree = SOURCE_ROOT; };
 		5BC4E849150F911D00CBE1C0 /* shaders */ = {isa = PBXFileReference; lastKnownFileType = text; name = shaders; path = GAMEPLAY_PATH/gameplay/res/shaders; sourceTree = SOURCE_ROOT; };
-		5BC4E84A150F911D00CBE1C0 /* textures */ = {isa = PBXFileReference; lastKnownFileType = text; name = textures; path = GAMEPLAY_PATH/gameplay/res/textures; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -202,7 +201,6 @@
 			isa = PBXGroup;
 			children = (
 				5BC4E849150F911D00CBE1C0 /* shaders */,
-				5BC4E84A150F911D00CBE1C0 /* textures */,
 				5BC4E77F150F879E00CBE1C0 /* gameplay.xcodeproj */,
 			);
 			name = GamePlay;
@@ -479,6 +477,8 @@
 		5B61612A14CCC24C0073B857 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+                ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				CODE_SIGN_IDENTITY = "iPhone Developer";
 				GCC_PRECOMPILE_PREFIX_HEADER = NO;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
 				GCC_WARN_UNUSED_VARIABLE = NO;
@@ -489,6 +489,7 @@
 					"GAMEPLAY_PATH/external-deps/oggvorbis/include",
 				);
 				INFOPLIST_FILE = "TEMPLATE_PROJECT-ios.plist";
+                IPHONEOS_DEPLOYMENT_TARGET = 5.1;
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"GAMEPLAY_PATH/external-deps/libpng/lib/ios/$(CURRENT_ARCH)\"",
@@ -496,6 +497,7 @@
 					"\"GAMEPLAY_PATH/external-deps/oggvorbis/lib/ios/$(CURRENT_ARCH)\"",
 				);
 				SDKROOT = iphoneos;
+                TARGETED_DEVICE_FAMILY = "1,2";
 				USER_HEADER_SEARCH_PATHS = "";
 				WRAPPER_EXTENSION = app;
 			};
@@ -504,6 +506,8 @@
 		5B61612B14CCC24C0073B857 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+                ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				CODE_SIGN_IDENTITY = "iPhone Developer";
 				GCC_PRECOMPILE_PREFIX_HEADER = NO;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
 				GCC_WARN_UNUSED_VARIABLE = NO;
@@ -514,6 +518,7 @@
 					"GAMEPLAY_PATH/external-deps/oggvorbis/include",
 				);
 				INFOPLIST_FILE = "TEMPLATE_PROJECT-ios.plist";
+                IPHONEOS_DEPLOYMENT_TARGET = 5.1;
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"GAMEPLAY_PATH/external-deps/libpng/lib/ios/$(CURRENT_ARCH)\"",
@@ -521,6 +526,7 @@
 					"\"GAMEPLAY_PATH/external-deps/oggvorbis/lib/ios/$(CURRENT_ARCH)\"",
 				);
 				SDKROOT = iphoneos;
+                TARGETED_DEVICE_FAMILY = "1,2";
 				USER_HEADER_SEARCH_PATHS = "";
 				WRAPPER_EXTENSION = app;
 			};

+ 2 - 2
gameplay-template/res/box.material

@@ -5,8 +5,8 @@ material box
         pass
         {
             // shaders
-            vertexShader = res/shaders/colored.vsh
-            fragmentShader = res/shaders/colored.fsh
+            vertexShader = res/colored.vsh
+            fragmentShader = res/colored.fsh
             
             // uniforms
             u_worldViewProjectionMatrix = WORLD_VIEW_PROJECTION_MATRIX

+ 111 - 0
gameplay-template/res/colored.fsh

@@ -0,0 +1,111 @@
+#ifdef OPENGL_ES
+precision highp float;
+#endif
+
+// Uniforms
+uniform vec3 u_lightColor;                      // Light color
+uniform vec3 u_ambientColor;                    // Ambient color
+uniform vec4 u_diffuseColor;                    // Diffuse color
+#if defined(GLOBAL_ALPHA)
+uniform float u_globalAlpha;                    // Global alpha value
+#endif
+
+// Inputs
+varying vec3 v_normalVector;                    // NormalVector in view space.
+
+// Global variables
+vec4 _baseColor;                                // Base color
+vec3 _ambientColor;                             // Ambient Color
+vec3 _diffuseColor;                             // Diffuse Color
+
+void lighting(vec3 normalVector, vec3 lightDirection, float attenuation)
+{
+    // Ambient
+    _ambientColor = _baseColor.rgb * u_ambientColor;
+
+    // Diffuse
+    float ddot = dot(normalVector, lightDirection);
+    float diffuseIntensity = attenuation * ddot;
+    diffuseIntensity = max(0.0, diffuseIntensity);
+    _diffuseColor = u_lightColor * _baseColor.rgb * diffuseIntensity;
+}
+
+#if defined(POINT_LIGHT)
+
+varying vec4 v_vertexToPointLightDirection;     // Light direction w.r.t current vertex.
+
+void applyLight()
+{
+    // Normalize the vectors.
+    vec3 normalVector = normalize(v_normalVector);
+    
+    vec3 vertexToPointLightDirection = normalize(v_vertexToPointLightDirection.xyz);
+    
+    // Fetch point light attenuation.
+    float pointLightAttenuation = v_vertexToPointLightDirection.w;
+    lighting(normalVector, vertexToPointLightDirection, pointLightAttenuation);
+}
+
+#elif defined(SPOT_LIGHT)
+
+uniform vec3 u_spotLightDirection;              // Direction of the spot light.
+uniform float u_spotLightInnerAngleCos;         // The bright spot [0.0 - 1.0]
+uniform float u_spotLightOuterAngleCos;         // The soft outer part [0.0 - 1.0]
+varying vec3 v_vertexToSpotLightDirection;      // Light direction w.r.t current vertex.
+varying float v_spotLightAttenuation;           // Attenuation of spot light.
+
+float lerpstep( float lower, float upper, float s)
+{
+    return clamp( ( s - lower ) / ( upper - lower ), 0.0, 1.0 );
+}
+
+void applyLight()
+{
+    // Normalize the vectors.
+    vec3 normalVector = normalize(v_normalVector);
+    vec3 spotLightDirection = u_spotLightDirection; 
+    vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection);
+
+    // "-lightDirection" is used because light direction points in opposite direction to
+    // to spot direction.
+    // Calculate spot light effect.
+    float spotCurrentAngleCos = max(0.0, dot(spotLightDirection, -vertexToSpotLightDirection));
+
+    // Intensity of spot depends on the spot light attenuation and the 
+    // part of the cone vertexToSpotLightDirection points to (inner or outer).
+    float spotLightAttenuation = clamp(v_spotLightAttenuation, 0.0, 1.0);
+    spotLightAttenuation *= lerpstep(u_spotLightOuterAngleCos, u_spotLightInnerAngleCos, spotCurrentAngleCos);
+
+    lighting(normalVector, vertexToSpotLightDirection, spotLightAttenuation);
+}
+
+#else
+
+uniform vec3 u_lightDirection;       	        // Light direction
+
+void applyLight()
+{
+    // Normalize the vectors.
+    vec3 normalVector = normalize(v_normalVector);
+    vec3 lightDirection = normalize(u_lightDirection);
+
+    lighting(normalVector, -lightDirection, 1.0);
+}
+#endif
+
+void main()
+{
+    // Fetch diffuse color from texture.
+    _baseColor = u_diffuseColor;
+
+    // Apply light
+    applyLight();
+
+    // Light the pixel
+    gl_FragColor.a = _baseColor.a;
+    gl_FragColor.rgb = _ambientColor + _diffuseColor;
+
+#if defined(GLOBAL_ALPHA)
+    gl_FragColor.a *= u_globalAlpha;
+#endif
+}

+ 183 - 0
gameplay-template/res/colored.vsh

@@ -0,0 +1,183 @@
+// Uniforms
+uniform mat4 u_worldViewProjectionMatrix;           // Matrix to transform a position to clip space.
+uniform mat4 u_inverseTransposeWorldViewMatrix;     // Matrix to transform a normal to view space.
+
+// Inputs
+attribute vec4 a_position;                          // Vertex Position (x, y, z, w)
+attribute vec3 a_normal;                            // Vertex Normal (x, y, z)
+
+// Outputs
+varying vec3 v_normalVector;                        // NormalVector in view space.
+
+#if defined(SKINNING)
+
+attribute vec4 a_blendWeights;
+attribute vec4 a_blendIndices;
+
+// 32 4x3 matrices as an array of floats
+uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3];
+
+// Common vectors.
+vec4 _skinnedPosition;
+vec3 _skinnedNormal;
+
+void skinPosition(float blendWeight, int matrixIndex)
+{
+    vec4 tmp;
+
+    tmp.x = dot(a_position, u_matrixPalette[matrixIndex]);
+    tmp.y = dot(a_position, u_matrixPalette[matrixIndex + 1]);
+    tmp.z = dot(a_position, u_matrixPalette[matrixIndex + 2]);
+    tmp.w = a_position.w;
+
+    _skinnedPosition += blendWeight * tmp;
+}
+
+vec4 getPosition()
+{
+    _skinnedPosition = vec4(0.0);
+
+    // Transform position to view space using 
+    // matrix palette with four matrices used to transform a vertex.
+
+    float blendWeight = a_blendWeights[0];
+    int matrixIndex = int (a_blendIndices[0]) * 3;
+    skinPosition(blendWeight, matrixIndex);
+
+    blendWeight = a_blendWeights[1];
+    matrixIndex = int(a_blendIndices[1]) * 3;
+    skinPosition(blendWeight, matrixIndex);
+
+    blendWeight = a_blendWeights[2];
+    matrixIndex = int(a_blendIndices[2]) * 3;
+    skinPosition(blendWeight, matrixIndex);
+
+    blendWeight = a_blendWeights[3];
+    matrixIndex = int(a_blendIndices[3]) * 3;
+    skinPosition(blendWeight, matrixIndex);
+
+    return _skinnedPosition;    
+}
+
+void skinNormal(float blendWeight, int matrixIndex)
+{
+    vec3 tmp;
+
+    tmp.x = dot(a_normal, u_matrixPalette[matrixIndex].xyz);
+    tmp.y = dot(a_normal, u_matrixPalette[matrixIndex + 1].xyz);
+    tmp.z = dot(a_normal, u_matrixPalette[matrixIndex + 2].xyz);
+
+    _skinnedNormal += blendWeight * tmp;
+}
+
+vec3 getNormal()
+{
+    _skinnedNormal = vec3(0.0);
+
+    // Transform normal to view space using 
+    // matrix palette with four matrices used to transform a vertex.
+
+    float blendWeight = a_blendWeights[0];
+    int matrixIndex = int (a_blendIndices[0]) * 3;
+    skinNormal(blendWeight, matrixIndex);
+
+    blendWeight = a_blendWeights[1];
+    matrixIndex = int(a_blendIndices[1]) * 3;
+    skinNormal(blendWeight, matrixIndex);
+
+    blendWeight = a_blendWeights[2];
+    matrixIndex = int(a_blendIndices[2]) * 3;
+    skinNormal(blendWeight, matrixIndex);
+
+    blendWeight = a_blendWeights[3];
+    matrixIndex = int(a_blendIndices[3]) * 3;
+    skinNormal(blendWeight, matrixIndex);
+
+    return _skinnedNormal;
+}
+
+#else
+
+vec4 getPosition()
+{
+    return a_position;    
+}
+
+vec3 getNormal()
+{
+    return a_normal;
+}
+
+#endif
+
+#if defined(POINT_LIGHT)
+
+uniform mat4 u_worldViewMatrix;                     // Matrix to tranform a position to view space.
+uniform vec3 u_pointLightPosition;                  // Position
+uniform float u_pointLightRangeInverse;             // Inverse of light range.
+varying vec4 v_vertexToPointLightDirection;         // Light direction w.r.t current vertex.
+
+void applyLight(vec4 position)
+{
+    vec4 positionWorldViewSpace = u_worldViewMatrix * position;
+    
+    // Compute the light direction.
+    vec3 lightDirection = u_pointLightPosition - positionWorldViewSpace.xyz;
+    
+    vec4 vertexToPointLightDirection;
+    vertexToPointLightDirection.xyz = lightDirection;
+    
+    // Attenuation.
+    vertexToPointLightDirection.w = 1.0 - dot(lightDirection * u_pointLightRangeInverse, lightDirection * u_pointLightRangeInverse);
+
+    // Output light direction.
+    v_vertexToPointLightDirection =  vertexToPointLightDirection;
+}
+
+#elif defined(SPOT_LIGHT)
+
+uniform mat4 u_worldViewMatrix;                     // Matrix to tranform a position to view space.
+uniform vec3 u_spotLightPosition;                   // Position
+uniform float u_spotLightRangeInverse;              // Inverse of light range.
+varying vec3 v_vertexToSpotLightDirection;          // Light direction w.r.t current vertex.
+varying float v_spotLightAttenuation;               // Attenuation of spot light.
+
+void applyLight(vec4 position)
+{
+    vec4 positionWorldViewSpace = u_worldViewMatrix * position;
+
+    // Compute the light direction.
+    vec3 lightDirection = u_spotLightPosition - positionWorldViewSpace.xyz;
+
+    // Attenuation
+    v_spotLightAttenuation = 1.0 - dot(lightDirection * u_spotLightRangeInverse, lightDirection * u_spotLightRangeInverse);
+
+    // Output light direction.
+    v_vertexToSpotLightDirection = lightDirection;
+}
+
+#else
+
+void applyLight(vec4 position)
+{
+}
+
+#endif
+
+void main()
+{
+    vec4 position = getPosition();
+    vec3 normal = getNormal();
+        
+    // Transform position to clip space.
+    gl_Position = u_worldViewProjectionMatrix * position;
+
+    // Transform normal to view space.
+    mat3 inverseTransposeWorldViewMatrix = mat3(u_inverseTransposeWorldViewMatrix[0].xyz,
+                                                u_inverseTransposeWorldViewMatrix[1].xyz,
+                                                u_inverseTransposeWorldViewMatrix[2].xyz);
+    v_normalVector = inverseTransposeWorldViewMatrix * normal;
+
+    // Apply light.
+    applyLight(position);
+}

+ 4 - 4
gameplay-template/src/TemplateGame.cpp

@@ -11,9 +11,9 @@ TemplateGame::TemplateGame()
 void TemplateGame::initialize()
 {
     // Load game scene from file
-    Package* pkg = Package::create("res/box.gpb");
-    _scene = pkg->loadScene();
-    SAFE_RELEASE(pkg);
+    Bundle* bundle = Bundle::create("res/box.gpb");
+    _scene = bundle->loadScene();
+    SAFE_RELEASE(bundle);
 
     // Get light node
     Node* lightNode = _scene->findNode("directionalLight");
@@ -47,7 +47,7 @@ void TemplateGame::render(long elapsedTime)
     _scene->visit(this, &TemplateGame::drawScene);
 }
 
-bool TemplateGame::drawScene(Node* node, void* cookie)
+bool TemplateGame::drawScene(Node* node)
 {
     // If the node visited contains a model, draw it
     Model* model = node->getModel(); 

+ 2 - 2
gameplay-template/src/TemplateGame.h

@@ -18,7 +18,7 @@ public:
     TemplateGame();
 
     /**
-     * Touch event handler.
+     * @see Game::touchEvent
      */
     void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
 
@@ -49,7 +49,7 @@ private:
     /**
      * Draws the scene each frame.
      */
-    bool drawScene(Node* node, void* cookie);
+    bool drawScene(Node* node);
 
     Scene* _scene;
 };