comparison GameUIs.cpp @ 163:62585ad07024

2.02.12
author Ritor1
date Mon, 03 Dec 2012 08:55:58 +0600
parents 062e8a8e09bc
children b7f43ecfb3a3
comparison
equal deleted inserted replaced
162:8ff698000225 163:62585ad07024
26 enum TEXTURE_TYPE v10; // [sp-4h] [bp-268h]@25 26 enum TEXTURE_TYPE v10; // [sp-4h] [bp-268h]@25
27 unsigned int uDialogueType_; // [sp+10h] [bp-254h]@1 27 unsigned int uDialogueType_; // [sp+10h] [bp-254h]@1
28 //RGBTexture *pTex; // [sp+10h] [bp-254h]@12 28 //RGBTexture *pTex; // [sp+10h] [bp-254h]@12
29 //SavegameHeader *Dest; // [sp+14h] [bp-250h]@12 29 //SavegameHeader *Dest; // [sp+14h] [bp-250h]@12
30 //const char *Str1; // [sp+18h] [bp-24Ch]@12 30 //const char *Str1; // [sp+18h] [bp-24Ch]@12
31 LODWriteableFile v15; // [sp+1Ch] [bp-248h]@1 31 LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1
32 int v16; // [sp+260h] [bp-4h]@1 32 int v16; // [sp+260h] [bp-4h]@1
33 33
34 uDialogueType_ = uDialogueType; 34 uDialogueType_ = uDialogueType;
35 dword_6BE138 = -1; 35 dword_6BE138 = -1;
36 ++pIcons_LOD->uTexturePacksCount; 36 ++pIcons_LOD->uTexturePacksCount;
46 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); 46 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
47 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); 47 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
48 if ( uDialogueType_ ) 48 if ( uDialogueType_ )
49 { 49 {
50 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0)); 50 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
51 if ( pCurrentScreen == 11 ) 51 if ( pCurrentScreen == 11 )//save or load
52 { 52 {
53 v1 = uTextureID_save_up; 53 v1 = uTextureID_save_up;
54 v2 = uTextureID_LS_saveU; 54 v2 = uTextureID_LS_saveU;
55 } 55 }
56 else 56 else
74 if ( dword_6A0C9C > (signed int)uNumSavegameFiles ) 74 if ( dword_6A0C9C > (signed int)uNumSavegameFiles )
75 { 75 {
76 dword_6A0C9C = 0; 76 dword_6A0C9C = 0;
77 uLoadGameUI_SelectedSlot = 0; 77 uLoadGameUI_SelectedSlot = 0;
78 } 78 }
79 v15.AllocSubIndicesAndIO(0x12Cu, 0); 79 pLODFile.AllocSubIndicesAndIO(0x12C, 0);
80 assert(sizeof(SavegameHeader) == 0x64); 80 assert(sizeof(SavegameHeader) == 0x64);
81 //v3 = 0; 81 //v3 = 0;
82 for (uint i = 0; i < uNumSavegameFiles; ++i) 82 for (uint i = 0; i < uNumSavegameFiles; ++i)
83 { 83 {
84 //Dest = pSavegameHeader; 84 //Dest = pSavegameHeader;
91 { 91 {
92 pSavegameUsedSlots[i] = 0; 92 pSavegameUsedSlots[i] = 0;
93 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty" 93 strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty"
94 continue; 94 continue;
95 } 95 }
96 v15.LoadFile(pTmpBuf, 1); 96 pLODFile.LoadFile(pTmpBuf, 1);
97 v4 = v15.FindContainer("header.bin", true); 97 v4 = pLODFile.FindContainer("header.bin", true);
98 if ( v4 ) 98 if ( v4 )
99 fread(&pSavegameHeader[i], 0x64u, 1u, v4); 99 fread(&pSavegameHeader[i], 0x64, 1, v4);
100 if ( !_strcmpi(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7" 100 if ( !_strcmpi(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7"
101 strcpy(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[16]);// "Autosave" 101 strcpy(pSavegameList->pSavesNames[i], pGlobalTXT_LocalizationStrings[16]);// "Autosave"
102 v5 = v15.FindContainer("image.pcx", true); 102 v5 = pLODFile.FindContainer("image.pcx", true);
103 if ( !v5 ) 103 if ( !v5 )
104 { 104 {
105 pSavegameUsedSlots[i] = 0; 105 pSavegameUsedSlots[i] = 0;
106 strcpy(pSavegameList->pSavesNames[i], ""); 106 strcpy(pSavegameList->pSavesNames[i], "");
107 } 107 }
108 else 108 else
109 { 109 {
110 pSavegameThumbnails[i].LoadFromFILE(v5, 0, true); 110 pSavegameThumbnails[i].LoadFromFILE(v5, 0, true);
111 v15.CloseWriteFile(); 111 pLODFile.CloseWriteFile();
112 pSavegameUsedSlots[i] = 1; 112 pSavegameUsedSlots[i] = 1;
113 } 113 }
114 //LABEL_23: 114 //LABEL_23:
115 //Str1 += 280; 115 //Str1 += 280;
116 //++pTex; 116 //++pTex;
120 // goto LABEL_24; 120 // goto LABEL_24;
121 //} 121 //}
122 //goto LABEL_22; 122 //goto LABEL_22;
123 } 123 }
124 124
125 LABEL_24: 125 //LABEL_24:
126 v15.FreeSubIndexAndIO(); 126 pLODFile.FreeSubIndexAndIO();
127 if ( pCurrentScreen == 11 ) 127 if ( pCurrentScreen == 11 ) // save/load screen
128 { 128 {
129 v6 = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); 129 v6 = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
130 v10 = (TEXTURE_TYPE)2; 130 v10 = (TEXTURE_TYPE)2;
131 v8 = "LS_saveD"; 131 v8 = "LS_saveD";
132 } 132 }
151 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0), 0); 151 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0), 0);
152 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, 0xA6, 0, 0, "", 152 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, 0xA6, 0, 0, "",
153 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0), 0); 153 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0), 0);
154 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, 0xA2, 0, 0, "", 154 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, 0xA2, 0, 0, "",
155 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0), 0); 155 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0), 0);
156 v7 = pGUIWindow_CurrentMenu->CreateButton(215, 0x143, 0x11, 0x11, 1, 0, 0xA3, uNumSavegameFiles, 0, "", 156 ptr_69BD58 = pGUIWindow_CurrentMenu->CreateButton(215, 0x143, 0x11, 0x11, 1, 0, 0xA3, uNumSavegameFiles, 0, "",
157 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0), 0); 157 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0), 0);
158 v16 = -1; 158 v16 = -1;
159 ptr_69BD58 = v7; 159 //ptr_69BD58 = v7;
160 } 160 }
161 161
162 //----- (0045E93E) -------------------------------------------------------- 162 //----- (0045E93E) --------------------------------------------------------
163 void __cdecl GameUI_DrawSaveMenu() 163 void __cdecl GameUI_DrawSaveMenu()
164 { 164 {