changeset 498:41267f6e344d

examples: use mlk_example_finish
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:47:00 +0100
parents 8d5a266a1774
children d3ea59fce7dc
files examples/example-animation/example-animation.c examples/example-audio/example-audio.c examples/example-battle/example-battle.c examples/example-cursor/example-cursor.c examples/example-debug/example-debug.c examples/example-drawable/example-drawable.c examples/example-font/example-font.c examples/example-gridmenu/example-gridmenu.c examples/example-label/example-label.c examples/example-message/example-message.c examples/example-notify/example-notify.c examples/example-sprite/example-sprite.c examples/example-trace/example-trace.c examples/example-ui/example-ui.c
diffstat 14 files changed, 29 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/examples/example-animation/example-animation.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-animation/example-animation.c	Tue Feb 28 13:47:00 2023 +0100
@@ -21,7 +21,6 @@
 #include <mlk/core/event.h>
 #include <mlk/core/game.h>
 #include <mlk/core/image.h>
-#include <mlk/core/sys.h>
 #include <mlk/core/window.h>
 #include <mlk/core/painter.h>
 #include <mlk/core/panic.h>
@@ -128,9 +127,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-audio/example-audio.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-audio/example-audio.c	Tue Feb 28 13:47:00 2023 +0100
@@ -68,9 +68,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 static void
--- a/examples/example-battle/example-battle.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-battle/example-battle.c	Tue Feb 28 13:47:00 2023 +0100
@@ -324,10 +324,7 @@
 static void
 quit(void)
 {
-	registry_finish();
-	mlk_theme_finish();
-	mlk_window_finish();
-	mlk_sys_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-cursor/example-cursor.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-cursor/example-cursor.c	Tue Feb 28 13:47:00 2023 +0100
@@ -130,9 +130,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-debug/example-debug.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-debug/example-debug.c	Tue Feb 28 13:47:00 2023 +0100
@@ -95,9 +95,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-drawable/example-drawable.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-drawable/example-drawable.c	Tue Feb 28 13:47:00 2023 +0100
@@ -185,9 +185,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-font/example-font.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-font/example-font.c	Tue Feb 28 13:47:00 2023 +0100
@@ -130,9 +130,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-gridmenu/example-gridmenu.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-gridmenu/example-gridmenu.c	Tue Feb 28 13:47:00 2023 +0100
@@ -49,14 +49,6 @@
 }
 
 static void
-quit(void)
-{
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
-}
-
-static void
 handle(struct mlk_state *st, const union mlk_event *ev)
 {
 	struct mlk_gridmenu *menu = st->data;
@@ -121,6 +113,12 @@
 	mlk_game_loop();
 }
 
+static void
+quit(void)
+{
+	mlk_example_finish();
+}
+
 int
 main(int argc, char **argv)
 {
--- a/examples/example-label/example-label.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-label/example-label.c	Tue Feb 28 13:47:00 2023 +0100
@@ -122,14 +122,6 @@
 }
 
 static void
-quit(void)
-{
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
-}
-
-static void
 handle(struct mlk_state *st, const union mlk_event *ev)
 {
 	(void)st;
@@ -175,6 +167,12 @@
 	mlk_game_loop();
 }
 
+static void
+quit(void)
+{
+	mlk_example_finish();
+}
+
 int
 main(int argc, char **argv)
 {
--- a/examples/example-message/example-message.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-message/example-message.c	Tue Feb 28 13:47:00 2023 +0100
@@ -54,15 +54,6 @@
 }
 
 static void
-quit(void)
-{
-	mlk_window_finish();
-	rpg_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
-}
-
-static void
 handle(struct mlk_state *st, const union mlk_event *ev)
 {
 	switch (ev->type) {
@@ -328,6 +319,12 @@
 	run(&msg);
 }
 
+static void
+quit(void)
+{
+	mlk_example_finish();
+}
+
 int
 main(int argc, char **argv)
 {
--- a/examples/example-notify/example-notify.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-notify/example-notify.c	Tue Feb 28 13:47:00 2023 +0100
@@ -111,9 +111,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-sprite/example-sprite.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-sprite/example-sprite.c	Tue Feb 28 13:47:00 2023 +0100
@@ -143,9 +143,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-trace/example-trace.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-trace/example-trace.c	Tue Feb 28 13:47:00 2023 +0100
@@ -110,9 +110,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int
--- a/examples/example-ui/example-ui.c	Tue Feb 28 13:42:24 2023 +0100
+++ b/examples/example-ui/example-ui.c	Tue Feb 28 13:47:00 2023 +0100
@@ -269,9 +269,7 @@
 static void
 quit(void)
 {
-	mlk_window_finish();
-	mlk_ui_finish();
-	mlk_core_finish();
+	mlk_example_finish();
 }
 
 int