Mercurial > MadButterfly
comparison examples/dynamic/main.c @ 244:d36abace2ce4
Fix bug in *_goto_scene()
- Wrong type casting in *_goto_scene() of mb_c_source.m5. Once again!
- Change examples/dynamic/main.c that scene is numbered started from zero.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 31 Dec 2008 23:50:53 +0800 |
parents | d3fe0a0f3a8b |
children | 81458bb0bf34 |
comparison
equal
deleted
inserted
replaced
243:6c6b62d342ee | 244:d36abace2ce4 |
---|---|
302 get_now(&timer); | 302 get_now(&timer); |
303 MB_TIMEVAL_SET(&interval, 1 ,0); | 303 MB_TIMEVAL_SET(&interval, 1 ,0); |
304 MB_TIMEVAL_ADD(&timer, &interval); | 304 MB_TIMEVAL_ADD(&timer, &interval); |
305 mb_tman_timeout( MBApp_getTimer(myApp), &timer, switch_scene, myApp); | 305 mb_tman_timeout( MBApp_getTimer(myApp), &timer, switch_scene, myApp); |
306 | 306 |
307 en->currentscene = (en->currentscene+1) %2; | 307 en->currentscene = (en->currentscene + 1) % 2; |
308 printf("switch to scene %d\n", en->currentscene); | 308 printf("switch to scene %d\n", en->currentscene + 1); |
309 MB_SPRITE_GOTO_SCENE(myApp->rootsprite,en->currentscene); | 309 MB_SPRITE_GOTO_SCENE(myApp->rootsprite,en->currentscene + 1); |
310 rdman_redraw_all(myApp->rdman); | |
310 } | 311 } |
311 | 312 |
312 int main(int argc, char * const argv[]) { | 313 int main(int argc, char * const argv[]) { |
313 subject_t *subject; | 314 subject_t *subject; |
314 mb_button_t *b; | 315 mb_button_t *b; |