summaryrefslogtreecommitdiffstats
path: root/overlay/packages
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2010-11-02 20:42:55 -0700
committerAdam Powell <adamp@google.com>2010-11-02 22:47:11 -0700
commit9389f2be393210b1c49d6982c2c96d531f9faa81 (patch)
treed0446ff0d6adfe0595de7697c68b898975e24c66 /overlay/packages
parentec8de83301370de5962e1255effaccc8a8974914 (diff)
downloaddevice_samsung_crespo-9389f2be393210b1c49d6982c2c96d531f9faa81.zip
device_samsung_crespo-9389f2be393210b1c49d6982c2c96d531f9faa81.tar.gz
device_samsung_crespo-9389f2be393210b1c49d6982c2c96d531f9faa81.tar.bz2
Tweak Nexus live wallpaper; enable 32-bit surface tweak; change background
Change-Id: Ia30fb21f0cca22d0023a1bc8f1463e4009587c33
Diffstat (limited to 'overlay/packages')
-rw-r--r--overlay/packages/wallpapers/Basic/res/drawable-hdpi/pyramid_background.pngbin0 -> 700848 bytes
-rw-r--r--overlay/packages/wallpapers/Basic/res/raw/nexus.rs40
-rw-r--r--overlay/packages/wallpapers/Basic/res/values/surfacemode.xml18
3 files changed, 49 insertions, 9 deletions
diff --git a/overlay/packages/wallpapers/Basic/res/drawable-hdpi/pyramid_background.png b/overlay/packages/wallpapers/Basic/res/drawable-hdpi/pyramid_background.png
new file mode 100644
index 0000000..76ffd37
--- /dev/null
+++ b/overlay/packages/wallpapers/Basic/res/drawable-hdpi/pyramid_background.png
Binary files differ
diff --git a/overlay/packages/wallpapers/Basic/res/raw/nexus.rs b/overlay/packages/wallpapers/Basic/res/raw/nexus.rs
index 69ac3b8..df79689 100644
--- a/overlay/packages/wallpapers/Basic/res/raw/nexus.rs
+++ b/overlay/packages/wallpapers/Basic/res/raw/nexus.rs
@@ -78,7 +78,7 @@ void initPulse(struct pulse_s * pulse, int pulseType) {
pulse->dy = scale;
} else {
// Bottom
- pulse->originY = State->height;
+ pulse->originY = State->height / scale;
pulse->dy = -scale;
}
} else {
@@ -90,7 +90,7 @@ void initPulse(struct pulse_s * pulse, int pulseType) {
pulse->dx = scale;
} else {
// Right
- pulse->originX = State->width * 2;
+ pulse->originX = State->width * 2 / scale;
pulse->dx = -scale;
}
}
@@ -119,6 +119,17 @@ void initPulses() {
}
}
+void drawBackground(int width, int height) {
+ bindProgramFragment(NAMED_PFTextureBG);
+ bindTexture(NAMED_PFTextureBG, 0, NAMED_TBackground);
+ color(1.0f, 1.0f, 1.0f, 1.0f);
+ if (State->rotate) {
+ drawRect(0.0f, 0.0f, height*2, width, 0.0f);
+ } else {
+ drawRect(0.0f, 0.0f, width*2, height, 0.0f);
+ }
+}
+
void drawPulses(struct pulse_s * pulseSet, int setSize) {
bindProgramFragment(NAMED_PFTexture);
bindProgramFragmentStore(NAMED_PSBlend);
@@ -167,7 +178,6 @@ void drawPulses(struct pulse_s * pulseSet, int setSize) {
}
} else if (p->dx > 0) {
x += PULSE_SIZE; // need to start on the other side of this cell
- matrixRotate(matrix, 180.0f, 0.0f, 0.0f, 1.0f);
vpLoadTextureMatrix(matrix);
float xx = x - (TRAIL_SIZE * PULSE_SIZE);
if (xx >= State->width * 2) {
@@ -175,7 +185,7 @@ void drawPulses(struct pulse_s * pulseSet, int setSize) {
} else {
setColor(p->color);
bindTexture(NAMED_PFTexture, 0, NAMED_TPulse);
- drawRect(xx, y, x, y + PULSE_SIZE, 0.0f);
+ drawRect(x, y, xx, y + PULSE_SIZE, 0.0f);
bindTexture(NAMED_PFTexture, 0, NAMED_TGlow);
drawRect(x - HALF_PULSE_SIZE - HALF_GLOW_SIZE,
y + HALF_PULSE_SIZE - HALF_GLOW_SIZE,
@@ -184,15 +194,14 @@ void drawPulses(struct pulse_s * pulseSet, int setSize) {
0.0f);
}
} else if (p->dy < 0) {
- matrixRotate(matrix, -90.0f, 0.0f, 0.0f, 1.0f);
vpLoadTextureMatrix(matrix);
float yy = y + (TRAIL_SIZE * PULSE_SIZE);
if (yy <= 0) {
initPulse(p, p->pulseType);
} else {
setColor(p->color);
- bindTexture(NAMED_PFTexture, 0, NAMED_TPulse);
- drawRect(x, y, x + PULSE_SIZE, yy, 0.0f);
+ bindTexture(NAMED_PFTexture, 0, NAMED_TPulseVert);
+ drawRect(x, yy, x + PULSE_SIZE, y, 0.0f);
bindTexture(NAMED_PFTexture, 0, NAMED_TGlow);
drawRect(x + HALF_PULSE_SIZE - HALF_GLOW_SIZE,
y + HALF_PULSE_SIZE - HALF_GLOW_SIZE,
@@ -202,14 +211,13 @@ void drawPulses(struct pulse_s * pulseSet, int setSize) {
}
} else if (p->dy > 0) {
y += PULSE_SIZE; // need to start on the other side of this cell
- matrixRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f);
vpLoadTextureMatrix(matrix);
float yy = y - (TRAIL_SIZE * PULSE_SIZE);
if (yy >= State->height) {
initPulse(p, p->pulseType);
} else {
setColor(p->color);
- bindTexture(NAMED_PFTexture, 0, NAMED_TPulse);
+ bindTexture(NAMED_PFTexture, 0, NAMED_TPulseVert);
drawRect(x, yy, x + PULSE_SIZE, y, 0.0f);
bindTexture(NAMED_PFTexture, 0, NAMED_TGlow);
drawRect(x + HALF_PULSE_SIZE - HALF_GLOW_SIZE,
@@ -284,6 +292,20 @@ int main(int index) {
int width = State->width;
int height = State->height;
+ float matrix[16];
+ matrixLoadIdentity(matrix);
+ 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);
+ }
+
+ vpLoadModelMatrix(matrix);
+
+ drawBackground(width, height);
+
drawPulses(gPulses, MAX_PULSES);
drawPulses(gExtras, MAX_EXTRAS);
diff --git a/overlay/packages/wallpapers/Basic/res/values/surfacemode.xml b/overlay/packages/wallpapers/Basic/res/values/surfacemode.xml
new file mode 100644
index 0000000..37774ed
--- /dev/null
+++ b/overlay/packages/wallpapers/Basic/res/values/surfacemode.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <bool name="use_32bit">true</bool>
+</resources>