annotate UISaveLoad.cpp @ 809:7bb33867d2cb

Pv[] in sprintfex
author Ritor1
date Tue, 26 Mar 2013 00:09:21 +0600
parents d6236f6a9882
children dfd683c4f538
rev   line source
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
1 #include <assert.h>
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
2
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
3 #include "MM7.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
4
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
5 #include "MapInfo.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
6 #include "Game.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
7 #include "GUIWindow.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
8 #include "GUIFont.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
9 #include "GUIButton.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
10 #include "GUIProgressBar.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
11 #include "Party.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
12 #include "AudioPlayer.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
13 #include "Outdoor.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
14 #include "IndoorCamera.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
15 #include "Overlays.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
16 #include "Monsters.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
17 #include "Arcomage.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
18 #include "LOD.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
19 #include "Actor.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
20 #include "Allocator.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
21 #include "Events.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
22 #include "Viewport.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
23 #include "FrameTableInc.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
24 #include "Math.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
25 #include "SpriteObject.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
26 #include "ObjectList.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
27 #include "Chest.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
28 #include "PaletteManager.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
29 #include "DecorationList.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
30 #include "SaveLoad.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
31 #include "stru123.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
32 #include "Time.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
33 #include "IconFrameTable.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
34 #include "Awards.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
35 #include "Autonotes.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
36 #include "stru160.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
37 #include "stru279.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
38 #include "TurnEngine.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
39 #include "stru277.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
40 #include "Weather.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
41 #include "stru272.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
42 #include "stru298.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
43 #include "StorylineTextTable.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
44 #include "Events2D.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
45 #include "texts.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
46 #include "stru351.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
47
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
48 #include "mm7_data.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
49
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
50
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
51 //----- (004601B7) --------------------------------------------------------
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
52 void GameUI_MainMenu_DoDrawLoad(int a1)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
53 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
54 unsigned __int16 v1; // bx@1
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
55 unsigned int v2; // edi@4
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
56 unsigned int v3; // eax@4
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
57 unsigned int v4; // eax@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
58 int v5; // edi@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
59 unsigned int v6; // eax@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
60 unsigned int pMapID; // eax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
61 signed __int64 v8; // qax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
62 unsigned int v9; // ebx@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
63 unsigned __int64 v10; // qax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
64 __int64 v11; // qax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
65 char v12; // di@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
66 unsigned __int64 v13; // qtt@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
67 unsigned int v14; // ecx@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
68 __int64 pOurHour; // qax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
69 int v16; // edi@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
70 signed int pHour; // ebx@22
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
71 //const char *v18; // ST14_4@32
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
72 int v19; // eax@32
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
73 const char *v20; // ST18_4@32
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
74 int v21; // eax@32
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
75 //const char *v22; // ST14_4@32
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
76 int v23; // eax@32
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
77 const char *pSlotName; // edi@36
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
78 int v25; // eax@43
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
79 GUIWindow pWindow; // [sp+Ch] [bp-78h]@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
80 /*unsigned int Dst; // [sp+Ch] [bp-78h]@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
81 unsigned int v27; // [sp+10h] [bp-74h]@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
82 int v28; // [sp+14h] [bp-70h]@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
83 int v29; // [sp+18h] [bp-6Ch]@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
84 unsigned int v30; // [sp+1Ch] [bp-68h]@8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
85 unsigned int v31; // [sp+20h] [bp-64h]@8*/
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
86 int pMinutes; // [sp+60h] [bp-24h]@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
87 int pMonthNum; // [sp+68h] [bp-1Ch]@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
88 unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
89 __int64 pAMPM2; // [sp+74h] [bp-10h]@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
90 int pYear; // [sp+7Ch] [bp-8h]@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
91 int a4; // [sp+80h] [bp-4h]@1
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
92 int pFilesID;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
93
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
94 v1 = 255;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
95 a4 = a1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
96 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
97 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
98 pRenderer->BeginScene();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
99 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOADINGPROC )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
100 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
101 pRenderer->DrawTextureIndexed(8, 8, uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
102 if ( a4 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
103 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
104 v2 = uTextureID_save_up;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
105 v3 = uTextureID_LS_saveU;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
106 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
107 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
108 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
109 v2 = uTextureID_load_up;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
110 v3 = uTextureID_LS_loadU;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
111 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
112 pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0));
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
113 pRenderer->DrawTextureIndexed(18, 139, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0));
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
114 pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
115 v1 = 255;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
116 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
117 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
118 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
119 memset(&pWindow, 0, 0x54);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
120 pWindow.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
121 v4 = pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
122 pWindow.uFrameWidth = 220;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
123 v4 += 157;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
124 pWindow.uFrameY = v4;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
125 v5 = pFontSmallnum->uFontHeight;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
126 pWindow.uFrameZ = pWindow.uFrameX + 219;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
127 pWindow.uFrameHeight = v5;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
128 pWindow.uFrameW = v5 + v4 - 1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
129 v6 = uLoadGameUI_SelectedSlot;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
130 if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
131 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
132 pRenderer->DrawTextureRGB(pGUIWindow_CurrentMenu->uFrameX + 276, pGUIWindow_CurrentMenu->uFrameY + 171, pSavegameThumbnails + uLoadGameUI_SelectedSlot);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
133 v6 = uLoadGameUI_SelectedSlot;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
134 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
135 pMapID = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
136 pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapID].pName, 3);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
137 v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
138 pMinutes = (int)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
139 v9 = v8;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
140 v8 /= 60i64;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
141 pAMPM2 = v8;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
142 v10 = (unsigned int)v8 / 24;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
143 pSaveFiles = v10;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
144 v11 = (unsigned int)(v10 / 7);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
145 v12 = v11;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
146 LODWORD(v13) = (unsigned int)v11 >> 2;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
147 HIDWORD(v13) = HIDWORD(v11);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
148 pMonthNum = v13 % 12;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
149 pYear = v13 / 12;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
150 pMinutes = (int)__PAIR__(pMinutes, v9) % 60;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
151 pOurHour = pAMPM2 % 24;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
152 v14 = (unsigned __int64)(pAMPM2 % 24) >> 32;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
153 LODWORD(pAMPM2) = pAMPM2 % 24;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
154 HIDWORD(pOurHour) = pSaveFiles % 28;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
155 pYear += game_starting_year;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
156 v16 = v12 & 3;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
157 pWindow.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
158 HIDWORD(pAMPM2) = v14 == 0 && ((signed int)v14 > 0 || (unsigned int)pOurHour >= 12)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
159 && (signed int)v14 <= 0 && (v14 != 0 || (unsigned int)pOurHour < 24);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
160 if ( v14 != 0 || (signed int)v14 <= 0 && (unsigned int)pOurHour <= 12 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
161 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
162 if ( !(v14 | (unsigned int)pOurHour) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
163 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
164 pSaveFiles = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
165 pHour = 12;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
166 goto LABEL_23;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
167 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
168 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
169 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
170 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
171 v14 = (__PAIR__(v14, (unsigned int)pOurHour) - 12) >> 32;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
172 LODWORD(pOurHour) = pOurHour - 12;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
173 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
174 pHour = pOurHour;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
175 pSaveFiles = v14;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
176 LABEL_23:
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
177 auto day = aDayNames[HIDWORD(pOurHour) % 7];
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
178 auto ampm = aAMPMNames[HIDWORD(pAMPM2)];
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
179 auto month = aMonthNames[pMonthNum];
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
180 //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
181 sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
182 pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
183 v1 = 255;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
184 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
185 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
186 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
187 pGUIWindow_CurrentMenu->field_40 = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
188 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
189 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
190 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
191 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
192 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
193 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
194 ++pMessageQueue_50CBD0->uNumMessages;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
195 }*/
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
196 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
197 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
198 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
199 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
200 if ( pGUIWindow_CurrentMenu->field_40 == 3 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
201 pGUIWindow_CurrentMenu->field_40 = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
202 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
203 if (GetCurrentMenuID() == MENU_LOADINGPROC)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
204 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
205 //v18 = pGlobalTXT_LocalizationStrings[135];
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
206 v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"Загрузка"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
207 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
208 v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
209 v21 = pFontSmallnum->AlignText_Center(0xBA, (const char *)pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
210 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106, 0, v20, 185, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
211 //v22 = pGlobalTXT_LocalizationStrings[165];
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
212 v23 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[165]);//"Пожалуйста, пожождите"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
213 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
214 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
215 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
216 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
217 if ( a4 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
218 pSaveFiles = 40;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
219 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
220 pSaveFiles = uNumSavegameFiles;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
221 a4 = 199;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
222 pFilesID = pSaveListPosition;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
223 pSlotName = (const char *)(&pSavegameHeader[pSaveListPosition]);//draw name for save slot
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
224 do
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
225 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
226 if ( pFilesID >= (signed int)pSaveFiles )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
227 break;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
228 short clr;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
229 HIDWORD(pAMPM2) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
230 if ( pGUIWindow_CurrentMenu->field_40 != 1 || pFilesID != uLoadGameUI_SelectedSlot )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
231 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
232 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, pSlotName, 185, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
233 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
234 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
235 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
236 v25 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, (const char *)pKeyActionMap->pPressedKeysBuffer, 175, 1);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
237 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
238 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
239 a4 += 21;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
240 ++pFilesID;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
241 pSlotName += 100;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
242 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
243 while ( a4 < 346 );
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
244 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
245 pRenderer->EndScene();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
246 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
247 // 6A0C9C: using guessed type int dword_6A0C9C;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
248
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
249 //----- (004606F7) --------------------------------------------------------
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
250 void __cdecl GameUI_MainMenu_DrawLoad()
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
251 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
252 GameUI_MainMenu_DoDrawLoad(0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
253 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
254
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
255 //----- (004606FE) --------------------------------------------------------
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
256 void __cdecl sub_4606FE()
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
257 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
258 GameUI_MainMenu_DoDrawLoad(1);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
259 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
260
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
261
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
262 void __cdecl FreeSavegameThumbnails()
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
263 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
264 for (int i = 0; i < 40; ++i)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
265 //pAllocator->FreeChunk(pSavegameThumbnails[i].pPixels);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
266 pSavegameThumbnails[i].Release();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 701
diff changeset
267 }