More test app work
diff --git a/Android.mk b/Android.mk
index f5297f8..5f47871 100644
--- a/Android.mk
+++ b/Android.mk
@@ -85,10 +85,12 @@
 	rsContext.cpp \
 	rsDevice.cpp \
 	rsElement.cpp \
+        rsFileA3D.cpp \
 	rsLight.cpp \
 	rsLocklessFifo.cpp \
 	rsObjectBase.cpp \
 	rsMatrix.cpp \
+        rsMesh.cpp \
 	rsProgram.cpp \
 	rsProgramFragment.cpp \
 	rsProgramFragmentStore.cpp \
diff --git a/java/Rollo/AndroidManifest.xml b/java/Rollo/AndroidManifest.xml
index da160a3..127a140 100644
--- a/java/Rollo/AndroidManifest.xml
+++ b/java/Rollo/AndroidManifest.xml
@@ -3,7 +3,7 @@
     package="com.android.rollo">
     <application android:label="Rollo">
         <activity android:name="Rollo"
-                  android:theme="@android:style/Theme.Black.NoTitleBar">
+                  android:theme="@android:style/Theme.Translucent">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
diff --git a/java/Rollo/res/raw/rollo2.c b/java/Rollo/res/raw/rollo2.c
new file mode 100644
index 0000000..b04ea73
--- /dev/null
+++ b/java/Rollo/res/raw/rollo2.c
@@ -0,0 +1,67 @@
+#pragma version(1)
+#pragma stateVertex(PV)
+#pragma stateFragment(PF)
+#pragma stateFragmentStore(PFS)
+
+void drawLoop(int x, int y, int z, int rot)
+{
+    int ct;
+    int tx;
+    int ty;
+    int tmpSin;
+    int tmpCos;
+    int sz;
+
+    for (ct = 0; ct < 10; ct ++) {
+        tmpSin = sinx((ct * 36 + rot) * 0x10000);
+        tmpCos = cosx((ct * 36 + rot) * 0x10000);
+
+        ty = y + tmpCos * 4;
+        tx = x + tmpSin * 4;
+        pfBindTexture(NAMED_PF, 0, loadI32(1, ct & 3));
+
+        sz = 0xc000;
+        drawQuad(tx - sz, ty - sz, z,
+                 tx + sz, ty - sz, z,
+                 tx + sz, ty + sz, z,
+                 tx - sz, ty + sz, z);
+    }
+}
+
+int main(void* con, int ft, int launchID)
+{
+    int rowCount;
+    int x;
+    int y;
+    int row;
+    int col;
+    int imageID;
+    int tx1;
+    int ty1;
+    int tz1;
+    int tx2;
+    int ty2;
+    int tz2;
+    int tmpSin;
+    int tmpCos;
+    int iconCount;
+    int pressure;
+
+    int ringCount;
+
+
+
+    rotStep = 16 * 0x10000;
+    pressure = loadI32(0, 2);
+    rowCount = 4;
+
+    iconCount = loadI32(0, 1);
+    rot = (-20 + loadI32(0, 0)) * 0x10000;
+
+    for (ringCount = 0; ringCount < 5; ringCount++) {
+        drawLoop(0, 0, 0x90000 + (ringCount * 0x80000));
+    }
+
+    return 0;
+}
+
diff --git a/java/Rollo/src/com/android/rollo/RolloRS.java b/java/Rollo/src/com/android/rollo/RolloRS.java
index 91f25c2..d086702 100644
--- a/java/Rollo/src/com/android/rollo/RolloRS.java
+++ b/java/Rollo/src/com/android/rollo/RolloRS.java
@@ -190,8 +190,9 @@
 
     private void initRS() {
         mRS.scriptCBegin();
-        mRS.scriptCSetClearColor(0.0f, 0.0f, 0.1f, 1.0f);
-        mRS.scriptCSetScript(mRes, R.raw.rollo);
+        mRS.scriptCSetClearColor(0.0f, 0.0f, 0.1f, 0.5f);
+        //mRS.scriptCSetScript(mRes, R.raw.rollo);
+        mRS.scriptCSetScript(mRes, R.raw.rollo2);
         mRS.scriptCSetRoot(true);
         mScript = mRS.scriptCCreate();
 
@@ -202,6 +203,8 @@
         mScript.bindAllocation(mAllocIconID, 1);
         setPosition(0, 0);
 
+        //RenderScript.File f = mRS.fileOpen("/sdcard/test.a3d");
+
         mRS.contextBindRootScript(mScript);
     }
 }
diff --git a/java/Rollo/src/com/android/rollo/RolloView.java b/java/Rollo/src/com/android/rollo/RolloView.java
index 27d2dd6..4b0520b 100644
--- a/java/Rollo/src/com/android/rollo/RolloView.java
+++ b/java/Rollo/src/com/android/rollo/RolloView.java
@@ -37,6 +37,7 @@
 import android.view.SurfaceView;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
+import android.graphics.PixelFormat;
 
 public class RolloView extends RSSurfaceView {
 
@@ -44,6 +45,7 @@
         super(context);
 
         //setFocusable(true);
+        getHolder().setFormat(PixelFormat.TRANSLUCENT);
     }
 
     private RenderScript mRS;
@@ -55,6 +57,8 @@
         mRS = createRenderScript();
         mRender = new RolloRS();
         mRender.init(mRS, getResources(), w, h);
+
+
     }
 
     @Override
diff --git a/rsContext.cpp b/rsContext.cpp
index 4025ff8..78b8bf8 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -35,9 +35,16 @@
 
     EGLint s_configAttribs[] = {
          EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+#if 1
+         EGL_RED_SIZE,       8,
+         EGL_GREEN_SIZE,     8,
+         EGL_BLUE_SIZE,      8,
+         EGL_ALPHA_SIZE,     8,
+#else
          EGL_RED_SIZE,       5,
          EGL_GREEN_SIZE,     6,
          EGL_BLUE_SIZE,      5,
+#endif
          EGL_DEPTH_SIZE,     16,
          EGL_NONE
      };
diff --git a/rsFileA3D.cpp b/rsFileA3D.cpp
index f669417..86d294b 100644
--- a/rsFileA3D.cpp
+++ b/rsFileA3D.cpp
@@ -261,9 +261,12 @@
 
     p->mIndexCount = io->loadU32();
     uint32_t vertIdx = io->loadU32();
+    p->mRestartCounts = io->loadU16();
     uint32_t bits = io->loadU8();
     p->mType = (RsPrimitive)io->loadU8();
 
+    LOGE("processChunk_Primitive count %i, bits %i", p->mIndexCount, bits);
+
     p->mVerticies = (Mesh::Verticies_t *)mIndex[vertIdx].mRsObj;
 
     p->mIndicies = new uint16_t[p->mIndexCount];
@@ -279,6 +282,27 @@
             p->mIndicies[ct] = io->loadU32();
             break;
         }
+        LOGE("  idx %i", p->mIndicies[ct]);
+    }
+
+    if (p->mRestartCounts) {
+        p->mRestarts = new uint16_t[p->mRestartCounts];
+        for (uint32_t ct = 0; ct < p->mRestartCounts; ct++) {
+            switch(bits) {
+            case 8:
+                p->mRestarts[ct] = io->loadU8();
+                break;
+            case 16:
+                p->mRestarts[ct] = io->loadU16();
+                break;
+            case 32:
+                p->mRestarts[ct] = io->loadU32();
+                break;
+            }
+            LOGE("  idx %i", p->mRestarts[ct]);
+        }
+    } else {
+        p->mRestarts = NULL;
     }
 
     ie->mRsObj = p;
@@ -289,16 +313,17 @@
     Mesh::Verticies_t *cv = new Mesh::Verticies_t;
     cv->mAllocationCount = io->loadU32();
     cv->mAllocations = new Allocation *[cv->mAllocationCount];
+    LOGE("processChunk_Verticies count %i", cv->mAllocationCount);
     for (uint32_t ct = 0; ct < cv->mAllocationCount; ct++) {
         uint32_t i = io->loadU32();
         cv->mAllocations[ct] = (Allocation *)mIndex[i].mRsObj;
+        LOGE("  idx %i", i);
     }
     ie->mRsObj = cv;
 }
 
 void FileA3D::processChunk_Element(Context *rsc, IO *io, A3DIndexEntry *ie)
 {
-    LOGE("processChunk_Element ie %p", ie);
     rsi_ElementBegin(rsc);
 
     uint32_t count = io->loadU32();
@@ -320,6 +345,8 @@
     uint32_t index = io->loadU32();
     uint32_t count = io->loadU32();
 
+    LOGE("processChunk_ElementSource count %i, index %i", count, index);
+
     RsElement e = (RsElement)mIndex[index].mRsObj;
 
     RsAllocation a = rsi_AllocationCreateSized(rsc, e, count);
@@ -328,6 +355,7 @@
     float * data = (float *)alloc->getPtr();
     while(count--) {
         *data = io->loadF();
+        LOGE("  %f", *data);
         data++;
     }
     ie->mRsObj = alloc;
diff --git a/rsMesh.h b/rsMesh.h
index 1db36e1..be207a3 100644
--- a/rsMesh.h
+++ b/rsMesh.h
@@ -57,6 +57,9 @@
 
         uint32_t mIndexCount;
         uint16_t *mIndicies;
+
+        uint32_t mRestartCounts;
+        uint16_t *mRestarts;
     };
 
     Verticies_t * mVerticies;