annotate GameUIs.cpp @ 107:ccc0cf95706a

Слияние
author Ritor1
date Mon, 05 Nov 2012 09:16:17 +0600
parents 6c42178c226e
children 062e8a8e09bc
rev   line source
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
1 #include <direct.h>
4acbadf78023 missing file added
Nomad
parents:
diff changeset
2 #include <io.h>
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
3 #include <assert.h>
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
5 #include "GUIWindow.h"
4acbadf78023 missing file added
Nomad
parents:
diff changeset
6 #include "GUIFont.h"
4acbadf78023 missing file added
Nomad
parents:
diff changeset
7 #include "LOD.h"
4acbadf78023 missing file added
Nomad
parents:
diff changeset
8 #include "SaveLoad.h"
4acbadf78023 missing file added
Nomad
parents:
diff changeset
9 #include "Render.h"
4acbadf78023 missing file added
Nomad
parents:
diff changeset
10
4acbadf78023 missing file added
Nomad
parents:
diff changeset
11 #include "mm7_data.h"
4acbadf78023 missing file added
Nomad
parents:
diff changeset
12
4acbadf78023 missing file added
Nomad
parents:
diff changeset
13
4acbadf78023 missing file added
Nomad
parents:
diff changeset
14 //----- (0045E361) --------------------------------------------------------
4acbadf78023 missing file added
Nomad
parents:
diff changeset
15 void __fastcall GameUI_DrawLoadMenu(unsigned int uDialogueType)
4acbadf78023 missing file added
Nomad
parents:
diff changeset
16 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
17 unsigned int v1; // ebp@5
4acbadf78023 missing file added
Nomad
parents:
diff changeset
18 unsigned int v2; // eax@5
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
19 //signed int v3; // ebp@11
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
20 FILE *v4; // eax@14
4acbadf78023 missing file added
Nomad
parents:
diff changeset
21 FILE *v5; // eax@18
4acbadf78023 missing file added
Nomad
parents:
diff changeset
22 unsigned int v6; // eax@25
4acbadf78023 missing file added
Nomad
parents:
diff changeset
23 GUIButton *v7; // eax@27
4acbadf78023 missing file added
Nomad
parents:
diff changeset
24 const char *v8; // [sp-8h] [bp-26Ch]@25
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
25 //char *v9; // [sp-4h] [bp-268h]@19
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
26 enum TEXTURE_TYPE v10; // [sp-4h] [bp-268h]@25
4acbadf78023 missing file added
Nomad
parents:
diff changeset
27 unsigned int uDialogueType_; // [sp+10h] [bp-254h]@1
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
28 //RGBTexture *pTex; // [sp+10h] [bp-254h]@12
6c42178c226e minor things
Nomad
parents: 80
diff changeset
29 //SavegameHeader *Dest; // [sp+14h] [bp-250h]@12
6c42178c226e minor things
Nomad
parents: 80
diff changeset
30 //const char *Str1; // [sp+18h] [bp-24Ch]@12
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
31 LODWriteableFile v15; // [sp+1Ch] [bp-248h]@1
4acbadf78023 missing file added
Nomad
parents:
diff changeset
32 int v16; // [sp+260h] [bp-4h]@1
4acbadf78023 missing file added
Nomad
parents:
diff changeset
33
4acbadf78023 missing file added
Nomad
parents:
diff changeset
34 uDialogueType_ = uDialogueType;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
35 dword_6BE138 = -1;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
36 ++pIcons_LOD->uTexturePacksCount;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
37 v16 = 0;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
38 if ( !pIcons_LOD->uNumPrevLoadedFiles )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
39 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
40
4acbadf78023 missing file added
Nomad
parents:
diff changeset
41 memset(pSavegameUsedSlots, 0, 45 * sizeof(int));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
42 memset(pSavegameThumbnails, 0, 45 * sizeof(RGBTexture));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
43
4acbadf78023 missing file added
Nomad
parents:
diff changeset
44 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
45 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
46 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
47 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
48 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
49 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
50 if ( uDialogueType_ )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
51 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
52 pRenderer->DrawTextureIndexed(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
53 8u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
54 8u,
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
55 (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 4
diff changeset
56 if ( pCurrentScreen == 11 )
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
57 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
58 v1 = uTextureID_save_up;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
59 v2 = uTextureID_LS_saveU;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
60 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
61 else
4acbadf78023 missing file added
Nomad
parents:
diff changeset
62 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
63 v1 = uTextureID_load_up;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
64 v2 = uTextureID_LS_loadU;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
65 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
66 pRenderer->DrawTextureIndexed(241u, 302u, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
67 pRenderer->DrawTextureIndexed(18u, 141u, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
68 pRenderer->DrawTextureIndexed(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
69 351u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
70 302u,
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
71 (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
72 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
73 else
4acbadf78023 missing file added
Nomad
parents:
diff changeset
74 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 4
diff changeset
75 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
76 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
77 pGUIWindow_CurrentMenu = GUIWindow::Create(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
78 saveload_dlg_xs[uDialogueType_],
4acbadf78023 missing file added
Nomad
parents:
diff changeset
79 saveload_dlg_ys[uDialogueType_],
4acbadf78023 missing file added
Nomad
parents:
diff changeset
80 saveload_dlg_zs[uDialogueType_],
4acbadf78023 missing file added
Nomad
parents:
diff changeset
81 saveload_dlg_ws[uDialogueType_],
4acbadf78023 missing file added
Nomad
parents:
diff changeset
82 WINDOW_MainMenu_Load,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
83 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
84 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
85 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..."
4acbadf78023 missing file added
Nomad
parents:
diff changeset
86 pRenderer->Present();
4acbadf78023 missing file added
Nomad
parents:
diff changeset
87 pSavegameList->Initialize(0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
88 if ( dword_6A0C9C > (signed int)uNumSavegameFiles )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
89 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
90 dword_6A0C9C = 0;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
91 uLoadGameUI_SelectedSlot = 0;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
92 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
93 v15.AllocSubIndicesAndIO(0x12Cu, 0);
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
95 assert(sizeof(SavegameHeader) == 0x64);
6c42178c226e minor things
Nomad
parents: 80
diff changeset
96
6c42178c226e minor things
Nomad
parents: 80
diff changeset
97 //v3 = 0;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
98 for (uint i = 0; i < uNumSavegameFiles; ++i)
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
99 {
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
100 //Dest = pSavegameHeader;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
101 //pTex = pSavegameThumbnails;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
102 //Str1 = (const char *)pSavegameList->pSavesNames;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
103 //while ( 1 )
6c42178c226e minor things
Nomad
parents: 80
diff changeset
104 //{
6c42178c226e minor things
Nomad
parents: 80
diff changeset
105 sprintf(pTmpBuf, "saves\\%s", pSavegameList->pSavesNames[i]);
6c42178c226e minor things
Nomad
parents: 80
diff changeset
106 if (_access(pTmpBuf, 6))
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
107 {
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
108 pSavegameUsedSlots[i] = 0;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
109 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty"
6c42178c226e minor things
Nomad
parents: 80
diff changeset
110 continue;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
111 }
6c42178c226e minor things
Nomad
parents: 80
diff changeset
112
6c42178c226e minor things
Nomad
parents: 80
diff changeset
113 v15.LoadFile(pTmpBuf, 1);
6c42178c226e minor things
Nomad
parents: 80
diff changeset
114 v4 = v15.FindContainer("header.bin", true);
6c42178c226e minor things
Nomad
parents: 80
diff changeset
115 if ( v4 )
6c42178c226e minor things
Nomad
parents: 80
diff changeset
116 fread(&pSavegameHeader[i], 0x64u, 1u, v4);
6c42178c226e minor things
Nomad
parents: 80
diff changeset
117 if ( !_strcmpi(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7"
6c42178c226e minor things
Nomad
parents: 80
diff changeset
118 strcpy(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[16]);// "Autosave"
6c42178c226e minor things
Nomad
parents: 80
diff changeset
119
6c42178c226e minor things
Nomad
parents: 80
diff changeset
120 v5 = v15.FindContainer("image.pcx", true);
6c42178c226e minor things
Nomad
parents: 80
diff changeset
121 if ( !v5 )
6c42178c226e minor things
Nomad
parents: 80
diff changeset
122 {
6c42178c226e minor things
Nomad
parents: 80
diff changeset
123 pSavegameUsedSlots[i] = 0;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
124 strcpy(pSavegameList->pSavesNames[i], "");
6c42178c226e minor things
Nomad
parents: 80
diff changeset
125 }
6c42178c226e minor things
Nomad
parents: 80
diff changeset
126 else
6c42178c226e minor things
Nomad
parents: 80
diff changeset
127 {
6c42178c226e minor things
Nomad
parents: 80
diff changeset
128 pSavegameThumbnails[i].LoadFromFILE(v5, 0, true);
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
129 v15.CloseWriteFile();
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
130 pSavegameUsedSlots[i] = 1;
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
131 }
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
132 //LABEL_23:
6c42178c226e minor things
Nomad
parents: 80
diff changeset
133 //Str1 += 280;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
134 //++pTex;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
135 //++Dest;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
136 //++v3;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
137 //if ( v3 >= (signed int)uNumSavegameFiles )
6c42178c226e minor things
Nomad
parents: 80
diff changeset
138 // goto LABEL_24;
6c42178c226e minor things
Nomad
parents: 80
diff changeset
139 //}
6c42178c226e minor things
Nomad
parents: 80
diff changeset
140 //goto LABEL_22;
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
141 }
94
6c42178c226e minor things
Nomad
parents: 80
diff changeset
142
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
143 LABEL_24:
4acbadf78023 missing file added
Nomad
parents:
diff changeset
144 v15.FreeSubIndexAndIO();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 4
diff changeset
145 if ( pCurrentScreen == 11 )
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
146 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
147 v6 = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
148 v10 = (TEXTURE_TYPE)2;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
149 v8 = "LS_saveD";
4acbadf78023 missing file added
Nomad
parents:
diff changeset
150 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
151 else
4acbadf78023 missing file added
Nomad
parents:
diff changeset
152 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
153 v6 = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
154 v10 = (TEXTURE_TYPE)2;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
155 v8 = "LS_loadD";
4acbadf78023 missing file added
Nomad
parents:
diff changeset
156 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
157 uTextureID_x_d = v6;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
158 uTextureID_LS_ = pIcons_LOD->LoadTexture(v8, v10);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
159 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
160 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE);
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
161 pGUIWindow_CurrentMenu->CreateButton(21u, 198u, 191u, 18u, 1, 0, 0xA5u, 0, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
162 pGUIWindow_CurrentMenu->CreateButton(21u, 219u, 191u, 18u, 1, 0, 0xA5u, 1u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
163 pGUIWindow_CurrentMenu->CreateButton(21u, 240u, 191u, 18u, 1, 0, 0xA5u, 2u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
164 pGUIWindow_CurrentMenu->CreateButton(21u, 261u, 191u, 18u, 1, 0, 0xA5u, 3u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
165 pGUIWindow_CurrentMenu->CreateButton(21u, 282u, 191u, 18u, 1, 0, 0xA5u, 4u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
166 pGUIWindow_CurrentMenu->CreateButton(21u, 303u, 191u, 18u, 1, 0, 0xA5u, 5u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
167 pGUIWindow_CurrentMenu->CreateButton(21u, 324u, 191u, 18u, 1, 0, 0xA5u, 6u, 0, "", 0);
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
168 ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
169 241u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
170 302u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
171 105u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
172 40u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
173 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
174 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
175 0xA4u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
176 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
177 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
178 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
179 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
180 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
181 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
182 350u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
183 302u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
184 105u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
185 40u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
186 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
187 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
188 0xA6u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
189 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
190 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
191 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
192 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
193 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
194 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
195 215u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
196 199u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
197 17u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
198 17u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
199 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
200 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
201 0xA2u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
202 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
203 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
204 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
205 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
206 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
207 v7 = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
208 215u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
209 0x143u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
210 0x11u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
211 0x11u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
212 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
213 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
214 0xA3u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
215 uNumSavegameFiles,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
216 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
217 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
218 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
219 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
220 v16 = -1;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
221 ptr_69BD58 = v7;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
222 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
223
4acbadf78023 missing file added
Nomad
parents:
diff changeset
224 //----- (0045E93E) --------------------------------------------------------
4acbadf78023 missing file added
Nomad
parents:
diff changeset
225 void __cdecl GameUI_DrawSaveMenu()
4acbadf78023 missing file added
Nomad
parents:
diff changeset
226 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
227 unsigned int v0; // ebp@4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
228 unsigned int v1; // eax@4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
229 unsigned int *v2; // ebp@6
4acbadf78023 missing file added
Nomad
parents:
diff changeset
230 char *v3; // eax@7
4acbadf78023 missing file added
Nomad
parents:
diff changeset
231 FILE *v4; // eax@11
4acbadf78023 missing file added
Nomad
parents:
diff changeset
232 FILE *v5; // eax@11
4acbadf78023 missing file added
Nomad
parents:
diff changeset
233 const char *v6; // ST64_4@14
4acbadf78023 missing file added
Nomad
parents:
diff changeset
234 GUIButton *v7; // eax@16
4acbadf78023 missing file added
Nomad
parents:
diff changeset
235 char *v8; // [sp+10h] [bp-254h]@6
4acbadf78023 missing file added
Nomad
parents:
diff changeset
236 SavegameHeader *Dest; // [sp+14h] [bp-250h]@6
4acbadf78023 missing file added
Nomad
parents:
diff changeset
237 RGBTexture *this_; // [sp+18h] [bp-24Ch]@6
4acbadf78023 missing file added
Nomad
parents:
diff changeset
238 LODWriteableFile v11; // [sp+1Ch] [bp-248h]@1
4acbadf78023 missing file added
Nomad
parents:
diff changeset
239 int v12; // [sp+260h] [bp-4h]@1
4acbadf78023 missing file added
Nomad
parents:
diff changeset
240
4acbadf78023 missing file added
Nomad
parents:
diff changeset
241 ++pIcons_LOD->uTexturePacksCount;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
242 v12 = 0;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
243 if ( !pIcons_LOD->uNumPrevLoadedFiles )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
244 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
245 memset(pSavegameUsedSlots, 0, 0xB4u);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
246 memset(&pSavegameThumbnails, 0, 0x708u);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
247 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
248 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
249 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
250 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
251 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
252 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
253 pRenderer->DrawTextureIndexed(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
254 8u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
255 8u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
256 (Texture *)(uTextureID_loadsave != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 4
diff changeset
257 if ( pCurrentScreen == 11 )
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
258 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
259 v0 = uTextureID_save_up;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
260 v1 = uTextureID_LS_saveU;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
261 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
262 else
4acbadf78023 missing file added
Nomad
parents:
diff changeset
263 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
264 v0 = uTextureID_load_up;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
265 v1 = uTextureID_LS_loadU;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
266 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
267 pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
268 pRenderer->DrawTextureIndexed(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
269 0x15Fu,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
270 0x12Eu,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
271 (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
272 pRenderer->DrawTextureIndexed(0x12u, 0x8Du, (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0));
4acbadf78023 missing file added
Nomad
parents:
diff changeset
273 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
274 pRenderer->Present();
4acbadf78023 missing file added
Nomad
parents:
diff changeset
275 pSavegameList->Initialize(1u);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
276 v11.AllocSubIndicesAndIO(0x12Cu, 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
277 v2 = pSavegameUsedSlots;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
278 Dest = pSavegameHeader;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
279 this_ = pSavegameThumbnails;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
280 v8 = (char *)pSavegameList->pSavesNames;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
281 do
4acbadf78023 missing file added
Nomad
parents:
diff changeset
282 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
283 v3 = v8;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
284 if ( !*v8 )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
285 v3 = "1.mm7";
80
a84fb3752681 28.10.12
Ritor1
parents: 59
diff changeset
286 sprintf(pTmpBuf, "saves\\%s", v3);
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
287 if ( _access(pTmpBuf, 0) || _access(pTmpBuf, 6) )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
288 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
289 v6 = pGlobalTXT_LocalizationStrings[72];
4acbadf78023 missing file added
Nomad
parents:
diff changeset
290 *v2 = 0;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
291 strcpy(Dest->pName, v6);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
292 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
293 else
4acbadf78023 missing file added
Nomad
parents:
diff changeset
294 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
295 v11.LoadFile(pTmpBuf, 1);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
296 v4 = v11.FindContainer("header.bin", 1);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
297 fread(Dest, 0x64u, 1u, v4);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
298 v5 = v11.FindContainer("image.pcx", 1);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
299 if ( v5 )
4acbadf78023 missing file added
Nomad
parents:
diff changeset
300 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
301 this_->LoadFromFILE(v5, 0, 1u);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
302 v11.CloseWriteFile();
4acbadf78023 missing file added
Nomad
parents:
diff changeset
303 *v2 = 1;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
304 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
305 else
4acbadf78023 missing file added
Nomad
parents:
diff changeset
306 {
4acbadf78023 missing file added
Nomad
parents:
diff changeset
307 *v2 = 0;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
308 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
309 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
310 v8 += 280;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
311 ++this_;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
312 ++Dest;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
313 ++v2;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
314 }
4acbadf78023 missing file added
Nomad
parents:
diff changeset
315 while ( (signed int)v8 < (signed int)&_69FBB4_ptr_iterator_end );
4acbadf78023 missing file added
Nomad
parents:
diff changeset
316 v11.FreeSubIndexAndIO();
4acbadf78023 missing file added
Nomad
parents:
diff changeset
317 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
318 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
319 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
320 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
321 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_Chest|WINDOW_MainMenu|0x2), 0, 0);
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
322 pGUIWindow_CurrentMenu->CreateButton(21u, 198u, 0xBFu, 0x12u, 1, 0, 0xA5u, 0, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
323 pGUIWindow_CurrentMenu->CreateButton(21u, 218u, 0xBFu, 0x12u, 1, 0, 0xA5u, 1u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
324 pGUIWindow_CurrentMenu->CreateButton(21u, 238u, 0xBFu, 0x12u, 1, 0, 0xA5u, 2u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
325 pGUIWindow_CurrentMenu->CreateButton(21u, 258u, 0xBFu, 0x12u, 1, 0, 0xA5u, 3u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
326 pGUIWindow_CurrentMenu->CreateButton(21u, 278u, 0xBFu, 0x12u, 1, 0, 0xA5u, 4u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
327 pGUIWindow_CurrentMenu->CreateButton(21u, 298u, 0xBFu, 0x12u, 1, 0, 0xA5u, 5u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
328 pGUIWindow_CurrentMenu->CreateButton(21u, 318u, 0xBFu, 0x12u, 1, 0, 0xA5u, 6u, 0, "", 0);
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
329 ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
330 0xF1u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
331 0x12Eu,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
332 0x69u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
333 0x28u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
334 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
335 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
336 0xA4u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
337 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
338 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
339 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
340 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
341 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
342 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
343 0x15Eu,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
344 0x12Eu,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
345 0x69u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
346 0x28u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
347 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
348 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
349 0xA6u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
350 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
351 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
352 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
353 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
354 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
355 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
356 0xD7u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
357 0xC7u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
358 0x11u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
359 0x11u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
360 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
361 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
362 0xA2u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
363 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
364 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
365 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
366 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
367 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
368 v7 = pGUIWindow_CurrentMenu->CreateButton(
4acbadf78023 missing file added
Nomad
parents:
diff changeset
369 0xD7u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
370 0x143u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
371 0x11u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
372 0x11u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
373 1,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
374 0,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
375 0xA3u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
376 0x22u,
4acbadf78023 missing file added
Nomad
parents:
diff changeset
377 0,
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
378 "",
4
4acbadf78023 missing file added
Nomad
parents:
diff changeset
379 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0),
4acbadf78023 missing file added
Nomad
parents:
diff changeset
380 0);
4acbadf78023 missing file added
Nomad
parents:
diff changeset
381 v12 = -1;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
382 ptr_69BD58 = v7;
4acbadf78023 missing file added
Nomad
parents:
diff changeset
383 }