From: Daniel Sandler Date: Fri, 19 Feb 2010 21:27:52 +0000 (-0800) Subject: am 12290bd7: Fix coords of NeuralNetwork LW tap effects. X-Git-Tag: android-x86-2.2~11^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=88fe1fb6cbaa5138c5beceb85cb5d4499b0403f5;hp=5e1b4fa0fc048e4c6aca395cd6d8a3f127a96491;p=android-x86%2Fpackages-wallpapers-Basic.git am 12290bd7: Fix coords of NeuralNetwork LW tap effects. Merge commit '12290bd7369db1e81b2dd67be67ef0d4b292b412' into eclair-plus-aosp * commit '12290bd7369db1e81b2dd67be67ef0d4b292b412': Fix coords of NeuralNetwork LW tap effects. --- diff --git a/res/raw/nexus.rs b/res/raw/nexus.rs index 3b43411..b82a307 100644 --- a/res/raw/nexus.rs +++ b/res/raw/nexus.rs @@ -284,6 +284,7 @@ int main(int index) { if (State->rotate) { //matrixLoadRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f); //matrixTranslate(matrix, 0.0f, -height, 1.0f); + // XXX: HAX: do not slide display in landscape } else { matrixTranslate(matrix, -(State->xOffset * width), 0, 0); } diff --git a/src/com/android/wallpaper/nexus/NexusRS.java b/src/com/android/wallpaper/nexus/NexusRS.java index 6d5cce7..88f3a0e 100644 --- a/src/com/android/wallpaper/nexus/NexusRS.java +++ b/src/com/android/wallpaper/nexus/NexusRS.java @@ -105,7 +105,9 @@ class NexusRS extends RenderScriptScene { @Override public void resize(int width, int height) { - super.resize(width, height); + super.resize(width, height); // updates mWidth, mHeight + + // android.util.Log.d("NexusRS", String.format("resize(%d, %d)", width, height)); mWorldState.width = width; mWorldState.height = height; @@ -281,8 +283,15 @@ class NexusRS extends RenderScriptScene { boolean resultRequested) { final int dw = mWorldState.width; - final int bw = 960; - x = (int) (x + mWorldState.xOffset * (bw-dw)); + final int bw = 960; // XXX: hardcoded width of background texture + if (mWorldState.rotate == 0) { + // nexus.rs ignores the xOffset when rotated; we shall endeavor to do so as well + x = (int) (x + mWorldState.xOffset * (bw-dw)); + } + + // android.util.Log.d("NexusRS", String.format( + // "dw=%d, bw=%d, xOffset=%g, x=%d", + // dw, bw, mWorldState.xOffset, x)); if ("android.wallpaper.tap".equals(action)) { sendCommand(1, x, y);