summaryrefslogtreecommitdiffstats
path: root/src/save/PCSave.h
blob: 4a2d9a667841080d435d6a2b25d49381376a394c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

enum eSaveStatus
{
	SAVESTATUS_SUCCESSFUL = 0,
	SAVESTATUS_ERR_SAVE_CREATE,
	SAVESTATUS_ERR_SAVE_WRITE,
	SAVESTATUS_ERR_SAVE_CLOSE,
	SAVESTATUS_ERR_LOAD_OPEN,
	SAVESTATUS_ERR_LOAD_READ,
	SAVESTATUS_ERR_LOAD_CLOSE,
	SAVESTATUS_ERR_DATA_INVALID,

	// unused
	SAVESTATUS_DELETEFAILED8,
	SAVESTATUS_DELETEFAILED9,
	SAVESTATUS_DELETEFAILED10,
};

enum
{
	SLOT_OK = 0,
	SLOT_EMPTY,
	SLOT_CORRUPTED
};

class C_PcSave
{
public:
	eSaveStatus nErrorCode;

	C_PcSave() : nErrorCode(SAVESTATUS_SUCCESSFUL) {}
	void PopulateSlotInfo();
	bool DeleteSlot(int32 slot);
	bool SaveSlot(int32 slot);
	bool PcClassSaveRoutine(int32 a2, uint8 *data, uint32 size);
	static void SetSaveDirectory(const char *path);
};

extern C_PcSave PcSaveHelper;