Przeglądaj źródła

Merge pull request #368 from blackberry/master

Fixes for Android
Sean Paul Taylor 13 lat temu
rodzic
commit
2f440083a0

+ 2 - 2
gameplay-template/android/template.build.xml

@@ -64,8 +64,8 @@
     <target name="-post-compile">
     <target name="-post-compile">
         <copy file="../res/box.gpb" tofile="assets/res/box.gpb"/>
         <copy file="../res/box.gpb" tofile="assets/res/box.gpb"/>
         <copy file="../res/box.material" tofile="assets/res/box.material"/>
         <copy file="../res/box.material" tofile="assets/res/box.material"/>
-        <copy file="../../../gameplay/res/shaders/colored.vsh" tofile="assets/res/shaders/colored.vsh"/>
-        <copy file="../../../gameplay/res/shaders/colored.fsh" tofile="assets/res/shaders/colored.fsh"/>
+        <copy file="../res/colored.vsh" tofile="assets/res/colored.vsh"/>
+        <copy file="../res/colored.fsh" tofile="assets/res/colored.fsh"/>
     </target>
     </target>
 
 
     <!-- Import the actual build file.
     <!-- Import the actual build file.

+ 3 - 0
gameplay-template/src/TemplateGame.cpp

@@ -15,6 +15,9 @@ void TemplateGame::initialize()
     _scene = bundle->loadScene();
     _scene = bundle->loadScene();
     SAFE_RELEASE(bundle);
     SAFE_RELEASE(bundle);
 
 
+    // Set the aspect ratio for the scene's camera to match the current resolution
+    _scene->getActiveCamera()->setAspectRatio((float)getWidth() / (float)getHeight());
+    
     // Get light node
     // Get light node
     Node* lightNode = _scene->findNode("directionalLight");
     Node* lightNode = _scene->findNode("directionalLight");
     Light* light = lightNode->getLight();
     Light* light = lightNode->getLight();