From 8329d42d3e592f4cd42cdfa586e2325ddc76c898 Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 10 Mar 2026 01:35:50 +0100 Subject: perf profiler, simplify 2d render, string struct, many small things --- src/main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5d70ef8..451c014 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,6 @@ #include "game.h" #include "game/assets.h" -// disable new_delete_type_mismatch asan warning #ifndef __has_feature #define __has_feature(feature) 0 #endif @@ -16,7 +15,7 @@ I32* canvas; GAME_DATA* game; GL_DATA* gl; -void loop() { +U8 loop() { static U8 init = 0; if( !init || !gl ) { @@ -27,10 +26,10 @@ void loop() { game = game_init( gl ); init = 1; - return; + return 0; } - game_main_loop( game ); + return game_main_loop( game ); } int main(int argc, char* argv[]) { @@ -40,8 +39,8 @@ int main(int argc, char* argv[]) { canvas[0] = 800; canvas[1] = 600; - while( true ) { - loop(); + for( ;; ) { + if( loop() ) break; } game_destroy( game ); -- cgit v1.2.3