From: Randy McShandy Date: Sun, 10 Aug 2025 00:07:10 +0000 (-0500) Subject: Load Game main menu option working. X-Git-Url: http://git.mcshandy.xyz/gitweb.cgi?a=commitdiff_plain;h=4247ffb89ae96123722fd6ee2e04563067c14d6b;p=barrow_crawler Load Game main menu option working. --- diff --git a/src/menufuncs.c b/src/menufuncs.c index 1b95b6b..388e869 100644 --- a/src/menufuncs.c +++ b/src/menufuncs.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "structs.h" @@ -24,8 +25,24 @@ bool menu_action_MI_LOAD_GAME() { bool response = false; + ProcessInfo* process = &processes[SAVE_FILE_LOAD]; + process->state = WAITING; + const int success = load_game(); + if ((success == 0 ) && timers[STATUS_TEXT_FADE_TIME].time == 0.0) + { + process->state = FINISHED; + } + else if (success != 0) + { + process->state = BAD; + } + + memcpy(text_places[STATUS_TEXT_PLACE], process->info_text[process->state], 64); + timers[STATUS_TEXT_FADE_TIME].time = timers[STATUS_TEXT_FADE_TIME].max; + + resource_state = CONTROL_RESOURCE_READY; return response; } diff --git a/src/render_raylib.c b/src/render_raylib.c index 658ebc8..3877989 100644 --- a/src/render_raylib.c +++ b/src/render_raylib.c @@ -569,7 +569,7 @@ void initialize_renderer() cam_reset_position.y = 1.0f; /* if not loading a save */ - if (1) + if (processes[SAVE_FILE_LOAD].state == UNKNOWN) { playtime.cam = (Camera3D){0}; playtime.cam.position = cam_reset_position; @@ -581,7 +581,7 @@ void initialize_renderer() } else { - /* Load a save */ + /* Use data from save */ } /*