Mercurial > mm7
annotate UI/UISaveLoad.cpp @ 1713:e013b92030e3
UIRest cleared
author | Ritor1 |
---|---|
date | Tue, 24 Sep 2013 23:40:33 +0600 |
parents | afc1c3514dd5 |
children | 873ac151c38d |
rev | line source |
---|---|
1298 | 1 #ifdef _MSC_VER |
2 #define _CRT_SECURE_NO_WARNINGS | |
3 #endif | |
4 | |
5 #include <io.h> | |
1299 | 6 #include "..\MM7.h" |
1298 | 7 |
1299 | 8 #include "..\Keyboard.h" |
1298 | 9 |
1299 | 10 #include "..\MapInfo.h" |
11 #include "..\GUIWindow.h" | |
12 #include "..\GUIFont.h" | |
13 #include "..\Render.h" | |
14 #include "..\LOD.h" | |
15 #include "..\SaveLoad.h" | |
16 #include "..\texts.h" | |
1298 | 17 |
1299 | 18 #include "..\mm7_data.h" |
1298 | 19 |
20 | |
21 //----- (004601B7) -------------------------------------------------------- | |
22 static void UI_DrawSaveLoad(bool save) | |
23 { | |
1713 | 24 //unsigned __int16 v1; // bx@1 |
1298 | 25 unsigned int v2; // edi@4 |
26 unsigned int v3; // eax@4 | |
27 unsigned int v4; // eax@8 | |
28 int v5; // edi@8 | |
29 unsigned int v6; // eax@8 | |
30 unsigned int pMapID; // eax@10 | |
31 signed __int64 v8; // qax@10 | |
32 unsigned int v9; // ebx@10 | |
33 unsigned __int64 v10; // qax@10 | |
34 __int64 v11; // qax@10 | |
35 char v12; // di@10 | |
36 unsigned __int64 v13; // qtt@10 | |
37 unsigned int v14; // ecx@10 | |
38 __int64 pOurHour; // qax@10 | |
39 int v16; // edi@10 | |
40 signed int pHour; // ebx@22 | |
41 int v19; // eax@32 | |
42 const char *v20; // ST18_4@32 | |
43 int v21; // eax@32 | |
44 int v23; // eax@32 | |
45 const char *pSlotName; // edi@36 | |
46 int v25; // eax@43 | |
47 GUIWindow pWindow; // [sp+Ch] [bp-78h]@8 | |
48 int pMinutes; // [sp+60h] [bp-24h]@10 | |
49 int pMonthNum; // [sp+68h] [bp-1Ch]@10 | |
50 unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10 | |
51 __int64 pAMPM2; // [sp+74h] [bp-10h]@10 | |
52 int pYear; // [sp+7Ch] [bp-8h]@10 | |
53 int pFilesID; | |
54 | |
1713 | 55 //v1 = 255; |
56 //TargetColor(0xFF, 0xFF, 0xFF); | |
57 //TargetColor(0xFF, 0xFF, 0x9B); | |
1298 | 58 pRenderer->BeginScene(); |
59 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LoadingProcInMainMenu ) | |
60 { | |
61 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); | |
62 if (save) | |
63 { | |
64 v2 = uTextureID_save_up; | |
65 v3 = uTextureID_LS_saveU; | |
66 } | |
67 else | |
68 { | |
69 v2 = uTextureID_load_up; | |
70 v3 = uTextureID_LS_loadU; | |
71 } | |
72 pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(v3)); | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
73 pRenderer->DrawTextureIndexed( 18, 139, pIcons_LOD->GetTexture(v2)); |
1298 | 74 pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); |
75 } | |
76 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) | |
77 { | |
78 memset(&pWindow, 0, 0x54); | |
79 pWindow.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240; | |
80 v4 = pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight; | |
81 pWindow.uFrameWidth = 220; | |
82 v4 += 157; | |
83 pWindow.uFrameY = v4; | |
84 v5 = pFontSmallnum->uFontHeight; | |
85 pWindow.uFrameZ = pWindow.uFrameX + 219; | |
86 pWindow.uFrameHeight = v5; | |
87 pWindow.uFrameW = v5 + v4 - 1; | |
88 v6 = uLoadGameUI_SelectedSlot; | |
89 if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels) | |
90 { | |
91 pRenderer->DrawTextureRGB(pGUIWindow_CurrentMenu->uFrameX + 276, pGUIWindow_CurrentMenu->uFrameY + 171, &pSavegameThumbnails[uLoadGameUI_SelectedSlot]); | |
92 v6 = uLoadGameUI_SelectedSlot; | |
93 } | |
94 pMapID = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName); | |
95 pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapID].pName, 3); | |
96 v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60; | |
97 pMinutes = (int)(((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32); | |
98 v9 = v8; | |
99 v8 /= 60i64; | |
100 pAMPM2 = v8; | |
101 v10 = (unsigned int)v8 / 24; | |
102 pSaveFiles = v10; | |
103 v11 = (unsigned int)(v10 / 7); | |
104 v12 = v11; | |
105 LODWORD(v13) = (unsigned int)v11 >> 2; | |
106 HIDWORD(v13) = HIDWORD(v11); | |
107 pMonthNum = v13 % 12; | |
108 pYear = v13 / 12; | |
109 pMinutes = (int)__PAIR__(pMinutes, v9) % 60; | |
110 pOurHour = pAMPM2 % 24; | |
111 v14 = (unsigned __int64)(pAMPM2 % 24) >> 32; | |
112 LODWORD(pAMPM2) = pAMPM2 % 24; | |
113 HIDWORD(pOurHour) = pSaveFiles % 28; | |
114 pYear += game_starting_year; | |
115 v16 = v12 & 3; | |
116 pWindow.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261; | |
117 HIDWORD(pAMPM2) = v14 == 0 && ((signed int)v14 > 0 || (unsigned int)pOurHour >= 12) | |
118 && (signed int)v14 <= 0 && (v14 != 0 || (unsigned int)pOurHour < 24); | |
119 if ( v14 != 0 || ((signed int)v14 <= 0) && (unsigned int)pOurHour <= 12 ) | |
120 { | |
121 if ( !(v14 | (unsigned int)pOurHour) ) | |
122 { | |
123 pSaveFiles = 0; | |
124 pHour = 12; | |
125 goto LABEL_23; | |
126 } | |
127 } | |
128 else | |
129 { | |
130 v14 = (__PAIR__(v14, (unsigned int)pOurHour) - 12) >> 32; | |
131 LODWORD(pOurHour) = pOurHour - 12; | |
132 } | |
133 pHour = pOurHour; | |
134 pSaveFiles = v14; | |
135 LABEL_23: | |
136 auto day = aDayNames[HIDWORD(pOurHour) % 7]; | |
137 auto ampm = aAMPMNames[HIDWORD(pAMPM2)]; | |
138 auto month = aMonthNames[pMonthNum]; | |
139 //sprintf(pTmpBuf.data(), "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID); | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
140 sprintfex(pTmpBuf.data(), "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear); |
1298 | 141 pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf.data(), 3u); |
1713 | 142 //v1 = 255; |
1298 | 143 } |
144 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
145 { | |
146 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
147 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer); | |
148 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); | |
149 } | |
150 else | |
151 { | |
152 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED) | |
153 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
154 } | |
155 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu) | |
156 { | |
157 //v18 = pGlobalTXT_LocalizationStrings[135]; | |
158 v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"Çàãðóçêà" | |
159 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0); | |
160 v20 = (const char *)(&pSavegameHeader[uLoadGameUI_SelectedSlot]); | |
161 v21 = pFontSmallnum->AlignText_Center(0xBA, (const char *)pSavegameHeader.data() + 100 * uLoadGameUI_SelectedSlot); | |
162 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106, 0, v20, 185, 0); | |
163 //v22 = pGlobalTXT_LocalizationStrings[165]; | |
164 v23 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[165]);//"Ïîæàëóéñòà, ïîæîæäèòå" | |
165 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0); | |
166 } | |
167 else | |
168 { | |
169 if ( save ) | |
170 pSaveFiles = 40; | |
171 else | |
172 pSaveFiles = uNumSavegameFiles; | |
173 int a4 = 199; | |
174 pFilesID = pSaveListPosition; | |
175 pSlotName = (const char *)(&pSavegameHeader[pSaveListPosition]);//draw name for save slot | |
176 do | |
177 { | |
178 if ( pFilesID >= (signed int)pSaveFiles ) | |
179 break; | |
180 short clr; | |
1713 | 181 HIDWORD(pAMPM2) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? TargetColor(0xFF, 0xFF, 0x64) : 0); |
1298 | 182 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS || pFilesID != uLoadGameUI_SelectedSlot ) |
183 { | |
184 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, pSlotName, 185, 0); | |
185 } | |
186 else | |
187 { | |
188 v25 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, (const char *)pKeyActionMap->pPressedKeysBuffer, 175, 1); | |
189 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum); | |
190 } | |
191 a4 += 21; | |
192 ++pFilesID; | |
193 pSlotName += 100; | |
194 } | |
195 while ( a4 < 346 ); | |
196 } | |
197 pRenderer->EndScene(); | |
198 } | |
199 // 6A0C9C: using guessed type int dword_6A0C9C; | |
200 | |
201 //----- (004606F7) -------------------------------------------------------- | |
202 void LoadUI_Draw() | |
203 { | |
204 UI_DrawSaveLoad(false); | |
205 } | |
206 | |
207 //----- (004606FE) -------------------------------------------------------- | |
208 void SaveUI_Draw() | |
209 { | |
210 UI_DrawSaveLoad(true); | |
211 } | |
212 | |
213 | |
214 //----- (0045E361) -------------------------------------------------------- | |
215 void LoadUI_Load(unsigned int uDialogueType) | |
216 { | |
217 unsigned int v1; // ebp@5 | |
218 unsigned int v2; // eax@5 | |
219 //signed int v3; // ebp@11 | |
220 FILE *v4; // eax@14 | |
221 FILE *v5; // eax@18 | |
222 unsigned int v6; // eax@25 | |
223 GUIButton *v7; // eax@27 | |
224 const char *v8; // [sp-8h] [bp-26Ch]@25 | |
225 //char *v9; // [sp-4h] [bp-268h]@19 | |
226 enum TEXTURE_TYPE v10; // [sp-4h] [bp-268h]@25 | |
227 unsigned int uDialogueType_; // [sp+10h] [bp-254h]@1 | |
228 //RGBTexture *pTex; // [sp+10h] [bp-254h]@12 | |
229 //SavegameHeader *Dest; // [sp+14h] [bp-250h]@12 | |
230 //const char *Str1; // [sp+18h] [bp-24Ch]@12 | |
231 LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1 | |
232 int v16; // [sp+260h] [bp-4h]@1 | |
233 | |
234 uDialogueType_ = uDialogueType; | |
235 dword_6BE138 = -1; | |
236 pIcons_LOD->_inlined_sub2(); | |
237 | |
238 memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); | |
239 memset(pSavegameThumbnails.data(), 0, 45 * sizeof(RGBTexture)); | |
240 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); | |
241 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); | |
242 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); | |
243 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); | |
244 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); | |
245 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); | |
246 if ( uDialogueType_ ) | |
247 { | |
248 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); | |
249 if ( pCurrentScreen == SCREEN_SAVEGAME ) | |
250 { | |
251 v1 = uTextureID_save_up; | |
252 v2 = uTextureID_LS_saveU; | |
253 } | |
254 else | |
255 { | |
256 v1 = uTextureID_load_up; | |
257 v2 = uTextureID_LS_loadU; | |
258 } | |
259 pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(v2)); | |
260 pRenderer->DrawTextureIndexed( 18, 141, pIcons_LOD->GetTexture(v1)); | |
261 pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); | |
262 } | |
263 else | |
264 { | |
265 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); | |
266 } | |
267 pGUIWindow_CurrentMenu = GUIWindow::Create(saveload_dlg_xs[uDialogueType_], saveload_dlg_ys[uDialogueType_], saveload_dlg_zs[uDialogueType_], | |
268 saveload_dlg_ws[uDialogueType_], WINDOW_MainMenu_Load, 0, 0); | |
269 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." | |
270 pRenderer->Present(); | |
271 pSavegameList->Initialize(0); | |
272 if ( pSaveListPosition > (signed int)uNumSavegameFiles ) | |
273 { | |
274 pSaveListPosition = 0; | |
275 uLoadGameUI_SelectedSlot = 0; | |
276 } | |
277 pLODFile.AllocSubIndicesAndIO(0x12C, 0); | |
1545 | 278 Assert(sizeof(SavegameHeader) == 0x64); |
1298 | 279 //v3 = 0; |
280 for (uint i = 0; i < uNumSavegameFiles; ++i) | |
281 { | |
282 | |
283 sprintf(pTmpBuf.data(), "saves\\%s", pSavegameList->pFileList[i].pSaveFileName); | |
284 if (_access(pTmpBuf.data(), 6)) | |
285 { | |
286 pSavegameUsedSlots[i] = 0; | |
287 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty" | |
288 continue; | |
289 } | |
290 pLODFile.LoadFile(pTmpBuf.data(), 1); | |
291 v4 = pLODFile.FindContainer("header.bin", true); | |
292 if ( v4 ) | |
293 fread(&pSavegameHeader[i], 0x64, 1, v4); | |
294 if ( !_stricmp(pSavegameList->pFileList[i].pSaveFileName, pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7" | |
295 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[16]);// "Autosave" | |
296 v5 = pLODFile.FindContainer("image.pcx", true); | |
297 if ( !v5 ) | |
298 { | |
299 pSavegameUsedSlots[i] = 0; | |
300 strcpy(pSavegameList->pFileList[i].pSaveFileName, ""); | |
301 } | |
302 else | |
303 { | |
304 pSavegameThumbnails[i].LoadFromFILE(v5, 0, true); | |
305 pLODFile.CloseWriteFile(); | |
306 pSavegameUsedSlots[i] = 1; | |
307 } | |
308 } | |
309 | |
310 //LABEL_24: | |
311 pLODFile.FreeSubIndexAndIO(); | |
312 if ( pCurrentScreen == SCREEN_SAVEGAME ) | |
313 { | |
314 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); | |
315 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD",TEXTURE_16BIT_PALETTE); | |
316 } | |
317 else | |
318 { | |
319 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); | |
320 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_loadD",TEXTURE_16BIT_PALETTE); | |
321 } | |
322 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); | |
323 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); | |
324 pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); | |
325 pGUIWindow_CurrentMenu->CreateButton(21, 219, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); | |
326 pGUIWindow_CurrentMenu->CreateButton(21, 240, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); | |
327 pGUIWindow_CurrentMenu->CreateButton(21, 261, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); | |
328 pGUIWindow_CurrentMenu->CreateButton(21, 282, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); | |
329 pGUIWindow_CurrentMenu->CreateButton(21, 303, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); | |
330 pGUIWindow_CurrentMenu->CreateButton(21, 324, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); | |
331 pBtnLoadSlot = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); | |
332 pBtnCancel = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); | |
333 pBtnArrowUp = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); | |
334 pBtnDownArrow = pGUIWindow_CurrentMenu->CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); | |
335 } | |
336 | |
337 //----- (0045E93E) -------------------------------------------------------- | |
338 void SaveUI_Load() | |
339 { | |
340 unsigned int v0; // ebp@4 | |
341 unsigned int v1; // eax@4 | |
342 char *v3; // eax@7 | |
343 FILE *v4; // eax@11 | |
344 FILE *v5; // eax@11 | |
345 LODWriteableFile v11; // [sp+1Ch] [bp-248h]@1 | |
346 | |
347 ++pIcons_LOD->uTexturePacksCount; | |
348 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
349 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
350 memset(pSavegameUsedSlots.data(), 0, 0xB4u); | |
351 memset(&pSavegameThumbnails, 0, 0x708u); | |
352 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); | |
353 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); | |
354 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); | |
355 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); | |
356 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); | |
357 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); | |
358 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); | |
359 if ( pCurrentScreen == SCREEN_SAVEGAME ) | |
360 { | |
361 v0 = uTextureID_save_up; | |
362 v1 = uTextureID_LS_saveU; | |
363 } | |
364 else | |
365 { | |
366 v0 = uTextureID_load_up; | |
367 v1 = uTextureID_LS_loadU; | |
368 } | |
369 pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, pIcons_LOD->GetTexture(v1)); | |
370 pRenderer->DrawTextureIndexed(0x15Fu, 0x12Eu, pIcons_LOD->GetTexture(uTextureID_x_u)); | |
371 pRenderer->DrawTextureIndexed(0x12u, 0x8Du, pIcons_LOD->GetTexture(v0)); | |
372 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0); | |
373 pRenderer->Present(); | |
374 pSavegameList->Initialize(1u); | |
375 v11.AllocSubIndicesAndIO(0x12Cu, 0); | |
376 //v2 = pSavegameUsedSlots; | |
377 // Dest = pSavegameHeader; | |
378 // this_ = pSavegameThumbnails; | |
379 // v8 = (char *)pSavegameList->pSavesNames; | |
380 for (uint i = 0; i < 40; ++i) | |
381 { | |
382 v3 = pSavegameList->pFileList[i].pSaveFileName; | |
383 if ( !*pSavegameList->pFileList[i].pSaveFileName ) | |
384 v3 = "1.mm7"; | |
385 sprintf(pTmpBuf.data(), "saves\\%s", v3); | |
386 if ( _access(pTmpBuf.data(), 0) || _access(pTmpBuf.data(), 6) ) | |
387 { | |
388 pSavegameUsedSlots[i] = 0; | |
389 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[LOCSTR_EMPTY]); | |
390 } | |
391 else | |
392 { | |
393 v11.LoadFile(pTmpBuf.data(), 1); | |
394 v4 = v11.FindContainer("header.bin", 1); | |
395 fread(&pSavegameHeader[i], 100, 1u, v4); | |
396 v5 = v11.FindContainer("image.pcx", 1); | |
397 if ( v5 ) | |
398 { | |
399 pSavegameThumbnails[i].LoadFromFILE(v5, 0, 1u); | |
400 v11.CloseWriteFile(); | |
401 pSavegameUsedSlots[i] = 1; | |
402 } | |
403 else | |
404 { | |
405 pSavegameUsedSlots[i] = 0; | |
406 } | |
407 } | |
408 | |
409 } | |
410 | |
411 v11.FreeSubIndexAndIO(); | |
412 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); | |
413 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); | |
414 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); | |
415 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); | |
416 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SaveLoadButtons, 0, 0); | |
417 pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); | |
418 pGUIWindow_CurrentMenu->CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); | |
419 pGUIWindow_CurrentMenu->CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); | |
420 pGUIWindow_CurrentMenu->CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); | |
421 pGUIWindow_CurrentMenu->CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); | |
422 pGUIWindow_CurrentMenu->CreateButton(21, 298, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); | |
423 pGUIWindow_CurrentMenu->CreateButton(21, 318, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); | |
424 pBtnLoadSlot = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); | |
425 pBtnCancel = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); | |
426 pBtnArrowUp = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); | |
427 pBtnDownArrow = pGUIWindow_CurrentMenu->CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, 34, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); | |
428 } |