From 44a3cec957d8cf7afaadefcb530f15a26e27e7a7 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Mon, 17 Aug 2026 19:47:04 +0200 Subject: [PATCH] Changed texture transparent color to 0x0001 for future compatibility with fxsdk and gint. Added error handling for display update and other functions. --- SDL3_Core | 2 +- assets/asset_builder/README.md | 2 +- assets/asset_builder/src/image.c | 4 ++-- src/game.c | 12 ++++++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/SDL3_Core b/SDL3_Core index 5ba0ff9..519ae78 160000 --- a/SDL3_Core +++ b/SDL3_Core @@ -1 +1 @@ -Subproject commit 5ba0ff9be3ad150f89a01a7941382b86320b46d3 +Subproject commit 519ae78ada36b922c64de8d37571db8d0ba0c944 diff --git a/assets/asset_builder/README.md b/assets/asset_builder/README.md index 31b9b96..b8d76f7 100644 --- a/assets/asset_builder/README.md +++ b/assets/asset_builder/README.md @@ -27,7 +27,7 @@ For the moment each input file is openend and analized 2 times. ## Image (.png) -Convert png's RGBA8888 to custom RGB565 with #FF00FF (or #F81F in RGB565) as the transparent color. +Convert png's RGBA8888 to custom RGB565 with #0001 in RGB565 as the transparent color. If png's alpha is null then the color of the pixel will be replaced with this. ### Image asset data structure diff --git a/assets/asset_builder/src/image.c b/assets/asset_builder/src/image.c index 2f85a51..1e41dbc 100644 --- a/assets/asset_builder/src/image.c +++ b/assets/asset_builder/src/image.c @@ -186,9 +186,9 @@ int parse_png_for_content_and_write(const char *input_file_name, FILE *output_fi } else { - r = 0x1F; + r = 0x00; g = 0x00; - b = 0x1F; + b = 0x01; } uint16_t pixel = ((r) << 11) | ((g) << 5) | b; diff --git a/src/game.c b/src/game.c index 24293e1..72f29ed 100644 --- a/src/game.c +++ b/src/game.c @@ -15,9 +15,9 @@ int game_init(void) game.is_running = false; if(display_init()) return_failure_int; - if(asset_manager_init()) return_failure_int; event_bus_init(); entity_manager_init(); + if(asset_manager_init()) return_failure_int; if(!asset_manager_load_asset("tileset", ASSET_TEXTURE)) return_failure_int; @@ -145,7 +145,11 @@ int game_render(void) return_failure_int; } - display_update(); + if(display_update()) + { + game.is_running = false; + return_failure_int; + } return EXIT_SUCCESS; } @@ -153,8 +157,8 @@ int game_render(void) int game_exit(void) { if(asset_manager_exit()) return_failure_int; - entity_manager_exit(); - event_bus_exit(); + if(entity_manager_exit()) return_failure_int; + if(event_bus_exit()) return_failure_int; display_exit(); return EXIT_SUCCESS;