diff options
| author | Romain Guy <romainguy@android.com> | 2009-10-15 12:37:13 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@android.com> | 2009-10-15 12:37:13 -0700 |
| commit | a6d4d985fd0d7d0d6c3b7e579b8f3157a13a8aec (patch) | |
| tree | b8126b9b8608a0496f52a3f0dfc35de375e3f4d0 /res | |
| parent | a454eca5a443705380b1231527e103334b580594 (diff) | |
| download | android_packages_wallpapers_Basic-a6d4d985fd0d7d0d6c3b7e579b8f3157a13a8aec.tar.gz android_packages_wallpapers_Basic-a6d4d985fd0d7d0d6c3b7e579b8f3157a13a8aec.tar.bz2 android_packages_wallpapers_Basic-a6d4d985fd0d7d0d6c3b7e579b8f3157a13a8aec.zip | |
Water live wallpaper now runs correctly in landscape.
Orientation change still to be tested.
Change-Id: I07befb15a72a5f3e5c00276f5b9826603b2fc3a1
Diffstat (limited to 'res')
| -rw-r--r-- | res/raw/fall.rs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/res/raw/fall.rs b/res/raw/fall.rs index 028bb3c..a54e3b5 100644 --- a/res/raw/fall.rs +++ b/res/raw/fall.rs @@ -247,7 +247,9 @@ void generateRipples() { } } -void drawLeaf(struct Leaves_s *leaf, int meshWidth, int meshHeight, float glWidth, float glHeight) { +void drawLeaf(struct Leaves_s *leaf, int meshWidth, int meshHeight, float glWidth, float glHeight, + int rotate) { + float x = leaf->x; float x1 = x - LEAF_SIZE; float x2 = x + LEAF_SIZE; @@ -282,8 +284,12 @@ void drawLeaf(struct Leaves_s *leaf, int meshWidth, int meshHeight, float glWidt if (a > 0.0f) { color(0.0f, 0.0f, 0.0f, 0.15f); - - matrixLoadIdentity(matrix); + + if (rotate) { + matrixLoadRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f); + } else { + matrixLoadIdentity(matrix); + } matrixTranslate(matrix, x, y, 0.0f); matrixScale(matrix, s, s, 1.0f); matrixRotate(matrix, r, 0.0f, 0.0f, 1.0f); @@ -301,7 +307,11 @@ void drawLeaf(struct Leaves_s *leaf, int meshWidth, int meshHeight, float glWidt color(1.0f, 1.0f, 1.0f, 1.0f); } - matrixLoadIdentity(matrix); + if (rotate) { + matrixLoadRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f); + } else { + matrixLoadIdentity(matrix); + } matrixTranslate(matrix, x, y, tz); matrixScale(matrix, s, s, 1.0f); matrixRotate(matrix, r, 0.0f, 0.0f, 1.0f); @@ -363,12 +373,13 @@ void drawLeaves() { int height = State->meshHeight; float glWidth = State->glWidth; float glHeight = State->glHeight; + int rotate = State->rotate; struct Leaves_s *leaf = Leaves; int i = 0; for ( ; i < leavesCount; i += 1) { - drawLeaf(leaf, width, height, glWidth, glHeight); + drawLeaf(leaf, width, height, glWidth, glHeight, rotate); leaf += 1; } @@ -475,6 +486,12 @@ int main(int index) { generateRipples(); updateSimpleMesh(NAMED_WaterMesh); + if (State->rotate) { + float matrix[16]; + matrixLoadRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f); + vpLoadModelMatrix(matrix); + } + drawRiverbed(); drawSky(); drawLighting(); |
