瀏覽代碼

Merge pull request #368 from blackberry/master

Fixes for Android
Sean Paul Taylor 13 年之前
父節點
當前提交
2f440083a0
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 2 2
      gameplay-template/android/template.build.xml
  2. 3 0
      gameplay-template/src/TemplateGame.cpp

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

@@ -64,8 +64,8 @@
     <target name="-post-compile">
         <copy file="../res/box.gpb" tofile="assets/res/box.gpb"/>
         <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>
 
     <!-- Import the actual build file.

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

@@ -15,6 +15,9 @@ void TemplateGame::initialize()
     _scene = bundle->loadScene();
     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
     Node* lightNode = _scene->findNode("directionalLight");
     Light* light = lightNode->getLight();