annotate UIRest.cpp @ 800:e6bab3f2c1be

Слияние
author Ritor1
date Mon, 25 Mar 2013 10:40:44 +0600
parents d6236f6a9882
children dfd683c4f538
rev   line source
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
1 #include <assert.h>
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
2
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
3 #include "MM7.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
4
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
5 #include "MapInfo.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
6 #include "Game.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
7 #include "GUIWindow.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
8 #include "GUIFont.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
9 #include "GUIButton.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
10 #include "GUIProgressBar.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
11 #include "Party.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
12 #include "AudioPlayer.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
13 #include "Outdoor.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
14 #include "IndoorCamera.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
15 #include "Overlays.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
16 #include "Monsters.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
17 #include "Arcomage.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
18 #include "LOD.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
19 #include "Actor.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
20 #include "Allocator.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
21 #include "Events.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
22 #include "Viewport.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
23 #include "FrameTableInc.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
24 #include "Math.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
25 #include "SpriteObject.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
26 #include "ObjectList.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
27 #include "Chest.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
28 #include "PaletteManager.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
29 #include "DecorationList.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
30 #include "SaveLoad.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
31 #include "stru123.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
32 #include "Time.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
33 #include "IconFrameTable.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
34 #include "Awards.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
35 #include "Autonotes.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
36 #include "stru160.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
37 #include "stru279.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
38 #include "TurnEngine.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
39 #include "stru277.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
40 #include "Weather.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
41 #include "stru272.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
42 #include "stru298.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
43 #include "StorylineTextTable.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
44 #include "Events2D.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
45 #include "texts.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
46 #include "stru351.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
47
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
48 #include "mm7_data.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
49
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
50
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
51
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
52 //----- (0041F6C1) --------------------------------------------------------
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
53 void __cdecl RestUI_Initialize()
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
54 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
55 Player *v0; // eax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
56
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
57 if ( !dword_506F14 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
58 pAudioPlayer->StopChannels(-1, -1);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
59 if ( pCurrentScreen )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
60 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
61 pGUIWindow_CurrentMenu->Release();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
62 pCurrentScreen = SCREEN_GAME;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
63 viewparams->bRedrawGameUI = 1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
64 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
65 pEventTimer->Pause();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
66 if ( dword_506F14 != 2 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
67 GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
68 _506F18_num_hours_to_sleep = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
69 dword_506F14 = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
70 uRestUI_FoodRequiredToRest = 2;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
71 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
72 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
73 pParty->vPosition.x,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
74 pParty->vPosition.y,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
75 pParty->vPosition.z);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
76 if ( PartyHasDragon() )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
77 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
78 v0 = pParty->pPlayers;//[0].uClass;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
79 while ( v0 <= &pParty->pPlayers[3] )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
80 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
81 ++v0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
82 if ( v0 > &pParty->pPlayers[3] )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
83 break;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
84 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
85 if(v0->classType == PLAYER_CLASS_WARLOCK)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
86 ++uRestUI_FoodRequiredToRest;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
87 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
88 if ( CheckHiredNPCSpeciality(Porter) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
89 --uRestUI_FoodRequiredToRest;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
90 if ( CheckHiredNPCSpeciality(QuarterMaster) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
91 uRestUI_FoodRequiredToRest -= 2;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
92 if ( CheckHiredNPCSpeciality(Gypsy) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
93 --uRestUI_FoodRequiredToRest;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
94 if ( uRestUI_FoodRequiredToRest < 1 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
95 uRestUI_FoodRequiredToRest = 1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
96 if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
97 uRestUI_FoodRequiredToRest = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
98 ++pIcons_LOD->uTexturePacksCount;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
99 if ( !pIcons_LOD->uNumPrevLoadedFiles )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
100 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
101 pCurrentScreen = SCREEN_REST;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
102 _507CD4_RestUI_hourglass_anim_controller = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
103 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
104 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
105 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
106 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
107 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
108 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
109 LoadActualSkyFrame();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
110 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
111 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
112 280u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
113 297u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
114 154u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
115 37u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
116 1,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
117 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
118 0xA7u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
119 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
120 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
121 "",
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
122 (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0),
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
123 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
124 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
125 24u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
126 154u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
127 225u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
128 37u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
129 1,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
130 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
131 0x61u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
132 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
133 0x52u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
134 "",
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
135 (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0),
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
136 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
137 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
138 61u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
139 232u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
140 154u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
141 33u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
142 1,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
143 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
144 0x6Du,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
145 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
146 0x44u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
147 "",
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
148 (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0),
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
149 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
150 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
151 61u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
152 264u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
153 154u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
154 33u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
155 1,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
156 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
157 0x60u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
158 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
159 0x48u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
160 "",
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
161 (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0),
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
162 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
163 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
164 61u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
165 296u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
166 154u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
167 33u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
168 1,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
169 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
170 0x5Fu,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
171 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
172 0x4Du,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
173 "",
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
174 (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0),
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
175 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
176 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
177
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
178 //----- (0041FA01) --------------------------------------------------------
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
179 void __cdecl RestUI_Draw()
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
180 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
181 int v0; // esi@1
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
182 Player **ppPlayers; // ecx@1
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
183 Player *pPlayer; // eax@2
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
184 unsigned int v3; // eax@15
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
185 //char v4; // al@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
186 bool v5; // eax@21
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
187 GUIButton Dst; // [sp+8h] [bp-DCh]@19
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
188 //double v7; // [sp+C4h] [bp-20h]@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
189 float v8; // [sp+CCh] [bp-18h]@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
190 __int64 v9; // [sp+D0h] [bp-14h]@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
191 unsigned int v10; // [sp+D8h] [bp-Ch]@9
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
192 __int16 a9[2]; // [sp+DCh] [bp-8h]@1
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
193 int a5; // [sp+E0h] [bp-4h]@1
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
194
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
195 v0 = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
196 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
197 *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
198 ppPlayers = &pPlayers[1];
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
199 do
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
200 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
201 pPlayer = *ppPlayers;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
202 if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
203 ++v0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
204 ++ppPlayers;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
205 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
206 while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] );
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
207 if ( v0 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
208 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
209 pRenderer->DrawTextureIndexed(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
210 8u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
211 8u,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
212 (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0));
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
213 v10 = pParty->uCurrentHour;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
214 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
215 if ( (signed int)pParty->uCurrentHour <= 12 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
216 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
217 if ( !v10 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
218 v10 = 12;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
219 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
220 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
221 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
222 v10 -= 12;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
223 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
224 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
225 if ( pTexture_RestUI_CurrentHourglassFrame )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
226 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
227 pTexture_RestUI_CurrentHourglassFrame->Release();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
228 pIcons_LOD->_40F9C5();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
229 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
230 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
231 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
232 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
233 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
234 v3 = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
235 _507CD4_RestUI_hourglass_anim_controller = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
236 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
237 v9 = v3;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
238 v8 = (double)v3 / 512.0 * 120.0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
239 //v7 = v8 + 6.7553994e15;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
240 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
241 hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
242 //hourglass_icon_idx = v4;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
243 if (hourglass_icon_idx >= 120 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
244 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
245 //v4 = 1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
246 hourglass_icon_idx = 1;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
247 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
248 sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
249 pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
250 pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
251 memset(&Dst, 0, 0xBCu);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
252 Dst.uX = 24;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
253 Dst.uY = 154;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
254 Dst.uWidth = 171;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
255 Dst.uHeight = 37;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
256 Dst.uZ = 194;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
257 Dst.uW = 190;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
258 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
259 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
260 Dst.pParent = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
261 sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
262 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
263 pButton_RestUI_WaitUntilDawn->DrawLabel(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
264 pGlobalTXT_LocalizationStrings[237],
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
265 pFontCreate,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
266 a5,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
267 *(int **)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
268 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
269 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
270 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
271 memset(&Dst, 0, 0xBCu);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
272 Dst.uX = 45;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
273 Dst.uY = 199;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
274 Dst.uWidth = 185;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
275 Dst.uHeight = 30;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
276 Dst.uZ = 229;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
277 Dst.uW = 228;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
278 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
279 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
280 Dst.pParent = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
281 v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
282 sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
283 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
284 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
285 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
286 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
287 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
288 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
289 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
290 if ( dword_506F14 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
291 Sleep6Hours();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
292 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
293 else
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
294 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
295 GUIWindow::Create(
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
296 pButton_RestUI_Exit->uX,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
297 pButton_RestUI_Exit->uY,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
298 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
299 0,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
300 (enum WindowType)96,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
301 (int)pButton_RestUI_Exit,
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
302 (int)pGlobalTXT_LocalizationStrings[81]);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
303 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
304 }