Mercurial > might-and-magic-trilogy
comparison SaveLoad.cpp @ 110:430786d916d6
6.11.12 SaveLoad
author | Ritor1 |
---|---|
date | Tue, 06 Nov 2012 17:30:24 +0600 |
parents | ccc0cf95706a |
children | e5d6903a077a |
comparison
equal
deleted
inserted
replaced
109:62772029b56d | 110:430786d916d6 |
---|---|
296 __int16 *v68; // [sp+25Ch] [bp-14h]@32 | 296 __int16 *v68; // [sp+25Ch] [bp-14h]@32 |
297 unsigned int v69; // [sp+260h] [bp-10h]@23 | 297 unsigned int v69; // [sp+260h] [bp-10h]@23 |
298 int v70; // [sp+264h] [bp-Ch]@22 | 298 int v70; // [sp+264h] [bp-Ch]@22 |
299 std::string *v71; // [sp+268h] [bp-8h]@8 | 299 std::string *v71; // [sp+268h] [bp-8h]@8 |
300 int a3; // [sp+26Fh] [bp-1h]@8 | 300 int a3; // [sp+26Fh] [bp-1h]@8 |
301 | 301 |
302 v66 = a2; | 302 v66 = a2; |
303 //v64 = (std::string *)a1; | 303 //v64 = (std::string *)a1; |
304 | |
305 strcpy(byte_6BE3B0, pCurrentMapName); | 304 strcpy(byte_6BE3B0, pCurrentMapName); |
306 if (!_strcmpi(pCurrentMapName, "d05.blv")) | 305 if (!_strcmpi(pCurrentMapName, "d05.blv")) |
307 return false; | 306 return false; |
308 | |
309 DstBuf = malloc(0xF4240u); | 307 DstBuf = malloc(0xF4240u); |
310 pDir.Reset(); | 308 pDir.Reset(); |
311 v52 = pParty->vPosition.x; | 309 v52 = pParty->vPosition.x; |
312 v51 = pParty->vPosition.y; | 310 v51 = pParty->vPosition.y; |
313 v62 = pParty->vPosition.z; | 311 v62 = pParty->vPosition.z; |
317 pParty->vPosition.y = pParty->vPrevPosition.z; | 315 pParty->vPosition.y = pParty->vPrevPosition.z; |
318 pParty->vPosition.z = pParty->vPrevPosition.y; | 316 pParty->vPosition.z = pParty->vPrevPosition.y; |
319 pParty->uFallStartY = pParty->vPrevPosition.y; | 317 pParty->uFallStartY = pParty->vPrevPosition.y; |
320 pParty->sRotationY = pParty->sPrevRotationY; | 318 pParty->sRotationY = pParty->sPrevRotationY; |
321 pParty->sRotationX = pParty->sPrevRotationX; | 319 pParty->sRotationX = pParty->sPrevRotationX; |
322 | |
323 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | 320 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
324 pIndoor->stru1.uLastVisitDay = pParty->uTimePlayed; | 321 pIndoor->stru1.uLastVisitDay = pParty->uTimePlayed; |
325 else | 322 else |
326 pOutdoor->uLastVisitDay = pParty->uTimePlayed; | 323 pOutdoor->uLastVisitDay = pParty->uTimePlayed; |
327 | |
328 v3 = MakeScreenshot(150, 112); | 324 v3 = MakeScreenshot(150, 112); |
329 { | 325 strcpy(pDir.pFilename, "image.pcx"); |
330 strcpy(pDir.pFilename, "image.pcx"); | 326 pRenderer->_49F5A2((int)v3, 150, 112, DstBuf, 1000000, (int)&pDir.uDataSize); |
331 | |
332 pRenderer->_49F5A2((int)v3, 150, 112, DstBuf, 1000000, (int)&pDir.uDataSize); | |
333 } | |
334 free(v3); | 327 free(v3); |
335 | 328 if ( pCurrentScreen == 11 )//Save |
336 if ( pCurrentScreen == 11 ) | 329 { |
337 { | 330 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0)); |
338 pRenderer->DrawTextureIndexed( | 331 pRenderer->DrawTextureIndexed(0x12u, 0x8Du, (Texture *)(uTextureID_save_up != -1 ? &pIcons_LOD->pTextures[uTextureID_save_up] : 0)); |
339 8u, | |
340 8u, | |
341 (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0)); | |
342 pRenderer->DrawTextureIndexed( | |
343 0x12u, | |
344 0x8Du, | |
345 (Texture *)(uTextureID_save_up != -1 ? &pIcons_LOD->pTextures[uTextureID_save_up] : 0)); | |
346 v36 = pGlobalTXT_LocalizationStrings[190]; | |
347 v4 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[190]); | 332 v4 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[190]); |
348 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v4 + 25, 219, 0, v36, 0, 0, 0); | 333 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v4 + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение |
349 v37 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot); | 334 v5 = pFontSmallnum->AlignText_Center(0xBAu, (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); |
350 v5 = pFontSmallnum->AlignText_Center(0xBAu, | 335 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v5 + 25, 0x103u, 0, (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot), 185, 0); |
351 (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); | |
352 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v5 + 25, 0x103u, 0, v37, 185, 0); | |
353 v36 = pGlobalTXT_LocalizationStrings[165]; | |
354 v6 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]); | 336 v6 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]); |
355 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v6 + 25, 299, 0, v36, 0, 0, 0); | 337 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v6 + 25, 299, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0); //Пожалуйста, подождите |
356 pRenderer->Present(); | 338 pRenderer->Present(); |
357 } | 339 } |
358 if ( pNew_LOD->Write(&pDir, DstBuf, 0) ) | 340 if ( pNew_LOD->Write(&pDir, DstBuf, 0) ) |
359 { | 341 { |
360 sprintf(Str, pGlobalTXT_LocalizationStrings[612], 200); | 342 sprintf(Str, pGlobalTXT_LocalizationStrings[612], 200); //Сохраненная игра повреждена! Code=%d |
361 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:773", 0); | 343 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:773", 0); |
362 } | 344 } |
363 else | 345 else |
364 { | 346 { |
365 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp"; | 347 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp"; |
366 } | 348 } |
367 strcpy(Dest, pCurrentMapName); | 349 strcpy(Dest, pCurrentMapName); |
368 v45 = pParty->uTimePlayed; | 350 v45 = pParty->uTimePlayed; |
380 { | 362 { |
381 v39 = 202; | 363 v39 = 202; |
382 sprintf(Str, pGlobalTXT_LocalizationStrings[612], 202); | 364 sprintf(Str, pGlobalTXT_LocalizationStrings[612], 202); |
383 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:793", 0); | 365 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:793", 0); |
384 } | 366 } |
385 strcpy((char *)&pDir, "Timer.bin"); | 367 strcpy((char *)&pDir, "clock.bin"); |
386 pDir.uDataSize = 40; | 368 pDir.uDataSize = 40; |
387 if ( pNew_LOD->Write(&pDir, &pEventTimer, 0) ) | 369 if ( pNew_LOD->Write(&pDir, &pEventTimer, 0) ) |
388 { | 370 { |
389 v39 = 203; | 371 v39 = 203; |
390 sprintf(Str, pGlobalTXT_LocalizationStrings[612], 203); | 372 sprintf(Str, pGlobalTXT_LocalizationStrings[612], 203); |
648 pParty->vPosition.z = v62; | 630 pParty->vPosition.z = v62; |
649 pParty->uFallStartY = v62; | 631 pParty->uFallStartY = v62; |
650 pParty->sRotationY = v53; | 632 pParty->sRotationY = v53; |
651 result = v54; | 633 result = v54; |
652 pParty->sRotationX = v54; | 634 pParty->sRotationX = v54; |
653 | |
654 return result; | 635 return result; |
655 } | 636 } |
656 | 637 |
657 | 638 |
658 //----- (00460078) -------------------------------------------------------- | 639 //----- (00460078) -------------------------------------------------------- |