Mercurial > mm7
comparison GUI/UI/UISaveLoad.cpp @ 2572:d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
author | a.parshin |
---|---|
date | Sat, 05 Mar 2016 01:51:54 +0200 |
parents | fed97f15d1e1 |
children | 0c67be4ec900 |
comparison
equal
deleted
inserted
replaced
2571:cf29f444ddd7 | 2572:d87bfbd3bb3b |
---|---|
74 { | 74 { |
75 pLODFile.LoadFile(pTmpBuf.data(), 1); | 75 pLODFile.LoadFile(pTmpBuf.data(), 1); |
76 fread(&pSavegameHeader[i], 100, 1, pLODFile.FindContainer("header.bin", 1)); | 76 fread(&pSavegameHeader[i], 100, 1, pLODFile.FindContainer("header.bin", 1)); |
77 if (pLODFile.FindContainer("image.pcx", 1)) | 77 if (pLODFile.FindContainer("image.pcx", 1)) |
78 { | 78 { |
79 pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", 1), 0, 1); | 79 //pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", 1), 0, 1); |
80 pLODFile.CloseWriteFile(); | 80 pLODFile.CloseWriteFile(); |
81 pSavegameUsedSlots[i] = 1; | 81 pSavegameUsedSlots[i] = 1; |
82 } | 82 } |
83 else | 83 else |
84 pSavegameUsedSlots[i] = 0; | 84 pSavegameUsedSlots[i] = 0; |
135 | 135 |
136 dword_6BE138 = -1; | 136 dword_6BE138 = -1; |
137 pIcons_LOD->_inlined_sub2(); | 137 pIcons_LOD->_inlined_sub2(); |
138 | 138 |
139 memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); | 139 memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); |
140 memset(pSavegameThumbnails.data(), 0, 45 * sizeof(RGBTexture)); | 140 memset(pSavegameThumbnails.data(), 0, 45 * sizeof(Image *)); |
141 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); | 141 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); |
142 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); | 142 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); |
143 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); | 143 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); |
144 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); | 144 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); |
145 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); | 145 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); |
158 pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); | 158 pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); |
159 } | 159 } |
160 pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); | 160 pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); |
161 } | 161 } |
162 else | 162 else |
163 pRenderer->DrawTextureNew(0, 0, &main_menu_background); | 163 pRenderer->DrawTextureNew(0, 0, main_menu_background); |
164 | 164 |
165 | 165 |
166 /*pGUIWindow_CurrentMenu = new GUIWindow_Load( | 166 /*pGUIWindow_CurrentMenu = new GUIWindow_Load( |
167 saveload_dlg_xs[uDialogueType], | 167 saveload_dlg_xs[uDialogueType], |
168 saveload_dlg_ys[uDialogueType], | 168 saveload_dlg_ys[uDialogueType], |
208 pSavegameUsedSlots[i] = 0; | 208 pSavegameUsedSlots[i] = 0; |
209 strcpy(pSavegameList->pFileList[i].pSaveFileName, ""); | 209 strcpy(pSavegameList->pFileList[i].pSaveFileName, ""); |
210 } | 210 } |
211 else | 211 else |
212 { | 212 { |
213 pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", true), 0, true); | 213 //pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", true), 0, true); |
214 pLODFile.CloseWriteFile(); | 214 pLODFile.CloseWriteFile(); |
215 pSavegameUsedSlots[i] = 1; | 215 pSavegameUsedSlots[i] = 1; |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
297 save_load_window.uFrameWidth = 220; | 297 save_load_window.uFrameWidth = 220; |
298 save_load_window.uFrameY = (pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight) + 157; | 298 save_load_window.uFrameY = (pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight) + 157; |
299 save_load_window.uFrameZ = save_load_window.uFrameX + 219; | 299 save_load_window.uFrameZ = save_load_window.uFrameX + 219; |
300 save_load_window.uFrameHeight = pFontSmallnum->uFontHeight; | 300 save_load_window.uFrameHeight = pFontSmallnum->uFontHeight; |
301 save_load_window.uFrameW = pFontSmallnum->uFontHeight + save_load_window.uFrameY - 1; | 301 save_load_window.uFrameW = pFontSmallnum->uFontHeight + save_load_window.uFrameY - 1; |
302 if ( pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels ) | 302 if ( pSavegameThumbnails[uLoadGameUI_SelectedSlot] ) |
303 pRenderer->DrawTextureRGB(pGUIWindow_CurrentMenu->uFrameX + 276, pGUIWindow_CurrentMenu->uFrameY + 171, &pSavegameThumbnails[uLoadGameUI_SelectedSlot]); | 303 pRenderer->DrawTextureNew((pGUIWindow_CurrentMenu->uFrameX + 276)/640.0f, (pGUIWindow_CurrentMenu->uFrameY + 171)/480.0f, pSavegameThumbnails[uLoadGameUI_SelectedSlot]); |
304 //Draw map name | 304 //Draw map name |
305 save_load_window.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pSavegameHeader[uLoadGameUI_SelectedSlot].pLocationName)].pName, 3); | 305 save_load_window.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pSavegameHeader[uLoadGameUI_SelectedSlot].pLocationName)].pName, 3); |
306 //Draw date | 306 //Draw date |
307 full_hours = ((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) / 60i64; | 307 full_hours = ((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) / 60i64; |
308 full_days = (unsigned int)full_hours / 24; | 308 full_days = (unsigned int)full_hours / 24; |