mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
savegame: move common module
This commit is contained in:
parent
962e87a9e6
commit
e7c193a106
4 changed files with 21 additions and 18 deletions
|
@ -1,5 +1,4 @@
|
|||
#include "game/savegame.h"
|
||||
|
||||
#include "log.h"
|
||||
|
||||
static int32_t m_BoundSlot = -1;
|
|
@ -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);
|
||||
|
|
19
src/libtrx/include/libtrx/game/savegame/common.h
Normal file
19
src/libtrx/include/libtrx/game/savegame/common.h
Normal 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);
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue