annotate GameUIs.cpp @ 37:cad1f62f21c0

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