From f99909bd503df2a6304e4e66757e26458c6f76b1 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Wed, 27 Apr 2011 18:13:57 -0700 Subject: [PATCH] Fix RS graphics samples. Change-Id: I7434dfa21707d506cd79897068d9f1d02a227521 --- .../Balls/src/com/example/android/rs/balls/balls.rs | 10 ++++------ .../com/example/android/rs/helloworld/helloworld.rs | 2 +- .../src/com/example/android/rs/miscsamples/rslist.rs | 4 ++-- .../example/android/rs/miscsamples/rsrenderstates.rs | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.rs b/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.rs index d86b804a5..f94e3e20c 100644 --- a/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.rs +++ b/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.rs @@ -56,12 +56,12 @@ int root() { Ball_t *bout; if (frame & 1) { - rsSetObject(&bc.ain, rsGetAllocation(balls2)); - rsSetObject(&bc.aout, rsGetAllocation(balls1)); + bc.ain = rsGetAllocation(balls2); + bc.aout = rsGetAllocation(balls1); bout = balls2; } else { - rsSetObject(&bc.ain, rsGetAllocation(balls1)); - rsSetObject(&bc.aout, rsGetAllocation(balls2)); + bc.ain = rsGetAllocation(balls1); + bc.aout = rsGetAllocation(balls2); bout = balls1; } @@ -78,8 +78,6 @@ int root() { frame++; rsgBindProgramFragment(gPFPoints); rsgDrawMesh(partMesh); - rsClearObject(&bc.ain); - rsClearObject(&bc.aout); return 1; } diff --git a/samples/RenderScript/HelloWorld/src/com/example/android/rs/helloworld/helloworld.rs b/samples/RenderScript/HelloWorld/src/com/example/android/rs/helloworld/helloworld.rs index 34e940ad9..bcf624e20 100644 --- a/samples/RenderScript/HelloWorld/src/com/example/android/rs/helloworld/helloworld.rs +++ b/samples/RenderScript/HelloWorld/src/com/example/android/rs/helloworld/helloworld.rs @@ -31,7 +31,7 @@ void init() { gTouchY = 50.0f; } -int root(int launchID) { +int root(void) { // Clear the background color rsgClearColor(0.0f, 0.0f, 0.0f, 0.0f); diff --git a/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rslist.rs b/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rslist.rs index 7b2dae24b..d9d450dc4 100644 --- a/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rslist.rs +++ b/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rslist.rs @@ -34,7 +34,7 @@ void init() { int textPos = 0; -int root(int launchID) { +int root(void) { rsgClearColor(0.0f, 0.0f, 0.0f, 0.0f); @@ -45,7 +45,7 @@ int root(int launchID) { rsgBindFont(gItalic); rs_allocation listAlloc; - rsSetObject(&listAlloc, rsGetAllocation(gList)); + listAlloc = rsGetAllocation(gList); int allocSize = rsAllocationGetDimX(listAlloc); int width = rsgGetWidth(); diff --git a/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rsrenderstates.rs b/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rsrenderstates.rs index b8ec8aa63..5dabd00bc 100644 --- a/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rsrenderstates.rs +++ b/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/rsrenderstates.rs @@ -633,7 +633,7 @@ static void displayAnisoSample() { } } -int root(int launchID) { +int root(void) { gDt = rsGetDt();