summaryrefslogtreecommitdiffstats
path: root/res/raw
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-09-23 15:15:48 -0700
committerJoe Onorato <joeo@android.com>2009-09-23 15:20:25 -0700
commit26646340d861a4c182e741be1ec677040dc7e979 (patch)
tree05bc5545f226bbb9447434a071da1ac18896881e /res/raw
parenta997a515151b3ba853bd3e45c1d5b53579aaa193 (diff)
downloadandroid_packages_apps_Trebuchet-26646340d861a4c182e741be1ec677040dc7e979.tar.gz
android_packages_apps_Trebuchet-26646340d861a4c182e741be1ec677040dc7e979.tar.bz2
android_packages_apps_Trebuchet-26646340d861a4c182e741be1ec677040dc7e979.zip
Rollo tweaks.
- Turn off the "zoom" log message. - Make it stop rendering. Add a workaround to not always flipping the last page by drawing one extra frame.
Diffstat (limited to 'res/raw')
-rw-r--r--res/raw/rollo.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/res/raw/rollo.c b/res/raw/rollo.c
index 5dcb16c66..cff4620c0 100644
--- a/res/raw/rollo.c
+++ b/res/raw/rollo.c
@@ -24,6 +24,22 @@ float g_ZoomTarget;
// Drawing constants, should be parameters ======
#define VIEW_ANGLE 1.28700222f
+int g_oneLastFrame = 1;
+int one_last_frame(int more) {
+ if (more) {
+ g_oneLastFrame = 1;
+ return 1;
+ } else {
+ if (g_oneLastFrame) {
+ g_oneLastFrame = 0;
+ return 1;
+ } else {
+ g_oneLastFrame = 1;
+ return 0;
+ }
+ }
+}
+
void init() {
g_AttractionTable[0] = 4.5f;
g_AttractionTable[1] = 4.5f;
@@ -295,7 +311,7 @@ main(int launchID)
g_DT = (newTime - g_LastTime) / 1000.f;
g_LastTime = newTime;
- debugF("zoom", g_Zoom);
+ //debugF("zoom", g_Zoom);
if (g_Zoom != g_ZoomTarget) {
float dz = (g_ZoomTarget - g_Zoom) * g_DT * 5;
if (dz && (fabsf(dz) < 0.03f)) {
@@ -317,7 +333,8 @@ main(int launchID)
pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
if (g_Zoom == 0) {
// Nothing else to do if fully zoomed out.
- return 1;
+ g_PosPage = roundf(g_PosPage);
+ return one_last_frame(0);
}
} else {
pfClearColor(0.0f, 0.0f, 0.0f, 0.80f);
@@ -370,6 +387,6 @@ main(int launchID)
// Bug workaround where the last frame is not always displayed
// So we keep rendering until the bug is fixed.
- return 1;//(g_PosVelocity != 0) || fracf(g_PosPage);
+ return one_last_frame((g_PosVelocity != 0) || fracf(g_PosPage) || g_Zoom != g_ZoomTarget);
}