comparison GameUIs.cpp @ 160:062e8a8e09bc

LoadWindow(work) 30.11.12
author Ritor1
date Fri, 30 Nov 2012 17:29:38 +0600
parents 6c42178c226e
children 62585ad07024
comparison
equal deleted inserted replaced
159:494015e90b8b 160:062e8a8e09bc
35 dword_6BE138 = -1; 35 dword_6BE138 = -1;
36 ++pIcons_LOD->uTexturePacksCount; 36 ++pIcons_LOD->uTexturePacksCount;
37 v16 = 0; 37 v16 = 0;
38 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 38 if ( !pIcons_LOD->uNumPrevLoadedFiles )
39 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 39 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
40 40 memset(pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots));
41 memset(pSavegameUsedSlots, 0, 45 * sizeof(int));
42 memset(pSavegameThumbnails, 0, 45 * sizeof(RGBTexture)); 41 memset(pSavegameThumbnails, 0, 45 * sizeof(RGBTexture));
43
44 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); 42 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
45 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); 43 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
46 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); 44 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
47 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); 45 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
48 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); 46 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
49 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); 47 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
50 if ( uDialogueType_ ) 48 if ( uDialogueType_ )
51 { 49 {
52 pRenderer->DrawTextureIndexed( 50 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
53 8u,
54 8u,
55 (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
56 if ( pCurrentScreen == 11 ) 51 if ( pCurrentScreen == 11 )
57 { 52 {
58 v1 = uTextureID_save_up; 53 v1 = uTextureID_save_up;
59 v2 = uTextureID_LS_saveU; 54 v2 = uTextureID_LS_saveU;
60 } 55 }
61 else 56 else
62 { 57 {
63 v1 = uTextureID_load_up; 58 v1 = uTextureID_load_up;
64 v2 = uTextureID_LS_loadU; 59 v2 = uTextureID_LS_loadU;
65 } 60 }
66 pRenderer->DrawTextureIndexed(241u, 302u, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0)); 61 pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
67 pRenderer->DrawTextureIndexed(18u, 141u, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0)); 62 pRenderer->DrawTextureIndexed(18, 141, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
68 pRenderer->DrawTextureIndexed( 63 pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
69 351u,
70 302u,
71 (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
72 } 64 }
73 else 65 else
74 { 66 {
75 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); 67 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
76 } 68 }
77 pGUIWindow_CurrentMenu = GUIWindow::Create( 69 pGUIWindow_CurrentMenu = GUIWindow::Create(saveload_dlg_xs[uDialogueType_], saveload_dlg_ys[uDialogueType_], saveload_dlg_zs[uDialogueType_],
78 saveload_dlg_xs[uDialogueType_], 70 saveload_dlg_ws[uDialogueType_], WINDOW_MainMenu_Load, 0, 0);
79 saveload_dlg_ys[uDialogueType_],
80 saveload_dlg_zs[uDialogueType_],
81 saveload_dlg_ws[uDialogueType_],
82 WINDOW_MainMenu_Load,
83 0,
84 0);
85 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." 71 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..."
86 pRenderer->Present(); 72 pRenderer->Present();
87 pSavegameList->Initialize(0); 73 pSavegameList->Initialize(0);
88 if ( dword_6A0C9C > (signed int)uNumSavegameFiles ) 74 if ( dword_6A0C9C > (signed int)uNumSavegameFiles )
89 { 75 {
90 dword_6A0C9C = 0; 76 dword_6A0C9C = 0;
91 uLoadGameUI_SelectedSlot = 0; 77 uLoadGameUI_SelectedSlot = 0;
92 } 78 }
93 v15.AllocSubIndicesAndIO(0x12Cu, 0); 79 v15.AllocSubIndicesAndIO(0x12Cu, 0);
94
95 assert(sizeof(SavegameHeader) == 0x64); 80 assert(sizeof(SavegameHeader) == 0x64);
96
97 //v3 = 0; 81 //v3 = 0;
98 for (uint i = 0; i < uNumSavegameFiles; ++i) 82 for (uint i = 0; i < uNumSavegameFiles; ++i)
99 { 83 {
100 //Dest = pSavegameHeader; 84 //Dest = pSavegameHeader;
101 //pTex = pSavegameThumbnails; 85 //pTex = pSavegameThumbnails;
107 { 91 {
108 pSavegameUsedSlots[i] = 0; 92 pSavegameUsedSlots[i] = 0;
109 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty" 93 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty"
110 continue; 94 continue;
111 } 95 }
112 96 v15.LoadFile(pTmpBuf, 1);
113 v15.LoadFile(pTmpBuf, 1);
114 v4 = v15.FindContainer("header.bin", true); 97 v4 = v15.FindContainer("header.bin", true);
115 if ( v4 ) 98 if ( v4 )
116 fread(&pSavegameHeader[i], 0x64u, 1u, v4); 99 fread(&pSavegameHeader[i], 0x64u, 1u, v4);
117 if ( !_strcmpi(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7" 100 if ( !_strcmpi(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7"
118 strcpy(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[16]);// "Autosave" 101 strcpy(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[16]);// "Autosave"
119 102 v5 = v15.FindContainer("image.pcx", true);
120 v5 = v15.FindContainer("image.pcx", true);
121 if ( !v5 ) 103 if ( !v5 )
122 { 104 {
123 pSavegameUsedSlots[i] = 0; 105 pSavegameUsedSlots[i] = 0;
124 strcpy(pSavegameList->pSavesNames[i], ""); 106 strcpy(pSavegameList->pSavesNames[i], "");
125 } 107 }
156 } 138 }
157 uTextureID_x_d = v6; 139 uTextureID_x_d = v6;
158 uTextureID_LS_ = pIcons_LOD->LoadTexture(v8, v10); 140 uTextureID_LS_ = pIcons_LOD->LoadTexture(v8, v10);
159 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); 141 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE);
160 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); 142 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE);
161 pGUIWindow_CurrentMenu->CreateButton(21u, 198u, 191u, 18u, 1, 0, 0xA5u, 0, 0, "", 0); 143 pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, 0xA5, 0, 0, "", 0);
162 pGUIWindow_CurrentMenu->CreateButton(21u, 219u, 191u, 18u, 1, 0, 0xA5u, 1u, 0, "", 0); 144 pGUIWindow_CurrentMenu->CreateButton(21, 219, 191, 18, 1, 0, 0xA5, 1, 0, "", 0);
163 pGUIWindow_CurrentMenu->CreateButton(21u, 240u, 191u, 18u, 1, 0, 0xA5u, 2u, 0, "", 0); 145 pGUIWindow_CurrentMenu->CreateButton(21, 240, 191, 18, 1, 0, 0xA5, 2, 0, "", 0);
164 pGUIWindow_CurrentMenu->CreateButton(21u, 261u, 191u, 18u, 1, 0, 0xA5u, 3u, 0, "", 0); 146 pGUIWindow_CurrentMenu->CreateButton(21, 261, 191, 18, 1, 0, 0xA5, 3, 0, "", 0);
165 pGUIWindow_CurrentMenu->CreateButton(21u, 282u, 191u, 18u, 1, 0, 0xA5u, 4u, 0, "", 0); 147 pGUIWindow_CurrentMenu->CreateButton(21, 282, 191, 18, 1, 0, 0xA5, 4, 0, "", 0);
166 pGUIWindow_CurrentMenu->CreateButton(21u, 303u, 191u, 18u, 1, 0, 0xA5u, 5u, 0, "", 0); 148 pGUIWindow_CurrentMenu->CreateButton(21, 303, 191, 18, 1, 0, 0xA5, 5, 0, "", 0);
167 pGUIWindow_CurrentMenu->CreateButton(21u, 324u, 191u, 18u, 1, 0, 0xA5u, 6u, 0, "", 0); 149 pGUIWindow_CurrentMenu->CreateButton(21, 324, 191, 18, 1, 0, 0xA5, 6, 0, "", 0);
168 ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton( 150 ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, 0xA4, 0, 0, "",
169 241u, 151 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0), 0);
170 302u, 152 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, 0xA6, 0, 0, "",
171 105u, 153 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0), 0);
172 40u, 154 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, 0xA2, 0, 0, "",
173 1, 155 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0), 0);
174 0, 156 v7 = pGUIWindow_CurrentMenu->CreateButton(215, 0x143, 0x11, 0x11, 1, 0, 0xA3, uNumSavegameFiles, 0, "",
175 0xA4u, 157 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0), 0);
176 0,
177 0,
178 "",
179 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0),
180 0);
181 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(
182 350u,
183 302u,
184 105u,
185 40u,
186 1,
187 0,
188 0xA6u,
189 0,
190 0,
191 "",
192 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0),
193 0);
194 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(
195 215u,
196 199u,
197 17u,
198 17u,
199 1,
200 0,
201 0xA2u,
202 0,
203 0,
204 "",
205 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0),
206 0);
207 v7 = pGUIWindow_CurrentMenu->CreateButton(
208 215u,
209 0x143u,
210 0x11u,
211 0x11u,
212 1,
213 0,
214 0xA3u,
215 uNumSavegameFiles,
216 0,
217 "",
218 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0),
219 0);
220 v16 = -1; 158 v16 = -1;
221 ptr_69BD58 = v7; 159 ptr_69BD58 = v7;
222 } 160 }
223 161
224 //----- (0045E93E) -------------------------------------------------------- 162 //----- (0045E93E) --------------------------------------------------------