savegame: move common module

This commit is contained in:
lahm86 2025-04-08 19:38:06 +01:00
parent 962e87a9e6
commit e7c193a106
4 changed files with 21 additions and 18 deletions

View file

@ -1,5 +1,4 @@
#include "game/savegame.h"
#include "log.h"
static int32_t m_BoundSlot = -1;

View file

@ -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);

View file

@ -0,0 +1,19 @@
#pragma once
#include <stdint.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);

View file

@ -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',