diff 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
line wrap: on
line diff
--- a/Engine/SaveLoad.cpp	Sat Mar 05 16:25:53 2016 +0200
+++ b/Engine/SaveLoad.cpp	Mon Mar 07 03:48:40 2016 +0200
@@ -35,14 +35,60 @@
 struct SavegameList *pSavegameList = new SavegameList;
 unsigned int uNumSavegameFiles;
 std::array<unsigned int, 45> pSavegameUsedSlots;
-//std::array<struct RGBTexture, 45> pSavegameThumbnails;
 std::array<Image *, 45> pSavegameThumbnails;
 std::array<SavegameHeader, 45> pSavegameHeader;
 
 
 
+
+
+//----- (00411B59) --------------------------------------------------------
+void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer)
+{
+    //unsigned int v2; // esi@1
+    //unsigned int v3; // edi@1
+    FILE *v4; // ebx@1
+    FILE *v5; // eax@2
+              //char pContainerName[64]; // [sp+Ch] [bp-44h]@1
+              //unsigned int v7; // [sp+4Ch] [bp-4h]@1
+
+    if (pSavegameThumbnails[uSlot])
+    {
+        pSavegameThumbnails[uSlot]->Release();
+        pSavegameThumbnails[uSlot] = nullptr;
+    }
+
+
+    wchar_t filename[1024];
+    swprintf(filename, L"data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
+    pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromFile(filename);
+
+    if (!pSavegameThumbnails[uSlot])
+    {
+        swprintf(filename, L"lloyd%d%d.pcx", uPlayer, uSlot + 1);
+        pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromNewLOD(filename);
+    }
+    /*sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
+    v4 = fopen(pContainerName, "rb");
+    if ( v4 )
+    {
+    pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1);
+    fclose(v4);
+    }
+    else
+    {
+    sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1);
+    v5 = pNew_LOD->FindContainer(pContainerName, 1);
+    if ( v5 )
+    pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0);
+    else
+    *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0;
+    }*/
+}
+
+
 //----- (0045EE8A) --------------------------------------------------------
-void __fastcall LoadGame(unsigned int uSlot)
+void LoadGame(unsigned int uSlot)
 {
   bool v25; // esi@62
   bool v26; // eax@62
@@ -308,8 +354,8 @@
 
     if (current_screen_type == SCREEN_SAVEGAME)
     {
-        pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave);
-        pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, img_loadsave);
+        pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave);
+        pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, saveload_ui_loadsave);
         text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[190]);
         pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, text_pos + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение
         text_pos = pFontSmallnum->AlignText_Center(186, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
@@ -570,7 +616,7 @@
 }
 
 //----- (00460078) --------------------------------------------------------
-void __fastcall DoSavegame(unsigned int uSlot)
+void DoSavegame(unsigned int uSlot)
 {
   if ( _stricmp(pCurrentMapName, "d05.blv") )//Not Arena(не Арена)
   {