Bläddra i källkod

Fixed shader compiler over optimization issue on various Android devices.
Change Android builds to copy resources in pre-build instead of post-compile.

seanpaultaylor 12 år sedan
förälder
incheckning
7955457cbf

+ 1 - 2
CMakeLists.txt

@@ -25,6 +25,5 @@ add_subdirectory(gameplay)
 add_subdirectory(samples)
 
 # gameplay encoder
-# A pre-compiled executable can be found in 'gameplay/bin'
-# Uncomment out this line if you want to build the encoder instead of using the pre-compiled gameplay-encoder.
+# A pre-compiled executable can be found in 'gameplay/bin'. Uncomment to build yourself.
 #add_subdirectory(tools/encoder)

+ 4 - 5
gameplay/res/shaders/lighting.frag

@@ -46,9 +46,9 @@ vec3 getLitPixel()
     for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; ++i)
     {
         #if defined(BUMPED)
-        vec3 lightDirection = normalize(v_directionalLightDirection[i]);
+        vec3 lightDirection = normalize(v_directionalLightDirection[i] * 2.0);
         #else
-        vec3 lightDirection = normalize(u_directionalLightDirection[i]);
+        vec3 lightDirection = normalize(u_directionalLightDirection[i] * 2.0);
         #endif 
         combinedColor += computeLighting(normalVector, -lightDirection, u_directionalLightColor[i], 1.0);
     }
@@ -73,11 +73,10 @@ vec3 getLitPixel()
         float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0);
         vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection[i]);
 
-        // TODO: Let app normalize this! Need Node::getForwardVectorViewNorm
         #if defined(BUMPED)
-            vec3 spotLightDirection = normalize(v_spotLightDirection[i]);
+            vec3 spotLightDirection = normalize(v_spotLightDirection[i] * 2.0f);
         #else
-            vec3 spotLightDirection = normalize(u_spotLightDirection[i]);
+            vec3 spotLightDirection = normalize(u_spotLightDirection[i] * 2.0f);
         #endif
 
         // "-lightDirection" is used because light direction points in opposite direction to spot direction.

+ 99 - 98
samples/browser/android/build.xml

@@ -1,98 +1,99 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="sample-browser" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" unless="sdk.dir" />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-
-    <target name="-pre-build">
-		<mkdir dir="src"/>
-    </target>
-	
-<!--
-    <target name="-pre-compile">
-    </target>
-
-    /* This is typically used for code obfuscation.
-       Compiled code location: ${out.classes.absolute.dir}
-       If this is not done in place, override ${out.dex.input.absolute.dir} */
-       -->
-    <target name="-post-compile">
-	    <copy file="../game.config" tofile="assets/game.config"/>
-        <copy todir="assets/res/common">
-            <fileset dir="../res/common"/>
-        </copy>
-		<copy todir="assets/res/png">
-            <fileset dir="../res/png"/>
-        </copy>
-		<copy todir="assets/res/shaders">
-            <fileset dir="../../../gameplay/res/shaders"/>
-        </copy>
-        <copy todir="assets/res/ui">
-            <fileset dir="../../../gameplay/res/ui"/>
-        </copy>
-    </target>
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="sample-browser" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
+         Here are some properties you may want to change/update:
+
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
+
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
+
+         -->
+    <property file="ant.properties" />
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems. -->
+    <loadproperties srcFile="project.properties" />
+
+    <!-- quick check on sdk.dir -->
+    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" unless="sdk.dir" />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+     in between standard targets -->
+
+    <target name="-pre-build">
+		<mkdir dir="src"/>
+	    <copy file="../game.config" tofile="assets/game.config"/>
+        <copy todir="assets/res/common">
+            <fileset dir="../res/common"/>
+        </copy>
+		<copy todir="assets/res/png">
+            <fileset dir="../res/png"/>
+        </copy>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+		<copy todir="assets/res/shaders">
+            <fileset dir="../../../gameplay/res/shaders"/>
+        </copy>
+        <copy todir="assets/res/ui">
+            <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
+    </target>
+	
+<!--
+    <target name="-pre-compile">
+    </target>
+
+    /* This is typically used for code obfuscation.
+       Compiled code location: ${out.classes.absolute.dir}
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
+       -->
+    <target name="-post-compile">
+    </target>
+
+    <!-- Import the actual build file.
+
+         To customize existing targets, there are two options:
+         - Customize only one target:
+             - copy/paste the target into this file, *before* the
+               <import> task.
+             - customize it to your needs.
+         - Customize the whole content of build.xml
+             - copy/paste the content of the rules files (minus the top node)
+               into this file, replacing the <import> task.
+             - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
+    -->
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>

+ 129 - 128
samples/character/android/build.xml

@@ -1,128 +1,129 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="sample-character" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
-          unless="sdk.dir" />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-
-    <target name="-pre-build">
-		<mkdir dir="src"/>
-    </target>
-	
-<!--
-    <target name="-pre-compile">
-    </target>
-
-    /* This is typically used for code obfuscation.
-       Compiled code location: ${out.classes.absolute.dir}
-       If this is not done in place, override ${out.dex.input.absolute.dir} */
-       -->
-    <target name="-post-compile">
-        <copy file="../game.png.config" tofile="assets/game.config"/>
-        <copy file="../res/design/backboard.png" tofile="assets/res/png/backboard.png"/>
-        <copy file="../res/design/basketball.png" tofile="assets/res/png/basketball.png"/>
-        <copy file="../res/design/basketballnet.png" tofile="assets/res/png/basketballnet.png"/>
-        <copy file="../res/design/book.png" tofile="assets/res/png/book.png"/>
-        <copy file="../res/design/bookshelf.png" tofile="assets/res/png/bookshelf.png"/>
-        <copy file="../res/design/boy.png" tofile="assets/res/png/boy.png"/>
-        <copy file="../res/design/decals.png" tofile="assets/res/png/decals.png"/>
-        <copy file="../res/design/door.png" tofile="assets/res/png/door.png"/>
-        <copy file="../res/design/doorframe.png" tofile="assets/res/png/doorframe.png"/>
-        <copy file="../res/design/easel.png" tofile="assets/res/png/easel.png"/>
-        <copy file="../res/design/floor.png" tofile="assets/res/png/floor.png"/>
-        <copy file="../res/design/floortiles.png" tofile="assets/res/png/floortiles.png"/>
-        <copy file="../res/design/playtable.png" tofile="assets/res/png/playtable.png"/>
-        <copy file="../res/design/gamepad.png" tofile="assets/res/png/gamepad.png"/>
-        <copy file="../res/design/playtable.png" tofile="assets/res/png/playtable.png"/>
-        <copy file="../res/design/shadow.png" tofile="assets/res/png/shadow.png"/>
-        <copy file="../res/design/storageorganizer.png" tofile="assets/res/png/storageorganizer.png"/>
-        <copy file="../res/design/tableleg1.png" tofile="assets/res/png/tableleg1.png"/>
-        <copy file="../res/design/tableleg2.png" tofile="assets/res/png/tableleg2.png"/>
-        <copy file="../res/design/tableleg3.png" tofile="assets/res/png/tableleg3.png"/>
-        <copy file="../res/design/tableleg4.png" tofile="assets/res/png/tableleg4.png"/>
-        <copy file="../res/design/tabletop.png" tofile="assets/res/png/tabletop.png"/>
-        <copy file="../res/design/tiles.png" tofile="assets/res/png/tiles.png"/>
-        <copy file="../res/design/tilesn.png" tofile="assets/res/png/tilesn.png"/>
-        <copy file="../res/design/toybox.png" tofile="assets/res/png/toybox.png"/>
-        <copy file="../res/design/walleast.png" tofile="assets/res/png/walleast.png"/>
-        <copy file="../res/design/wallnorth.png" tofile="assets/res/png/wallnorth.png"/>
-        <copy file="../res/design/walloverhang.png" tofile="assets/res/png/walloverhang.png"/>
-        <copy file="../res/design/wallsouth.png" tofile="assets/res/png/wallsouth.png"/>
-        <copy file="../res/design/wallwest.png" tofile="assets/res/png/wallwest.png"/>
-        <copy file="../res/design/windowledge.png" tofile="assets/res/png/windowledge.png"/>
-        <copy file="../res/design/wood.png" tofile="assets/res/png/wood.png"/>
-        <copy file="../res/design/woodn.png" tofile="assets/res/png/woodn.png"/>
-        <copy todir="assets/res/common">
-            <fileset dir="../res/common"/>
-        </copy>
-        <copy todir="assets/res/shaders">
-            <fileset dir="../../../gameplay/res/shaders"/>
-        </copy>
-        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
-    </target>
-
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="sample-character" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
+         Here are some properties you may want to change/update:
+
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
+
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
+
+         -->
+    <property file="ant.properties" />
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems. -->
+    <loadproperties srcFile="project.properties" />
+
+    <!-- quick check on sdk.dir -->
+    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+          unless="sdk.dir" />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+     in between standard targets -->
+    <target name="-pre-build">
+		<mkdir dir="src"/>
+        <copy file="../game.png.config" tofile="assets/game.config"/>
+        <copy file="../res/design/backboard.png" tofile="assets/res/png/backboard.png"/>
+        <copy file="../res/design/basketball.png" tofile="assets/res/png/basketball.png"/>
+        <copy file="../res/design/basketballnet.png" tofile="assets/res/png/basketballnet.png"/>
+        <copy file="../res/design/book.png" tofile="assets/res/png/book.png"/>
+        <copy file="../res/design/bookshelf.png" tofile="assets/res/png/bookshelf.png"/>
+        <copy file="../res/design/boy.png" tofile="assets/res/png/boy.png"/>
+        <copy file="../res/design/decals.png" tofile="assets/res/png/decals.png"/>
+        <copy file="../res/design/door.png" tofile="assets/res/png/door.png"/>
+        <copy file="../res/design/doorframe.png" tofile="assets/res/png/doorframe.png"/>
+        <copy file="../res/design/easel.png" tofile="assets/res/png/easel.png"/>
+        <copy file="../res/design/floor.png" tofile="assets/res/png/floor.png"/>
+        <copy file="../res/design/floortiles.png" tofile="assets/res/png/floortiles.png"/>
+        <copy file="../res/design/playtable.png" tofile="assets/res/png/playtable.png"/>
+        <copy file="../res/design/gamepad.png" tofile="assets/res/png/gamepad.png"/>
+        <copy file="../res/design/playtable.png" tofile="assets/res/png/playtable.png"/>
+        <copy file="../res/design/shadow.png" tofile="assets/res/png/shadow.png"/>
+        <copy file="../res/design/storageorganizer.png" tofile="assets/res/png/storageorganizer.png"/>
+        <copy file="../res/design/tableleg1.png" tofile="assets/res/png/tableleg1.png"/>
+        <copy file="../res/design/tableleg2.png" tofile="assets/res/png/tableleg2.png"/>
+        <copy file="../res/design/tableleg3.png" tofile="assets/res/png/tableleg3.png"/>
+        <copy file="../res/design/tableleg4.png" tofile="assets/res/png/tableleg4.png"/>
+        <copy file="../res/design/tabletop.png" tofile="assets/res/png/tabletop.png"/>
+        <copy file="../res/design/tiles.png" tofile="assets/res/png/tiles.png"/>
+        <copy file="../res/design/tilesn.png" tofile="assets/res/png/tilesn.png"/>
+        <copy file="../res/design/toybox.png" tofile="assets/res/png/toybox.png"/>
+        <copy file="../res/design/walleast.png" tofile="assets/res/png/walleast.png"/>
+        <copy file="../res/design/wallnorth.png" tofile="assets/res/png/wallnorth.png"/>
+        <copy file="../res/design/walloverhang.png" tofile="assets/res/png/walloverhang.png"/>
+        <copy file="../res/design/wallsouth.png" tofile="assets/res/png/wallsouth.png"/>
+        <copy file="../res/design/wallwest.png" tofile="assets/res/png/wallwest.png"/>
+        <copy file="../res/design/windowledge.png" tofile="assets/res/png/windowledge.png"/>
+        <copy file="../res/design/wood.png" tofile="assets/res/png/wood.png"/>
+        <copy file="../res/design/woodn.png" tofile="assets/res/png/woodn.png"/>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+        <copy todir="assets/res/common">
+            <fileset dir="../res/common"/>
+        </copy>
+        <copy todir="assets/res/shaders">
+            <fileset dir="../../../gameplay/res/shaders"/>
+        </copy>
+         <copy todir="assets/res/ui">
+            <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
+    </target>
+	
+<!--
+    <target name="-pre-compile">
+    </target>
+
+    /* This is typically used for code obfuscation.
+       Compiled code location: ${out.classes.absolute.dir}
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
+       -->
+    <target name="-post-compile">
+    </target>
+
+    <!-- Import the actual build file.
+
+         To customize existing targets, there are two options:
+         - Customize only one target:
+             - copy/paste the target into this file, *before* the
+               <import> task.
+             - customize it to your needs.
+         - Customize the whole content of build.xml
+             - copy/paste the content of the rules files (minus the top node)
+               into this file, replacing the <import> task.
+             - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
+    -->
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>

+ 14 - 12
samples/lua/android/build.xml

@@ -48,6 +48,20 @@
 
     <target name="-pre-build">
 		<mkdir dir="src"/>
+        <copy file="../game.config" tofile="assets/game.config"/>
+        <copy file="../res/ai.lua" tofile="assets/res/ai.lua"/>
+        <copy file="../res/game.lua" tofile="assets/res/game.lua"/>
+        <copy file="../res/lua.gpb" tofile="assets/res/lua.gpb"/>
+        <copy file="../res/lua.material" tofile="assets/res/lua.material"/>
+        <copy file="../res/lua.scene" tofile="assets/res/lua.scene"/>
+        <copy file="../res/lua-logo.png" tofile="assets/res/lua-logo.png"/>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+        <copy todir="assets/res/shaders">
+            <fileset dir="../../../gameplay/res/shaders"/>
+        </copy>
+         <copy todir="assets/res/ui">
+            <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
     </target>
 	
 <!--
@@ -59,18 +73,6 @@
        If this is not done in place, override ${out.dex.input.absolute.dir} */
        -->
     <target name="-post-compile">
-        <copy file="../game.config" tofile="assets/game.config"/>
-        <copy file="../res/ai.lua" tofile="assets/res/ai.lua"/>
-        <copy file="../res/arial.gpb" tofile="assets/res/arial.gpb"/>
-        <copy file="../res/game.lua" tofile="assets/res/game.lua"/>
-        <copy file="../res/lua.gpb" tofile="assets/res/lua.gpb"/>
-        <copy file="../res/lua.material" tofile="assets/res/lua.material"/>
-        <copy file="../res/lua.scene" tofile="assets/res/lua.scene"/>
-        <copy file="../res/lua-logo.png" tofile="assets/res/lua-logo.png"/>
-        <copy todir="assets/res/shaders">
-            <fileset dir="../../../gameplay/res/shaders"/>
-        </copy>
-        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
     </target>
 
     <!-- Import the actual build file.

+ 12 - 10
samples/mesh/android/build.xml

@@ -50,6 +50,18 @@
 
     <target name="-pre-build">
 		<mkdir dir="src"/>
+        <copy file="../game.config" tofile="assets/game.config"/>
+        <copy file="../res/mesh.scene" tofile="assets/res/mesh.scene"/>
+        <copy file="../res/mesh.gpb" tofile="assets/res/mesh.gpb"/>
+        <copy file="../res/mesh.material" tofile="assets/res/mesh.material"/>
+        <copy file="../res/duck.png" tofile="assets/res/duck.png"/>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+        <copy todir="assets/res/shaders">
+            <fileset dir="../../../gameplay/res/shaders"/>
+        </copy>
+        <copy todir="assets/res/ui">
+            <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
     </target>
 	
 <!--
@@ -61,16 +73,6 @@
        If this is not done in place, override ${out.dex.input.absolute.dir} */
        -->
     <target name="-post-compile">
-        <copy file="../game.config" tofile="assets/game.config"/>
-        <copy file="../res/arial.gpb" tofile="assets/res/arial.gpb"/>
-        <copy file="../res/mesh.scene" tofile="assets/res/mesh.scene"/>
-        <copy file="../res/mesh.gpb" tofile="assets/res/mesh.gpb"/>
-        <copy file="../res/mesh.material" tofile="assets/res/mesh.material"/>
-        <copy file="../res/duck.png" tofile="assets/res/duck.png"/>
-        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
-        <copy todir="assets/res/shaders">
-            <fileset dir="../../../gameplay/res/shaders"/>
-        </copy>
     </target>
 
     <!-- Import the actual build file.

+ 4 - 2
samples/particles/android/build.xml

@@ -59,7 +59,6 @@
        If this is not done in place, override ${out.dex.input.absolute.dir} */
        -->
     <target name="-post-compile">
-        <copy file="../res/arial.gpb" tofile="assets/res/arial.gpb"/>
         <copy file="../res/editor.form" tofile="assets/res/editor.form"/>
         <copy file="../res/editor.png" tofile="assets/res/editor.png"/>
         <copy file="../res/editor.theme" tofile="assets/res/editor.theme"/>
@@ -70,10 +69,13 @@
         <copy file="../res/grid.material" tofile="assets/res/grid.material"/>
         <copy file="../res/smoke.particle" tofile="assets/res/smoke.particle"/>
         <copy file="../res/smoke.png" tofile="assets/res/smoke.png"/>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
         <copy todir="assets/res/shaders">
           <fileset dir="../../../gameplay/res/shaders"/>
         </copy>
-        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+        <copy todir="assets/res/ui">
+          <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
     </target>
 
     <!-- Import the actual build file.

+ 103 - 101
samples/racer/android/build.xml

@@ -1,101 +1,103 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="sample-racer" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
-          unless="sdk.dir" />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-
-    <target name="-pre-build">
-		<mkdir dir="src"/>
-    </target>
-	
-<!--
-    <target name="-pre-compile">
-    </target>
-
-    /* This is typically used for code obfuscation.
-       Compiled code location: ${out.classes.absolute.dir}
-       If this is not done in place, override ${out.dex.input.absolute.dir} */
-       -->
-    <target name="-post-compile">
-	    <copy file="../game.png.config" tofile="assets/game.config"/>
-		
-        <copy todir="assets/res/common">
-            <fileset dir="../res/common"/>
-        </copy>
-		
-        <copy todir="assets/res/png">
-            <fileset dir="../res/png"/>
-        </copy>
-		
-		<copy todir="assets/res/shaders">
-            <fileset dir="../../../gameplay/res/shaders"/>
-        </copy>
-		
-		<copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
-    </target>
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="sample-racer" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
+         Here are some properties you may want to change/update:
+
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
+
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
+
+         -->
+    <property file="ant.properties" />
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems. -->
+    <loadproperties srcFile="project.properties" />
+
+    <!-- quick check on sdk.dir -->
+    <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+          unless="sdk.dir" />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+     in between standard targets -->
+
+    <target name="-pre-build">
+		<mkdir dir="src"/>
+    </target>
+	
+<!--
+    <target name="-pre-compile">
+    </target>
+
+    /* This is typically used for code obfuscation.
+       Compiled code location: ${out.classes.absolute.dir}
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
+       -->
+    <target name="-post-compile">
+	    <copy file="../game.png.config" tofile="assets/game.config"/>
+		
+        <copy todir="assets/res/common">
+            <fileset dir="../res/common"/>
+        </copy>
+		
+        <copy todir="assets/res/png">
+            <fileset dir="../res/png"/>
+        </copy>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+		<copy todir="assets/res/shaders">
+            <fileset dir="../../../gameplay/res/shaders"/>
+        </copy>
+		<copy todir="assets/res/ui">
+            <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
+		
+    </target>
+
+    <!-- Import the actual build file.
+
+         To customize existing targets, there are two options:
+         - Customize only one target:
+             - copy/paste the target into this file, *before* the
+               <import> task.
+             - customize it to your needs.
+         - Customize the whole content of build.xml
+             - copy/paste the content of the rules files (minus the top node)
+               into this file, replacing the <import> task.
+             - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
+    -->
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>

+ 4 - 1
samples/spaceship/android/build.xml

@@ -70,10 +70,13 @@
         <copy file="../res/propulsion_glow.png" tofile="assets/res/propulsion_glow.png"/>
         <copy file="../res/spaceship.gpb" tofile="assets/res/spaceship.gpb"/>
         <copy file="../res/spaceship.wav" tofile="assets/res/spaceship.wav"/>
+        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
         <copy todir="assets/res/shaders">
             <fileset dir="../../../gameplay/res/shaders"/>
         </copy>
-        <copy file="../../../gameplay/res/logo_powered_white.png" tofile="assets/res/logo_powered_white.png"/>
+        <copy todir="assets/res/ui">
+            <fileset dir="../../../gameplay/res/ui"/>
+        </copy>
     </target>
 
 

+ 9 - 7
template/android/template.build.xml

@@ -51,6 +51,15 @@
 
     <target name="-pre-build">
 		<mkdir dir="src"/>
+        <copy todir="assets/res">
+            <fileset dir="../res" />
+        </copy>
+        <copy todir="assets/res/shaders">
+            <fileset dir="../GAMEPLAY_PATH/gameplay/res/shaders" />
+       </copy>
+        <copy todir="assets/res/ui">
+            <fileset dir="../GAMEPLAY_PATH/gameplay/res/ui" />
+       </copy>
     </target>
 	
 <!--
@@ -62,13 +71,6 @@
        If this is not done in place, override ${out.dex.input.absolute.dir} */
        -->
     <target name="-post-compile">
-    	<delete dir="assets/res"/>
-        <copy todir="assets/res">
-            <fileset dir="../res" />
-        </copy>
-        <copy todir="assets/res/shaders">
-            <fileset dir="../GAMEPLAY_PATH/gameplay/res/shaders" />
-       </copy>
     </target>
 
     <!-- Import the actual build file.