Changed texture transparent color to 0x0001 for future compatibility with fxsdk and gint. Added error handling for display update and other functions.
This commit is contained in:
parent
434cc4fd4e
commit
44a3cec957
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5ba0ff9be3ad150f89a01a7941382b86320b46d3
|
Subproject commit 519ae78ada36b922c64de8d37571db8d0ba0c944
|
||||||
|
|
@ -27,7 +27,7 @@ For the moment each input file is openend and analized 2 times.
|
||||||
|
|
||||||
## Image (.png)
|
## 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.
|
If png's alpha is null then the color of the pixel will be replaced with this.
|
||||||
|
|
||||||
### Image asset data structure
|
### Image asset data structure
|
||||||
|
|
|
||||||
|
|
@ -186,9 +186,9 @@ int parse_png_for_content_and_write(const char *input_file_name, FILE *output_fi
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r = 0x1F;
|
r = 0x00;
|
||||||
g = 0x00;
|
g = 0x00;
|
||||||
b = 0x1F;
|
b = 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t pixel = ((r) << 11) | ((g) << 5) | b;
|
uint16_t pixel = ((r) << 11) | ((g) << 5) | b;
|
||||||
|
|
|
||||||
12
src/game.c
12
src/game.c
|
|
@ -15,9 +15,9 @@ int game_init(void)
|
||||||
game.is_running = false;
|
game.is_running = false;
|
||||||
|
|
||||||
if(display_init()) return_failure_int;
|
if(display_init()) return_failure_int;
|
||||||
if(asset_manager_init()) return_failure_int;
|
|
||||||
event_bus_init();
|
event_bus_init();
|
||||||
entity_manager_init();
|
entity_manager_init();
|
||||||
|
if(asset_manager_init()) return_failure_int;
|
||||||
|
|
||||||
if(!asset_manager_load_asset("tileset", ASSET_TEXTURE)) 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;
|
return_failure_int;
|
||||||
}
|
}
|
||||||
|
|
||||||
display_update();
|
if(display_update())
|
||||||
|
{
|
||||||
|
game.is_running = false;
|
||||||
|
return_failure_int;
|
||||||
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
@ -153,8 +157,8 @@ int game_render(void)
|
||||||
int game_exit(void)
|
int game_exit(void)
|
||||||
{
|
{
|
||||||
if(asset_manager_exit()) return_failure_int;
|
if(asset_manager_exit()) return_failure_int;
|
||||||
entity_manager_exit();
|
if(entity_manager_exit()) return_failure_int;
|
||||||
event_bus_exit();
|
if(event_bus_exit()) return_failure_int;
|
||||||
display_exit();
|
display_exit();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue