diff --git a/src/libtrx/game/savegame.c b/src/libtrx/game/savegame/common.c similarity index 99% rename from src/libtrx/game/savegame.c rename to src/libtrx/game/savegame/common.c index e6b29488c..06d4a12db 100644 --- a/src/libtrx/game/savegame.c +++ b/src/libtrx/game/savegame/common.c @@ -1,5 +1,4 @@ #include "game/savegame.h" - #include "log.h" static int32_t m_BoundSlot = -1; diff --git a/src/libtrx/include/libtrx/game/savegame.h b/src/libtrx/include/libtrx/game/savegame.h index b9a46e29f..ac83fd6bd 100644 --- a/src/libtrx/include/libtrx/game/savegame.h +++ b/src/libtrx/include/libtrx/game/savegame.h @@ -1,21 +1,6 @@ #pragma once +#include "./savegame/common.h" #include "./savegame/const.h" #include "./savegame/enum.h" #include "./savegame/types.h" - -// Remembers the slot used when the player starts a loaded game. -// Persists across level reloads. -void Savegame_BindSlot(int32_t slot_num); - -// Removes the binding of the current slot. Used when the player exits to -// title, issues a command like `/play` etc. -void Savegame_UnbindSlot(void); - -// Returns the currently bound slot number. If there is none, returns -1. -int32_t Savegame_GetBoundSlot(void); - -extern int32_t Savegame_GetSlotCount(void); -extern bool Savegame_IsSlotFree(int32_t slot_num); -extern bool Savegame_Load(int32_t slot_num); -extern bool Savegame_Save(int32_t slot_num); diff --git a/src/libtrx/include/libtrx/game/savegame/common.h b/src/libtrx/include/libtrx/game/savegame/common.h new file mode 100644 index 000000000..f2a4225f6 --- /dev/null +++ b/src/libtrx/include/libtrx/game/savegame/common.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +// Remembers the slot used when the player starts a loaded game. +// Persists across level reloads. +void Savegame_BindSlot(int32_t slot_num); + +// Removes the binding of the current slot. Used when the player exits to +// title, issues a command like `/play` etc. +void Savegame_UnbindSlot(void); + +// Returns the currently bound slot number. If there is none, returns -1. +int32_t Savegame_GetBoundSlot(void); + +extern int32_t Savegame_GetSlotCount(void); +extern bool Savegame_IsSlotFree(int32_t slot_num); +extern bool Savegame_Load(int32_t slot_num); +extern bool Savegame_Save(int32_t slot_num); diff --git a/src/libtrx/meson.build b/src/libtrx/meson.build index b4cc7b9da..c385ab3ea 100644 --- a/src/libtrx/meson.build +++ b/src/libtrx/meson.build @@ -189,7 +189,7 @@ sources = [ 'game/random.c', 'game/rooms/common.c', 'game/rooms/draw.c', - 'game/savegame.c', + 'game/savegame/common.c', 'game/shell/common.c', 'game/shell/main.c', 'game/sound.c',