Loading libs/rs/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -85,10 +85,12 @@ LOCAL_SRC_FILES:= \ rsContext.cpp \ rsDevice.cpp \ rsElement.cpp \ rsFileA3D.cpp \ rsLight.cpp \ rsLocklessFifo.cpp \ rsObjectBase.cpp \ rsMatrix.cpp \ rsMesh.cpp \ rsProgram.cpp \ rsProgramFragment.cpp \ rsProgramFragmentStore.cpp \ Loading libs/rs/java/Rollo/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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" /> Loading libs/rs/java/Rollo/res/raw/rollo2.c 0 → 100644 +67 −0 Original line number Diff line number Diff line #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; } libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java +5 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,9 @@ public class RolloRS { 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(); Loading @@ -202,6 +203,8 @@ public class RolloRS { mScript.bindAllocation(mAllocIconID, 1); setPosition(0, 0); //RenderScript.File f = mRS.fileOpen("/sdcard/test.a3d"); mRS.contextBindRootScript(mScript); } } Loading libs/rs/java/Rollo/src/com/android/rollo/RolloView.java +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.KeyEvent; import android.view.MotionEvent; import android.graphics.PixelFormat; public class RolloView extends RSSurfaceView { Loading @@ -44,6 +45,7 @@ public class RolloView extends RSSurfaceView { super(context); //setFocusable(true); getHolder().setFormat(PixelFormat.TRANSLUCENT); } private RenderScript mRS; Loading @@ -55,6 +57,8 @@ public class RolloView extends RSSurfaceView { mRS = createRenderScript(); mRender = new RolloRS(); mRender.init(mRS, getResources(), w, h); } @Override Loading Loading
libs/rs/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -85,10 +85,12 @@ LOCAL_SRC_FILES:= \ rsContext.cpp \ rsDevice.cpp \ rsElement.cpp \ rsFileA3D.cpp \ rsLight.cpp \ rsLocklessFifo.cpp \ rsObjectBase.cpp \ rsMatrix.cpp \ rsMesh.cpp \ rsProgram.cpp \ rsProgramFragment.cpp \ rsProgramFragmentStore.cpp \ Loading
libs/rs/java/Rollo/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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" /> Loading
libs/rs/java/Rollo/res/raw/rollo2.c 0 → 100644 +67 −0 Original line number Diff line number Diff line #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; }
libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java +5 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,9 @@ public class RolloRS { 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(); Loading @@ -202,6 +203,8 @@ public class RolloRS { mScript.bindAllocation(mAllocIconID, 1); setPosition(0, 0); //RenderScript.File f = mRS.fileOpen("/sdcard/test.a3d"); mRS.contextBindRootScript(mScript); } } Loading
libs/rs/java/Rollo/src/com/android/rollo/RolloView.java +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.KeyEvent; import android.view.MotionEvent; import android.graphics.PixelFormat; public class RolloView extends RSSurfaceView { Loading @@ -44,6 +45,7 @@ public class RolloView extends RSSurfaceView { super(context); //setFocusable(true); getHolder().setFormat(PixelFormat.TRANSLUCENT); } private RenderScript mRS; Loading @@ -55,6 +57,8 @@ public class RolloView extends RSSurfaceView { mRS = createRenderScript(); mRender = new RolloRS(); mRender.init(mRS, getResources(), w, h); } @Override Loading