# HG changeset patch # User Thinker K.F. Li # Date 1230738653 -28800 # Node ID d36abace2ce4ad5c09eebb68b7af9e4af596ed63 # Parent 6c6b62d342ee674362e640d053867509af322416 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. diff -r 6c6b62d342ee -r d36abace2ce4 examples/dynamic/main.c --- a/examples/dynamic/main.c Wed Dec 31 22:39:28 2008 +0800 +++ b/examples/dynamic/main.c Wed Dec 31 23:50:53 2008 +0800 @@ -304,9 +304,10 @@ MB_TIMEVAL_ADD(&timer, &interval); mb_tman_timeout( MBApp_getTimer(myApp), &timer, switch_scene, myApp); - en->currentscene = (en->currentscene+1) %2; - printf("switch to scene %d\n", en->currentscene); - MB_SPRITE_GOTO_SCENE(myApp->rootsprite,en->currentscene); + en->currentscene = (en->currentscene + 1) % 2; + printf("switch to scene %d\n", en->currentscene + 1); + MB_SPRITE_GOTO_SCENE(myApp->rootsprite,en->currentscene + 1); + rdman_redraw_all(myApp->rdman); } int main(int argc, char * const argv[]) { diff -r 6c6b62d342ee -r d36abace2ce4 tools/mb_c_source.m4 --- a/tools/mb_c_source.m4 Wed Dec 31 22:39:28 2008 +0800 +++ b/tools/mb_c_source.m4 Wed Dec 31 23:50:53 2008 +0800 @@ -392,7 +392,7 @@ if(sprite->last_scene) { p = sprite->last_scene; while(*p != 0) { - coord = (coord_t *)MB_SPRITE_OFF_2_PTR(sprite, *p); + coord = *(coord_t **)MB_SPRITE_OFF_2_PTR(sprite, *p); coord_hide(coord); rdman_coord_changed(sprite->rdman, coord); p++; @@ -407,7 +407,7 @@ scene = $1_scenes[scene_no]; p = scene; while(*p != 0) { - coord = (coord_t *)MB_SPRITE_OFF_2_PTR(sprite, *p); + coord = *(coord_t **)MB_SPRITE_OFF_2_PTR(sprite, *p); coord_show(coord); rdman_coord_changed(sprite->rdman, coord); p++;