diff libmlk-adventure/adventure/molko.c @ 299:648f5f949afb

core: implement stackable states
author David Demelier <markand@malikania.fr>
date Sun, 11 Apr 2021 16:41:34 +0200
parents 196264679079
children 363024b76da7
line wrap: on
line diff
--- a/libmlk-adventure/adventure/molko.c	Wed Mar 10 18:49:08 2021 +0100
+++ b/libmlk-adventure/adventure/molko.c	Sun Apr 11 16:41:34 2021 +0200
@@ -85,7 +85,7 @@
 	assets_init();
 
 	/* Start to splash. */
-	game_switch(state_mainmenu_new(), 1);
+	game_push(state_mainmenu_new());
 	molko.team.members[0] = &character_neth;
 	molko.team.members[1] = &character_neth;
 	inventory_add(&molko.inventory, &item_potion, 100);
@@ -108,7 +108,7 @@
 		for (union event ev; event_poll(&ev); )
 			continue;
 
-		game_switch(molko.panic, 1);
+		game_push(molko.panic);
 		game_loop();
 	}
 }
@@ -118,7 +118,7 @@
 {
 	molko.state = MOLKO_STATE_MAP;
 
-	game_switch(state_map_new(map, origin_x, origin_y), 0);
+	game_push(state_map_new(map, origin_x, origin_y));
 	game.inhibit = INHIBIT_NONE;
 }
 
@@ -127,7 +127,7 @@
 {
 	molko.state = MOLKO_STATE_BATTLE;
 
-	game_switch(state_battle_new(bt), 0);
+	game_push(state_battle_new(bt));
 }
 
 const char *