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
|
|
12 unsigned int uNumSavegameFiles;
|
|
13 unsigned int pSavegameUsedSlots[45];
|
|
14 struct SavegameList *pSavegameList;
|
|
15 struct RGBTexture *pSavegameThumbnails;
|
|
16
|
|
17
|
|
18
|
|
19 //----- (0045E297) --------------------------------------------------------
|
|
20 void SavegameList::Initialize(unsigned int a1)
|
|
21 {
|
|
22 signed int v1; // edi@4
|
|
23 unsigned int v2; // eax@6
|
|
24 unsigned int v3; // [sp+10h] [bp-4h]@1
|
|
25
|
|
26 v3 = a1;
|
|
27 memset(&pSavegameList, 0, 0x3138u);
|
|
28 _chdir("saves");
|
|
29 uNumSavegameFiles = 0;
|
|
30 if ( !v3 && _access(pGlobalTXT_LocalizationStrings[613], 0) != -1 )
|
|
31 strcpy(pSavegameList->pSavesNames[uNumSavegameFiles++], pGlobalTXT_LocalizationStrings[613]);
|
|
32 v1 = 0;
|
|
33 do
|
|
34 {
|
|
35 sprintfex(pTmpBuf, "save%03d.mm7", v1);
|
|
36 if ( _access(pTmpBuf, 0) != -1 )
|
|
37 {
|
|
38 v2 = v1;
|
|
39 if ( !v3 )
|
|
40 v2 = uNumSavegameFiles;
|
|
41 strcpy(pSavegameList->pSavesNames[v2], pTmpBuf);
|
|
42 ++uNumSavegameFiles;
|
|
43 }
|
|
44 ++v1;
|
|
45 }
|
|
46 while ( v1 < 40 );
|
|
47 _chdir("..");
|
|
48 } |