annotate SaveLoad.cpp @ 7:1200e31f08e5

10.10.12
author Серик@ПончиК
date Wed, 10 Oct 2012 21:05:53 +0600
parents 8b8875f5b359
children 540178ef9b18
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <io.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include <direct.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "SaveLoad.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 unsigned int uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 unsigned int pSavegameUsedSlots[45];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 struct SavegameList *pSavegameList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 struct RGBTexture *pSavegameThumbnails;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 //----- (0045E297) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 void SavegameList::Initialize(unsigned int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 signed int v1; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 unsigned int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 unsigned int v3; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 memset(&pSavegameList, 0, 0x3138u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 _chdir("saves");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 uNumSavegameFiles = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 if ( !v3 && _access(pGlobalTXT_LocalizationStrings[613], 0) != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 strcpy(pSavegameList->pSavesNames[uNumSavegameFiles++], pGlobalTXT_LocalizationStrings[613]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 sprintfex(pTmpBuf, "save%03d.mm7", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 if ( _access(pTmpBuf, 0) != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 v2 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 v2 = uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 strcpy(pSavegameList->pSavesNames[v2], pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 ++uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 while ( v1 < 40 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 _chdir("..");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 }