World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
UISaveLoad.cpp
См. документацию.
1 #include "GUI/UI/UISaveLoad.h"
2 
3 #ifdef _WINDOWS
4 #include <io.h>
5 #else
6 #include "Common/PlatformLinux.h"
7 #endif
8 #include <string>
9 
10 #include "Engine/Engine.h"
11 #include "Engine/AssetsManager.h"
12 #include "Engine/Localization.h"
13 #include "Engine/MapInfo.h"
15 #include "Engine/LOD.h"
16 #include "Engine/SaveLoad.h"
19 
20 #include "IO/Keyboard.h"
21 
22 #include "GUI/GUIButton.h"
23 #include "GUI/GUIFont.h"
24 #include "GUI/UI/UIMainMenu.h"
25 
26 #include "Platform/Api.h"
27 
28 
29 static void UI_DrawSaveLoad(bool save);
30 
33 Image *scrollstop = nullptr;
34 
37  memset(&pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots));
38  memset(&pSavegameThumbnails, 0, sizeof(pSavegameThumbnails));
39 
40  saveload_ui_loadsave = assets->GetImage_ColorKey("loadsave", 0x7FF);
41  saveload_ui_save_up = assets->GetImage_ColorKey("save_up", 0x7FF);
42  saveload_ui_saveu = assets->GetImage_ColorKey("LS_saveU", 0x7FF);
43  saveload_ui_x_u = assets->GetImage_ColorKey("x_u", 0x7FF);
44 
46 
49 
50  LOD::File pLODFile;
51  for (uint i = 0; i < MAX_SAVE_SLOTS; ++i) {
52  // String file_name = pSavegameList->pFileList[i];
53  String file_name = StringPrintf("save%03d.mm7", i);
54  if (file_name.empty()) {
55  file_name = "1.mm7";
56  }
57 
58  String str = "saves\\" + file_name;
59  str = MakeDataPath(str.c_str());
60  if (_access(str.c_str(), 0) || _access(str.c_str(), 6)) {
61  pSavegameUsedSlots[i] = 0;
62  strcpy(pSavegameHeader[i].pName, localization->GetString(72)); // Empty
63  } else {
64  pLODFile.Open(str);
65  void *data = pLODFile.LoadRaw("header.bin");
66  memcpy(&pSavegameHeader[i], data, sizeof(SavegameHeader));
67 
68  if (pSavegameHeader[i].pName[0] == '\0') {
69  // blank so add something - suspect quicksaves
70  String newname = pSavegameList->pFileList[i];
71  String test = newname.substr(0, newname.size() - 4);
72  strcpy(pSavegameHeader[i].pName, test.c_str());
73  }
74 
75  pSavegameThumbnails[i] = Image::Create(new PCX_LOD_File_Loader(&pLODFile, "image.pcx"));
76  if (pSavegameThumbnails[i]->GetWidth() == 0) {
77  pSavegameThumbnails[i]->Release();
78  pSavegameThumbnails[i] = nullptr;
79  }
80 
81  if (pSavegameThumbnails[i] != nullptr) {
82  pSavegameUsedSlots[i] = 1;
83  } else {
84  pSavegameUsedSlots[i] = 0;
85  }
86  }
87  }
88 
91  ui_ar_up_dn = assets->GetImage_Alpha("ar_up_dn");
92  ui_ar_dn_dn = assets->GetImage_Alpha("ar_dn_dn");
93 
94  scrollstop = assets->GetImage_ColorKey("con_x", 0x7FF);
95 
96  // GUIWindow_Save c-tor --- part
97  CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "");
98  CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "");
99  CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "");
100  CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "");
101  CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "");
102  CreateButton(21, 298, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "");
103  CreateButton(21, 318, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "");
104 
105  pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", { { saveload_ui_ls_saved } });
106  pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", { { saveload_ui_x_d } });
107  pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", { { ui_ar_up_dn } });
108  pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, MAX_SAVE_SLOTS, 0, "", { { ui_ar_dn_dn } });
109 }
110 
113  render->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, saveload_ui_loadsave);
114  render->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_saveu);
115  render->DrawTextureAlphaNew(18 / 640.0f, 139 / 480.0f, saveload_ui_save_up);
116  render->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, saveload_ui_x_u);
117  }
118  UI_DrawSaveLoad(true);
119 }
120 
122  GUIWindow(WINDOW_Load, 0, 0, 0, 0, 0) {
124 
125  dword_6BE138 = -1;
127 
128  memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots));
129  memset(pSavegameThumbnails.data(), 0, MAX_SAVE_SLOTS * sizeof(Image *));
130 
131  saveload_ui_loadsave = assets->GetImage_ColorKey("loadsave", 0x7FF);
132  saveload_ui_load_up = assets->GetImage_ColorKey("load_up", 0x7FF);
133  saveload_ui_loadu = assets->GetImage_ColorKey("LS_loadU", 0x7FF);
134  saveload_ui_x_u = assets->GetImage_ColorKey("x_u", 0x7FF);
135 
136  main_menu_background = nullptr;
137  if (!ingame) {
139  }
140 
141  // GUIWindow::GUIWindow
142  this->uFrameX = saveload_dlg_xs[ingame ? 1 : 0];
143  this->uFrameY = saveload_dlg_ys[ingame ? 1 : 0];
144  this->uFrameWidth = saveload_dlg_zs[ingame ? 1 : 0];
145  this->uFrameHeight = saveload_dlg_ws[ingame ? 1 : 0];
146  this->uFrameZ = uFrameX + uFrameWidth - 1;
147  this->uFrameW = uFrameY + uFrameHeight - 1;
148 
149  DrawText(pFontSmallnum, 25, 199, 0, localization->GetString(505), 0, 0, 0); // "Reading..."
150  render->Present();
151 
153  // if (pSaveListPosition > (int)uNumSavegameFiles) {
154  pSaveListPosition = 0;
156  //}
157  LOD::File pLODFile;
158  Assert(sizeof(SavegameHeader) == 100);
159  for (uint i = 0; i < uNumSavegameFiles; ++i) {
160  String str = "saves\\" + pSavegameList->pFileList[i];
161  str = MakeDataPath(str.c_str());
162  if (_access(str.c_str(), 6)) {
163  pSavegameUsedSlots[i] = 0;
164  strcpy(pSavegameHeader[i].pName, localization->GetString(72)); // "Empty"
165  continue;
166  }
167 
168  if (!pLODFile.Open(str)) __debugbreak();
169  void *data = pLODFile.LoadRaw("header.bin");
170  memcpy(&pSavegameHeader[i], data, sizeof(SavegameHeader));
171  if (!_stricmp(pSavegameList->pFileList[i].c_str(), localization->GetString(613))) { // "AutoSave.MM7"
172  strcpy(pSavegameHeader[i].pName, localization->GetString(16)); // "Autosave"
173  }
174 
175  if (pSavegameHeader[i].pName[0] == '\0') {
176  // blank so add something - suspect quicksaves
177  String newname = pSavegameList->pFileList[i];
178  String test = newname.substr(0, newname.size() - 4);
179  strcpy(pSavegameHeader[i].pName, test.c_str());
180  }
181 
182  pSavegameThumbnails[i] = Image::Create(new PCX_LOD_File_Loader(&pLODFile, "image.pcx"));
183  if (pSavegameThumbnails[i]->GetWidth() == 0) {
184  pSavegameThumbnails[i]->Release();
185  pSavegameThumbnails[i] = nullptr;
186  }
187 
188  pSavegameUsedSlots[i] = 1;
189  if (pSavegameThumbnails[i] != nullptr) {
190  // pSavegameUsedSlots[i] = 1;
191  } else {
192  // pSavegameUsedSlots[i] = 0;
193  // pSavegameList->pFileList[i].clear();
194  }
195  }
196 
199  ui_ar_up_dn = assets->GetImage_Alpha("AR_UP_DN");
200  ui_ar_dn_dn = assets->GetImage_Alpha("AR_DN_DN");
201 
202  scrollstop = assets->GetImage_ColorKey("con_x", 0x7FF);
203 
204  CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "");
205  CreateButton(21, 219, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "");
206  CreateButton(21, 240, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "");
207  CreateButton(21, 261, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "");
208  CreateButton(21, 282, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "");
209  CreateButton(21, 303, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "");
210  CreateButton(21, 324, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "");
211 
212  pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", { { saveload_ui_ls_saved } });
213  pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", { { saveload_ui_x_d } });
214  pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", { { ui_ar_up_dn } });
215  pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", { { ui_ar_dn_dn } });
216 }
217 
219  if (main_menu_background != nullptr) {
220  render->DrawTextureNew(0, 0, main_menu_background);
221  }
223  render->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, saveload_ui_loadsave);
224  render->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_loadu);
225  render->DrawTextureAlphaNew(18 / 640.0f, 139 / 480.0f, saveload_ui_load_up);
226  render->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, saveload_ui_x_u);
227  }
228  UI_DrawSaveLoad(false);
229 }
230 
231 static void UI_DrawSaveLoad(bool save) {
232  GUIWindow save_load_window;
233  unsigned int pSaveFiles;
234 
236  memset(&save_load_window, 0, 0x54);
237  save_load_window.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240;
238  save_load_window.uFrameWidth = 220;
239  save_load_window.uFrameY = (pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->GetHeight()) + 157;
240  save_load_window.uFrameZ = save_load_window.uFrameX + 219;
241  save_load_window.uFrameHeight = pFontSmallnum->GetHeight();
242  save_load_window.uFrameW = pFontSmallnum->GetHeight() + save_load_window.uFrameY - 1;
245  // Draw map name
247 
248  // Draw date
249  GameTime savegame_time = pSavegameHeader[uLoadGameUI_SelectedSlot].playing_time;
250  auto savegame_hour = savegame_time.GetHoursOfDay();
251 
252  save_load_window.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
253  int am;
254  if (savegame_hour >= 12) {
255  savegame_hour -= 12;
256  if (!savegame_hour) {
257  savegame_hour = 12;
258  }
259  am = 1;
260  } else {
261  am = 0;
262  }
263 
264  auto str = StringPrintf(
265  "%s %d:%02d %s\n%d %s %d",
266  localization->GetDayName(savegame_time.GetDaysOfWeek()),
267  savegame_hour,
268  savegame_time.GetMinutesFraction(),
269  localization->GetAmPm(am),
270  savegame_time.GetDaysOfMonth() + 1,
271  localization->GetMonthName(savegame_time.GetMonthsOfYear()),
272  savegame_time.GetYears() + game_starting_year);
273  save_load_window.DrawTitleText(pFontSmallnum, 0, 0, 0, str, 3);
274  }
275 
276  if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) {
279  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveGame, 0, 0);
280  } else {
281  if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
283  }
284 
287  220, 0, localization->GetString(135), 0, 0, 0); // Çàãðóçêà
291  304, 0, localization->GetString(165), 0, 0, 0); // Ïîæàëóéñòà, ïîæîæäèòå
292  } else {
293  if (save) {
294  pSaveFiles = MAX_SAVE_SLOTS;
295 
296  // ingame save scroll bar
297  float ypos3 = (float(pSaveListPosition) / (pSaveFiles - 7)) * 89.f;
298  render->DrawTextureAlphaNew(216 / 640.f, (217 + ypos3) / 480.f, scrollstop);
299  } else {
300  pSaveFiles = uNumSavegameFiles;
301 
302  // load scroll bar
303  float ypos = (float(pSaveListPosition) / (pSaveFiles - 7)) * 89.f;
304  render->DrawTextureAlphaNew((216+ pGUIWindow_CurrentMenu->uFrameX) / 640.f, (217 + pGUIWindow_CurrentMenu->uFrameY + ypos) / 480.f, scrollstop);
305  }
306 
307  int slot_Y = 199;
308  for (uint i = pSaveListPosition; i < pSaveFiles; ++i) {
309  if (slot_Y >= 346) {
310  break;
311  }
312  if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS || i != uLoadGameUI_SelectedSlot) {
313  pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 27, slot_Y, i == uLoadGameUI_SelectedSlot ? Color16(0xFF, 0xFF, 0x64) : 0, pSavegameHeader[i].pName, 185, 0);
314  } else {
316  slot_Y, pFontSmallnum);
317  }
318  slot_Y += 21;
319  }
320  }
321 }
322 
324  while (!pMessageQueue_50CBD0->Empty()) {
325  UIMessageType msg;
326  int param, param2;
327  pMessageQueue_50CBD0->PopMessage(&msg, &param, &param2);
328 
329  switch (msg) {
330  case UIMSG_LoadGame: {
332  break;
334  break;
335  }
336  case UIMSG_SelectLoadSlot: {
337  // main menu save/load wnd clicking on savegame lines
338  if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
339  pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
341  // load clicked line
342  int v26 = param + pSaveListPosition;
343  if (dword_6BE138 == v26) {
344  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
345  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
346  }
348  dword_6BE138 = v26;
349  } else {
350  // typing in the line
354  }
355  break;
356  }
357  case UIMSG_SaveLoadBtn: {
359  break;
360  }
361  case UIMSG_DownArrow: {
363  if (pSaveListPosition > (param - 7))
364  pSaveListPosition = (param - 7);
365  // if (pSaveListPosition < 1)
366  // pSaveListPosition = 0;
368  break;
369  }
370  case UIMSG_ArrowUp: {
372  if (pSaveListPosition < 0)
373  pSaveListPosition = 0;
375  break;
376  }
377  case UIMSG_Cancel: {
379  break;
380  }
381  case UIMSG_Escape: {
382  viewparams->field_48 = 1;
383  // if (current_screen_type == SCREEN_LOADGAME)
384  {
385  // crt_deconstruct_ptr_6A0118();
386 
389  pEventTimer->Resume();
390  viewparams->bRedrawGameUI = true;
391  break;
392  }
393  break;
394  }
395  }
396  }
397 }
398 
402 
404  window->PeekMessageLoop();
405  if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) {
406  OS_WaitMessage();
407  continue;
408  }
409 
410  render->BeginScene();
413  render->Present();
414  }
415 
417  pGUIWindow_CurrentMenu = nullptr;
418 }
MENU_SAVELOAD
@ MENU_SAVELOAD
Definition: GUIWindow.h:254
OnButtonClick2
Definition: GUIWindow.h:523
uLoadGameUI_SelectedSlot
unsigned int uLoadGameUI_SelectedSlot
Definition: mm7_data.cpp:693
GUIWindow::DrawText
void DrawText(GUIFont *font, int x, int y, unsigned short uFontColor, const char *str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
Definition: GUIWindow.cpp:694
ViewingParams::field_48
int field_48
Definition: Viewport.h:75
GUIWindow::uFrameW
unsigned int uFrameW
Definition: GUIWindow.h:473
KeyboardActionMapping::EnterText
void EnterText(int a2, int max_string_len, GUIWindow *pWindow)
Definition: Keyboard.cpp:181
UIMessageType
UIMessageType
Definition: GUIWindow.h:13
GUIMessageQueue::Empty
bool Empty()
Definition: GUIWindow.h:659
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
GUIWindow_Save::saveload_ui_x_u
Image * saveload_ui_x_u
Definition: UISaveLoad.h:18
UIMSG_Escape
@ UIMSG_Escape
Definition: GUIWindow.h:96
Viewport.h
pBtnArrowUp
GUIButton * pBtnArrowUp
Definition: GUIButton.cpp:86
MapStats::pInfos
MapInfo pInfos[77]
Definition: MapInfo.h:79
LOD.h
Image::GetHeight
unsigned int GetHeight()
Definition: Image.cpp:230
GUIWindow_Load
Definition: UISaveLoad.h:21
GUIWindow
Definition: GUIWindow.h:433
Timer::Resume
void Resume()
Definition: Time.cpp:27
GUIWindow_Load::saveload_ui_loadu
Image * saveload_ui_loadu
Definition: UISaveLoad.h:33
pBtnCancel
GUIButton * pBtnCancel
Definition: GUIButton.cpp:87
pGUIWindow_CurrentMenu
GUIWindow * pGUIWindow_CurrentMenu
Definition: GUIWindow.cpp:54
GUIWindow::CreateButton
GUIButton * CreateButton(int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
Definition: GUIWindow.cpp:717
SetCurrentMenuID
void SetCurrentMenuID(MENU_STATE uMenu)
Definition: GUIWindow.cpp:128
WINDOW_Save
@ WINDOW_Save
Definition: GUIWindow.h:348
GUIWindow_Save::saveload_ui_loadsave
Image * saveload_ui_loadsave
Definition: UISaveLoad.h:16
MapStats::GetMapInfo
MAP_TYPE GetMapInfo(const String &Str2)
Definition: MapInfo.cpp:225
GUIWindow_Load::Update
virtual void Update()
Definition: UISaveLoad.cpp:218
GameTime::GetDaysOfWeek
int GetDaysOfWeek() const
Definition: Time.h:40
GameTime::GetDaysOfMonth
int GetDaysOfMonth() const
Definition: Time.h:41
UIMSG_SaveGame
@ UIMSG_SaveGame
Definition: GUIWindow.h:68
saveload_dlg_ys
std::array< unsigned int, 2 > saveload_dlg_ys
Definition: mm7_data.cpp:202
game_starting_year
int game_starting_year
Definition: mm7_data.cpp:193
localization
Localization * localization
Definition: Localization.cpp:11
MENU_MAIN
@ MENU_MAIN
Definition: GUIWindow.h:251
GUIWindow_Save::saveload_ui_saveu
Image * saveload_ui_saveu
Definition: UISaveLoad.h:17
scrollstop
Image * scrollstop
Definition: UISaveLoad.cpp:33
pSavegameUsedSlots
std::array< unsigned int, MAX_SAVE_SLOTS > pSavegameUsedSlots
Definition: SaveLoad.cpp:43
uNumSavegameFiles
unsigned int uNumSavegameFiles
Definition: SaveLoad.cpp:42
GUIWindow::DrawTitleText
void DrawTitleText(GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
Definition: GUIWindow.cpp:665
AssetsManager::GetImage_PCXFromIconsLOD
Texture * GetImage_PCXFromIconsLOD(const String &name)
Definition: AssetsManager.cpp:81
GUIWindow::Release
virtual void Release()
Definition: GUIWindow.cpp:292
GUIFont.h
GUIFont::GetHeight
unsigned int GetHeight() const
Definition: GUIFont.cpp:84
ImageLoader.h
GameTime::GetYears
int GetYears() const
Definition: Time.h:35
GUIWindow_Save::saveload_ui_save_up
Image * saveload_ui_save_up
Definition: UISaveLoad.h:15
AssetsManager.h
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
GUIWindow::receives_keyboard_input_2
int receives_keyboard_input_2
Definition: GUIWindow.h:486
GUIWindow::uFrameZ
unsigned int uFrameZ
Definition: GUIWindow.h:472
Engine.h
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
pMapStats
struct MapStats * pMapStats
Definition: mm7_data.cpp:20
GameTime::GetMinutesFraction
int GetMinutesFraction() const
Definition: Time.h:38
OnSaveLoad
Definition: GUIWindow.h:558
GetCurrentMenuID
MENU_STATE GetCurrentMenuID()
Definition: GUIWindow.cpp:133
UIMSG_DownArrow
@ UIMSG_DownArrow
Definition: GUIWindow.h:130
OnCancel3
Definition: GUIWindow.h:588
Localization.h
Image::GetWidth
unsigned int GetWidth()
Definition: Image.cpp:217
WINDOW_Load
@ WINDOW_Load
Definition: GUIWindow.h:349
SavegameList::Initialize
static void Initialize()
Definition: SaveLoad.cpp:547
GUIButton.h
Image
Definition: Image.h:19
GUIWindow::DrawTextInRect
int DrawTextInRect(GUIFont *font, unsigned int x, unsigned int y, unsigned int color, const char *text, int rect_width, int reverse_text)
Definition: GUIWindow.cpp:702
IRender.h
UIMSG_ArrowUp
@ UIMSG_ArrowUp
Definition: GUIWindow.h:129
GUIWindow_Save::GUIWindow_Save
GUIWindow_Save()
Definition: UISaveLoad.cpp:35
GUIWindow_Load::saveload_ui_load_up
Image * saveload_ui_load_up
Definition: UISaveLoad.h:31
UI_DrawSaveLoad
static void UI_DrawSaveLoad(bool save)
Definition: UISaveLoad.cpp:231
GUIFont::AlignText_Center
unsigned int AlignText_Center(unsigned int width, const String &str)
Definition: GUIFont.cpp:306
CURRENT_SCREEN::SCREEN_LOADGAME
@ SCREEN_LOADGAME
param
GLfloat param
Definition: SDL_opengl_glext.h:373
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
GUIWindow_Load::GUIWindow_Load
GUIWindow_Load(bool ingame)
Definition: UISaveLoad.cpp:121
SaveLoad.h
AssetsManager::GetImage_ColorKey
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
Definition: AssetsManager.cpp:34
GUIWindow::uFrameHeight
unsigned int uFrameHeight
Definition: GUIWindow.h:471
KeyboardActionMapping::pPressedKeysBuffer
char pPressedKeysBuffer[257]
Definition: Keyboard.h:66
CURRENT_SCREEN::SCREEN_SAVEGAME
@ SCREEN_SAVEGAME
pIcons_LOD
LODFile_IconsBitmaps * pIcons_LOD
Definition: LOD.cpp:12
GUIWindow_Load::main_menu_background
Image * main_menu_background
Definition: UISaveLoad.h:29
pSavegameThumbnails
std::array< Image *, MAX_SAVE_SLOTS > pSavegameThumbnails
Definition: SaveLoad.cpp:44
MainMenuLoad_EventLoop
void MainMenuLoad_EventLoop()
Definition: UISaveLoad.cpp:323
PCX_LOD_File_Loader
Definition: ImageLoader.h:94
pSaveListPosition
int pSaveListPosition
Definition: mm7_data.cpp:692
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
MainMenuLoad_Loop
void MainMenuLoad_Loop()
Definition: UISaveLoad.cpp:399
GameTime::GetHoursOfDay
int GetHoursOfDay() const
Definition: Time.h:39
GUI_UpdateWindows
void GUI_UpdateWindows()
Definition: GUIWindow.cpp:956
MapInfo::pName
String pName
Definition: MapInfo.h:38
saveload_dlg_zs
std::array< unsigned int, 2 > saveload_dlg_zs
Definition: mm7_data.cpp:203
UIMainMenu.h
UIMSG_SaveLoadBtn
@ UIMSG_SaveLoadBtn
Definition: GUIWindow.h:131
saveload_ui_x_d
Image * saveload_ui_x_d
Definition: UISaveLoad.cpp:32
saveload_dlg_xs
std::array< unsigned int, 2 > saveload_dlg_xs
Definition: mm7_data.cpp:201
GUIMessageQueue::PopMessage
void PopMessage(UIMessageType *pMsg, int *pParam, int *a4)
Definition: GUIWindow.cpp:174
UIMSG_Cancel
@ UIMSG_Cancel
Definition: GUIWindow.h:133
GUIWindow_Save::Update
virtual void Update()
Definition: UISaveLoad.cpp:111
KeyboardActionMapping::SetWindowInputStatus
void SetWindowInputStatus(int a2)
Definition: Keyboard.cpp:195
Localization::GetAmPm
const char * GetAmPm(unsigned int index) const
Definition: Localization.h:79
GUIWindow_Load::saveload_ui_loadsave
Image * saveload_ui_loadsave
Definition: UISaveLoad.h:32
ui_ar_dn_dn
Image * ui_ar_dn_dn
Definition: GUIWindow.cpp:100
GUIWindow::uFrameY
unsigned int uFrameY
Definition: GUIWindow.h:469
saveload_ui_ls_saved
Image * saveload_ui_ls_saved
Definition: UISaveLoad.cpp:31
GUIWindow::DrawFlashingInputCursor
void DrawFlashingInputCursor(int uX, int uY, GUIFont *a2)
Definition: GUIWindow.cpp:759
pBtnLoadSlot
GUIButton * pBtnLoadSlot
Definition: GUIButton.cpp:88
UIMSG_LoadGame
@ UIMSG_LoadGame
Definition: GUIWindow.h:67
pBtnDownArrow
GUIButton * pBtnDownArrow
Definition: GUIButton.cpp:85
MAX_SAVE_SLOTS
constexpr unsigned int MAX_SAVE_SLOTS
Definition: SaveLoad.h:33
GameTime::GetMonthsOfYear
int GetMonthsOfYear() const
Definition: Time.h:43
MENU_LoadingProcInMainMenu
@ MENU_LoadingProcInMainMenu
Definition: GUIWindow.h:260
CURRENT_SCREEN::SCREEN_GAME
@ SCREEN_GAME
MapInfo.h
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
Localization::GetMonthName
const char * GetMonthName(unsigned int index) const
Definition: Localization.h:19
pKeyActionMap
struct KeyboardActionMapping * pKeyActionMap
Definition: Keyboard.cpp:35
MakeDataPath
std::string MakeDataPath(const char *file_rel_path)
Definition: Engine.cpp:126
Image::Create
static Image * Create(unsigned int width, unsigned int height, IMAGE_FORMAT format, const void *pixels=nullptr)
Definition: Image.cpp:243
UIMSG_SelectLoadSlot
@ UIMSG_SelectLoadSlot
Definition: GUIWindow.h:132
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
uint
unsigned int uint
Definition: MM7.h:4
LOD::File
Definition: LOD.h:58
__debugbreak
void __cdecl __debugbreak(void)
LOD::File::Open
bool Open(const String &pFilename)
Definition: LOD.cpp:751
GUIWindow_Load::saveload_ui_x_u
Image * saveload_ui_x_u
Definition: UISaveLoad.h:34
ViewingParams::bRedrawGameUI
int bRedrawGameUI
Definition: Viewport.h:74
dword_6BE364_game_settings_1
int dword_6BE364_game_settings_1
Definition: mm7_data.cpp:714
AssetsManager::GetImage_Alpha
Texture * GetImage_Alpha(const String &name)
Definition: AssetsManager.cpp:66
Localization::GetDayName
const char * GetDayName(unsigned int index) const
Definition: Localization.h:15
PlatformLinux.h
ui_ar_up_dn
Image * ui_ar_up_dn
Definition: GUIWindow.cpp:102
SavegameHeader
Definition: SaveLoad.h:18
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
KeyboardActionMapping::uNumKeysPressed
uint8_t uNumKeysPressed
Definition: Keyboard.h:67
UISaveLoad.h
dword_6BE138
int dword_6BE138
Definition: mm7_data.cpp:704
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
Color16
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
Definition: Engine.cpp:148
LODFile_IconsBitmaps::_inlined_sub2
void _inlined_sub2()
Definition: LOD.cpp:37
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
SavegameList::pFileList
std::array< String, 45 > pFileList
Definition: SaveLoad.h:13
LOD::File::LoadRaw
void * LoadRaw(const String &pContainer, size_t *data_size=nullptr)
Definition: LOD.cpp:895
String
std::string String
Definition: Strings.h:10
Keyboard.h
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
GameTime
Definition: Time.h:14
OS_WaitMessage
void OS_WaitMessage()
Definition: Lin.cpp:32
saveload_dlg_ws
std::array< unsigned int, 2 > saveload_dlg_ws
Definition: mm7_data.cpp:204
pFontSmallnum
GUIFont * pFontSmallnum
Definition: GUIFont.cpp:25
Api.h
pSavegameList
struct SavegameList * pSavegameList
Definition: SaveLoad.cpp:41
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52
pSavegameHeader
std::array< SavegameHeader, MAX_SAVE_SLOTS > pSavegameHeader
Definition: SaveLoad.cpp:45