diff GameUIs.cpp @ 160:062e8a8e09bc

LoadWindow(work) 30.11.12
author Ritor1
date Fri, 30 Nov 2012 17:29:38 +0600
parents 6c42178c226e
children 62585ad07024
line wrap: on
line diff
--- a/GameUIs.cpp	Fri Nov 30 09:40:51 2012 +0600
+++ b/GameUIs.cpp	Fri Nov 30 17:29:38 2012 +0600
@@ -37,10 +37,8 @@
   v16 = 0;
   if ( !pIcons_LOD->uNumPrevLoadedFiles )
     pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
-
-  memset(pSavegameUsedSlots, 0, 45 * sizeof(int));
+  memset(pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots));
   memset(pSavegameThumbnails, 0, 45 * sizeof(RGBTexture));
-
   uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
   uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
   uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
@@ -49,10 +47,7 @@
   uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
   if ( uDialogueType_ )
   {
-    pRenderer->DrawTextureIndexed(
-      8u,
-      8u,
-      (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
+    pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
     if ( pCurrentScreen == 11 )
     {
       v1 = uTextureID_save_up;
@@ -63,25 +58,16 @@
       v1 = uTextureID_load_up;
       v2 = uTextureID_LS_loadU;
     }
-    pRenderer->DrawTextureIndexed(241u, 302u, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
-    pRenderer->DrawTextureIndexed(18u, 141u, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
-    pRenderer->DrawTextureIndexed(
-      351u,
-      302u,
-      (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
+    pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
+    pRenderer->DrawTextureIndexed(18, 141, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
+    pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
   }
   else
   {
     pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
   }
-  pGUIWindow_CurrentMenu = GUIWindow::Create(
-                             saveload_dlg_xs[uDialogueType_],
-                             saveload_dlg_ys[uDialogueType_],
-                             saveload_dlg_zs[uDialogueType_],
-                             saveload_dlg_ws[uDialogueType_],
-                             WINDOW_MainMenu_Load,
-                             0,
-                             0);
+  pGUIWindow_CurrentMenu = GUIWindow::Create(saveload_dlg_xs[uDialogueType_], saveload_dlg_ys[uDialogueType_], saveload_dlg_zs[uDialogueType_],
+                             saveload_dlg_ws[uDialogueType_], WINDOW_MainMenu_Load, 0, 0);
   pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..."
   pRenderer->Present();
   pSavegameList->Initialize(0);
@@ -91,9 +77,7 @@
     uLoadGameUI_SelectedSlot = 0;
   }
   v15.AllocSubIndicesAndIO(0x12Cu, 0);
-
   assert(sizeof(SavegameHeader) == 0x64);
-
   //v3 = 0;
   for (uint i = 0; i < uNumSavegameFiles; ++i)
   {
@@ -109,15 +93,13 @@
       strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty"
       continue;
     }
-
-    v15.LoadFile(pTmpBuf, 1);
+	v15.LoadFile(pTmpBuf, 1);
     v4 = v15.FindContainer("header.bin", true);
     if ( v4 )
       fread(&pSavegameHeader[i], 0x64u, 1u, v4);
     if ( !_strcmpi(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7"
       strcpy(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[16]);// "Autosave"
-
-    v5 = v15.FindContainer("image.pcx", true);
+	v5 = v15.FindContainer("image.pcx", true);
     if ( !v5 )
     {
       pSavegameUsedSlots[i] = 0;
@@ -158,65 +140,21 @@
   uTextureID_LS_ = pIcons_LOD->LoadTexture(v8, v10);
   uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE);
   uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 198u, 191u, 18u, 1, 0, 0xA5u, 0, 0, "", 0);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 219u, 191u, 18u, 1, 0, 0xA5u, 1u, 0, "", 0);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 240u, 191u, 18u, 1, 0, 0xA5u, 2u, 0, "", 0);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 261u, 191u, 18u, 1, 0, 0xA5u, 3u, 0, "", 0);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 282u, 191u, 18u, 1, 0, 0xA5u, 4u, 0, "", 0);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 303u, 191u, 18u, 1, 0, 0xA5u, 5u, 0, "", 0);
-  pGUIWindow_CurrentMenu->CreateButton(21u, 324u, 191u, 18u, 1, 0, 0xA5u, 6u, 0, "", 0);
-  ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(
-                 241u,
-                 302u,
-                 105u,
-                 40u,
-                 1,
-                 0,
-                 0xA4u,
-                 0,
-                 0,
-                 "",
-                 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0),
-                 0);
-  ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(
-                 350u,
-                 302u,
-                 105u,
-                 40u,
-                 1,
-                 0,
-                 0xA6u,
-                 0,
-                 0,
-                 "",
-                 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0),
-                 0);
-  ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(
-                 215u,
-                 199u,
-                 17u,
-                 17u,
-                 1,
-                 0,
-                 0xA2u,
-                 0,
-                 0,
-                 "",
-                 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0),
-                 0);
-  v7 = pGUIWindow_CurrentMenu->CreateButton(
-         215u,
-         0x143u,
-         0x11u,
-         0x11u,
-         1,
-         0,
-         0xA3u,
-         uNumSavegameFiles,
-         0,
-         "",
-         (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0),
-         0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, 0xA5, 0, 0, "", 0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 219, 191, 18, 1, 0, 0xA5, 1, 0, "", 0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 240, 191, 18, 1, 0, 0xA5, 2, 0, "", 0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 261, 191, 18, 1, 0, 0xA5, 3, 0, "", 0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 282, 191, 18, 1, 0, 0xA5, 4, 0, "", 0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 303, 191, 18, 1, 0, 0xA5, 5, 0, "", 0);
+  pGUIWindow_CurrentMenu->CreateButton(21, 324, 191, 18, 1, 0, 0xA5, 6, 0, "", 0);
+  ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, 0xA4, 0, 0, "",
+                 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0), 0);
+  ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, 0xA6, 0, 0, "",
+                 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0), 0);
+  ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, 0xA2, 0, 0, "",
+                 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0), 0);
+  v7 = pGUIWindow_CurrentMenu->CreateButton(215, 0x143, 0x11, 0x11, 1, 0, 0xA3, uNumSavegameFiles, 0, "",
+         (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0), 0);
   v16 = -1;
   ptr_69BD58 = v7;
 }