comparison Engine/SaveLoad.cpp @ 2574:dd36326a9994

More texture refactoring GetLeather -> DrawTextureCustomHeight
author a.parshin
date Mon, 07 Mar 2016 03:48:40 +0200
parents 0c67be4ec900
children
comparison
equal deleted inserted replaced
2573:0c67be4ec900 2574:dd36326a9994
33 33
34 34
35 struct SavegameList *pSavegameList = new SavegameList; 35 struct SavegameList *pSavegameList = new SavegameList;
36 unsigned int uNumSavegameFiles; 36 unsigned int uNumSavegameFiles;
37 std::array<unsigned int, 45> pSavegameUsedSlots; 37 std::array<unsigned int, 45> pSavegameUsedSlots;
38 //std::array<struct RGBTexture, 45> pSavegameThumbnails;
39 std::array<Image *, 45> pSavegameThumbnails; 38 std::array<Image *, 45> pSavegameThumbnails;
40 std::array<SavegameHeader, 45> pSavegameHeader; 39 std::array<SavegameHeader, 45> pSavegameHeader;
41 40
42 41
43 42
43
44
45 //----- (00411B59) --------------------------------------------------------
46 void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer)
47 {
48 //unsigned int v2; // esi@1
49 //unsigned int v3; // edi@1
50 FILE *v4; // ebx@1
51 FILE *v5; // eax@2
52 //char pContainerName[64]; // [sp+Ch] [bp-44h]@1
53 //unsigned int v7; // [sp+4Ch] [bp-4h]@1
54
55 if (pSavegameThumbnails[uSlot])
56 {
57 pSavegameThumbnails[uSlot]->Release();
58 pSavegameThumbnails[uSlot] = nullptr;
59 }
60
61
62 wchar_t filename[1024];
63 swprintf(filename, L"data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
64 pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromFile(filename);
65
66 if (!pSavegameThumbnails[uSlot])
67 {
68 swprintf(filename, L"lloyd%d%d.pcx", uPlayer, uSlot + 1);
69 pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromNewLOD(filename);
70 }
71 /*sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
72 v4 = fopen(pContainerName, "rb");
73 if ( v4 )
74 {
75 pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1);
76 fclose(v4);
77 }
78 else
79 {
80 sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1);
81 v5 = pNew_LOD->FindContainer(pContainerName, 1);
82 if ( v5 )
83 pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0);
84 else
85 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0;
86 }*/
87 }
88
89
44 //----- (0045EE8A) -------------------------------------------------------- 90 //----- (0045EE8A) --------------------------------------------------------
45 void __fastcall LoadGame(unsigned int uSlot) 91 void LoadGame(unsigned int uSlot)
46 { 92 {
47 bool v25; // esi@62 93 bool v25; // esi@62
48 bool v26; // eax@62 94 bool v26; // eax@62
49 SavegameHeader header; // [sp+Ch] [bp-E4h]@23 95 SavegameHeader header; // [sp+Ch] [bp-E4h]@23
50 char Str[123]; // [sp+70h] [bp-80h]@25 96 char Str[123]; // [sp+70h] [bp-80h]@25
306 pRenderer->PackScreenshot(150, 112, uncompressed_buff, 1000000, &pLodDirectory.uDataSize);//создание скриншота 352 pRenderer->PackScreenshot(150, 112, uncompressed_buff, 1000000, &pLodDirectory.uDataSize);//создание скриншота
307 strcpy(pLodDirectory.pFilename, "image.pcx"); 353 strcpy(pLodDirectory.pFilename, "image.pcx");
308 354
309 if (current_screen_type == SCREEN_SAVEGAME) 355 if (current_screen_type == SCREEN_SAVEGAME)
310 { 356 {
311 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave); 357 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave);
312 pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, img_loadsave); 358 pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, saveload_ui_loadsave);
313 text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[190]); 359 text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[190]);
314 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, text_pos + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение 360 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, text_pos + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение
315 text_pos = pFontSmallnum->AlignText_Center(186, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); 361 text_pos = pFontSmallnum->AlignText_Center(186, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
316 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, text_pos + 25, 259, 0, pSavegameHeader[uLoadGameUI_SelectedSlot].pName, 185, 0); 362 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, text_pos + 25, 259, 0, pSavegameHeader[uLoadGameUI_SelectedSlot].pName, 185, 0);
317 text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[165]); 363 text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[165]);
568 pParty->sRotationY = sPRotationY; 614 pParty->sRotationY = sPRotationY;
569 pParty->sRotationX = sPRotationX; 615 pParty->sRotationX = sPRotationX;
570 } 616 }
571 617
572 //----- (00460078) -------------------------------------------------------- 618 //----- (00460078) --------------------------------------------------------
573 void __fastcall DoSavegame(unsigned int uSlot) 619 void DoSavegame(unsigned int uSlot)
574 { 620 {
575 if ( _stricmp(pCurrentMapName, "d05.blv") )//Not Arena(не Арена) 621 if ( _stricmp(pCurrentMapName, "d05.blv") )//Not Arena(не Арена)
576 { 622 {
577 LOD::Directory pDir; // [sp+Ch] [bp-28h]@2 623 LOD::Directory pDir; // [sp+Ch] [bp-28h]@2
578 SaveGame(0, 0); 624 SaveGame(0, 0);