diff examples/example-ui/main.c @ 298:196264679079

misc: remove usage of bool
author David Demelier <markand@malikania.fr>
date Wed, 10 Mar 2021 18:49:08 +0100
parents 76afe639fd72
children 3638b39ef2bf
line wrap: on
line diff
--- a/examples/example-ui/main.c	Wed Mar 10 18:49:00 2021 +0100
+++ b/examples/example-ui/main.c	Wed Mar 10 18:49:08 2021 +0100
@@ -65,7 +65,7 @@
 	struct action_stack st;
 
 	struct {
-		bool active;
+		int active;
 		int x;
 		int y;
 	} motion;
@@ -129,9 +129,9 @@
 static void
 init(void)
 {
-	if (!core_init("fr.malikania", "ui") || !ui_init())
+	if (core_init("fr.malikania", "ui") < 0 || ui_init() < 0)
 		panic();
-	if (!window_open("Example - UI", W, H))
+	if (window_open("Example - UI", W, H) < 0)
 		panic();
 }
 
@@ -213,7 +213,7 @@
 	action_stack_add(&ui.st, &ui.quit.act);
 }
 
-static bool
+static int
 headerclick(int x, int y)
 {
 	return maths_is_boxed(
@@ -246,7 +246,7 @@
 		break;
 	case EVENT_CLICKDOWN:
 		if (headerclick(ev->click.x, ev->click.y)) {
-			ui.motion.active = true;
+			ui.motion.active = 1;
 			ui.motion.x = ev->click.x;
 			ui.motion.y = ev->click.y;
 			window_set_cursor(WINDOW_CURSOR_SIZE);
@@ -255,7 +255,7 @@
 			action_stack_handle(&ui.st, ev);
 		break;
 	case EVENT_CLICKUP:
-		ui.motion.active = false;
+		ui.motion.active = 0;
 		window_set_cursor(WINDOW_CURSOR_ARROW);
 		/* Fallthrough. */
 	default:
@@ -298,7 +298,7 @@
 	prepare();
 	resize();
 
-	game_switch(&state, true);
+	game_switch(&state, 1);
 	game_loop();
 }