blob: bae786d4657694077f597f2c90fbe6db7edbc216 [file] [log] [blame]
Joe Onorato93839052009-08-06 20:34:32 -07001#pragma version(1)
2#pragma stateVertex(PV)
Jason Samscd689e12009-09-29 15:28:22 -07003#pragma stateFragment(PFTexLinear)
4#pragma stateStore(PSIcons)
Joe Onorato93839052009-08-06 20:34:32 -07005
Joe Onorato43e7bcf2009-08-08 18:53:53 -07006#define PI 3.14159f
7
Jason Sams86c87ed2009-09-18 13:55:55 -07008
9// Attraction to center values from page edge to page center.
10float g_AttractionTable[9];
11float g_FrictionTable[9];
12float g_PhysicsTableSize;
13
14float g_PosPage;
15float g_PosVelocity;
16float g_LastPositionX;
17int g_LastTouchDown;
18float g_DT;
19int g_LastTime;
Jason Sams86c87ed2009-09-18 13:55:55 -070020int g_PageCount;
Jason Samsfd22dac2009-09-20 17:24:16 -070021float g_Zoom;
Joe Onorato93839052009-08-06 20:34:32 -070022
Joe Onorato43e7bcf2009-08-08 18:53:53 -070023// Drawing constants, should be parameters ======
Joe Onoratoefabe002009-08-28 09:38:18 -070024#define VIEW_ANGLE 1.28700222f
Joe Onorato43e7bcf2009-08-08 18:53:53 -070025
Jason Sams12c14a82009-10-06 14:33:15 -070026float g_OldPosPage;
27float g_OldPosVelocity;
28float g_OldZoom;
29
30void updateReadback() {
31 if ((g_OldPosPage != g_PosPage) ||
32 (g_OldPosVelocity != g_PosVelocity) ||
33 (g_OldZoom != g_Zoom)) {
34
35 g_OldPosPage = g_PosPage;
36 g_OldPosVelocity = g_PosVelocity;
37 g_OldZoom = g_Zoom;
38
39 int i[3];
40 i[0] = g_PosPage * (1 << 16);
41 i[1] = g_PosVelocity * (1 << 16);
42 i[2] = g_OldZoom * (1 << 16);
43 sendToClient(&i[0], 1, 12, 1);
44 }
45}
46
Jason Sams78aebd82009-09-15 13:06:59 -070047void init() {
Jason Sams0aa71662009-10-02 18:43:18 -070048 g_AttractionTable[0] = 6.5f;
49 g_AttractionTable[1] = 6.5f;
50 g_AttractionTable[2] = 7.0f;
51 g_AttractionTable[3] = 6.0f;
52 g_AttractionTable[4] = -6.0f;
53 g_AttractionTable[5] = -7.0f;
54 g_AttractionTable[6] = -6.5f;
55 g_AttractionTable[7] = -6.5f;
56 g_AttractionTable[8] = -6.5f; // dup 7 to avoid a clamp later
Jason Sams86c87ed2009-09-18 13:55:55 -070057 g_FrictionTable[0] = 3.5f;
58 g_FrictionTable[1] = 3.6f;
Jason Sams0aa71662009-10-02 18:43:18 -070059 g_FrictionTable[2] = 4.0f;
60 g_FrictionTable[3] = 5.0f;
61 g_FrictionTable[4] = 5.0f;
62 g_FrictionTable[5] = 4.0f;
Jason Sams86c87ed2009-09-18 13:55:55 -070063 g_FrictionTable[6] = 3.6f;
64 g_FrictionTable[7] = 3.5f;
65 g_FrictionTable[8] = 3.5f; // dup 7 to avoid a clamp later
66 g_PhysicsTableSize = 7;
67
68 g_PosVelocity = 0;
69 g_PosPage = 0;
70 g_LastTouchDown = 0;
71 g_LastPositionX = 0;
Jason Samsfd22dac2009-09-20 17:24:16 -070072 g_Zoom = 0;
Jason Sams86c87ed2009-09-18 13:55:55 -070073}
74
75void move() {
76 if (g_LastTouchDown) {
77 float dx = -(state->newPositionX - g_LastPositionX);
78 g_PosVelocity = 0;
79 g_PosPage += dx;
Jason Samsfd22dac2009-09-20 17:24:16 -070080
81 float pmin = -0.25f;
82 float pmax = (g_PageCount - 1) + 0.25f;
83 g_PosPage = clampf(g_PosPage, pmin, pmax);
Jason Sams86c87ed2009-09-18 13:55:55 -070084 }
85 g_LastTouchDown = state->newTouchDown;
86 g_LastPositionX = state->newPositionX;
Jason Sams28870b72009-09-30 17:32:05 -070087 //debugF("Move P", g_PosPage);
Jason Sams86c87ed2009-09-18 13:55:55 -070088}
89
90void fling() {
91 g_LastTouchDown = 0;
92 g_PosVelocity = -state->flingVelocityX;
Jason Samsfd22dac2009-09-20 17:24:16 -070093 float av = fabsf(g_PosVelocity);
Jason Sams0aa71662009-10-02 18:43:18 -070094 float minVel = 3.5f;
Jason Samsfd22dac2009-09-20 17:24:16 -070095
96 minVel *= 1.f - (fabsf(fracf(g_PosPage + 0.5f) - 0.5f) * 0.45f);
97
98 if (av < minVel && av > 0.2f) {
99 if (g_PosVelocity > 0) {
100 g_PosVelocity = minVel;
101 } else {
102 g_PosVelocity = -minVel;
103 }
104 }
105
Jason Sams86c87ed2009-09-18 13:55:55 -0700106 if (g_PosPage <= 0) {
107 g_PosVelocity = maxf(0, g_PosVelocity);
108 }
109 if (g_PosPage > (g_PageCount - 1)) {
Jason Samsfd22dac2009-09-20 17:24:16 -0700110 g_PosVelocity = minf(0, g_PosVelocity);
Jason Sams86c87ed2009-09-18 13:55:55 -0700111 }
Jason Sams28870b72009-09-30 17:32:05 -0700112 //debugF("fling v", g_PosVelocity);
Jason Sams78aebd82009-09-15 13:06:59 -0700113}
114
Joe Onorato360d0352009-09-28 14:37:53 -0400115void touchUp() {
116 g_LastTouchDown = 0;
117}
118
Joe Onorato43e7bcf2009-08-08 18:53:53 -0700119int
120count_pages(int iconCount)
Joe Onorato93839052009-08-06 20:34:32 -0700121{
Joe Onorato43e7bcf2009-08-08 18:53:53 -0700122 int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
123 int pages = iconCount / iconsPerPage;
124 if (pages*iconsPerPage != iconCount) {
Joe Onoratod769a632009-08-11 17:09:02 -0700125 pages++;
Joe Onorato43e7bcf2009-08-08 18:53:53 -0700126 }
Joe Onoratod769a632009-08-11 17:09:02 -0700127 return pages;
128}
129
Joe Onoratod769a632009-08-11 17:09:02 -0700130float
131modf(float x, float y)
132{
133 return x-(y*floorf(x/y));
Joe Onorato93839052009-08-06 20:34:32 -0700134}
135
Jason Sams86c87ed2009-09-18 13:55:55 -0700136void updatePos() {
137 if (g_LastTouchDown) {
138 return;
139 }
140
Jason Sams86c87ed2009-09-18 13:55:55 -0700141 float tablePosNorm = fracf(g_PosPage + 0.5f);
142 float tablePosF = tablePosNorm * g_PhysicsTableSize;
143 int tablePosI = tablePosF;
144 float tablePosFrac = tablePosF - tablePosI;
Jason Sams86c87ed2009-09-18 13:55:55 -0700145 float accel = lerpf(g_AttractionTable[tablePosI],
146 g_AttractionTable[tablePosI + 1],
147 tablePosFrac) * g_DT;
148 float friction = lerpf(g_FrictionTable[tablePosI],
149 g_FrictionTable[tablePosI + 1],
150 tablePosFrac) * g_DT;
151 //debugF(" accel", accel);
152 //debugF(" friction", friction);
153
Jason Samsfd22dac2009-09-20 17:24:16 -0700154 // If our velocity is low OR acceleration is opposing it, apply it.
Jason Sams0aa71662009-10-02 18:43:18 -0700155 if (fabsf(g_PosVelocity) < 1.0f || (g_PosVelocity * accel) < 0) {
Jason Samsfd22dac2009-09-20 17:24:16 -0700156 g_PosVelocity += accel;
157 }
158
Jason Sams86c87ed2009-09-18 13:55:55 -0700159 if ((friction > fabsf(g_PosVelocity)) && (friction > fabsf(accel))) {
160 // Special get back to center and overcome friction physics.
161 float t = tablePosNorm - 0.5f;
162 if (fabsf(t) < (friction * g_DT)) {
163 // really close, just snap
164 g_PosPage = roundf(g_PosPage);
165 g_PosVelocity = 0;
166 } else {
167 if (t > 0) {
168 g_PosVelocity = -friction;
169 } else {
170 g_PosVelocity = friction;
171 }
172 }
173 } else {
174 // Normal physics
175 if (g_PosVelocity > 0) {
176 g_PosVelocity -= friction;
Jason Samsfd22dac2009-09-20 17:24:16 -0700177 g_PosVelocity = maxf(g_PosVelocity, 0);
Jason Sams86c87ed2009-09-18 13:55:55 -0700178 } else {
179 g_PosVelocity += friction;
Jason Samsfd22dac2009-09-20 17:24:16 -0700180 g_PosVelocity = minf(g_PosVelocity, 0);
Jason Sams86c87ed2009-09-18 13:55:55 -0700181 }
182 }
183 g_PosPage += g_PosVelocity * g_DT;
184
185 // Check for out of boundry conditions.
186 if (g_PosPage < 0 && g_PosVelocity < 0) {
Jason Sams0aa71662009-10-02 18:43:18 -0700187 float damp = 1.0 + (g_PosPage * 4);
Jason Sams86c87ed2009-09-18 13:55:55 -0700188 damp = clampf(damp, 0.f, 0.9f);
189 g_PosVelocity *= damp;
190 }
191 if (g_PosPage > (g_PageCount-1) && g_PosVelocity > 0) {
Jason Sams0aa71662009-10-02 18:43:18 -0700192 float damp = 1.0 - ((g_PosPage - g_PageCount + 1) * 4);
Jason Sams86c87ed2009-09-18 13:55:55 -0700193 damp = clampf(damp, 0.f, 0.9f);
194 g_PosVelocity *= damp;
195 }
196}
197
Joe Onorato0d1c5632009-08-28 15:57:18 -0700198float
199far_size(float sizeAt0)
200{
201 return sizeAt0 * (RADIUS+2) / 2; // -2 is the camera z=(z-camZ)/z
202}
203
Joe Onoratoefabe002009-08-28 09:38:18 -0700204void
Jason Samsfd22dac2009-09-20 17:24:16 -0700205draw_page(int icon, int lastIcon, float centerAngle, float scale)
Joe Onoratoefabe002009-08-28 09:38:18 -0700206{
207 int row;
208 int col;
209
Jason Sams86c87ed2009-09-18 13:55:55 -0700210 //debugF("center angle", centerAngle);
Joe Onorato85a02a82009-09-08 12:34:22 -0700211
Joe Onoratoefabe002009-08-28 09:38:18 -0700212 float iconTextureWidth = ICON_WIDTH_PX / (float)ICON_TEXTURE_WIDTH_PX;
213 float iconTextureHeight = ICON_HEIGHT_PX / (float)ICON_TEXTURE_HEIGHT_PX;
214
215 float iconWidthAngle = VIEW_ANGLE * ICON_WIDTH_PX / SCREEN_WIDTH_PX;
Jason Samsfd22dac2009-09-20 17:24:16 -0700216 float columnGutterAngle = iconWidthAngle * 0.9f;
Joe Onoratoefabe002009-08-28 09:38:18 -0700217
Joe Onorato6665c0f2009-09-02 15:27:24 -0700218 float farIconSize = FAR_ICON_SIZE;
Jason Samsfd22dac2009-09-20 17:24:16 -0700219 float iconGutterHeight = farIconSize * 1.3f;
Joe Onorato0d1c5632009-08-28 15:57:18 -0700220
Joe Onorato6665c0f2009-09-02 15:27:24 -0700221 float farIconTextureSize = far_size(2 * ICON_TEXTURE_WIDTH_PX / (float)SCREEN_WIDTH_PX);
222
Jason Sams78aebd82009-09-15 13:06:59 -0700223 float normalizedLabelWidth = 2 * params->bubbleWidth / (float)SCREEN_WIDTH_PX;
Jason Sams78aebd82009-09-15 13:06:59 -0700224 float farLabelHeight = far_size(params->bubbleHeight * (normalizedLabelWidth / params->bubbleWidth));
Joe Onoratoefabe002009-08-28 09:38:18 -0700225
226 for (row=0; row<ROWS_PER_PAGE && icon<=lastIcon; row++) {
227 float angle = centerAngle;
228 angle -= (columnGutterAngle + iconWidthAngle) * 1.5f;
229
Jason Samsfd22dac2009-09-20 17:24:16 -0700230 float iconTop = (farIconSize + iconGutterHeight) * (1.85f + ICON_TOP_OFFSET)
Joe Onorato0d1c5632009-08-28 15:57:18 -0700231 - row * (farIconSize + iconGutterHeight);
Joe Onoratoefabe002009-08-28 09:38:18 -0700232 float iconBottom = iconTop - farIconSize;
233
Jason Sams28870b72009-09-30 17:32:05 -0700234 float labelY = iconBottom - farLabelHeight;
Joe Onorato6665c0f2009-09-02 15:27:24 -0700235 float iconTextureTop = iconTop + (0.5f * (farIconTextureSize - farIconSize));
236 float iconTextureBottom = iconTextureTop - farIconTextureSize;
237
Joe Onoratoefabe002009-08-28 09:38:18 -0700238 for (col=0; col<COLUMNS_PER_PAGE && icon<=lastIcon; col++) {
239 // icon
240 float sine = sinf(angle);
241 float cosine = cosf(angle);
242
Joe Onorato0d1c5632009-08-28 15:57:18 -0700243 float centerX = sine * RADIUS;
Jason Samsfd22dac2009-09-20 17:24:16 -0700244 float centerZ = cosine * RADIUS / scale;
245
246 if (scale > 1.f) {
247 centerX *= scale;
248 }
Joe Onorato0d1c5632009-08-28 15:57:18 -0700249
Jason Sams28870b72009-09-30 17:32:05 -0700250 float iconLeftX = centerX - (/*cosine * */ farIconTextureSize * .5);
251 float iconRightX = centerX + (/*cosine * */ farIconTextureSize * .5);
252 float iconLeftZ = centerZ;// + (sine * farIconTextureSize * .5);
253 float iconRightZ = centerZ;// - (sine * farIconTextureSize * .5);
Joe Onorato6665c0f2009-09-02 15:27:24 -0700254
Jason Samsfd22dac2009-09-20 17:24:16 -0700255 color(1.0f, 1.0f, 1.0f, 0.99f);
Jason Sams78aebd82009-09-15 13:06:59 -0700256 if (state->selectedIconIndex == icon) {
Jason Samscd689e12009-09-29 15:28:22 -0700257 bindTexture(NAMED_PFTexLinear, 0, state->selectedIconTexture);
Joe Onorato6665c0f2009-09-02 15:27:24 -0700258 drawQuadTexCoords(
259 iconLeftX, iconTextureTop, iconLeftZ, 0.0f, 0.0f,
260 iconRightX, iconTextureTop, iconRightZ, 1.0f, 0.0f,
261 iconRightX, iconTextureBottom, iconRightZ, 1.0f, 1.0f,
262 iconLeftX, iconTextureBottom, iconLeftZ, 0.0f, 1.0f);
Joe Onorato1291a8c2009-09-15 15:07:25 -0400263 } else {
Jason Samscd689e12009-09-29 15:28:22 -0700264 bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_ICON_IDS, icon));
Joe Onorato1291a8c2009-09-15 15:07:25 -0400265 drawQuadTexCoords(
266 iconLeftX, iconTextureTop, iconLeftZ, 0.0f, 0.0f,
267 iconRightX, iconTextureTop, iconRightZ, 1.0f, 0.0f,
268 iconRightX, iconTextureBottom, iconRightZ, 1.0f, 1.0f,
269 iconLeftX, iconTextureBottom, iconLeftZ, 0.0f, 1.0f);
Joe Onorato6665c0f2009-09-02 15:27:24 -0700270 }
Joe Onoratoefabe002009-08-28 09:38:18 -0700271
Joe Onoratoefabe002009-08-28 09:38:18 -0700272 // label
Jason Samsfd22dac2009-09-20 17:24:16 -0700273 if (scale < 1.2f) {
Jason Sams28870b72009-09-30 17:32:05 -0700274 float a = (1.2f - maxf(scale, 1.0f)) * 5;
Jason Samsfd22dac2009-09-20 17:24:16 -0700275 color(1.0f, 1.0f, 1.0f, a);
Jason Samscd689e12009-09-29 15:28:22 -0700276 bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_LABEL_IDS, icon));
Jason Sams28870b72009-09-30 17:32:05 -0700277 drawSprite(centerX, labelY, centerZ,
278 params->bubbleBitmapWidth, params->bubbleBitmapHeight);
Joe Onorato85a02a82009-09-08 12:34:22 -0700279 }
Joe Onoratoefabe002009-08-28 09:38:18 -0700280
Joe Onoratoefabe002009-08-28 09:38:18 -0700281 angle += columnGutterAngle + iconWidthAngle;
282 icon++;
283 }
284 }
285}
286
Joe Onoratobcbeab82009-10-01 21:45:43 -0700287void
288draw_home_button()
289{
290 color(1.0f, 1.0f, 1.0f, 1.0f);
291 bindTexture(NAMED_PFTexLinear, 0, params->homeButtonId);
292
293 float scale = 2.0f / SCREEN_WIDTH_PX;
294
295 float x = 0.0f;
296
297 float y = -(SCREEN_HEIGHT_PX / (float)SCREEN_WIDTH_PX);
298 y += g_Zoom * (scale * params->homeButtonTextureHeight / 2);
299
300 float z = 0.0f;
301 drawSprite(x, y, z, params->homeButtonTextureWidth, params->homeButtonTextureHeight);
302}
303
Joe Onorato43e7bcf2009-08-08 18:53:53 -0700304int
Joe Onoratod769a632009-08-11 17:09:02 -0700305main(int launchID)
Joe Onorato93839052009-08-06 20:34:32 -0700306{
Jason Samsfd22dac2009-09-20 17:24:16 -0700307 // Compute dt in seconds.
Jason Sams86c87ed2009-09-18 13:55:55 -0700308 int newTime = uptimeMillis();
309 g_DT = (newTime - g_LastTime) / 1000.f;
310 g_LastTime = newTime;
Jason Sams86c87ed2009-09-18 13:55:55 -0700311
Joe Onorato26646342009-09-23 15:15:48 -0700312 //debugF("zoom", g_Zoom);
Jason Sams12c14a82009-10-06 14:33:15 -0700313 if (g_Zoom != state->zoomTarget) {
314 float dz = (state->zoomTarget - g_Zoom) * g_DT * 5;
Jason Samsfd22dac2009-09-20 17:24:16 -0700315 if (dz && (fabsf(dz) < 0.03f)) {
316 if (dz > 0) {
317 dz = 0.03f;
318 } else {
319 dz = -0.03f;
320 }
321 }
Jason Sams12c14a82009-10-06 14:33:15 -0700322 if (fabsf(g_Zoom - state->zoomTarget) < fabsf(dz)) {
323 g_Zoom = state->zoomTarget;
Jason Samsfd22dac2009-09-20 17:24:16 -0700324 } else {
325 g_Zoom += dz;
326 }
Jason Sams12c14a82009-10-06 14:33:15 -0700327 updateReadback();
Joe Onorato006b25f2009-09-03 11:38:43 -0700328 }
329
Jason Samsfd22dac2009-09-20 17:24:16 -0700330 // Set clear value to dim the background based on the zoom position.
Jason Sams12c14a82009-10-06 14:33:15 -0700331 if ((g_Zoom < 0.001f) && (state->zoomTarget < 0.001f)) {
Joe Onorato7bb17492009-09-24 17:51:01 -0700332 pfClearColor(0.0f, 0.0f, 0.0f, 0.0f);
Joe Onorato360d0352009-09-28 14:37:53 -0400333 // When we're zoomed out and not tracking motion events, reset the pos to 0.
334 if (!g_LastTouchDown) {
335 g_PosPage = 0;
336 }
Jason Sams12c14a82009-10-06 14:33:15 -0700337 return 1;//0;
Jason Sams28870b72009-09-30 17:32:05 -0700338 } else if (g_Zoom < 0.85f) {
Jason Samsfd22dac2009-09-20 17:24:16 -0700339 pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
Jason Samsfd22dac2009-09-20 17:24:16 -0700340 } else {
Joe Onoratobcbeab82009-10-01 21:45:43 -0700341 pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
Jason Samsfd22dac2009-09-20 17:24:16 -0700342 }
343
Joe Onorato43e7bcf2009-08-08 18:53:53 -0700344 // icons & labels
Jason Sams78aebd82009-09-15 13:06:59 -0700345 int iconCount = state->iconCount;
Jason Sams86c87ed2009-09-18 13:55:55 -0700346 g_PageCount = count_pages(iconCount);
Joe Onorato43e7bcf2009-08-08 18:53:53 -0700347
Jason Sams86c87ed2009-09-18 13:55:55 -0700348 updatePos(0.1f);
Jason Sams12c14a82009-10-06 14:33:15 -0700349 updateReadback();
Joe Onoratod769a632009-08-11 17:09:02 -0700350
Jason Sams86c87ed2009-09-18 13:55:55 -0700351 //debugF(" draw g_PosPage", g_PosPage);
Joe Onoratod769a632009-08-11 17:09:02 -0700352
Joe Onoratoc567acb2009-08-31 14:34:43 -0700353 // Draw the icons ========================================
Joe Onoratoefabe002009-08-28 09:38:18 -0700354
355 // Bug makes 1.0f alpha fail.
356 color(1.0f, 1.0f, 1.0f, 0.99f);
357
Jason Samsa9d176c2009-10-06 16:02:03 -0700358 if (iconCount <= 0) {
359 return 1;
360 }
Joe Onoratoefabe002009-08-28 09:38:18 -0700361 int lastIcon = iconCount-1;
362
Jason Sams86c87ed2009-09-18 13:55:55 -0700363 int page = g_PosPage;
364 float currentPagePosition = g_PosPage - page;
Joe Onoratod769a632009-08-11 17:09:02 -0700365
Joe Onoratod769a632009-08-11 17:09:02 -0700366 int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
Joe Onoratoefabe002009-08-28 09:38:18 -0700367 int icon = clamp(iconsPerPage * page, 0, lastIcon);
Joe Onorato93839052009-08-06 20:34:32 -0700368
Jason Samsfd22dac2009-09-20 17:24:16 -0700369 float scale = (1 / g_Zoom);
Jason Sams78aebd82009-09-15 13:06:59 -0700370
Jason Samsfd22dac2009-09-20 17:24:16 -0700371 float pageAngle = VIEW_ANGLE * 1.2f;
372 draw_page(icon, lastIcon, -pageAngle*currentPagePosition, scale);
373 draw_page(icon+iconsPerPage, lastIcon, (-pageAngle*currentPagePosition)+pageAngle, scale);
Jason Sams86c87ed2009-09-18 13:55:55 -0700374
Joe Onorato56848b02009-09-25 13:59:59 -0700375 // Draw the border lines for debugging ========================================
376 /*
377 bindProgramVertex(NAMED_PVOrtho);
378 bindProgramFragment(NAMED_PFOrtho);
379 bindProgramFragmentStore(NAMED_PFSText);
380
381 color(1.0f, 1.0f, 0.0f, 0.99f);
382 int i;
383 for (i=0; i<ROWS_PER_PAGE+1; i++) {
384 int y = loadI32(ALLOC_Y_BORDERS, i);
385 drawRect(0, y, SCREEN_WIDTH_PX, y+1, 0.0f);
386 }
387 for (i=0; i<COLUMNS_PER_PAGE+1; i++) {
388 int x = loadI32(ALLOC_X_BORDERS, i);
389 drawRect(x, 0, x+1, SCREEN_HEIGHT_PX, 0.0f);
390 }
391 */
Joe Onorato6665c0f2009-09-02 15:27:24 -0700392
Joe Onoratobcbeab82009-10-01 21:45:43 -0700393 // Draw the home button ========================================
394 draw_home_button();
395
Joe Onorato6665c0f2009-09-02 15:27:24 -0700396 /*
Joe Onorato56848b02009-09-25 13:59:59 -0700397 bindTexture(NAMED_PFOrtho, 0, loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_ID));
Joe Onoratoc567acb2009-08-31 14:34:43 -0700398 float handleLeft = 40 + (320 * (scrollXPx/(float)(maxScrollXPx)));
399 float handleTop = 680;
400 float handleWidth = loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_TEX_WIDTH);
401 float handleHeight = loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_TEX_HEIGHT);
402 drawRect(handleLeft, handleTop, handleLeft+handleWidth, handleTop+handleHeight, 0.0f);
403 */
Joe Onorato93839052009-08-06 20:34:32 -0700404
Jason Sams86c87ed2009-09-18 13:55:55 -0700405 // Bug workaround where the last frame is not always displayed
Jason Samsfd22dac2009-09-20 17:24:16 -0700406 // So we keep rendering until the bug is fixed.
Jason Sams12c14a82009-10-06 14:33:15 -0700407 return 1;//(g_PosVelocity != 0) || fracf(g_PosPage) || (g_Zoom != state->zoomTarget);
Joe Onorato93839052009-08-06 20:34:32 -0700408}
409