@@ -59,6 +59,7 @@ typedef struct {
5959 SDL_Surface * logo_surface ;
6060 SDL_Texture * logo_texture ;
6161 int current_scene ;
62+ int current_scene_index ; /* Index into scene_list */
6263 int fixed_scene ;
6364 float time ;
6465 float global_time ;
@@ -67,6 +68,8 @@ typedef struct {
6768 ScrollStyle scroll_style ;
6869 Star stars [NUM_STARS ];
6970 Uint32 scene_duration ; /* Milliseconds per scene */
71+ int scene_list [6 ]; /* Custom scene order */
72+ int num_scenes ; /* Number of scenes in list */
7073} DemoContext ;
7174
7275/* Plasma effect - optimized with lower resolution and LUT */
@@ -851,6 +854,7 @@ int main(int argc, char *argv[])
851854
852855 DemoContext ctx = {0 };
853856 ctx .fixed_scene = -1 ; /* -1 means auto-switch scenes */
857+ ctx .current_scene_index = 0 ;
854858 int scene_list [6 ];
855859 int num_scenes = 0 ;
856860
@@ -922,12 +926,25 @@ int main(int argc, char *argv[])
922926 /* Single scene - fix to that scene */
923927 ctx .fixed_scene = scene_list [0 ];
924928 ctx .current_scene = scene_list [0 ];
929+ ctx .num_scenes = 0 ; /* Fixed scene, no list */
925930 } else if (num_scenes > 1 ) {
926- /* Multiple scenes specified - use first as starting point */
927- ctx .current_scene = scene_list [0 ];
928- /* TODO: Implement custom scene cycling through scene_list */
929- fprintf (stderr , "Note: Multiple scene cycling not yet implemented, using first scene only\n" );
930- ctx .fixed_scene = scene_list [0 ];
931+ /* Multiple scenes specified - cycle through custom list */
932+ for (int i = 0 ; i < num_scenes ; i ++ ) {
933+ ctx .scene_list [i ] = scene_list [i ];
934+ }
935+ ctx .num_scenes = num_scenes ;
936+ ctx .current_scene_index = 0 ;
937+ ctx .current_scene = ctx .scene_list [0 ];
938+ } else {
939+ /* No scenes specified - use default list (skip scene 4) */
940+ ctx .scene_list [0 ] = 0 ;
941+ ctx .scene_list [1 ] = 1 ;
942+ ctx .scene_list [2 ] = 2 ;
943+ ctx .scene_list [3 ] = 3 ;
944+ ctx .scene_list [4 ] = 5 ;
945+ ctx .num_scenes = 5 ;
946+ ctx .current_scene_index = 0 ;
947+ ctx .current_scene = ctx .scene_list [0 ];
931948 }
932949
933950 ctx .window = SDL_CreateWindow ("Infix Container Demo" ,
@@ -1089,10 +1106,10 @@ int main(int argc, char *argv[])
10891106 } else if (fade_progress < 2.0f ) {
10901107 /* Switch scene and fade in */
10911108 if (ctx .fade_alpha < 0.5f ) {
1092- /* Skip scene 4 (bouncing logo - hidden scene) */
1093- ctx . current_scene = (ctx .current_scene + 1 ) % 6 ;
1094- if (ctx .current_scene == 4 ) {
1095- ctx .current_scene = 5 ; /* Jump to raining logo instead */
1109+ /* Advance to next scene in the list */
1110+ if (ctx .num_scenes > 0 ) {
1111+ ctx . current_scene_index = (ctx .current_scene_index + 1 ) % ctx . num_scenes ;
1112+ ctx .current_scene = ctx . scene_list [ ctx . current_scene_index ];
10961113 }
10971114 scene_start = current_time - (Uint32 )fade_duration ;
10981115 ctx .time = 0 ;
0 commit comments