Fix crashes in main application
Changelog: - Fix crash on empty emitter config - Fix engine de-init order - Update assets file to load for main applicationscene_man
parent
716393e9f4
commit
4ede1abcc1
|
@ -20,6 +20,7 @@ void init_particle_system(ParticleSystem_t* system)
|
|||
void play_particle_emitter(ParticleSystem_t* system, const ParticleEmitter_t* in_emitter)
|
||||
{
|
||||
if (in_emitter == NULL) return;
|
||||
if (in_emitter->config == NULL) return;
|
||||
|
||||
if (sc_queue_empty(&system->free_list)) return;
|
||||
uint32_t idx = sc_queue_del_first(&system->free_list);
|
||||
|
|
4
main.c
4
main.c
|
@ -28,7 +28,7 @@ int main(void)
|
|||
InitWindow(screenWidth, screenHeight, "raylib");
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
#ifndef NDEBUG
|
||||
load_from_infofile("res/assets_debug.info", &engine.assets);
|
||||
load_from_infofile("res/assets.info.raw", &engine.assets);
|
||||
init_player_creation("res/player_spr.info", &engine.assets);
|
||||
#else
|
||||
load_from_rres("res/myresources.rres", &engine.assets);
|
||||
|
@ -92,6 +92,6 @@ int main(void)
|
|||
free_sandbox_scene(&sandbox_scene);
|
||||
free_game_scene(&level_scene);
|
||||
free_menu_scene(&menu_scene);
|
||||
CloseWindow();
|
||||
deinit_engine(&engine);
|
||||
CloseWindow();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue