0
|
1 #include <io.h>
|
|
2 #include <direct.h>
|
|
3
|
|
4 #include "SaveLoad.h"
|
|
5
|
|
6 #include "mm7_data.h"
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
3
|
12 struct SavegameList *pSavegameList = new SavegameList;
|
0
|
13 unsigned int uNumSavegameFiles;
|
|
14 unsigned int pSavegameUsedSlots[45];
|
3
|
15 struct RGBTexture *pSavegameThumbnails = new RGBTexture[45];
|
|
16 SavegameHeader *pSavegameHeader = new SavegameHeader[45];
|
0
|
17
|
|
18
|
|
19
|
|
20 //----- (0045E297) --------------------------------------------------------
|
3
|
21 void SavegameList::Initialize(unsigned int bHideEmptySlots)
|
0
|
22 {
|
|
23 uNumSavegameFiles = 0;
|
3
|
24
|
|
25 _chdir("saves");
|
0
|
26 {
|
3
|
27 if (!bHideEmptySlots && _access(pGlobalTXT_LocalizationStrings[613], 0) != -1 )
|
|
28 strcpy(pSavesNames[uNumSavegameFiles++], pGlobalTXT_LocalizationStrings[613]);
|
|
29
|
|
30 for (uint i = 0; i < 40; ++i)
|
0
|
31 {
|
3
|
32 sprintf(pTmpBuf, "save%03d.mm7", i);
|
|
33 if (_access(pTmpBuf, 0) == -1)
|
|
34 continue;
|
|
35
|
|
36 uint idx = i;
|
|
37 if (!bHideEmptySlots)
|
|
38 idx = uNumSavegameFiles;
|
|
39 strcpy(pSavesNames[idx], pTmpBuf);
|
|
40
|
0
|
41 ++uNumSavegameFiles;
|
|
42 }
|
|
43 }
|
|
44 _chdir("..");
|
|
45 } |