annotate Game.cpp @ 2465:b054ea5daf45

cleaning project part 3
author zipi
date Sun, 17 Aug 2014 20:23:06 +0100
parents 104fdbea0386
children 48cc5e0d8fc9
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
4
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2242
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2338
diff changeset
6 #include "Arcomage.h"
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
8 #include "Vis.h"
2121
Ritor1
parents: 2114
diff changeset
9 #include "Weather.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
10 #include "LightmapBuilder.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
11 #include "DecalBuilder.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
12 #include "ParticleEngine.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
13 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
14 #include "Keyboard.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
15 #include "GammaControl.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
16 #include "stru6.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
17 #include "stru9.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
18 #include "stru10.h"
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2453
diff changeset
19 #include "ErrorHandling.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
20
0
Ritor1
parents:
diff changeset
21 #include "Game.h"
Ritor1
parents:
diff changeset
22 #include "Party.h"
Ritor1
parents:
diff changeset
23 #include "Viewport.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 2006
diff changeset
24 #include "Timer.h"
0
Ritor1
parents:
diff changeset
25 #include "Outdoor.h"
Ritor1
parents:
diff changeset
26 #include "Overlays.h"
Ritor1
parents:
diff changeset
27 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
28 #include "LOD.h"
Ritor1
parents:
diff changeset
29 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
30 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
31 #include "Bink_Smacker.h"
Ritor1
parents:
diff changeset
32 #include "Events.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 165
diff changeset
33 #include "texts.h"
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
34 #include "GUIFont.h"
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
35 #include "Log.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1214
diff changeset
36 #include "Lights.h"
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
37 #include "CastSpellInfo.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
38 #include "FrameTableInc.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
39 #include "Actor.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
40 #include "GUIProgressBar.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
41 #include "ObjectList.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
42 #include "Level/Decoration.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
43 #include "PaletteManager.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
44 #include "UI\UIHouses.h"
2350
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2348
diff changeset
45 #include "UI\UIShops.h"
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2348
diff changeset
46 #include "UI\UIPartyCreation.h"
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
47 #include "SaveLoad.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
48 #include "SpriteObject.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
49 #include "mm7.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
50 #include "Sprites.h"
2341
d6407efaa4ea Moving registry access stuff to Registry.h/cpp
Grumpy7
parents: 2339
diff changeset
51 #include "Registry.h"
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2341
diff changeset
52 #include "Chest.h"
0
Ritor1
parents:
diff changeset
53
2348
4100fb5c4913 Created header files for UI cpp files
Grumpy7
parents: 2347
diff changeset
54 #include "UI\UIGame.h"
0
Ritor1
parents:
diff changeset
55
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
56 #include "DecorationList.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
57 #include "IconFrameTable.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
58 #include "PlayerFrameTable.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
59 #include "MapsLongTimer.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
60 #include "StorylineTextTable.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
61 #include "FactionTable.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
62 #include "stru123.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
63 #include "LuaVM.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
64 #include "RenderD3D11.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
65 #include "MMT.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
66 #include "NewUI\MainMenu.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
67 #include <direct.h>
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
68
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
69
0
Ritor1
parents:
diff changeset
70
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
73
0
Ritor1
parents:
diff changeset
74 Game *pGame;
Ritor1
parents:
diff changeset
75
Ritor1
parents:
diff changeset
76
Ritor1
parents:
diff changeset
77
Ritor1
parents:
diff changeset
78
Ritor1
parents:
diff changeset
79
Ritor1
parents:
diff changeset
80 //----- (00435694) --------------------------------------------------------
Ritor1
parents:
diff changeset
81 void Game::ToggleFlags2(unsigned int uFlag)
Ritor1
parents:
diff changeset
82 {
Ritor1
parents:
diff changeset
83 unsigned int v2; // eax@1
Ritor1
parents:
diff changeset
84
Ritor1
parents:
diff changeset
85 v2 = this->uFlags2;
Ritor1
parents:
diff changeset
86 if ( v2 & uFlag )
Ritor1
parents:
diff changeset
87 this->uFlags2 = v2 & ~uFlag;
Ritor1
parents:
diff changeset
88 else
Ritor1
parents:
diff changeset
89 this->uFlags2 = uFlag | v2;
Ritor1
parents:
diff changeset
90 }
Ritor1
parents:
diff changeset
91
Ritor1
parents:
diff changeset
92 //----- (0044103C) --------------------------------------------------------
Ritor1
parents:
diff changeset
93 void Game::Draw()
Ritor1
parents:
diff changeset
94 {
Ritor1
parents:
diff changeset
95 int v4; // edi@26
Ritor1
parents:
diff changeset
96
1556
e668660457dc Some more cleaning
Nomad
parents: 1545
diff changeset
97 uFlags2 &= ~0x02;
0
Ritor1
parents:
diff changeset
98 if ( pParty->_497FC5_check_party_perception_against_level() )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2259
diff changeset
99 uFlags2 |= 2;
1638
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1556
diff changeset
100
1640
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
101 pGame->pIndoorCameraD3D->sRotationX = pParty->sRotationX;
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
102 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY;
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
103 pGame->pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pParty->sRotationY / 2048.0);
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
104 pGame->pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pParty->sRotationY / 2048.0);
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
105 pGame->pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353
1638
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1556
diff changeset
106
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1556
diff changeset
107 //pIndoorCamera->Initialize2();
1642
8971dc85b8fb More camera unifications.
Nomad
parents: 1640
diff changeset
108 pIndoorCameraD3D->CalculateRotations(pParty->sRotationX, pParty->sRotationY);
0
Ritor1
parents:
diff changeset
109 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
Ritor1
parents:
diff changeset
110 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
Ritor1
parents:
diff changeset
111
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
112 if ( pMovie_Track )
0
Ritor1
parents:
diff changeset
113 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
114 /*if ( !pRenderer->pRenderD3D )
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
115 {
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
116 pRenderer->BeginSceneD3D();
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
117 pMouse->DrawCursorToTarget();
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
118 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
119 }*/
0
Ritor1
parents:
diff changeset
120 }
Ritor1
parents:
diff changeset
121 else
Ritor1
parents:
diff changeset
122 {
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
123 if ( pParty->vPosition.x != pParty->vPrevPosition.x || pParty->sRotationY != pParty->sPrevRotationY || pParty->vPosition.y != pParty->vPrevPosition.y
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
124 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel )
0
Ritor1
parents:
diff changeset
125 pParty->uFlags |= 2u;
847
e398541aee60 fixed party save position
Gloval
parents: 831
diff changeset
126 pParty->vPrevPosition.x = pParty->vPosition.x;
78
d56c13146285 Rotate fixed correct
Ritor1
parents: 77
diff changeset
127 pParty->vPrevPosition.y = pParty->vPosition.y;
847
e398541aee60 fixed party save position
Gloval
parents: 831
diff changeset
128 pParty->vPrevPosition.z = pParty->vPosition.z;
0
Ritor1
parents:
diff changeset
129 //v0 = &pRenderer;
Ritor1
parents:
diff changeset
130 pParty->sPrevRotationY = pParty->sRotationY;
Ritor1
parents:
diff changeset
131 pParty->sPrevRotationX = pParty->sRotationX;
847
e398541aee60 fixed party save position
Gloval
parents: 831
diff changeset
132
0
Ritor1
parents:
diff changeset
133 pParty->sPrevEyelevel = pParty->sEyelevel;
Ritor1
parents:
diff changeset
134 pRenderer->BeginSceneD3D();
Ritor1
parents:
diff changeset
135
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
136 //if ( !pRenderer->pRenderD3D )
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
137 //pMouse->DrawCursorToTarget();
265
96bc024a5fed Render overflows
Nomad
parents: 227
diff changeset
138 if ( !PauseGameDrawing() || viewparams->field_48 == 1 )
0
Ritor1
parents:
diff changeset
139 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
140 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
141 {
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
142 float v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0;
0
Ritor1
parents:
diff changeset
143 //v3 = v2 + 6.7553994e15;
Ritor1
parents:
diff changeset
144 //pRenderer->field_1036A8_bitmapid = LODWORD(v3);
265
96bc024a5fed Render overflows
Nomad
parents: 227
diff changeset
145 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f);
0
Ritor1
parents:
diff changeset
146 }
Ritor1
parents:
diff changeset
147
Ritor1
parents:
diff changeset
148 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
149 pIndoor->Draw();
Ritor1
parents:
diff changeset
150 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
151 pOutdoor->Draw();
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2453
diff changeset
152 else
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2453
diff changeset
153 Error("Invalid level type: %u", uCurrentlyLoadedLevelType);
0
Ritor1
parents:
diff changeset
154
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
155 //if (pRenderer->pRenderD3D)
0
Ritor1
parents:
diff changeset
156 {
Ritor1
parents:
diff changeset
157 pDecalBuilder->DrawBloodsplats();
1394
8ea496564034 Some LightmapBuilder renames.
Nomad
parents: 1391
diff changeset
158 pGame->pLightmapBuilder->DrawLightmapsType(2);
0
Ritor1
parents:
diff changeset
159 }
Ritor1
parents:
diff changeset
160 }
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
161 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
0
Ritor1
parents:
diff changeset
162 }
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
163
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
164 //DEBUG: force redraw gui
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
165 viewparams->bRedrawGameUI = true;
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
166
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
167
0
Ritor1
parents:
diff changeset
168 pRenderer->BeginScene();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
169 //if (pRenderer->pRenderD3D)
0
Ritor1
parents:
diff changeset
170 pMouse->DrawCursorToTarget();
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
171 if (pOtherOverlayList->bRedraw)
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
172 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
173 v4 = viewparams->bRedrawGameUI;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
174 GameUI_Footer();
0
Ritor1
parents:
diff changeset
175 if (!viewparams->bRedrawGameUI)
Ritor1
parents:
diff changeset
176 GameUI_DrawRightPanelItems();
Ritor1
parents:
diff changeset
177 else
Ritor1
parents:
diff changeset
178 {
Ritor1
parents:
diff changeset
179 GameUI_DrawRightPanelFrames();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
180 GameUI_Footer_2();
0
Ritor1
parents:
diff changeset
181 viewparams->bRedrawGameUI = false;
Ritor1
parents:
diff changeset
182 }
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
183 if (!pMovie_Track)//!pVideoPlayer->pSmackerMovie)
0
Ritor1
parents:
diff changeset
184 {
2070
4231fdf46dde Minimap's drawing
Nomad
parents: 2069
diff changeset
185 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true);//redraw = pParty->uFlags & 2);
0
Ritor1
parents:
diff changeset
186 if (v4)
Ritor1
parents:
diff changeset
187 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
188 if ( !PauseGameDrawing() /*&& pRenderer->pRenderD3D*/) // clear game viewport with transparent color
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
189 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pViewport->uViewportBR_X - pViewport->uViewportTL_X,
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
190 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
191 0x7FF);
0
Ritor1
parents:
diff changeset
192 viewparams->field_48 = 0;
Ritor1
parents:
diff changeset
193 }
Ritor1
parents:
diff changeset
194 }
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
195
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
196 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw;
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
197 pOtherOverlayList->bRedraw = 0;
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
198
0
Ritor1
parents:
diff changeset
199 GameUI_DrawPartySpells();
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 271
diff changeset
200 if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C )
994
3431f6abc786 GameUI clean
Nomad
parents: 983
diff changeset
201 GameUI_DrawHiredNPCs();
0
Ritor1
parents:
diff changeset
202 GameUI_DrawPortraits(v4);
Ritor1
parents:
diff changeset
203 GameUI_DrawLifeManaBars();
Ritor1
parents:
diff changeset
204 GameUI_DrawCharacterSelectionFrame();
2205
db94443ea4e7 _44100D_should_alter_right_panel()
Ritor1
parents: 2202
diff changeset
205 if ( _44100D_should_alter_right_panel() )
994
3431f6abc786 GameUI clean
Nomad
parents: 983
diff changeset
206 GameUI_DrawRightPanel();
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
207 if ( !pMovie_Track )
0
Ritor1
parents:
diff changeset
208 {
Ritor1
parents:
diff changeset
209 pStru6Instance->DrawPlayerBuffAnims();
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 484
diff changeset
210 pOtherOverlayList->DrawTurnBasedIcon(v4);
0
Ritor1
parents:
diff changeset
211 GameUI_DrawTorchlightAndWizardEye();
Ritor1
parents:
diff changeset
212 }
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
213
794
Nomad
parents: 791
diff changeset
214
Nomad
parents: 791
diff changeset
215 static bool render_framerate = false;
Nomad
parents: 791
diff changeset
216 static float framerate = 0.0f;
Nomad
parents: 791
diff changeset
217 static uint frames_this_second = 0;
Nomad
parents: 791
diff changeset
218 static uint last_frame_time = GetTickCount();
Nomad
parents: 791
diff changeset
219 static uint framerate_time_elapsed = 0;
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2460
diff changeset
220
2123
de5cdcb03fda sky for snow
Ritor1
parents: 2122
diff changeset
221 if ( pCurrentScreen == SCREEN_GAME && uCurrentlyLoadedLevelType == LEVEL_Outdoor)
2122
5b654c03a11e for snow in house
Ritor1
parents: 2121
diff changeset
222 pWeather->Draw();//Ritor1: my include
794
Nomad
parents: 791
diff changeset
223
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2460
diff changeset
224 //while(GetTickCount() - last_frame_time < 33 );//FPS control
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
225 uint frame_dt = GetTickCount() - last_frame_time;
794
Nomad
parents: 791
diff changeset
226 last_frame_time = GetTickCount();
Nomad
parents: 791
diff changeset
227
Nomad
parents: 791
diff changeset
228 framerate_time_elapsed += frame_dt;
Nomad
parents: 791
diff changeset
229 if (framerate_time_elapsed >= 1000)
Nomad
parents: 791
diff changeset
230 {
Nomad
parents: 791
diff changeset
231 framerate = frames_this_second * (1000.0f / framerate_time_elapsed);
Nomad
parents: 791
diff changeset
232
Nomad
parents: 791
diff changeset
233 framerate_time_elapsed = 0;
Nomad
parents: 791
diff changeset
234 frames_this_second = 0;
Nomad
parents: 791
diff changeset
235 render_framerate = true;
Nomad
parents: 791
diff changeset
236 }
Nomad
parents: 791
diff changeset
237
Nomad
parents: 791
diff changeset
238 ++frames_this_second;
Nomad
parents: 791
diff changeset
239
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
240 if ( debug_information )
794
Nomad
parents: 791
diff changeset
241 {
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
242 if (render_framerate)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
243 {
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
244 sprintf(pTmpBuf.data(), "FPS: % .4f", framerate);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
245 pPrimaryWindow->DrawText(pFontArrus, 494, 0, Color16(0, 0, 0), pTmpBuf.data(), 0, 0, 0);
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
246 }
794
Nomad
parents: 791
diff changeset
247
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
248 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
249 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
250 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
251 sprintf(pTmpBuf.data(), "Party Sector ID: %u/%u\n", sector_id, pIndoor->uNumSectors);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
252 pPrimaryWindow->DrawText(pFontArrus, 16, 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1);
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
253 }
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
254 sprintf(pTmpBuf.data(), "Party Position: % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
255 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1);
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
256
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
257 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
258 {
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
259 uint uFaceID;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
260 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
261 int floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + 40, sector_id, &uFaceID);
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
262 sprintf(pTmpBuf.data(), "BLV_GetFloorLevel: %d face_id %d\n", floor_level, uFaceID);
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
263 }
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
264 else
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
265 {
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
266 int on_water, _a6;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
267 int floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false);
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
268 sprintf(pTmpBuf.data(), "ODM_GetFloorLevel: %d on_water: %s a6 = %d\n", floor_level, on_water ? "true" : "false", _a6);
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
269 }
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
270 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1);
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
271 }
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
272
0
Ritor1
parents:
diff changeset
273 GUI_UpdateWindows();
130
1c471f3629fb Party expressions update
Nomad
parents: 121
diff changeset
274 pParty->UpdatePlayersAndHirelingsEmotions();
937
ae747684f644 stru279 removed.
Nomad
parents: 872
diff changeset
275
434
137c59c3dbc4 Temple of Moon and Dragon Lair can now be entered.
Nomad
parents: 378
diff changeset
276 _unused_5B5924_is_travel_ui_drawn = false;
0
Ritor1
parents:
diff changeset
277 if (v4)
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
278 pMouse->bRedraw = true;
2216
3f375342de12 window->GetWidth() continue
Ritor1
parents: 2215
diff changeset
279 pMouse->ReadCursorWithItem();
0
Ritor1
parents:
diff changeset
280 pMouse->DrawCursor();
2216
3f375342de12 window->GetWidth() continue
Ritor1
parents: 2215
diff changeset
281 pMouse->Activate();
0
Ritor1
parents:
diff changeset
282 pRenderer->EndScene();
Ritor1
parents:
diff changeset
283 pRenderer->Present();
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 484
diff changeset
284 pParty->uFlags &= ~2;
0
Ritor1
parents:
diff changeset
285 }
Ritor1
parents:
diff changeset
286
Ritor1
parents:
diff changeset
287 //----- (0047A815) --------------------------------------------------------
Ritor1
parents:
diff changeset
288 void Game::DrawParticles()
Ritor1
parents:
diff changeset
289 {
Ritor1
parents:
diff changeset
290 pParticleEngine->Draw();
Ritor1
parents:
diff changeset
291 }
Ritor1
parents:
diff changeset
292
Ritor1
parents:
diff changeset
293 //----- (00463149) --------------------------------------------------------
Ritor1
parents:
diff changeset
294 void Game::Loop()
Ritor1
parents:
diff changeset
295 {
Ritor1
parents:
diff changeset
296 const char *pLocationName; // [sp-4h] [bp-68h]@74
Ritor1
parents:
diff changeset
297 bool bLoading; // [sp+10h] [bp-54h]@1
Ritor1
parents:
diff changeset
298 signed int v16; // [sp+14h] [bp-50h]@8
Ritor1
parents:
diff changeset
299 MSG Msg; // [sp+28h] [bp-3Ch]@20
Ritor1
parents:
diff changeset
300 char Source[64]; // [sp+44h] [bp-20h]@76
Ritor1
parents:
diff changeset
301
2006
30c2b575d25c signed fixes
zipi
parents: 1994
diff changeset
302 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu;
0
Ritor1
parents:
diff changeset
303 SetCurrentMenuID((MENU_STATE)-1);
2126
a2da7afb41b4 fix for previous commit load error
zipi
parents: 2124
diff changeset
304 if (bLoading)
0
Ritor1
parents:
diff changeset
305 {
Ritor1
parents:
diff changeset
306 pParty->Reset();
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
307 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
308 LoadGame(uLoadGameUI_SelectedSlot);
Ritor1
parents:
diff changeset
309 }
Ritor1
parents:
diff changeset
310
Ritor1
parents:
diff changeset
311 for (uint i = 1; i < 5; ++i)
Ritor1
parents:
diff changeset
312 for (uint j = 1; j < 6; ++j)
Ritor1
parents:
diff changeset
313 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
314 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
315 remove(pTmpBuf.data());
0
Ritor1
parents:
diff changeset
316 }
Ritor1
parents:
diff changeset
317
Ritor1
parents:
diff changeset
318 LoadPlayerPortraintsAndVoices();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
319 pIcons_LOD->_inlined_sub1();
328
8e23edf57e27 little fix
Ritor1
parents: 323
diff changeset
320 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
0
Ritor1
parents:
diff changeset
321
Ritor1
parents:
diff changeset
322 while ( 2 )
Ritor1
parents:
diff changeset
323 {
Ritor1
parents:
diff changeset
324 v16 = 1;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
325 pMessageQueue_50CBD0->Flush();
0
Ritor1
parents:
diff changeset
326
Ritor1
parents:
diff changeset
327 pPartyActionQueue->uNumActions = 0;
Ritor1
parents:
diff changeset
328 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
329 {
Ritor1
parents:
diff changeset
330 pTurnEngine->End(false);
Ritor1
parents:
diff changeset
331 pParty->bTurnBasedModeOn = false;
Ritor1
parents:
diff changeset
332 }
Ritor1
parents:
diff changeset
333 DoPrepareWorld(bLoading, 1);
Ritor1
parents:
diff changeset
334 pEventTimer->Resume();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
335 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
0
Ritor1
parents:
diff changeset
336 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
337 pCurrentScreen = SCREEN_GAME;
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
338
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
339 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
340 pGame->pVisInstance->_4C1A02();
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
341
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
342 bool game_finished = false;
0
Ritor1
parents:
diff changeset
343 do
Ritor1
parents:
diff changeset
344 {
Ritor1
parents:
diff changeset
345 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) )
Ritor1
parents:
diff changeset
346 {
Ritor1
parents:
diff changeset
347 if ( Msg.message == WM_QUIT )
Ritor1
parents:
diff changeset
348 Game_DeinitializeAndTerminate(0);
Ritor1
parents:
diff changeset
349 TranslateMessage(&Msg);
Ritor1
parents:
diff changeset
350 DispatchMessageA(&Msg);
Ritor1
parents:
diff changeset
351 }
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
352 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
0
Ritor1
parents:
diff changeset
353 {
Ritor1
parents:
diff changeset
354 WaitMessage();
Ritor1
parents:
diff changeset
355 continue;
Ritor1
parents:
diff changeset
356 }
Ritor1
parents:
diff changeset
357 pGame->_44EEA7();
Ritor1
parents:
diff changeset
358 GameUI_WritePointedObjectStatusString();
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
359 Keyboard::ProcessInputActions();
0
Ritor1
parents:
diff changeset
360 GameUI_MsgProc();
Ritor1
parents:
diff changeset
361 if ( pArcomageGame->bGameInProgress )
Ritor1
parents:
diff changeset
362 {
Ritor1
parents:
diff changeset
363 ArcomageGame::Loop();
Ritor1
parents:
diff changeset
364 pRenderer->Present();
Ritor1
parents:
diff changeset
365 continue;
Ritor1
parents:
diff changeset
366 }
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1642
diff changeset
367
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
368 pMediaPlayer->HouseMovieLoop();
2456
83174b7b3763 removed VideoPlayer.cpp/h and CShow.cpp/.h for MVS 2012
Ritor1
parents: 2454
diff changeset
369
983
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
370 pEventTimer->Update();
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
371 pMiscTimer->Update();
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
372
0
Ritor1
parents:
diff changeset
373 OnTimer(0);
Ritor1
parents:
diff changeset
374 GameUI_StatusBar_UpdateTimedString(0);
Ritor1
parents:
diff changeset
375 if ( pMiscTimer->bPaused && !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
376 pMiscTimer->Resume();
Ritor1
parents:
diff changeset
377 if ( pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn )
Ritor1
parents:
diff changeset
378 pEventTimer->bTackGameTime = 0;
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
379 if ( !pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING)
0
Ritor1
parents:
diff changeset
380 {
Ritor1
parents:
diff changeset
381 if ( !pEventTimer->bTackGameTime )
Ritor1
parents:
diff changeset
382 _494035_timed_effects__water_walking_damage__etc();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
383
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
384 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001)
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
385 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001;
0
Ritor1
parents:
diff changeset
386 else
Ritor1
parents:
diff changeset
387 {
2338
1e865e8690ba Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents: 2336
diff changeset
388 Actor::UpdateActorAI();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
389 UpdateUserInput_and_MapSpecificStuff();
0
Ritor1
parents:
diff changeset
390 }
Ritor1
parents:
diff changeset
391 }
Ritor1
parents:
diff changeset
392 if ( v16 )
Ritor1
parents:
diff changeset
393 {
Ritor1
parents:
diff changeset
394 v16 = 0;
Ritor1
parents:
diff changeset
395 viewparams->bRedrawGameUI = true;
Ritor1
parents:
diff changeset
396 }
378
50875632e776 AudioPlayer::UpdateSounds (004AAFCF) take 1
Nomad
parents: 328
diff changeset
397 pAudioPlayer->UpdateSounds();
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
398 if ( (signed int)uGameState == GAME_STATE_PLAYING )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
399 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
400 pGame->Draw();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
401 continue;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
402 }
978
9334a8c59c8d uGameState
Ritor1
parents: 961
diff changeset
403 if (uGameState == GAME_FINISHED)
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 0
diff changeset
404 {
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
405 game_finished = true;
0
Ritor1
parents:
diff changeset
406 continue;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 0
diff changeset
407 }
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
408 if (uGameState == GAME_STATE_CHANGE_LOCATION)// ñìåíà ëîêàöèè
0
Ritor1
parents:
diff changeset
409 {
Ritor1
parents:
diff changeset
410 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
411 PrepareWorld(0);
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
412 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
413 continue;
Ritor1
parents:
diff changeset
414 }
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2131
diff changeset
415 if ( (signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU )//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 0
diff changeset
416 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
417 game_finished = true;
0
Ritor1
parents:
diff changeset
418 continue;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 0
diff changeset
419 }
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
420 if ( uGameState == GAME_STATE_FINAL_WINDOW )
0
Ritor1
parents:
diff changeset
421 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
422 pRenderer->BeginScene();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
423 GUI_UpdateWindows();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
424 pRenderer->EndScene();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
425 pRenderer->Present();
0
Ritor1
parents:
diff changeset
426 continue;
Ritor1
parents:
diff changeset
427 }
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
428 if ( uGameState != GAME_STATE_PARTY_DIED )
0
Ritor1
parents:
diff changeset
429 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
430 pGame->Draw();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
431 continue;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
432 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
433 if ( uGameState == GAME_STATE_PARTY_DIED )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
434 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
435 pAudioPlayer->StopChannels(-1, -1);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
436 memset(&pParty->pHirelings[0], 0, 0x4Cu);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
437 memset(&pParty->pHirelings[1], 0, 0x4Cu);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
438 for ( int i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i )
0
Ritor1
parents:
diff changeset
439 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
440 if ( pNPCStats->pNewNPCData[i].field_24 )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
441 pNPCStats->pNewNPCData[i].uFlags &= 0xFFFFFF7Fu;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
442 }
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
443 pMediaPlayer->bStopBeforeSchedule = 0;
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2453
diff changeset
444 pMediaPlayer->PlayFullscreenMovie(MOVIE_Death, true);
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
445 if ( pMovie_Track )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
446 pMediaPlayer->Unload();
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
447 SaveGame(0, 0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
448 ++pParty->uNumDeaths;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
449 for ( uint i = 0; i < 4; ++i )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
450 pParty->pPlayers[i].SetVariable(VAR_Award, 85);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
451 pParty->days_played_without_rest = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
452 pParty->uTimePlayed += 0x276000ui64;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
453 LOWORD(pParty->uFlags) &= ~0x204;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
454 pParty->SetGold(0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
455 pOtherOverlayList->Reset();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
456 memset(pParty->pPartyBuffs.data(), 0, 0x140u);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
457
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
458 if ( pParty->bTurnBasedModeOn == 1 )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
459 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
460 pTurnEngine->End(true);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
461 pParty->bTurnBasedModeOn = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
462 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
463 for( int i = 0; i < 4; ++i)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
464 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
465 memset(pParty->pPlayers[i].pConditions.data(), 0, 0xA0u);//(pConditions, 0, 160)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
466 memset(pParty->pPlayers[i].pPlayerBuffs.data(), 0, 0x180u);//(pPlayerBuffs[0], 0, 384)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
467 pParty->pPlayers[i].sHealth = 1;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
468 uActiveCharacter = 1;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
469 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
470 if (_449B57_test_bit(pParty->_quest_bits, PARTY_QUEST_FINISHED_EMERALD_ISLE))
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
471 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
472 pParty->vPosition.x = -17331; // respawn in harmondale
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
473 pParty->vPosition.y = 12547;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
474 pParty->vPosition.z = 465;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
475 pParty->sRotationY = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
476 pLocationName = "out02.odm";
0
Ritor1
parents:
diff changeset
477 }
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
478 else
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
479 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
480 pParty->vPosition.x = 12552; // respawn on emerald isle
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
481 pParty->vPosition.y = 1816;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
482 pParty->vPosition.z = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
483 pParty->sRotationY = 512;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
484 pLocationName = "out01.odm";
0
Ritor1
parents:
diff changeset
485 }
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
486 strcpy(Source, pLocationName);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
487 pParty->uFallStartY = pParty->vPosition.z;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
488 pParty->sRotationX = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
489 pParty->uFallSpeed = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
490 pParty->field_6E4 = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
491 pParty->field_6E0 = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
492 if ( _stricmp(Source, pCurrentMapName) )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
493 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
494 strcpy(pCurrentMapName, Source);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
495 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
496 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
497 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
498 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
499 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
500 dword_5B65C0 = 1;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
501 PrepareWorld(1);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
502 }
2338
1e865e8690ba Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents: 2336
diff changeset
503 Actor::InitializeActors();
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
504
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
505 int num_conscious_players = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
506 int conscious_players_ids[4] = {-1, -1, -1, -1};
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
507 for (int i = 0; i < 4; ++i)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
508 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
509 if (pParty->pPlayers[i].CanAct())
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
510 conscious_players_ids[num_conscious_players++] = i;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
511 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
512 if (num_conscious_players)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
513 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
514 int idx = conscious_players_ids[rand() % num_conscious_players];
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
515 Assert(idx >= 0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
516 pParty->pPlayers[idx].PlaySound(SPEECH_99, 0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
517 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
518
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
519 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2);// "Once again you've cheated death!.." "Âû ñíîâà îáõèòðèëè ñìåðòü! …"
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
520 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
521 }
Ritor1
parents:
diff changeset
522 }
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
523 while (!game_finished);
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
524
0
Ritor1
parents:
diff changeset
525 pEventTimer->Pause();
Ritor1
parents:
diff changeset
526 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
1214
0d6c7ff3cddd simplified stru193_math constructor and class definition
Grumpy7
parents: 1205
diff changeset
527 if ( uGameState == GAME_STATE_LOADING_GAME )
0
Ritor1
parents:
diff changeset
528 {
Ritor1
parents:
diff changeset
529 sub_491E3A();
Ritor1
parents:
diff changeset
530 LoadPlayerPortraintsAndVoices();
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
531 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
532 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
Ritor1
parents:
diff changeset
533 bLoading = true;
Ritor1
parents:
diff changeset
534 continue;
Ritor1
parents:
diff changeset
535 }
Ritor1
parents:
diff changeset
536 break;
Ritor1
parents:
diff changeset
537 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
538 pCurrentScreen = SCREEN_VIDEO;
0
Ritor1
parents:
diff changeset
539 sub_491E3A();
Ritor1
parents:
diff changeset
540 }
Ritor1
parents:
diff changeset
541
Ritor1
parents:
diff changeset
542
Ritor1
parents:
diff changeset
543 //----- (0044F192) --------------------------------------------------------
Ritor1
parents:
diff changeset
544 void Game::PrepareBloodsplats()
Ritor1
parents:
diff changeset
545 {
Ritor1
parents:
diff changeset
546 for (uint i = 0; i < uNumBloodsplats; ++i)
Ritor1
parents:
diff changeset
547 {
2210
Ritor1
parents: 2205
diff changeset
548 pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z,
Ritor1
parents: 2205
diff changeset
549 pBloodsplats[i].radius, pBloodsplats[i].r, pBloodsplats[i].g, pBloodsplats[i].b);
0
Ritor1
parents:
diff changeset
550 }
Ritor1
parents:
diff changeset
551 }
Ritor1
parents:
diff changeset
552
Ritor1
parents:
diff changeset
553
Ritor1
parents:
diff changeset
554 //----- (0044F120) --------------------------------------------------------
Ritor1
parents:
diff changeset
555 void Game::PushStationaryLights(int a2)
Ritor1
parents:
diff changeset
556 {
1094
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
557 Game__StationaryLight* pLight;
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
558
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
559 for( int i=0; i<uNumStationaryLights; ++i )
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
560 {
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
561 pLight=&pStationaryLights[i];
2210
Ritor1
parents: 2205
diff changeset
562 pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z,
Ritor1
parents: 2205
diff changeset
563 pLight->flt_18, pLight->vRGBColor.x, pLight->vRGBColor.y, pLight->vRGBColor.z, _4E94D0_light_type);
1094
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
564 }
0
Ritor1
parents:
diff changeset
565 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
566 // 4E94D0: using guessed type char _4E94D0_light_type;
0
Ritor1
parents:
diff changeset
567
Ritor1
parents:
diff changeset
568 //----- (0044F0FD) --------------------------------------------------------
Ritor1
parents:
diff changeset
569 void Game::_44F0FD()
Ritor1
parents:
diff changeset
570 {
Ritor1
parents:
diff changeset
571 ToggleFlags(0x40u);
Ritor1
parents:
diff changeset
572
Ritor1
parents:
diff changeset
573 if ( !(uFlags & 0x40) )
Ritor1
parents:
diff changeset
574 {
Ritor1
parents:
diff changeset
575 uNumBloodsplats = 0;
Ritor1
parents:
diff changeset
576 field_E0C = 0;
Ritor1
parents:
diff changeset
577 }
Ritor1
parents:
diff changeset
578 }
Ritor1
parents:
diff changeset
579
Ritor1
parents:
diff changeset
580 //----- (0044F0D8) --------------------------------------------------------
Ritor1
parents:
diff changeset
581 void Game::ToggleFlags(uint uMask)
Ritor1
parents:
diff changeset
582 {
Ritor1
parents:
diff changeset
583 if (uFlags & uMask)
Ritor1
parents:
diff changeset
584 uFlags &= ~uMask;
Ritor1
parents:
diff changeset
585 else
Ritor1
parents:
diff changeset
586 uFlags |= uMask;
Ritor1
parents:
diff changeset
587 }
Ritor1
parents:
diff changeset
588
Ritor1
parents:
diff changeset
589
Ritor1
parents:
diff changeset
590 //----- (0044F07B) --------------------------------------------------------
Ritor1
parents:
diff changeset
591 bool Game::_44F07B()
Ritor1
parents:
diff changeset
592 {
2210
Ritor1
parents: 2205
diff changeset
593 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
Ritor1
parents: 2205
diff changeset
594 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
0
Ritor1
parents:
diff changeset
595 pKeyboardInstance->WasKeyPressed(VK_F11)))
Ritor1
parents:
diff changeset
596 return true;
Ritor1
parents:
diff changeset
597 return false;
Ritor1
parents:
diff changeset
598 }
Ritor1
parents:
diff changeset
599
Ritor1
parents:
diff changeset
600 //----- (0044EEA7) --------------------------------------------------------
Ritor1
parents:
diff changeset
601 bool Game::_44EEA7()
Ritor1
parents:
diff changeset
602 {
Ritor1
parents:
diff changeset
603 //Game *v1; // esi@1
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
604 //double v2; // st7@2
0
Ritor1
parents:
diff changeset
605 float depth; // ST00_4@9
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
606 //bool result; // eax@9
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
607 //unsigned int v5; // eax@14
0
Ritor1
parents:
diff changeset
608 __int64 v6; // kr00_8@21
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
609 //unsigned int y; // [sp+4h] [bp-24h]@2
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
610 //unsigned int x; // [sp+8h] [bp-20h]@2
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
611 Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
612 Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
613 POINT cursor; // [sp+20h] [bp-8h]@1
0
Ritor1
parents:
diff changeset
614
Ritor1
parents:
diff changeset
615 //v1 = this;
Ritor1
parents:
diff changeset
616 ++qword_5C6DF0;
Ritor1
parents:
diff changeset
617 pParticleEngine->UpdateParticles();
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
618 pMouseInstance->GetCursorPos(&cursor);
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
619
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
620 //x = cursor.y;
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
621 //y = cursor.x;
0
Ritor1
parents:
diff changeset
622 if ( sub_4637E0_is_there_popup_onscreen() )
Ritor1
parents:
diff changeset
623 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
624 v11 = &vis_face_filter;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
625 v10 = &vis_sprite_filter_2;
871
710cf848ad24 Particle engine made working.
Nomad
parents: 831
diff changeset
626 depth = pGame->pIndoorCameraD3D->GetPickDepth();
0
Ritor1
parents:
diff changeset
627 }
Ritor1
parents:
diff changeset
628 else
Ritor1
parents:
diff changeset
629 {
592
96f48cfdd657 some flags
Nomad
parents: 569
diff changeset
630 if ( uFlags2 & GAME_FLAGS_2_TARGETING_MODE )
0
Ritor1
parents:
diff changeset
631 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
632 v11 = &vis_face_filter;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
633 v10 = &vis_sprite_filter_1;
0
Ritor1
parents:
diff changeset
634 }
Ritor1
parents:
diff changeset
635 else
Ritor1
parents:
diff changeset
636 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
637 v11 = &vis_face_filter;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
638 v10 = &vis_sprite_filter_4;
0
Ritor1
parents:
diff changeset
639 }
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
640 depth = 5120.0;
0
Ritor1
parents:
diff changeset
641 }
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
642 //depth = v2;
0
Ritor1
parents:
diff changeset
643
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
644 PickMouse(depth, cursor.x, cursor.y, false, v10, v11);
0
Ritor1
parents:
diff changeset
645 pLightmapBuilder->std__vector_000004_size = 0;
Ritor1
parents:
diff changeset
646 pLightmapBuilder->std__vector_183808_size = 0;
Ritor1
parents:
diff changeset
647 pDecalBuilder->std__vector_pDecals_size = 0;
Ritor1
parents:
diff changeset
648 pDecalBuilder->field_308008 = 0;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
649 if (!_44F07B())
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
650 return false;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
651
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 638
diff changeset
652 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
794
Nomad
parents: 791
diff changeset
653 pStru10Instance->bDoNotDrawPortalFrustum = false;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
654 if ( /*pRenderer->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor)
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
655 pRenderer->uFogColor = GetLevelFogColor() & 0xFFFFFF;
0
Ritor1
parents:
diff changeset
656 if (uFlags & 0x0400)
Ritor1
parents:
diff changeset
657 uFlags2 |= 0x01;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
658 /*if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive )
0
Ritor1
parents:
diff changeset
659 {
Ritor1
parents:
diff changeset
660 uFlags2 |= 0x01;
Ritor1
parents:
diff changeset
661 field_E10 = qword_5C6DF0;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
662 }*/
0
Ritor1
parents:
diff changeset
663 v6 = qword_5C6DF0 - field_E10;
Ritor1
parents:
diff changeset
664 if ( qword_5C6DF0 - field_E10 == 1 )
Ritor1
parents:
diff changeset
665 uFlags2 |= v6;
Ritor1
parents:
diff changeset
666 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive )
Ritor1
parents:
diff changeset
667 {
2210
Ritor1
parents: 2205
diff changeset
668 uFlags2 |= 1;
0
Ritor1
parents:
diff changeset
669 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive;
Ritor1
parents:
diff changeset
670 }
Ritor1
parents:
diff changeset
671 _44E904();
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
672 return true;
0
Ritor1
parents:
diff changeset
673 }
Ritor1
parents:
diff changeset
674
Ritor1
parents:
diff changeset
675
Ritor1
parents:
diff changeset
676 //----- (0044EDE4) --------------------------------------------------------
2006
30c2b575d25c signed fixes
zipi
parents: 1994
diff changeset
677 bool Game::AlterGamma_BLV(BLVFace *pFace, signed int *pColor)
0
Ritor1
parents:
diff changeset
678 {
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
679 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
680 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
0
Ritor1
parents:
diff changeset
681 {
Ritor1
parents:
diff changeset
682 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
Ritor1
parents:
diff changeset
683 return true;
Ritor1
parents:
diff changeset
684 }
Ritor1
parents:
diff changeset
685 else
Ritor1
parents:
diff changeset
686 return false;
Ritor1
parents:
diff changeset
687 }
Ritor1
parents:
diff changeset
688
Ritor1
parents:
diff changeset
689 //----- (0044EE30) --------------------------------------------------------
2006
30c2b575d25c signed fixes
zipi
parents: 1994
diff changeset
690 bool Game::AlterGamma_ODM(ODMFace *pFace, signed int *pColor)
0
Ritor1
parents:
diff changeset
691 {
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
692 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
693 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
0
Ritor1
parents:
diff changeset
694 {
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
695 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
0
Ritor1
parents:
diff changeset
696 return true;
Ritor1
parents:
diff changeset
697 }
Ritor1
parents:
diff changeset
698 else
Ritor1
parents:
diff changeset
699 return false;
Ritor1
parents:
diff changeset
700 }
Ritor1
parents:
diff changeset
701
Ritor1
parents:
diff changeset
702
Ritor1
parents:
diff changeset
703 //----- (004645FA) --------------------------------------------------------
Ritor1
parents:
diff changeset
704 void Game::Deinitialize()
Ritor1
parents:
diff changeset
705 {
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
706 WriteWindowsRegistryInt("startinwindow", 1);//pRenderer->bWindowMode);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
707 //if (pRenderer->bWindowMode)
0
Ritor1
parents:
diff changeset
708 {
2052
71a814f4482a Moved implementation to cpp
Nomad
parents: 2044
diff changeset
709 WriteWindowsRegistryInt("window X", window->GetX());
71a814f4482a Moved implementation to cpp
Nomad
parents: 2044
diff changeset
710 WriteWindowsRegistryInt("window Y", window->GetY());
1984
b00f5bb7d930 Added back window position saving
zipi
parents: 1980
diff changeset
711 }
0
Ritor1
parents:
diff changeset
712 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
Ritor1
parents:
diff changeset
713 pItemsTable->Release();
Ritor1
parents:
diff changeset
714 pNPCStats->Release();
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
715
0
Ritor1
parents:
diff changeset
716 if (pMouse)
Ritor1
parents:
diff changeset
717 pMouse->Deactivate();
Ritor1
parents:
diff changeset
718
1093
c59ac5ea63f5 * stru154::GetFacePlane mistake fixed
zipi
parents: 1063
diff changeset
719 delete pRenderer;
0
Ritor1
parents:
diff changeset
720 pAudioPlayer->Release();//error
Ritor1
parents:
diff changeset
721 pNew_LOD->FreeSubIndexAndIO();
Ritor1
parents:
diff changeset
722 pGames_LOD->FreeSubIndexAndIO();
Ritor1
parents:
diff changeset
723 ClipCursor(0);
Ritor1
parents:
diff changeset
724 Game::Destroy();
2442
702cc7e6eefd some more memory accesses fixed
Grumpy7
parents: 2438
diff changeset
725 delete pEventTimer;
0
Ritor1
parents:
diff changeset
726 }
Ritor1
parents:
diff changeset
727
Ritor1
parents:
diff changeset
728 //----- (0044EE7C) --------------------------------------------------------
Ritor1
parents:
diff changeset
729 bool Game::draw_debug_outlines()
Ritor1
parents:
diff changeset
730 {
Ritor1
parents:
diff changeset
731 if (uFlags & 0x04)
Ritor1
parents:
diff changeset
732 {
Ritor1
parents:
diff changeset
733 pLightmapBuilder->DrawDebugOutlines(-1);
Ritor1
parents:
diff changeset
734 pDecalBuilder->DrawDecalDebugOutlines();
Ritor1
parents:
diff changeset
735 }
Ritor1
parents:
diff changeset
736 return true;
Ritor1
parents:
diff changeset
737 }
Ritor1
parents:
diff changeset
738
Ritor1
parents:
diff changeset
739 //----- (0044EC23) --------------------------------------------------------
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
740 int Game::_44EC23(struct Polygon *a2, int *a3, signed int a4)
0
Ritor1
parents:
diff changeset
741 {
Ritor1
parents:
diff changeset
742 double v4; // st7@4
Ritor1
parents:
diff changeset
743 //double v5; // ST00_8@4
Ritor1
parents:
diff changeset
744 signed int v6; // eax@5
Ritor1
parents:
diff changeset
745 //double v7; // ST00_8@6
Ritor1
parents:
diff changeset
746 signed int result; // eax@8
Ritor1
parents:
diff changeset
747 //double v9; // ST00_8@9
Ritor1
parents:
diff changeset
748 //double v10; // ST00_8@11
Ritor1
parents:
diff changeset
749 float a2a; // [sp+14h] [bp+8h]@4
Ritor1
parents:
diff changeset
750 float a3a; // [sp+18h] [bp+Ch]@4
Ritor1
parents:
diff changeset
751 float a3b; // [sp+18h] [bp+Ch]@6
Ritor1
parents:
diff changeset
752 float a4a; // [sp+1Ch] [bp+10h]@9
Ritor1
parents:
diff changeset
753 float a4b; // [sp+1Ch] [bp+10h]@11
Ritor1
parents:
diff changeset
754
Ritor1
parents:
diff changeset
755 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 )
Ritor1
parents:
diff changeset
756 {
Ritor1
parents:
diff changeset
757 v4 = (double)a4;
Ritor1
parents:
diff changeset
758 a2a = v4;
Ritor1
parents:
diff changeset
759 *a3 |= 2u;
Ritor1
parents:
diff changeset
760 a3a = (1.0 - this->fSaturation) * v4;
Ritor1
parents:
diff changeset
761 //v5 = a3a + 6.7553994e15;
Ritor1
parents:
diff changeset
762 //if ( SLODWORD(v5) >= 0 )
Ritor1
parents:
diff changeset
763 if (floorf(a3a + 0.5f) >= 0 )
Ritor1
parents:
diff changeset
764 {
Ritor1
parents:
diff changeset
765 a3b = (1.0 - this->fSaturation) * a2a;
Ritor1
parents:
diff changeset
766 //v7 = a3b + 6.7553994e15;
Ritor1
parents:
diff changeset
767 //v6 = LODWORD(v7);
Ritor1
parents:
diff changeset
768 v6 = floorf(a3b + 0.5f);
Ritor1
parents:
diff changeset
769 }
Ritor1
parents:
diff changeset
770 else
Ritor1
parents:
diff changeset
771 v6 = 0;
Ritor1
parents:
diff changeset
772 if ( a4 >= v6 )
Ritor1
parents:
diff changeset
773 {
Ritor1
parents:
diff changeset
774 a4a = (1.0 - fSaturation) * a2a;
Ritor1
parents:
diff changeset
775 //v9 = a4a + 6.7553994e15;
Ritor1
parents:
diff changeset
776 //if ( SLODWORD(v9) >= 0 )
Ritor1
parents:
diff changeset
777 if (floorf(a4a + 0.5f) >= 0)
Ritor1
parents:
diff changeset
778 {
Ritor1
parents:
diff changeset
779 a4b = (1.0 - fSaturation) * a2a;
Ritor1
parents:
diff changeset
780 //v10 = a4b + 6.7553994e15;
Ritor1
parents:
diff changeset
781 //result = LODWORD(v10);
Ritor1
parents:
diff changeset
782 result = floorf(a4b + 0.5f);
Ritor1
parents:
diff changeset
783 }
Ritor1
parents:
diff changeset
784 else
Ritor1
parents:
diff changeset
785 result = 0;
Ritor1
parents:
diff changeset
786 }
Ritor1
parents:
diff changeset
787 else
Ritor1
parents:
diff changeset
788 result = a4;
Ritor1
parents:
diff changeset
789 }
Ritor1
parents:
diff changeset
790 else
Ritor1
parents:
diff changeset
791 result = -1;
Ritor1
parents:
diff changeset
792 return result;
Ritor1
parents:
diff changeset
793 }
Ritor1
parents:
diff changeset
794
Ritor1
parents:
diff changeset
795
Ritor1
parents:
diff changeset
796
Ritor1
parents:
diff changeset
797 //----- (00465C8B) --------------------------------------------------------
Ritor1
parents:
diff changeset
798 Game *Game::Create()
Ritor1
parents:
diff changeset
799 {
Ritor1
parents:
diff changeset
800 return new Game;
Ritor1
parents:
diff changeset
801 }
Ritor1
parents:
diff changeset
802
Ritor1
parents:
diff changeset
803 //----- (00465CF3) --------------------------------------------------------
Ritor1
parents:
diff changeset
804 void Game::Destroy()
Ritor1
parents:
diff changeset
805 {
2370
bbf8a522dcec removing non-nullptr conditions before deletes
Grumpy7
parents: 2369
diff changeset
806 delete pGame;
0
Ritor1
parents:
diff changeset
807 pGame = nullptr;
Ritor1
parents:
diff changeset
808 }
Ritor1
parents:
diff changeset
809
Ritor1
parents:
diff changeset
810 //----- (0044ED0A) --------------------------------------------------------
Ritor1
parents:
diff changeset
811 signed int Game::_44ED0A(BLVFace *a2, int *a3, signed int a4)
Ritor1
parents:
diff changeset
812 {
Ritor1
parents:
diff changeset
813 double v4; // st7@3
Ritor1
parents:
diff changeset
814 //double v5; // ST00_8@3
Ritor1
parents:
diff changeset
815 signed int v6; // eax@4
Ritor1
parents:
diff changeset
816 //double v7; // ST00_8@5
Ritor1
parents:
diff changeset
817 signed int result; // eax@7
Ritor1
parents:
diff changeset
818 //double v9; // ST00_8@8
Ritor1
parents:
diff changeset
819 //double v10; // ST00_8@10
Ritor1
parents:
diff changeset
820 float v11; // [sp+14h] [bp+8h]@3
Ritor1
parents:
diff changeset
821 float v12; // [sp+18h] [bp+Ch]@3
Ritor1
parents:
diff changeset
822 float v13; // [sp+18h] [bp+Ch]@5
Ritor1
parents:
diff changeset
823 float v14; // [sp+1Ch] [bp+10h]@8
Ritor1
parents:
diff changeset
824 float v15; // [sp+1Ch] [bp+10h]@10
Ritor1
parents:
diff changeset
825
Ritor1
parents:
diff changeset
826 if ( this->uFlags2 & 2 && a2->uAttributes & 2 )
Ritor1
parents:
diff changeset
827 {
Ritor1
parents:
diff changeset
828 v4 = (double)a4;
Ritor1
parents:
diff changeset
829 v11 = v4;
Ritor1
parents:
diff changeset
830 *a3 |= 2u;
Ritor1
parents:
diff changeset
831 v12 = (1.0 - this->fSaturation) * v4;
Ritor1
parents:
diff changeset
832 //v5 = v12 + 6.7553994e15;
Ritor1
parents:
diff changeset
833 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 )
Ritor1
parents:
diff changeset
834 {
Ritor1
parents:
diff changeset
835 v13 = (1.0 - this->fSaturation) * v11;
Ritor1
parents:
diff changeset
836 //v7 = v13 + 6.7553994e15;
Ritor1
parents:
diff changeset
837 //v6 = LODWORD(v7);
Ritor1
parents:
diff changeset
838 v6 = floorf(v13 + 0.5f);
Ritor1
parents:
diff changeset
839 }
Ritor1
parents:
diff changeset
840 else
Ritor1
parents:
diff changeset
841 v6 = 0;
Ritor1
parents:
diff changeset
842 if ( a4 >= v6 )
Ritor1
parents:
diff changeset
843 {
Ritor1
parents:
diff changeset
844 v14 = (1.0 - fSaturation) * v11;
Ritor1
parents:
diff changeset
845 //v9 = v14 + 6.7553994e15;
Ritor1
parents:
diff changeset
846 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 )
Ritor1
parents:
diff changeset
847 {
Ritor1
parents:
diff changeset
848 v15 = (1.0 - fSaturation) * v11;
Ritor1
parents:
diff changeset
849 //v10 = v15 + 6.7553994e15;
Ritor1
parents:
diff changeset
850 //result = LODWORD(v10);
Ritor1
parents:
diff changeset
851 result = floorf(v15 + 0.5f);
Ritor1
parents:
diff changeset
852 }
Ritor1
parents:
diff changeset
853 else
Ritor1
parents:
diff changeset
854 result = 0;
Ritor1
parents:
diff changeset
855 }
Ritor1
parents:
diff changeset
856 else
Ritor1
parents:
diff changeset
857 result = a4;
Ritor1
parents:
diff changeset
858 }
Ritor1
parents:
diff changeset
859 else
Ritor1
parents:
diff changeset
860 result = -1;
Ritor1
parents:
diff changeset
861 return result;
Ritor1
parents:
diff changeset
862 }
Ritor1
parents:
diff changeset
863
Ritor1
parents:
diff changeset
864
Ritor1
parents:
diff changeset
865 //----- (0044E4B7) --------------------------------------------------------
Ritor1
parents:
diff changeset
866 Game::Game()
Ritor1
parents:
diff changeset
867 {
Ritor1
parents:
diff changeset
868 uNumStationaryLights = 0;
Ritor1
parents:
diff changeset
869 uNumBloodsplats = 0;
Ritor1
parents:
diff changeset
870 field_E0C = 0;
Ritor1
parents:
diff changeset
871 field_E10 = 0;
Ritor1
parents:
diff changeset
872 uNumStationaryLights_in_pStationaryLightsStack = 0;
Ritor1
parents:
diff changeset
873 bGammaControlInitialized = false;
Ritor1
parents:
diff changeset
874 uFlags = 0;
Ritor1
parents:
diff changeset
875 uFlags2 = 0;
Ritor1
parents:
diff changeset
876 uSomeGammaStartTime = 0;
Ritor1
parents:
diff changeset
877 uSomeGammaDeltaTime = 0;
Ritor1
parents:
diff changeset
878
1397
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
879 //pThreadWardInstance = new ThreadWard;
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
880 pThreadWardInstance = nullptr;
0
Ritor1
parents:
diff changeset
881 pParticleEngine = new ParticleEngine;
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1642
diff changeset
882 pMouse = pMouseInstance = new Mouse;
0
Ritor1
parents:
diff changeset
883 pLightmapBuilder = new LightmapBuilder;
Ritor1
parents:
diff changeset
884 pVisInstance = new Vis;
Ritor1
parents:
diff changeset
885 pStru6Instance = new stru6;
Ritor1
parents:
diff changeset
886 pIndoorCameraD3D = new IndoorCameraD3D;
Ritor1
parents:
diff changeset
887 pStru9Instance = new stru9;
Ritor1
parents:
diff changeset
888 pStru10Instance = new stru10;
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
889 //pStru11Instance = new stru11;
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
890 pStru11Instance = nullptr;
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
891 //pStru12Instance = new stru12(pStru11Instance);
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
892 pStru12Instance = nullptr;
1397
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
893 //pCShow = new CShow;
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
894 pCShow = nullptr;
0
Ritor1
parents:
diff changeset
895 pKeyboardInstance = new Keyboard;
Ritor1
parents:
diff changeset
896 pGammaController = new GammaController;
Ritor1
parents:
diff changeset
897
Ritor1
parents:
diff changeset
898 uFlags |= 0x0800;
Ritor1
parents:
diff changeset
899 uFlags2 |= 0x24;
Ritor1
parents:
diff changeset
900
Ritor1
parents:
diff changeset
901 _44F0FD();
Ritor1
parents:
diff changeset
902 }
Ritor1
parents:
diff changeset
903
Ritor1
parents:
diff changeset
904 //----- (0044E7F3) --------------------------------------------------------
Ritor1
parents:
diff changeset
905 Game::~Game()
Ritor1
parents:
diff changeset
906 {
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
907 delete pGammaController;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
908 delete pKeyboardInstance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
909 /*delete pCShow;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
910 delete pStru12Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
911 delete pStru11Instance;*/
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
912 delete pStru10Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
913 delete pStru9Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
914 delete pIndoorCameraD3D;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
915 delete pStru6Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
916 delete pVisInstance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
917 delete pLightmapBuilder;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
918 delete pMouseInstance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
919 delete pParticleEngine;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
920 //delete pThreadWardInstance;
0
Ritor1
parents:
diff changeset
921 }
Ritor1
parents:
diff changeset
922
Ritor1
parents:
diff changeset
923 //----- (0044E904) --------------------------------------------------------
Ritor1
parents:
diff changeset
924 void Game::_44E904()
Ritor1
parents:
diff changeset
925 {
Ritor1
parents:
diff changeset
926 //Game *v1; // esi@1
Ritor1
parents:
diff changeset
927 unsigned __int64 v2; // qax@1
Ritor1
parents:
diff changeset
928 unsigned int v3; // ecx@1
Ritor1
parents:
diff changeset
929 int v4; // edi@1
Ritor1
parents:
diff changeset
930 unsigned __int8 v5; // cf@7
Ritor1
parents:
diff changeset
931 double v6; // st7@13
Ritor1
parents:
diff changeset
932 double v7; // st7@15
Ritor1
parents:
diff changeset
933 signed __int64 v8; // [sp+Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
934
Ritor1
parents:
diff changeset
935 //v1 = this;
Ritor1
parents:
diff changeset
936 v2 = pEventTimer->Time();
Ritor1
parents:
diff changeset
937 v4 = (v2 - uSomeGammaStartTime) >> 32;
Ritor1
parents:
diff changeset
938 v3 = v2 - LODWORD(uSomeGammaStartTime);
Ritor1
parents:
diff changeset
939 v8 = v2 - uSomeGammaStartTime;
Ritor1
parents:
diff changeset
940 if ( v4 < 0
Ritor1
parents:
diff changeset
941 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0
Ritor1
parents:
diff changeset
942 && v3 <= 0x80 )
Ritor1
parents:
diff changeset
943 {
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
944 if ( v4 < 0 )
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
945 {
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
946 v3 = 0;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
947 v4 = 0;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
948 uSomeGammaStartTime = v2;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
949 v8 = __PAIR__(v4, v3);
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
950 }
0
Ritor1
parents:
diff changeset
951 }
Ritor1
parents:
diff changeset
952 else
Ritor1
parents:
diff changeset
953 {
Ritor1
parents:
diff changeset
954 if ( uSomeGammaDeltaTime )
Ritor1
parents:
diff changeset
955 {
Ritor1
parents:
diff changeset
956 LODWORD(uSomeGammaDeltaTime) = 0;
Ritor1
parents:
diff changeset
957 HIDWORD(uSomeGammaDeltaTime) = 0;
Ritor1
parents:
diff changeset
958 }
Ritor1
parents:
diff changeset
959 else
Ritor1
parents:
diff changeset
960 {
Ritor1
parents:
diff changeset
961 LODWORD(uSomeGammaDeltaTime) = v3;
Ritor1
parents:
diff changeset
962 HIDWORD(uSomeGammaDeltaTime) = v4;
Ritor1
parents:
diff changeset
963 }
Ritor1
parents:
diff changeset
964 v5 = __CFADD__(v3, -128);
Ritor1
parents:
diff changeset
965 v3 -= 128;
Ritor1
parents:
diff changeset
966 v4 = v5 + v4 - 1;
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
967 uSomeGammaStartTime = v2;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
968 v8 = __PAIR__(v4, v3);
0
Ritor1
parents:
diff changeset
969 }
Ritor1
parents:
diff changeset
970 if ( uSomeGammaDeltaTime )
Ritor1
parents:
diff changeset
971 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3));
Ritor1
parents:
diff changeset
972 else
Ritor1
parents:
diff changeset
973 v6 = (double)v8;
Ritor1
parents:
diff changeset
974 v7 = v6 * 0.0078125;
Ritor1
parents:
diff changeset
975 if ( v7 < 0.0 || v7 <= 1.0 )
Ritor1
parents:
diff changeset
976 {
Ritor1
parents:
diff changeset
977 if ( v7 < 0.0 )
Ritor1
parents:
diff changeset
978 v7 = 0.0;
Ritor1
parents:
diff changeset
979 }
Ritor1
parents:
diff changeset
980 else
Ritor1
parents:
diff changeset
981 v7 = 1.0;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
982 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
983 fSaturation = v7;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
984 //else
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
985 // fSaturation = (1.0 - 0.5) * v7 + 0.5;
0
Ritor1
parents:
diff changeset
986 }
Ritor1
parents:
diff changeset
987
Ritor1
parents:
diff changeset
988 //----- (0044EA17) --------------------------------------------------------
Ritor1
parents:
diff changeset
989 bool Game::InitializeGammaController()
Ritor1
parents:
diff changeset
990 {
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2151
diff changeset
991 //if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT ||
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2151
diff changeset
992 //pVersion->pVersionInfo.dwMajorVersion != 4 )
0
Ritor1
parents:
diff changeset
993 pGammaController->InitializeFromSurface(pRenderer->pFrontBuffer4);
Ritor1
parents:
diff changeset
994
Ritor1
parents:
diff changeset
995 bGammaControlInitialized = true;
Ritor1
parents:
diff changeset
996 uSomeGammaStartTime = pEventTimer->Time();
Ritor1
parents:
diff changeset
997 return true;
Ritor1
parents:
diff changeset
998 }
Ritor1
parents:
diff changeset
999
Ritor1
parents:
diff changeset
1000 //----- (0044EA5E) --------------------------------------------------------
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1001 bool Game::PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
0
Ritor1
parents:
diff changeset
1002 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1003 /*if (pCurrentScreen != SCREEN_GAME|| !pRenderer->pRenderD3D)
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1004 return false;*/
0
Ritor1
parents:
diff changeset
1005
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1006 if (!pVisInstance)
0
Ritor1
parents:
diff changeset
1007 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1008 MessageBoxW(nullptr, L"The 'Vis' object pointer has not been instatiated, but CGame::Pick() is trying to call through it.", nullptr, 0);
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1009 return false;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1010 }
0
Ritor1
parents:
diff changeset
1011
692
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
1012 if (uMouseX >= (signed int)pViewport->uScreen_TL_X &&
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
1013 uMouseX <= (signed int)pViewport->uScreen_BR_X &&
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
1014 uMouseY >= (signed int)pViewport->uScreen_TL_Y &&
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
1015 uMouseY <= (signed int)pViewport->uScreen_BR_Y)
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1016 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1017 pVisInstance->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter);
0
Ritor1
parents:
diff changeset
1018
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1019 if (bOutline)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1020 OutlineSelection();
0
Ritor1
parents:
diff changeset
1021 }
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1022
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1023 return true;
0
Ritor1
parents:
diff changeset
1024 }
Ritor1
parents:
diff changeset
1025 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
1026
Ritor1
parents:
diff changeset
1027 //----- (0044EB12) --------------------------------------------------------
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1028 bool Game::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
0
Ritor1
parents:
diff changeset
1029 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1030 if (pCurrentScreen == SCREEN_GAME && pVisInstance /*&& pRenderer->pRenderD3D*/)
0
Ritor1
parents:
diff changeset
1031 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1032 bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter);
0
Ritor1
parents:
diff changeset
1033
Ritor1
parents:
diff changeset
1034 if (bOutline)
Ritor1
parents:
diff changeset
1035 OutlineSelection();
Ritor1
parents:
diff changeset
1036 return r;
Ritor1
parents:
diff changeset
1037 }
Ritor1
parents:
diff changeset
1038 return false;
Ritor1
parents:
diff changeset
1039 }
123
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1040 /*
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1041 Result::Code Game::PickKeyboard(bool bOutline, struct unnamed_F93E6C *a3, struct unnamed_F93E6C *a4)
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1042 {
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1043 if (dword_4E28F8_PartyCantJumpIfTrue)
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1044 return Result::Generic;
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1045
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1046 pVis->PickKeyboard(a3, a4);
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1047 if (bOutline)
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1048 Game_outline_selection((int)this);
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1049 return Result::Success;
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1050 }
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1051 */
0
Ritor1
parents:
diff changeset
1052 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
1053
Ritor1
parents:
diff changeset
1054 //----- (0044EB5A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1055 void Game::OutlineSelection()
Ritor1
parents:
diff changeset
1056 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1057 if (!pVisInstance)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1058 return;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1059
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1060 if (!pVisInstance->default_list.uNumPointers)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1061 return;
0
Ritor1
parents:
diff changeset
1062
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1063 Vis_ObjectInfo* object_info = pVisInstance->default_list.object_pointers[0];
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1064 if (object_info)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1065 switch (object_info->object_type)
0
Ritor1
parents:
diff changeset
1066 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1067 case VisObjectType_Sprite:
0
Ritor1
parents:
diff changeset
1068 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1069 Log::Warning(L"Sprite outline currently unsupported");
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1070 return;
0
Ritor1
parents:
diff changeset
1071 }
Ritor1
parents:
diff changeset
1072
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1073 case VisObjectType_Face:
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1074 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1075 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0
Ritor1
parents:
diff changeset
1076 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1077 ODMFace* face = (ODMFace *)object_info->object;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1078 if (face->uAttributes & FACE_OUTLINED)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1079 face->uAttributes &= ~FACE_OUTLINED;
0
Ritor1
parents:
diff changeset
1080 else
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1081 face->uAttributes |= FACE_OUTLINED;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1082 }
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1083 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1084 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1085 BLVFace* face = (BLVFace *)object_info->object;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1086 if (face->uAttributes & FACE_OUTLINED)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1087 face->uAttributes &= ~FACE_OUTLINED;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1088 else
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1089 face->uAttributes |= FACE_OUTLINED;
0
Ritor1
parents:
diff changeset
1090 }
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2453
diff changeset
1091 else
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2453
diff changeset
1092 Error("Invalid level type", uCurrentlyLoadedLevelType);
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1093 }
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 293
diff changeset
1094 break;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1095
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1096 default:
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1097 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1098 MessageBoxW(nullptr, L"Undefined CObjectInfo type requested in CGame::outline_selection()", nullptr, 0);
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1099 ExitProcess(0);
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1100 }
0
Ritor1
parents:
diff changeset
1101 }
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1102 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1103 //----- (004304E7) --------------------------------------------------------
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1104 void GameUI_MsgProc()
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1105 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1106 unsigned int v2; // edx@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1107 Actor *pActor; // ecx@13
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1108 int v4; // ecx@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1109 unsigned int v10; // ecx@73
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1110 int v14; // eax@98
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1111 int v18; // eax@106
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1112 float v19; // ST64_4@121
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1113 float v21; // ST64_4@126
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1114 float v22; // ST64_4@127
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1115 unsigned int v24; // ecx@149
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1116 GUIWindow *pWindow2; // ecx@248
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1117 bool pKeyBindingFlag; // eax@269
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1118 unsigned int v33; // eax@277
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1119 int v37; // eax@341
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1120 int v38; // eax@358
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1121 SHORT v39; // ax@365
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1122 char *v41; // eax@380
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1123 int v42; // eax@396
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1124 signed int v44; // eax@398
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1125 int v45; // edx@398
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1126 signed int v46; // ecx@398
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1127 char v47; // zf@399
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1128 char v48; // zf@405
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1129 BLVFace *pBLVFace; // ecx@410
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1130 ODMFace *pODMFace; // ecx@412
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1131 CastSpellInfo *pSpellInfo; // ecx@415
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1132 __int16 v53; // ax@431
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1133 int v54; // eax@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1134 int v55; // ecx@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1135 int v56; // edx@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1136 int v57; // eax@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1137 Player *pPlayer; // edx@442
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1138 unsigned int pMapNum; // eax@445
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1139 signed int v60; // ST64_4@459
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1140 __int16 v63; // dx@479
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1141 unsigned int v64; // eax@486
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1142 int v65; // ecx@486
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1143 int v66; // eax@488
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1144 char *v67; // eax@489
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1145 __int16 v68; // dx@498
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1146 char *v69; // eax@512
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1147 int v70; // eax@525
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1148 int v71; // edi@527
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1149 NPCData *pNPCData3; // esi@527
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1150 char *v73; // ecx@533
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1151 signed int v74; // edi@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1152 int v75; // eax@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1153 int v76; // esi@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1154 int v77; // eax@537
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1155 Player *pPlayer2; // ecx@549
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1156 signed int v81; // eax@552
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1157 signed int v83; // ecx@554
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1158 signed int v84; // ecx@554
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1159 GUIButton *pButton; // eax@578
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1160 unsigned int v86; // eax@583
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1161 const char *v87; // ecx@595
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1162 const char *v88; // ecx@596
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1163 unsigned int v90; // eax@602
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1164 int v91; // edx@605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1165 int v92; // eax@605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1166 int v93; // edx@605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1167 int pPlayerNum; // edx@611
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1168 int v95; // eax@611
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1169 unsigned int v97; // eax@624
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1170 int v98; // eax@636
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1171 int v103; // eax@671
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1172 Player *pPlayer4; // ecx@718
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1173 int v105; // eax@718
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1174 Player *pPlayer5; // ST78_4@758
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1175 unsigned int v107; // eax@758
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1176 unsigned int v108; // eax@758
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1177 unsigned int v115; // eax@764
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1178 int v116; // eax@776
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1179 unsigned int v118; // eax@785
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1180 unsigned int v119; // ecx@786
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1181 unsigned int v121; // [sp-28h] [bp-624h]@711
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1182 unsigned int v123; // [sp-24h] [bp-620h]@711
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1183 unsigned int v125; // [sp-20h] [bp-61Ch]@711
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1184 int v127; // [sp-1Ch] [bp-618h]@107
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1185 unsigned int v128; // [sp-1Ch] [bp-618h]@711
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1186 GUIButton *pButton2; // [sp-4h] [bp-600h]@59
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1187 const char *v161; // [sp-4h] [bp-600h]@637
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1188 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1189 char *v173; // [sp+0h] [bp-5FCh]@444
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1190 char *v174; // [sp+0h] [bp-5FCh]@449
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1191 const char *v177; // [sp+0h] [bp-5FCh]@629
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1192 char *v178; // [sp+0h] [bp-5FCh]@637
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1193 signed int thisb; // [sp+14h] [bp-5E8h]@272
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1194 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1195 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1196 char *pMapName; // [sp+14h] [bp-5E8h]@445
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1197 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1198 int thisg; // [sp+14h] [bp-5E8h]@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1199 int thish; // [sp+14h] [bp-5E8h]@528
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1200 signed int thisi; // [sp+14h] [bp-5E8h]@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1201 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1202 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1203 int uMessageParam; // [sp+18h] [bp-5E4h]@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1204 int uAction; // [sp+1Ch] [bp-5E0h]@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1205 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1206 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1207 char v197; // [sp+2Bh] [bp-5D1h]@101
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1208 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1209 unsigned int v199; // [sp+30h] [bp-5CCh]@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1210 char *v200; // [sp+34h] [bp-5C8h]@518
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1211 POINT v202; // [sp+40h] [bp-5BCh]@141
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1212 POINT a2; // [sp+48h] [bp-5B4h]@127
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1213 POINT v205; // [sp+58h] [bp-5A4h]@171
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1214 POINT v207; // [sp+68h] [bp-594h]@155
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1215 POINT v211; // [sp+88h] [bp-574h]@704
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1216 int v213; // [sp+98h] [bp-564h]@385
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1217 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1218 char pOut[32]; // [sp+BCh] [bp-540h]@370
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1219 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1220 int v217[9]; // [sp+158h] [bp-4A4h]@652
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1221 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1222 char a1[64]; // [sp+1F8h] [bp-404h]@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1223 char Str2[128]; // [sp+238h] [bp-3C4h]@527
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1224 Actor actor; // [sp+2B8h] [bp-344h]@4
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
1225 int currHour;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1226
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1227 dword_50CDC8 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1228 if ( !pEventTimer->bPaused )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1229 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1230 pParty->sEyelevel = pParty->uDefaultEyelevel;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1231 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1232 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1233 if ( bDialogueUI_InitializeActor_NPC_ID )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1234 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1235 //Actor::Actor(&actor);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1236 memset(&actor, 0, 0x344u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1237 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1238 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1239 GameUI_InitializeDialogue(&actor, false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1240 bDialogueUI_InitializeActor_NPC_ID = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1241 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1242 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1243 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1244 //v1 = "";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1245 while ( 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1246 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1247 if ( !pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1248 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1249
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1250 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1251 switch ( uMessage )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1252 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1253 case UIMSG_ChangeGameState:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1254 uGameState = GAME_FINISHED;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1255 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1256 case UIMSG_PlayArcomage:
2453
2a8010d99cf8 _4BF5B2() renamed to BackToHouseMenu()
Ritor1
parents: 2450
diff changeset
1257 BackToHouseMenu();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1258 pArcomageGame->bGameInProgress = 1;
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2338
diff changeset
1259 ArcomageGame::PrepareArcomage();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1260 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1261 case UIMSG_StartNPCDialogue:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1262 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1263 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1264 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1265 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1266 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1267 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1268 pActor = &pActors[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1269 //goto _actor_init_dlg;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1270 GameUI_InitializeDialogue(pActor, true);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1271 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1272 case UIMSG_StartHireling1Dialogue:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1273 case UIMSG_StartHireling2Dialogue:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1274 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1275 if (bNoNPCHiring || pCurrentScreen)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1276 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1277
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1278 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1279 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1280 uAction = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1281 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1282 v4 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1283
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1284 for (uint i = 0; i < 2; ++i)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1285 //pNPCData0 = pParty->pHirelings;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1286 //do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1287 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1288 if (pParty->pHirelings[i].pName)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1289 //{
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1290 //v6 = uAction++;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1291 pTmpBuf[uAction++] = i;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1292 //}
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1293 //++pNPCData0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1294 //++v4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1295 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1296 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1297
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1298 //_this = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1299 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1300 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1301 NPCData* npc = &pNPCStats->pNewNPCData[i];
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1302 //do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1303 //{
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1304 if (npc->Hired() &&
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1305 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) &&
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1306 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1307 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1308 //v7 =;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1309 pTmpBuf[uAction++] = i + 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1310 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1311 //++_this;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1312 //++pNPCData4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1313 //}
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1314 //while ( _this < (signed int)pNPCStats->uNumNewNPCs );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1315 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1316
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1317 if ( (signed int)(hireling_idx + pParty->hirelingScrollPosition) < uAction )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1318 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1319 //Actor::Actor(&actor);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1320 memset(&actor, 0, 0x344u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1321 actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_idx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1322 pActor = &actor;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1323 GameUI_InitializeDialogue(&actor, true);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1324 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1325 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1326 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1327
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1328 case UIMSG_BuyInShop_Identify_Repair:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1329 UIShop_Buy_Identify_Repair();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1330 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1331 case UIMSG_ClickNPCTopic:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1332 ClickNPCTopic(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1333 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1334 case UIMSG_SelectShopDialogueOption:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1335 OnSelectShopDialogueOption(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1336 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1337 case UIMSG_SelectNPCDialogueOption:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1338 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1339 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1340 case UIMSG_ClickHouseNPCPortrait:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1341 _4B4224_UpdateNPCTopics(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1342 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1343 case UIMSG_StartNewGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1344 if ( dword_6BE138 == 124 || uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1345 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1346 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1347 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1348 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1349 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1350 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1351 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1352 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1353 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1354 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1355 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1356 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1357 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2);// "Are you sure? Click again to start a New Game"
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1358 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1359 dword_6BE138 = 124;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1360 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1361 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1362 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1363 case UIMSG_Game_OpenLoadGameDialog:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1364 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1365 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1366 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1367 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1368 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1369 pCurrentScreen = SCREEN_LOADGAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1370 LoadUI_Load(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1371 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1372 case UIMSG_Quit:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1373 if ( dword_6BE138 == 132 || uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1374 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1375 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1376 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1377 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1378 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1379 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1380 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1381 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1382 if ( !uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1383 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1384 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1385 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1386 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1387 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1388 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1389 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1390 dword_6BE138 = 132;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1391 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1392 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1393 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1394 case UIMSG_80:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1395 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1396 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1397 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1398 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1399 pCurrentScreen = SCREEN_OPTIONS;
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1400 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1401 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1402 case UIMSG_ArrowUp:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1403 --pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1404 if ( pSaveListPosition < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1405 pSaveListPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1406 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1407 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1408 case UIMSG_DownArrow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1409 ++pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1410 if ( pSaveListPosition >= uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1411 pSaveListPosition = uMessageParam - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1412 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1413 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1414 case UIMSG_Cancel:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1415 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1416 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1417 case UIMSG_SaveLoadBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1418 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1419 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1420 case UIMSG_SelectLoadSlot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1421 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1422 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1423 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1424 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1425 v10 = pSaveListPosition + uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1426 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1427 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
1428 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
1429 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1430 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1431 uLoadGameUI_SelectedSlot = v10;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1432 dword_6BE138 = v10;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1433 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1434 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1435 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1436 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1437 if ( strcmp(pSavegameHeader[uLoadGameUI_SelectedSlot].pName, pGlobalTXT_LocalizationStrings[72]) )// "Empty"
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1438 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1439 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1440 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1441 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1442 case UIMSG_LoadGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1443 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1444 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1445 LoadGame(uLoadGameUI_SelectedSlot);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1446 uGameState = GAME_STATE_LOADING_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1447 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1448 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1449 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1450 case UIMSG_SaveGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1451 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1452 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1453 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1454 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pKeyActionMap->pPressedKeysBuffer);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1455 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1456 DoSavegame(uLoadGameUI_SelectedSlot);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1457 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1458 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1459 case UIMSG_Game_OpenSaveGameDialog:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1460 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1461 pCurrentScreen = SCREEN_SAVEGAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1462 SaveUI_Load();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1463 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1464 case UIMSG_Game_OpenOptionsDialog://Open
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1465 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1466 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1467 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1468 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1469 pCurrentScreen = SCREEN_OPTIONS;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1470
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1471 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1472 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1473 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1474 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1475 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1476 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1477 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1478 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1479 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1480 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1481 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1482 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1483 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1484 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1485 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1486 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1487 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1488 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1489 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1490 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1491
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1492 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Options, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1493 pGUIWindow_CurrentMenu->CreateButton(22, 270,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1494 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1495 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1496 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1497 pGUIWindow_CurrentMenu->CreateButton(93, 270,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1498 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1499 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1500 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1501 pGUIWindow_CurrentMenu->CreateButton(164, 270,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1502 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1503 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1504 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1505
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1506 pGUIWindow_CurrentMenu->CreateButton(20, 303,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1507 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1508 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1509 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1510 pGUIWindow_CurrentMenu->CreateButton(128, 303,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1511 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1512 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1513 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1514 pGUIWindow_CurrentMenu->CreateButton(20, 325,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1515 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1516 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1517 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1518 pGUIWindow_CurrentMenu->CreateButton(128, 325,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1519 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1520 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1521 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1522
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1523 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1524 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1525 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1526
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1527 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1528 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1529 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1530
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1531 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1532 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1533 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1534
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1535 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1536 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1537 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1538 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1539
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1540 case UIMSG_OpenKeyMappingOptions://Open
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1541 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1542 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1543 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1544 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1545 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1546 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1547 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1548 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1549 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1550 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1551 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_KeyMappingOptions, 0, 0);
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1552
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1553 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1554
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1555 pGUIWindow_CurrentMenu->CreateButton(19, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1556 pGUIWindow_CurrentMenu->CreateButton(127, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1557 pGUIWindow_CurrentMenu->CreateButton(127, 324, 108, 20, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1558 pGUIWindow_CurrentMenu->CreateButton(19, 324, 108, 20, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1559
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1560 pGUIWindow_CurrentMenu->CreateButton(129, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1561 pGUIWindow_CurrentMenu->CreateButton(129, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 1, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1562 pGUIWindow_CurrentMenu->CreateButton(129, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 2, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1563 pGUIWindow_CurrentMenu->CreateButton(129, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 3, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1564 pGUIWindow_CurrentMenu->CreateButton(129, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 4, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1565 pGUIWindow_CurrentMenu->CreateButton(129, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 5, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1566 pGUIWindow_CurrentMenu->CreateButton(129, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 6, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1567 pGUIWindow_CurrentMenu->CreateButton(350, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 7, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1568 pGUIWindow_CurrentMenu->CreateButton(350, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 8, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1569 pGUIWindow_CurrentMenu->CreateButton(350, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 9, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1570 pGUIWindow_CurrentMenu->CreateButton(350, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 10, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1571 pGUIWindow_CurrentMenu->CreateButton(350, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 11, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1572 pGUIWindow_CurrentMenu->CreateButton(350, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 12, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1573 pGUIWindow_CurrentMenu->CreateButton(350, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 13, 0, "", 0);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1574
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1575 uGameMenuUI_CurentlySelectedKeyIdx = -1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1576 KeyboardPageNum = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1577 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1578 //*(_WORD *)KeyButtonArray[28] = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1579 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1580 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1581 case UIMSG_ChangeKeyButton:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1582 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1583 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1584 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1585 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1586 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1587 v14 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1588 if ( KeyboardPageNum != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1589 v14 = uMessageParam + 14;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1590 uGameMenuUI_CurentlySelectedKeyIdx = v14;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1591 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1592 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1593 case UIMSG_ResetKeyMapping:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1594 v197 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1595 pKeyActionMap->SetDefaultMapping();
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1596 for ( uint i = 0; i < 28; i++ )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1597 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1598 if ( pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i] )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1599 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1600 if ( v197 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1601 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1602 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 1);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1603 v197 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1604 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1605 else
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1606 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1607 }
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1608 pPrevVirtualCidesMapping[i] = pKeyActionMap->GetActionVKey((enum InputAction)i);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
1609 GameMenuUI_InvaligKeyBindingsFlags[i] = false;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1610 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1611 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1612 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1613 case UIMSG_SelectKeyPage1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1614 KeyboardPageNum = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1615 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1616 case UIMSG_SelectKeyPage2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1617 KeyboardPageNum = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1618 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1619 case UIMSG_OpenVideoOptions:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1620 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1621 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1622 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1623 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1624 pCurrentScreen = SCREEN_VIDEO_OPTIONS;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1625 optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1626 bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1627 us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1628 tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1629 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1630 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1631 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1632 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1633 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1634 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1635 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1636 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1637 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1638 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1639 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1640 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1641 not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1642 not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1643 not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1644 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_VideoOptions, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1645 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
1646 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1647 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1648 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1649 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1650 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1651 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
1652 /*if ( !pRenderer->bWindowMode )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1653 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1654 //v0 = 1;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1655 if ( pRenderer->IsGammaSupported() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1656 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1657 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1658 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1659 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1660 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
1661 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1662 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1663 case UIMSG_1A9:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1664 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1665 if ( uMessageParam == 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1666 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1667 //--uGammaPos;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1668 if ( (uGammaPos -- -1) < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1669 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1670 uGammaPos = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1671 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1672 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1673 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1674 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1675 pGame->pGammaController->Initialize(v19);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1676 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1677 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1678 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1679 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1680 if ( uMessageParam == 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1681 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1682 ++uGammaPos;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1683 if ( (signed int)uGammaPos <= 9 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1684 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1685 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1686 pGame->pGammaController->Initialize(v21);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1687 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1688 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1689 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1690 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1691 uGammaPos = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1692 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1693 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1694 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1695 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1696 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1697 pGame->pGammaController->Initialize(v22);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1698 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1699 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1700 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1701 case UIMSG_ToggleBloodsplats:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1702 pGame->ToggleFlags2(0x20u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1703 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1704 case UIMSG_ToggleColoredLights:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
1705 pRenderer->ToggleColoredLights();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1706 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1707 case UIMSG_ToggleTint:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
1708 pRenderer->ToggleTint();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1709 continue;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
1710 case UIMSG_ChangeMusicVolume:
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
1711 if ( uMessageParam == 4 )//-
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1712 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1713 --uMusicVolimeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1714 if ( (char)uMusicVolimeMultiplier < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1715 uMusicVolimeMultiplier = 0;
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1716 GUIWindow::Create(243, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1717 if ( uMusicVolimeMultiplier )
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1718 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1719 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1720 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1721 }
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
1722 if ( uMessageParam == 5 )//+
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1723 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1724 ++uMusicVolimeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1725 if ( (char)uMusicVolimeMultiplier > 9 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1726 uMusicVolimeMultiplier = 9;
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1727 GUIWindow::Create(435, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1728 if ( uMusicVolimeMultiplier )
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1729 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1730 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1731 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1732 }
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
1733 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//for mouse
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1734 if ( (char)uMusicVolimeMultiplier > 9 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1735 uMusicVolimeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1736 if ( uMusicVolimeMultiplier )
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1737 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1738 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1739 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1740 case UIMSG_ChangeSoundVolume:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1741 if ( uMessageParam == 4 )//reduce sound level button left
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1742 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1743 --uSoundVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1744 if ( (char)uSoundVolumeMultiplier < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1745 uSoundVolumeMultiplier = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1746 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1747 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1748 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1749 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1750 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1751 if ( uMessageParam == 5 )//Increase sound level button right
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1752 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1753 ++uSoundVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1754 if ( (char)uSoundVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1755 uSoundVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1756 //v168 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1757 v24 = 435;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1758 //v154 = (int)pBtn_SliderRight;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1759 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1760 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1761 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1762 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1763 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1764 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1765 if ( (char)uSoundVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1766 uSoundVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1767 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1768 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1769 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1770 case UIMSG_ToggleFlipOnExit:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1771 bFlipOnExit = bFlipOnExit == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1772 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1773 case UIMSG_ToggleAlwaysRun:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1774 bAlwaysRun = bAlwaysRun == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1775 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1776 case UIMSG_ToggleWalkSound:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1777 bWalkSound = bWalkSound == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1778 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1779 case UIMSG_ToggleShowDamage:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1780 bShowDamage = bShowDamage == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1781 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1782 case UIMSG_ChangeVoiceVolume:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1783 if ( uMessageParam == 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1784 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1785 --uVoicesVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1786 if ( (char)uVoicesVolumeMultiplier < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1787 uVoicesVolumeMultiplier = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1788 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1789 if ( !uVoicesVolumeMultiplier )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1790 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1791 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1792 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1793 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1794 if ( uMessageParam == 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1795 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1796 ++uVoicesVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1797 if ( (char)uVoicesVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1798 uVoicesVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1799 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1800 if ( !uVoicesVolumeMultiplier )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1801 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1802 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1803 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1804 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1805 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1806 if ( (char)uVoicesVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1807 uVoicesVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1808 if ( !uVoicesVolumeMultiplier )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1809 continue;
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
1810 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
1811 continue;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1812 case UIMSG_SetTurnSpeed:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1813 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1814 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1815 uTurnSpeed = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1816 continue;
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1817
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1818 case UIMSG_SetGraphicsMode:
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1819 /*if ( !bUseLoResSprites )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1820 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1821 byte_6BE388_graphicsmode = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1822 MM7Initialization();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1823 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1824 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1825 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1826 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1827 if ( uMessageParam == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1828 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1829 byte_6BE388_graphicsmode = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1830 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1831 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1832 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1833 if ( uMessageParam != 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1834 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1835 byte_6BE388_graphicsmode = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1836 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1837 MM7Initialization();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1838 continue;
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1839 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1840 ModalWindow(pNPCTopics[453].pText, UIMSG_0);
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1841 __debugbreak(); // Nomad: graphicsmode as it was now removed
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1842 continue;
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1843
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1844 case UIMSG_GameMenu_ReturnToGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1845 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1846 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1847 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1848 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1849 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1850 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1851 case UIMSG_OpenQuestBook:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1852 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1853 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1854 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1855 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1856 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1857 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1858 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1859 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1860 bFlashQuestBook = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1861 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1862 case UIMSG_OpenAutonotes:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1863 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1864 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1865 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1866 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1867 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1868 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1869 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1870 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1871 bFlashAutonotesBook = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1872 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1873 case UIMSG_OpenMapBook:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1874 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1875 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1876 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1877 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1878 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1879 viewparams->sViewCenterX = pParty->vPosition.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1880 viewparams->sViewCenterY = pParty->vPosition.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1881 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1882 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1883 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1884 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1885 case UIMSG_OpenCalendar:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1886 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1887 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1888 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1889 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1890 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1891 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1892 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1893 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1894 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1895 case UIMSG_OpenHistoryBook:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1896 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1897 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1898 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1899 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1900 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1901 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1902 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1903 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1904 bFlashHistoryBook = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1905 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1906 case UIMSG_Escape:// íàæàòèå Escape and return to game
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1907 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1908 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1909 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1910 switch ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1911 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1912 case SCREEN_E:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1913 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1914 case SCREEN_NPC_DIALOGUE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1915 case SCREEN_CHEST:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1916 case SCREEN_CHEST_INVENTORY:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1917 case SCREEN_CHANGE_LOCATION:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1918 case SCREEN_INPUT_BLV:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1919 case SCREEN_QUICK_REFERENCE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1920 if ( dword_50CDC8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1921 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1922 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1923 uMessageParam = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1924 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1925 case SCREEN_HOUSE:
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1926 if ( !dword_50CDC8 )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1927 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1928 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1929 uMessageParam = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1930 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1931 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1932 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1933 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1934 if ( !pModalWindow )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1935 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1936 pRenderer->ClearZBuffer(0, 479);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1937 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1938 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1939 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1940 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1941 if ( pCurrentScreen > SCREEN_67 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1942 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1943 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1944 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1945 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1946 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1947 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1948 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1949 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1950 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1951 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1952 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1953 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1954 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1955 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1956 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1957 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1958 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1959 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1960 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1961 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1962 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1963 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1964 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1965 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1966 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1967 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1968 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1969 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1970 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1971 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1972 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1973 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1974 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1975 if ( pCurrentScreen < SCREEN_64 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1976 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1977 switch ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1978 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1979 case SCREEN_CASTING:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1980 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1981 if ( some_active_character )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1982 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1983 uActiveCharacter = some_active_character;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1984 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1985 some_active_character = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1986 if ( pParty->bTurnBasedModeOn )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1987 pTurnEngine->ApplyPlayerAction();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1988 _50C9D0_AfterEnchClickEventId = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1989 _50C9D4_AfterEnchClickEventSecondParam = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1990 _50C9D8_AfterEnchClickEventTimeout = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1991 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1992 if ( ptr_50C9A4_ItemToEnchant && ptr_50C9A4_ItemToEnchant->uItemID )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1993 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1994 LOBYTE(ptr_50C9A4_ItemToEnchant->uAttributes) &= 0xFu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1995 _50C9A8_item_enchantment_timer = 0;
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
1996 ptr_50C9A4_ItemToEnchant = nullptr;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1997 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1998 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1999 {
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2000 if ( pCurrentScreen == SCREEN_CHARACTERS )
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2001 pMouse->SetCursorBitmap("MICON2");
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2002 else
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2003 {
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2004 pGUIWindow_Settings->Release();
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2005 pGUIWindow_Settings = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2006 pMouse->SetCursorBitmap("MICON1");
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2007 GameUI_Footer_TimeLeft = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2008 _50C9A0_IsEnchantingInProgress = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2009 back_to_game();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2010 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2011 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2012 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2013 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2014 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2015 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2016 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2017 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2018 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2019 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2020 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2021 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2022 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2023 case SCREEN_BOOKS:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2024 pBooksWindow->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2025 //crt_deconstruct_ptr_6A0118();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2026 pBooksWindow = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2027 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2028 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2029 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2030 if ( pCurrentScreen == SCREEN_CHARACTERS )
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2031 pMouse->SetCursorBitmap("MICON2");
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2032 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2033 {
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2034 pGUIWindow_Settings->Release();
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2035 pGUIWindow_Settings = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2036 pMouse->SetCursorBitmap("MICON1");
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2037 GameUI_Footer_TimeLeft = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2038 _50C9A0_IsEnchantingInProgress = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2039 back_to_game();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2040 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2041 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2042 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2043 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2044 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2045 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2046 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2047 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2048 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2049 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2050 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2051 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2052 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2053 case SCREEN_SAVEGAME:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2054 case SCREEN_LOADGAME:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2055 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2056 //crt_deconstruct_ptr_6A0118();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2057 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2058 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2059 case SCREEN_CHEST_INVENTORY:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2060 pCurrentScreen = SCREEN_CHEST;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2061 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2062 case SCREEN_CHEST:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2063 pWindow2 = pChestWindow;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2064 pWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2065 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2066 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2067 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2068 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2069 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2070 case SCREEN_19:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2071 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2072 pWindow2 = ptr_507BC8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2073 pWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2074 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2075 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2076 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2077 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2078 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2079 case SCREEN_OPTIONS://Close
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2080 options_menu_skin.Relaease();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2081 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2082 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2083 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2084 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2085 WriteWindowsRegistryInt("WalkSound", bWalkSound);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2086 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
2087 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2088 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2089 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2090 if ( !uTurnSpeed )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2091 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2092 WriteWindowsRegistryInt("TurnDelta", 3);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2093 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2094 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2095 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2096 if ( uTurnSpeed == 64 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2097 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2098 WriteWindowsRegistryInt("TurnDelta", 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2099 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2100 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2101 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2102 if ( uTurnSpeed != 128 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2103 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2104 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2105 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2106 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2107 WriteWindowsRegistryInt("TurnDelta", 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2108 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2109 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2110 case SCREEN_MENU:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2111 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2112 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2113 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2114 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2115 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2116 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2117 case SCREEN_VIDEO_OPTIONS:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2118 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2119 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2120 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2121 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2122 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2123 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
2124 /*if ( !pRenderer->bWindowMode )
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
2125 WriteWindowsRegistryInt("GammaPos", uGammaPos);*/
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2126
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2127 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2128 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2129
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2130 case SCREEN_KEYBOARD_OPTIONS://Return to game
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2131 v197 = 1;
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2132 pKeyBindingFlag = false;
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2133 for ( uint i = 0; i < 28; ++i )
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2134 {
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2135 if ( GameMenuUI_InvaligKeyBindingsFlags[i] )
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2136 pKeyBindingFlag = true;
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2137 }
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2138 if ( !pKeyBindingFlag )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2139 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2140 for ( uint i = 0; i < 5; i++ )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2141 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2142 if ( uTextureID_Optkb[i] )
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2143 pIcons_LOD->pTextures[uTextureID_Optkb[i]].Release();
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2144 }
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2145 memset(&uTextureID_Optkb, 0, 20);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2146 pIcons_LOD->SyncLoadedFilesCount();
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2147 for ( uint i = 0; i < 28; ++i )
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2148 {
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2149 if ( pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i] )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2150 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2151 if ( v197 )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2152 {
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2153 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 1);
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2154 v197 = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2155 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2156 else
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2157 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2158 }
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2159 if ( i > 3 && i != 25 && i != 26 )
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2160 pKeyToggleType = TOGGLE_OneTimePress;
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2161 else
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2162 pKeyToggleType = TOGGLE_Continuously;
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2163 pKeyActionMap->SetKeyMapping(i, pPrevVirtualCidesMapping[i], pKeyToggleType);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2164 }
2445
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2165 pKeyActionMap->StoreMappings();
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2166 stru_506E40.Release();
b10125a9c772 fix crash in keyboard option
Ritor1
parents: 2442
diff changeset
2167 break;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2168 }
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2169 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2170 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2171 case SCREEN_REST://close rest screen
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2172 if ( dword_506F14 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2173 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2174 Rest(_506F18_num_minutes_to_sleep);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2175 pParty->pPlayers[3].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2176 pParty->pPlayers[2].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2177 pParty->pPlayers[1].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2178 pParty->pPlayers[0].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2179 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2180 pTexture_RestUI_CurrentSkyFrame->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2181 pTexture_RestUI_CurrentHourglassFrame->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2182 pTexture_RestUI_CurrentHourglassFrame = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2183 pTexture_RestUI_CurrentSkyFrame = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2184 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2185 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2186 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2187 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2188 pOutdoor->UpdateSunlightVectors();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2189 pOutdoor->UpdateFog();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2190 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2191 _506F18_num_minutes_to_sleep = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2192 dword_506F14 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2193 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2194 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2195 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2196 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2197 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2198 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2199 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2200 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2201 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2202 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2203 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2204 back_to_game();
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2205 }
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2206 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2207 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2208 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2209 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2210 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2211 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2212 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2213 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2214 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2215 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2216 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2217 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2218 case SCREEN_E:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2219 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2220 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2221 pCurrentScreen = SCREEN_HOUSE;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2222 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2223 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2224 case SCREEN_HOUSE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2225 if ( uDialogueType )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2226 uDialogueType = 0;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2227 if ( uGameState == GAME_STATE_CHANGE_LOCATION )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2228 {
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1916
diff changeset
2229 while ( HouseDialogPressCloseBtn() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2230 ;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2231 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2232 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2233 {
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1916
diff changeset
2234 if ( HouseDialogPressCloseBtn() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2235 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2236 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2237 GetHouseGoodbyeSpeech();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2238 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0);
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2239 pMediaPlayer->Unload();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2240 pGUIWindow_CurrentMenu = window_SpeakInHouse;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2241 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2242 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2243 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2244 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2245 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2246 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2247 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2248 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2249 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2250 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2251 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2252 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2253 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2254 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2255 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2256 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2257 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2258 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2259 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2260 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2261 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2262 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2263 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2264 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2265 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2266 case SCREEN_INPUT_BLV://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2267 if ( uCurrentHouse_Animation == 153 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2268 PlayHouseSound(0x99u, HouseSound_Greeting_2);
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2269 pMediaPlayer->Unload();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2270 if ( npcIdToDismissAfterDialogue )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2271 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2272 pParty->hirelingScrollPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2273 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2274 pParty->CountHirelings();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2275 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2276 npcIdToDismissAfterDialogue = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2277 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2278 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2279 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2280 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2281 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2282 case SCREEN_NPC_DIALOGUE://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2283 if ( npcIdToDismissAfterDialogue )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2284 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2285 pParty->hirelingScrollPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2286 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2287 pParty->CountHirelings();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2288 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2289 npcIdToDismissAfterDialogue = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2290 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2291 //goto LABEL_317;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2292 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2293 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2294 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2295 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2296 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2297 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2298 sub_4452BB();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2299 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2300 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2301 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2302 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2303 case SCREEN_CHANGE_LOCATION://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2304 if ( pParty->vPosition.x < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2305 pParty->vPosition.x = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2306 if ( pParty->vPosition.x > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2307 pParty->vPosition.x = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2308 if ( pParty->vPosition.y < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2309 pParty->vPosition.y = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2310 if ( pParty->vPosition.y > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2311 pParty->vPosition.y = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2312 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2313 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2314 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2315 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2316 case SCREEN_VIDEO:
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2317 pMediaPlayer->Unload();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2318 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2319 case SCREEN_CHARACTERS:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2320 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2321 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2322 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2323 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2324 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2325 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2326 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2327 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2328 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2329 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2330 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2331 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2332 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2333 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2334 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2335 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2336 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2337 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2338 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2339 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2340 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2341 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2342 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2343 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2344 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2345 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2346 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2347 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2348 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2349 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2350 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2351 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2352 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2353 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2354 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2355 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2356 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2357 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2358 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2359 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2360 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2361 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2362 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2363 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2364 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2365 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2366 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2367 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2368 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2369 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2370 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2371 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2372 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2373 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2374 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2375 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2376 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2377 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2378 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2379 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2380 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2381 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2382 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2383 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2384 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2385 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2386 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2387 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2388 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2389 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2390 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2391 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2392 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2393 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2394 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2395 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2396 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2397 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2398 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2399 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2400 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2401 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2402 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2403 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2404 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2405 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2406 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2407 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2408 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2409 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2410 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2411 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2412 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2413 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2414 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2415 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2416 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2417 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2418 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2419 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2420 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2421 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2422 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2423 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2424 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2425 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2426 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2427 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2428 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2429 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2430 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2431 if ( !pGUIWindow_Settings )//Draw Menu
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2432 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2433 dword_6BE138 = -1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2434 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2435 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2436 pAudioPlayer->StopChannels(-1, -1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2437 pCurrentScreen = SCREEN_MENU;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2438
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2439 ++pIcons_LOD->uTexturePacksCount;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2440 if ( !pIcons_LOD->uNumPrevLoadedFiles )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2441 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2442
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
2443 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2444 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2445 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2446 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2447 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2448 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2449 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2450 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2451 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2452 pGlobalTXT_LocalizationStrings[614],// "New Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2453 pIcons_LOD->GetTexture(uTextureID_New1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2454 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2455 pGlobalTXT_LocalizationStrings[615],// "Save Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2456 pIcons_LOD->GetTexture(uTextureID_Save1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2457 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2458 pGlobalTXT_LocalizationStrings[616],// "Load Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2459 pIcons_LOD->GetTexture(uTextureID_Load1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2460 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2461 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2462 pIcons_LOD->GetTexture(uTextureID_Controls1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2463 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2464 pGlobalTXT_LocalizationStrings[618],// "Quit"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2465 pIcons_LOD->GetTexture(uTextureID_Quit1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2466 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2467 pGlobalTXT_LocalizationStrings[619],// "Return to Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2468 pIcons_LOD->GetTexture(uTextureID_Resume1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2469 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2470 viewparams->field_48 = 1;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2471
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2472 stru_506E40.Release();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2473 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
2131
651b24553ae9 savegame screenshot fix
Ritor1
parents: 2130
diff changeset
2474 stru_506E40.LoadPCXFile("gamma.pcx", 0);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2475
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2476 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2477 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2478 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2479 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2480 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2481 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2482 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2483 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2484 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2485 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2486 ModalWindow_Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2487 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2488 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2489 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2490 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2491 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2492 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2493 if ( pParty->hirelingScrollPosition < v37 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2494 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2495 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell???
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2496 if ( pParty->hirelingScrollPosition >= v37 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2497 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2498 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2499 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2500 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2501 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2502 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2503 /*if ( pParty->field_709 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2504 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2505 --pParty->field_709;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2506 if ( pParty->field_709 < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2507 pParty->field_709 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2508 }*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2509 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2510 GameUI_DrawHiredNPCs();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2511 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2512 case UIMSG_TransitionUI_Confirm:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2513 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2514 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2515 dword_50CDC8 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2516 sub_42FBDD();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2517 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful);
2438
c10c639f8365 * Fixed releasing movie for movie-less transitions.
a.parshin
parents: 2432
diff changeset
2518
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2519 if (pMovie_Track)
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2520 pMediaPlayer->Unload();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2521 DialogueEnding();
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2522 viewparams->bRedrawGameUI = true;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2523 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2524 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2525 if ( dword_59117C_teleportx )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2526 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2527 pParty->vPosition.x = dword_59117C_teleportx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2528 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2529 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2530 if ( dword_591178_teleporty )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2531 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2532 pParty->vPosition.y = dword_591178_teleporty;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2533 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2534 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2535 if ( dword_591174_teleportz )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2536 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2537 pParty->vPosition.z = dword_591174_teleportz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2538 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2539 pParty->uFallStartY = dword_591174_teleportz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2540 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2541 if ( dword_591170_teleport_directiony )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2542 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2543 pParty->sRotationY = dword_591170_teleport_directiony;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2544 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2545 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2546 if ( dword_59116C_teleport_directionx )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2547 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2548 pParty->sRotationX = dword_59116C_teleport_directionx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2549 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2550 v38 = dword_591168_teleport_speedz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2551 pParty->uFallSpeed = dword_591168_teleport_speedz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2552 dword_5B65BC = dword_591168_teleport_speedz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2553 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2554 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2555 v38 = dword_5B65BC;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2556 if ( *dword_591164_teleport_map_name != 48 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2557 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2558 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2559 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2560 OnMapLeave();
2101
ee2724b9ca05 RasterLine2D fix and etc.
Ritor1
parents: 2092
diff changeset
2561 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2562 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2563 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2564 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2565 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2566 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2567 pParty->uTimePlayed += 1474560i64;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2568 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2569 case UIMSG_TransitionWindowCloseBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2570 CloseWindowBackground();
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
2571 pMediaPlayer->Unload();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2572 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2573 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2574 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2575 case UIMSG_CycleCharacters:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2576 v39 = GetAsyncKeyState(VK_SHIFT);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2577 uActiveCharacter = CycleCharacter(v39);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2578 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2579 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2580 case UIMSG_OnTravelByFoot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2581 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2582 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2583 dword_50CDC8 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2584 sub_42FBDD();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2585 //pNPCData4 = (NPCData *)GetTravelTime();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2586 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2587 if ( bUnderwater != 1 && pParty->bFlying
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2588 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2589 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2590 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2591 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2592 if ( pParty->vPosition.x < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2593 pParty->vPosition.x = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2594 if ( pParty->vPosition.x > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2595 pParty->vPosition.x = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2596 if ( pParty->vPosition.y < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2597 pParty->vPosition.y = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2598 if ( pParty->vPosition.y > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2599 pParty->vPosition.y = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2600 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2601 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2602 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2603 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2604 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2605 pParty->field_6E4 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2606 pParty->field_6E0 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2607 CastSpellInfoHelpers::_427D48();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2608 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2609 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2610 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2611 ++pGameLoadingUI_ProgressBar->uProgressMax;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2612 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2613 pGameLoadingUI_ProgressBar->Progress();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2614 RestAndHeal(1440 * (signed int)GetTravelTime());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2615 if ( pParty->uNumFoodRations )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2616 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2617 pParty->RestAndHeal();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2618 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2619 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2620 pPlayer7 = pParty->pPlayers.data();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2621 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2622 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2623 pPlayer7->SetCondition(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2624 ++pPlayer7;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2625 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2626 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings.data() );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2627 ++pParty->days_played_without_rest;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2628 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2629 Party::TakeFood((unsigned int)GetTravelTime());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2630 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2631 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2632 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2633 pPlayer8 = pParty->pPlayers.data();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2634 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2635 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2636 pPlayer8->SetCondition(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2637 ++pPlayer8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2638 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2639 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings.data() );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2640 ++pParty->days_played_without_rest;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2641 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2642 pPaletteManager->ResetNonLocked();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2643 pSpriteFrameTable->ResetSomeSpriteFlags();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2644 strcpy(pCurrentMapName, pOut);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2645 strcpy(pLevelName, pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2646 v41 = strtok(pLevelName, ".");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2647 strcpy(pLevelName, v41);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2648 Level_LoadEvtAndStr(pLevelName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2649 pDecalBuilder->Reset(0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2650 LoadLevel_InitializeLevelEvt();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2651 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2652 bUnderwater = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2653 bNoNPCHiring = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2654 pGame->uFlags2 &= 0xFFFFFFF7u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2655 if ( Is_out15odm_underwater() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2656 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2657 bUnderwater = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2658 pGame->uFlags2 |= 8u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2659 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2660 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2661 bNoNPCHiring = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2662 PrepareToLoadODM(1u, (ODMRenderParams *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2663 pAudioPlayer->SetMapEAX();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2664 bDialogueUI_InitializeActor_NPC_ID = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2665 OnMapLoad();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2666 pOutdoor->SetFog();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2667 TeleportToStartingPoint(uLevel_StartingPointType);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2668 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2669 pParty->uFallStartY = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2670 _461103_load_level_sub();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2671 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2672 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2673 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2674 pGameLoadingUI_ProgressBar->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2675 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2676 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2677 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2678 case UIMSG_CHANGE_LOCATION_ClickCencelBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2679 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2680 if ( pParty->vPosition.x < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2681 pParty->vPosition.x = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2682 if ( pParty->vPosition.x > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2683 pParty->vPosition.x = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2684 if ( pParty->vPosition.y < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2685 pParty->vPosition.y = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2686 if ( pParty->vPosition.y > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2687 pParty->vPosition.y = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2688 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2689 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2690 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2691 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2692 case UIMSG_CastSpell_Telekinesis:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2693 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2694 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val();
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2695 /*else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2696 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2697 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2698 pPoint = pMouse->GetCursorPos(&v208);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2699 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]];
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2700 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2701 v44 = (unsigned __int16)v42;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2702 v45 = PID_TYPE(v44);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2703 uNumSeconds = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2704 v46 = PID_ID(v44);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2705 if ( v45 == 3 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2706 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2707 v47 = pActors[v46].uAIState == Dead;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2708 if ( !v47 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2709 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2710 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2711 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2712 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2713 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2714 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2715 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2716 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2717 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2718 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2719 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2720 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2721 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2722 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2723 if ( v45 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2724 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2725 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2726 if ( !v47 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2727 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2728 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2729 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2730 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2731 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2732 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2733 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2734 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2735 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2736 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2737 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2738 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2739 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2740 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2741 if ( v45 == 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2742 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2743 v48 = pLevelDecorations[v46].uEventID == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2744 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2745 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2746 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2747 if ( v45 != 6 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2748 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2749 if ( uCurrentlyLoadedLevelType != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2750 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2751 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
2092
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2070
diff changeset
2752 if ( !pODMFace->Clickable() || !pODMFace->sCogTriggeredID )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2753 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2754 v44 = uNumSeconds;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2755 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2756 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2757 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2758 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2759 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2760 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2761 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2762 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2763 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2764 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2765 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2766 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2767 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2768 pBLVFace = &pIndoor->pFaces[v46];
2092
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2070
diff changeset
2769 if ( !pBLVFace->Clickable() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2770 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2771 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2772 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2773 if ( v48 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2774 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2775 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2776 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2777 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2778 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2779 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2780 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2781 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2782 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2783 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2784 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2785 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2786 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2787 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2788 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2789 case UIMSG_HiredNPC_CastSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2790 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2791 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2792 if ( _50C9A0_IsEnchantingInProgress )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2793 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2794 uActiveCharacter = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2795 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2796 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2797 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2798 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2799 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2800 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2801 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2802 switch ( uMessage )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2803 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2804 case UIMSG_CastSpell_Character_Big_Improvement:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2805 pSpellInfo->uFlags &= ~0x02u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2806 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2807 case UIMSG_CastSpell_Character_Small_Improvement:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2808 pSpellInfo->uFlags &= ~0x0100u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2809 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2810 case UIMSG_HiredNPC_CastSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2811 pSpellInfo->uFlags &= ~0x0200u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2812 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2813 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2814 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2815 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2816 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2817 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2818 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2819 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2820 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2821 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2822 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2823 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2824 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2825 case UIMSG_BF:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2826 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2827 dword_50CDC8 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2828 sub_42FBDD();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2829 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2830 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
2831 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2832 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2833 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2834 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2835 if ( v53 < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2836 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2837 v54 = abs(v53) - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2838 _5B65B8_npcdata_hiword_house_or_other = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2839 dword_5B65BC = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2840 v55 = dword_4E4560[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2841 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2842 v56 = dword_4E4590[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2843 v57 = dword_4E45A8[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2844 _5B65A8_npcdata_uflags_or_other = v55;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2845 _5B65B4_npcdata_loword_house_or_other = v57;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2846 _5B65B0_npcdata_rep_or_other = v56;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2847 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2848 }
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1916
diff changeset
2849 HouseDialogPressCloseBtn();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2850 //goto LABEL_434;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2851 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2852 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2853 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2854 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2855 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2856 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2857 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
2858 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2859 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2860
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2861 case UIMSG_OnCastTownPortal:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2862 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
2863 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2864 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2865
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2866 case UIMSG_OnCastLloydsBeacon:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2867 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
2868 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_LloydsBeacon, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2869 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2870
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2871 case UIMSG_LloydsBeacon_FlippingBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2872 bRecallingBeacon = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2873 v127 = uMessageParam + 204;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2874 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2875 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2876 case UIMSG_HintBeaconSlot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2877 if ( !pGUIWindow_CurrentMenu )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2878 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2879 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2880 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2881 if ( bRecallingBeacon )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2882 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2883 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2884 continue;
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents: 2253
diff changeset
2885 v173 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2886 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2887 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2888 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2889 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2890 pMapNum = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2891 pMapName = "Not in Map Stats";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2892 if ( pMapNum )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2893 pMapName = pMapStats->pInfos[pMapNum].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2894 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2895 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2896 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2897 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2898 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2899 }
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents: 2253
diff changeset
2900 v174 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2901 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2902 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2903 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2904 case UIMSG_CloseAfterInstallBeacon:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2905 dword_50CDC8 = 1;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
2906 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2907 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2908 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2909 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2910 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2911 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2912 ++pMessageQueue_50CBD0->uNumMessages;*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2913 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2914 case UIMSG_InstallBeacon:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2915 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2916 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2917 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2918 byte_506360 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2919 pPlayer9->CanCastSpell(uRequiredMana);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2920 if ( pParty->bTurnBasedModeOn )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2921 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2922 v60 = sRecoveryTime;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2923 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2924 pPlayer9->SetRecoveryTime(v60);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2925 pTurnEngine->ApplyPlayerAction();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2926 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2927 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2928 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2929 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2930 }
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
2931 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2932 if ( bRecallingBeacon )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2933 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2934 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2935 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2936 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2937 OnMapLeave();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2938 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
2939 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2940 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2941 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2942 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2943 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2944 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2945 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2946 dword_5B65C0 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2947 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2948 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2949 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2950 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2951 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2952 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2953 pParty->uFallStartY = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2954 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2955 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2956 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
2957 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2958 pBooksWindow->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2959 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2960 pBooksWindow = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2961 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2962 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2963 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2964 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2965 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2966 pRenderer->SaveScreenshot(a1, 92, 68);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2967 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1);
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
2968 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2969 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2970 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2971 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2972 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2973 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2974 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2975 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2976 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2977 {
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
2978 if ( !_stricmp(pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName) )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2979 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2980 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2981 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2982 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2983 case UIMSG_ClickTownInTP:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2984 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2985 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2986 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2987 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2988 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2989 v63 = 208;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2990 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2991 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2992 v63 = 207;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2993 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2994 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2995 v63 = 211;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2996 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2997 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2998 v63 = 209;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2999 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3000 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3001 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3002 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3003 LABEL_486:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3004 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3005 v64 = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3006 v65 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3007 if ( v64 == TownPortalList[uMessageParam].uMapInfoID )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3008 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3009 pParty->vPosition.x = TownPortalList[v65].pos.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3010 pParty->vPosition.y = TownPortalList[v65].pos.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3011 pParty->vPosition.z = TownPortalList[v65].pos.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3012 pParty->uFallStartY = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3013 pParty->sRotationY = TownPortalList[v65].rot_y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3014 pParty->sRotationX = TownPortalList[v65].rot_x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3015 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3016 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3017 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3018 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3019 OnMapLeave();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
3020 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
3021 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3022 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3023 dword_5B65C0 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3024 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3025 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3026 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3027 v66 = TownPortalList[uMessageParam].rot_x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3028 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3029 _5B65B8_npcdata_hiword_house_or_other = v66;
2338
1e865e8690ba Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents: 2336
diff changeset
3030 Actor::InitializeActors();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3031 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3032 v67 = (char*)pGUIWindow_CurrentMenu->Hint;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3033 if ( v67 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3034 *((int *)v67 + 17) = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3035 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3036 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3037 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3038 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3039 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3040 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3041 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3042 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3043 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3044 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3045 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3046 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3047 v63 = 210;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3048 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3049 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3050 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3051 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3052 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3053 v63 = 206;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3054 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3055 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3056 return;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3057 goto LABEL_486;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3058 case UIMSG_HintTownPortal:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3059 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3060 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3061 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3062 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3063 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3064 v68 = 208;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3065 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3066 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3067 v68 = 207;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3068 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3069 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3070 v68 = 211;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3071 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3072 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3073 v68 = 209;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3074 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3075 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3076 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3077 //goto LABEL_506;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3078 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3079 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3080 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3081 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3082 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3083 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3084 v69 = pMapStats->pInfos[4].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3085 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3086 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3087 v69 = pMapStats->pInfos[3].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3088 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3089 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3090 v69 = pMapStats->pInfos[10].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3091 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3092 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3093 v69 = pMapStats->pInfos[7].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3094 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3095 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3096 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3097 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3098 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3099 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3100 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3101 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3102 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3103 v69 = pMapStats->pInfos[8].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3104 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3105 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3106 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3107 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3108 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3109 v69 = pMapStats->pInfos[21].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3110 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3111 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3112 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3113 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3114 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3115 v68 = 210;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3116 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3117 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3118 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3119 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3120 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3121 v68 = 206;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3122 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3123 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3124 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3125 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3126 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3127 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3128 //LABEL_506:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3129 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3130 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3131 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3132 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3133 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3134 v69 = pMapStats->pInfos[4].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3135 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3136 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3137 v69 = pMapStats->pInfos[3].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3138 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3139 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3140 v69 = pMapStats->pInfos[10].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3141 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3142 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3143 v69 = pMapStats->pInfos[7].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3144 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3145 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3146 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3147 //goto LABEL_519;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3148 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3149 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3150 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3151 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3152 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3153 v69 = pMapStats->pInfos[8].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3154 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3155 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3156 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3157 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3158 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3159 v69 = pMapStats->pInfos[21].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3160 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3161 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3162 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3163 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3164 case UIMSG_ShowFinalWindow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3165 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3166 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment."
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3167 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3168 ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3169 uGameState = GAME_STATE_FINAL_WINDOW;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3170 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3171 case UIMSG_OnFinalWindowClose:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3172 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3173 uGameState = GAME_STATE_PLAYING;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3174 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3175 __debugbreak(); // missed break/continue?
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3176 case UIMSG_DD:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3177 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3178 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3179 memcpy(&v216, txt_file_frametable_parser(pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3180 if ( v216.uPropCount == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3181 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3182 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3183 v70 = atoi(v216.pProperties[0]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3184 if ( v70 <= 0 || v70 >= 77 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3185 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3186 v71 = v70;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3187 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3188 pNPCData3 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3189 if ( (signed int)pNPCData4 > 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3190 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3191 thish = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3192 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3193 {
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3194 if ( !_stricmp(pGames_LOD->pSubIndices[thish].pFilename, Str2) )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3195 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3196 ++thish;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3197 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3198 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3199 while ( (signed int)pNPCData3 < (signed int)pNPCData4 );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3200 if ( (signed int)pNPCData3 < (signed int)pNPCData4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3201 {
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3202 strcpy(pCurrentMapName, pGames_LOD->pSubIndices[(int)pNPCData3].pFilename);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
3203 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
3204 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3205 OnMapLeave();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3206 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3207 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3208 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3209 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3210 v73 = Str2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3211 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3212 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3213 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3214 if ( v216.uPropCount != 3 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3215 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3216 v74 = atoi(v216.pProperties[0]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3217 thisi = atoi(v216.pProperties[1]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3218 v75 = atoi(v216.pProperties[2]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3219 v76 = v75;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3220 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3221 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3222 if ( pIndoor->GetSector(v74, thisi, v75) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3223 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3224 v77 = thisi;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3225 pParty->vPosition.x = v74;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3226 pParty->vPosition.y = v77;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3227 pParty->vPosition.z = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3228 pParty->uFallStartY = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3229 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3230 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3231 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3232 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3233 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3234 if ( v74 > -32768 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3235 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3236 if ( v74 < 32768 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3237 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3238 v77 = thisi;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3239 if ( thisi > -32768 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3240 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3241 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3242 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3243 pParty->vPosition.x = v74;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3244 pParty->vPosition.y = v77;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3245 pParty->vPosition.z = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3246 pParty->uFallStartY = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3247 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3248 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3249 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3250 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3251 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3252 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3253 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3254 v73 = "Can't jump to that location!";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3255 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3256 ShowStatusBarString(v73, 6u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3257 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3258 case UIMSG_CastQuickSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3259 if ( bUnderwater == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3260 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3261 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3262 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3263 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3264 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3265 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3266 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3267 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3268 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3269 case UIMSG_CastSpell_Monster_Improvement:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3270 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm,
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3271 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3272 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3273 v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3274 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3275 /*else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3276 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3277 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3278 pPoint2 = pMouse->GetCursorPos(&v201);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3279 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]];
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3280 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3281 v83 = v81;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3282 v44 = (unsigned __int16)v81;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3283 v84 = v83 >> 16;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3284 if ( PID_TYPE(v44) != 3 || v84 >= 5120 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3285 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3286 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3287 if ( uMessage == UIMSG_CastSpell_Shoot_Monster )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3288 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3289 pSpellInfo->uFlags &= ~0x08;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3290 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3291 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3292 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3293 if ( uMessage == UIMSG_CastSpell_Monster_Improvement )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3294 pSpellInfo->uFlags &= ~0x0100u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3295 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3296 pSpellInfo->uFlags &= ~0x0200u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3297 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3298 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3299 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3300 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3301 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3302 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3303 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3304 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3305 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3306 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3307 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3308 case UIMSG_1C:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3309 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3310 if ( !uActiveCharacter || pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3311 continue;
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3312 ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3313 pCurrentScreen = SCREEN_19;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3314 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3315 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3316 case UIMSG_STEALFROMACTOR:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3317 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3318 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3319 if ( pParty->bTurnBasedModeOn != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3320 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3321 if ( pActors[uMessageParam].uAIState == 5 )
1966
7840fe323f67 stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents: 1936
diff changeset
3322 pActors[uMessageParam].LootActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3323 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3324 Actor::StealFrom(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3325 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3326 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3327 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3328 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3329 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3330 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3331 if ( pActors[uMessageParam].uAIState == 5 )
1966
7840fe323f67 stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents: 1936
diff changeset
3332 pActors[uMessageParam].LootActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3333 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3334 Actor::StealFrom(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3335 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3336 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3337
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3338 case UIMSG_Attack:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3339 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3340 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3341 if ( pParty->bTurnBasedModeOn != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3342 {
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
3343 Player::_42ECB5_PlayerAttacksActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3344 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3345 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3346 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3347 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3348 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) )
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
3349 Player::_42ECB5_PlayerAttacksActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3350 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3351 case UIMSG_ExitRest:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3352 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3353 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3354 case UIMSG_Wait5Minutes:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3355 if ( dword_506F14 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3356 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3357 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3358 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3359 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3360 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3361 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3362 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3363 dword_506F14 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3364 _506F18_num_minutes_to_sleep = 5;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3365 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3366 case UIMSG_Wait1Hour:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3367 if ( dword_506F14 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3368 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3369 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3370 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3371 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3372 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3373 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3374 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3375 dword_506F14 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3376 _506F18_num_minutes_to_sleep = 60;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3377 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3378 case UIMSG_RentRoom:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3379 dword_506F14 = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3380 RestUI_Load();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3381 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3382 _506F18_num_minutes_to_sleep = v86;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3383 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3384 _506F18_num_minutes_to_sleep = v86 + 12 * 60;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3385 dword_506F14 = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3386 pParty->RestAndHeal();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3387 pParty->days_played_without_rest = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3388 pParty->pPlayers[3].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3389 pParty->pPlayers[2].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3390 pParty->pPlayers[1].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3391 pParty->pPlayers[0].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3392 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3393 case UIMSG_RestWindow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3394 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3395 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3396 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3397 continue;
1936
68f2d9d3a1d9 MSVS 2010 project file
Ritor1
parents: 1919
diff changeset
3398 if ( CheckActors_proximity() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3399 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3400 if ( pParty->bTurnBasedModeOn == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3401 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3402 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3403 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3404 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3405 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3406 if ( pParty->uFlags & 0x88 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3407 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3408 ShowStatusBarString(v88, 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3409 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3410 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3411 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3412 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3413 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3414 if ( pParty->bTurnBasedModeOn == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3415 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3416 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3417 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3418 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3419 if ( !(pParty->uFlags & 0x88) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3420 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3421 RestUI_Load();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3422 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3423 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3424 if ( pParty->bTurnBasedModeOn == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3425 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3426 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3427 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3428 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3429 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3430 if ( pParty->uFlags & 0x88 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3431 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3432 ShowStatusBarString(v88, 2u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3433 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3434 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3435 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3436 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3437 case UIMSG_Rest8Hour:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3438 if ( dword_506F14 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3439 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3440 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3441 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3442 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3443 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3444 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3445 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3446 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3447 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3448 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3449 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3450 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3451 {
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3452 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed;
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3453 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed;
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3454 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed;
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3455 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3456 v90 = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3457 if ( !v90 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3458 v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3459 pMapInfo = &pMapStats->pInfos[v90];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3460 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3461 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3462 v91 = rand() % 100;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3463 v92 = pMapInfo->EncM1percent;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3464 v93 = v91 + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3465 if ( v93 > v92 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3466 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3467 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3468 pNPCData4 = (NPCData *)1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3469 if ( !_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3470 pNPCData4 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3471 if ( pNPCData4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3472 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3473 pPlayerNum = rand() % 4;
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3474 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3475 v95 = rand();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3476 Rest(v95 % 6 + 60);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3477 _506F18_num_minutes_to_sleep = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3478 dword_506F14 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3479 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3480 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3481 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3482 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3483 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3484 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3485 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3486 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3487 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3488 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3489 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3490 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3491 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3492 Party::TakeFood(uRestUI_FoodRequiredToRest);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3493 _506F18_num_minutes_to_sleep = 480;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3494 dword_506F14 = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3495 pParty->RestAndHeal();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3496 pParty->days_played_without_rest = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3497 pParty->pPlayers[3].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3498 pParty->pPlayers[2].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3499 pParty->pPlayers[1].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3500 pParty->pPlayers[0].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3501 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3502 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3503 case UIMSG_AlreadyResting:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3504 if ( dword_506F14 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3505 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3506 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3507 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3508 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3509 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3510 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3511 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3512 v97 = _494820_training_time(pParty->uCurrentHour);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3513 dword_506F14 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3514 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3515 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3516 case UIMSG_HintSelectRemoveQuickSpellBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3517 if ( quick_spell_at_page && byte_506550 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3518 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3519 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3520 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3521 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3522 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3523 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3524 if ( pPlayers[uActiveCharacter]->uQuickSpell )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3525 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3526 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3527 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3528 strcpy(pTmpBuf.data(), v177);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3529 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3530 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3531 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3532 case UIMSG_SPellbook_ShowHightlightedSpellInfo:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3533 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3534 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3535 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3536 if ( sub_4637E0_is_there_popup_onscreen() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3537 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3538 v98 = *(char *)(uNumSeconds + 6734);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3539 if ( quick_spell_at_page - 1 == uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3540 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3541 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3542 v161 = pGlobalTXT_LocalizationStrings[485];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3543 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3544 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3545 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3546 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3547 v161 = pGlobalTXT_LocalizationStrings[486];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3548 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3549 sprintfex(pTmpBuf.data(), v161, v178);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3550 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3551 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3552 case UIMSG_ClickInstallRemoveQuickSpellBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3553 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3554 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3555 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3556 pPlayer10 = pPlayers[uActiveCharacter];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3557 if ( !byte_506550 || !quick_spell_at_page )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3558 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3559 pPlayer10->uQuickSpell = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3560 quick_spell_at_page = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3561 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3562 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3563 }
2184
e0863f5beee0 SPELL_WATER_RECHARGE_ITEM
Ritor1
parents: 2155
diff changeset
3564 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage;
e0863f5beee0 SPELL_WATER_RECHARGE_ITEM
Ritor1
parents: 2155
diff changeset
3565 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3566 if ( uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3567 pPlayer10->PlaySound(SPEECH_12, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3568 byte_506550 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3569 continue;
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3570 case UIMSG_SpellBook_PressTab://ïåðåëèñòûâàíèå ñòðàíèö êëàâèøåé Tab
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3571 {
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3572 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3573 continue;
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3574 int skill_count = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3575 uAction = 0;
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3576 for ( uint i = 0; i < 9; i++ )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3577 {
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3578 if ( pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i] )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3579 {
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3580 if ( pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i )
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3581 uAction = skill_count;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3582 v217[skill_count++] = i;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3583 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3584 }
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3585 if ( !skill_count )//íåò ñêèëëîâ
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3586 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3587 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3588 {
2460
1921b140607a VK_CONTROL
Ritor1
parents: 2456
diff changeset
3589 if ( GetAsyncKeyState(VK_SHIFT) )
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3590 {
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3591 --uAction;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3592 if ( uAction < 0 )
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3593 uAction = skill_count - 1;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3594 }
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3595 else
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3596 {
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3597 ++uAction;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3598 if ( uAction >= skill_count )
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3599 uAction = 0;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3600 }
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3601 OnCloseSpellBookPage();
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3602 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]);
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3603 pGUIWindow_CurrentMenu->OpenSpellBook();
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3604 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3605 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3606 continue;
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3607 }
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3608 case UIMSG_OpenSpellbookPage:
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3609 if ( pTurnEngine->turn_stage == TE_MOVEMENT || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3610 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3611 OnCloseSpellBookPage();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3612 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3613 pGUIWindow_CurrentMenu->OpenSpellBook();
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3614 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3615 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3616 case UIMSG_SelectSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3617 {
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3618 if (pTurnEngine->turn_stage == TE_MOVEMENT)
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3619 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3620 if (!uActiveCharacter)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3621 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3622
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3623 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
3624 Player* player = pPlayers[uActiveCharacter];
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3625 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3626 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3627 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3628 if ( quick_spell_at_page - 1 == uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3629 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3630 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3631 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3632 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3633 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3634 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3635 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3636 /*if ( dword_50C9E8 < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3637 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3638 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3639 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3640 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3641 ++dword_50C9E8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3642 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3643 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3644 // pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3645 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3646 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3647 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3648 byte_506550 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3649 quick_spell_at_page = uMessageParam + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3650 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3651 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3652 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3653 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3654
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3655 case UIMSG_CastSpellFromBook:
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3656 if ( pTurnEngine->turn_stage != TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3657 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3658 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3659
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3660 case UIMSG_SpellScrollUse:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3661 __debugbreak();
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3662 if ( pTurnEngine->turn_stage != TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3663 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3664 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3665 case UIMSG_SpellBookWindow:
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3666 if ( pTurnEngine->turn_stage == TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3667 continue;
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3668 if ( bUnderwater == true )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3669 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3670 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3671 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3672 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3673 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3674 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3675 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3676 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3677 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3678 {
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3679 if ( pCurrentScreen == SCREEN_GAME )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3680 {
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3681 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3682 pCurrentScreen = SCREEN_SPELL_BOOK;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3683 pEventTimer->Pause();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3684 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3685 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3686 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3687 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3688 }
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3689 if ( pCurrentScreen != SCREEN_REST && pCurrentScreen != SCREEN_CHARACTERS
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3690 && (pCurrentScreen <= SCREEN_63 || pCurrentScreen > SCREEN_67) )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3691 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3692 pGUIWindow_CurrentMenu->Release();
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3693 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3694 pCurrentScreen = SCREEN_SPELL_BOOK;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3695 pEventTimer->Pause();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3696 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3697 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3698 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3699 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3700 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3701 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3702 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3703 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3704 case UIMSG_QuickReference:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3705 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3706 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3707 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3708 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3709 ++pIcons_LOD->uTexturePacksCount;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3710 if ( !pIcons_LOD->uNumPrevLoadedFiles )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3711 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3712 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3713 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3714 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3715 pAudioPlayer->StopChannels(-1, -1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3716 pCurrentScreen = SCREEN_QUICK_REFERENCE;
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3717 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_QuickReference, 5, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3718 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3719 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3720 pGlobalTXT_LocalizationStrings[79],// "Exit"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3721 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3722 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3723 case UIMSG_GameMenuButton:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3724 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3725 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3726 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3727 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3728 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3729 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3730 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3731
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3732 stru_506E40.Release();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3733 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
2131
651b24553ae9 savegame screenshot fix
Ritor1
parents: 2130
diff changeset
3734 stru_506E40.LoadPCXFile("gamma.pcx", 0);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3735
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3736 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3737 //LABEL_453:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3738 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3739 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3740 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3741 //goto LABEL_770;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3742 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3743 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3744 ++pMessageQueue_50CBD0->uNumMessages;*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3745 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3746 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3747 case UIMSG_ClickAwardScrollBar:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3748 books_page_number = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3749 if ( pMouse->GetCursorPos(&v211)->y > 178 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3750 books_page_number = -1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3751 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3752 case UIMSG_ClickAwardsUpBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3753 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3754 BtnUp_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3755 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3756 case UIMSG_ClickAwardsDownBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3757 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3758 BtnDown_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3759 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3760 case UIMSG_ChangeDetaliz:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3761 bRingsShownInCharScreen ^= 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3762 pCharacterScreen_DetalizBtn->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3763 pCharacterScreen_DollBtn->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3764 if ( bRingsShownInCharScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3765 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3766 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3767 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3768 v123 = 445;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3769 v121 = 470;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3770 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3771 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3772 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3773 v128 = 30;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3774 v125 = 30;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3775 v123 = 300;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3776 v121 = 600;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3777 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3778 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3779 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3780 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3781 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3782 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3783 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3784 case UIMSG_ClickPaperdoll:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3785 OnPaperdollLeftClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3786 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3787 case UIMSG_ClickStatsBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3788 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3789 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3790 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3791 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3792 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3793 case UIMSG_ClickSkillsBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3794 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3795 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3796 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3797 CharacterUI_SkillsTab_CreateButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3798 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3799 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3800 case UIMSG_SkillUp:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3801 pPlayer4 = pPlayers[uActiveCharacter];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3802 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3803 LOWORD(v2) = *(short *)v105;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3804 uNumSeconds = v2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3805 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3806 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3807 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3808 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3809 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3810 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3811 if ( (uNumSeconds & 0x3F) < 0x3C )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3812 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3813 *(short *)v105 = uNumSeconds + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3814 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3815 pPlayer4->PlaySound(SPEECH_14, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3816 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3817 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3818 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3819 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3820 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3821 ShowStatusBarString(v87, 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3822 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3823 case UIMSG_ClickInventoryBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3824 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3825 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3826 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3827 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3828 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3829 case UIMSG_ClickExitCharacterWindowBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3830 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3831 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3832 case UIMSG_ClickAwardsBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3833 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3834 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3835 CreateAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3836 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3837 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3838 FillAwardsData();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3839 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3840 case UIMSG_ClickBooksBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3841 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3842 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3843 case 11://Page UP
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3844 BtnUp_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3845 pButton = pBtn_Book_2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3846 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3847 case 10://Page DOWN
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3848 BtnDown_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3849 pButton = pBtn_Book_1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3850 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3851 case 0://Zoom plus
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3852 pButton = pBtn_Book_1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3853 BtnDown_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3854 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3855 case 1://Zoom minus
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3856 pButton = pBtn_Book_2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3857 BtnUp_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3858 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3859 case 2://Potions
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3860 Book_PageBtn3_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3861 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3862 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3863 pButton = pBtn_Book_3;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3864 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3865 case 3://fountains
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3866 Book_PageBtn4_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3867 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3868 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3869 pButton = pBtn_Book_4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3870 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3871 case 4://obelisks
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3872 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3873 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3874 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3875 pButton = pBtn_Book_5;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3876 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3877 case 5://seer
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3878 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3879 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3880 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3881 pButton = pBtn_Book_6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3882 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3883 case 6://misc
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3884 pButton = pBtn_Autonotes_Misc;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3885 Autonotes_Misc_page_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3886 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3887 case 7://Instructors
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3888 pButton = pBtn_Autonotes_Instructors;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3889 Autonotes_Instructors_page_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3890 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3891 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3892 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3893 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3894 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3895 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3896 case UIMSG_SelectCharacter:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3897 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3898 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3899 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3900 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3901 case UIMSG_ShowStatus_Funds:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3902 v174 = (char *)pParty->uNumGoldInBank;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3903 //v158 = pParty->uNumGold + pParty->uNumGoldInBank;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3904 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3905 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3906 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3907 case UIMSG_ShowStatus_DateTime:
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3908 currHour = pParty->uCurrentHour;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3909 uNumSeconds = 1;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3910 if (pParty->uCurrentHour > 12 )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3911 {
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3912 if (pParty->uCurrentHour >= 24)
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3913 uNumSeconds = 0;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3914 currHour = (currHour - 12);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3915 }
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3916 else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3917 {
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3918 if (pParty->uCurrentHour < 12) // 12:00 is PM
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3919 uNumSeconds = 0;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3920 if (pParty->uCurrentHour == 0)
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3921 currHour = 12;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3922 }
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
3923 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", currHour, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3924 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3925 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3926 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3927 case UIMSG_ShowStatus_Food:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3928 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3929 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3930 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3931 case UIMSG_ShowStatus_Player:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3932 pPlayer5 = pPlayers[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3933 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3934 strcat(pTmpBuf.data(), ": ");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3935 v107 = pPlayer5->GetMajorConditionIdx();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3936 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3937 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3938 v108 = 8 * uMessageParam - 8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3939 LOBYTE(v108) = v108 | 4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3940 pMouse->uPointingObjectID = PID(OBJECT_Player,v108);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3941 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3942 case UIMSG_ShowStatus_ManaHP:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3943 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(),
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3944 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(),
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3945 pGlobalTXT_LocalizationStrings[212]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3946 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3947 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3948 case UIMSG_CHEST_ClickItem:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3949 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3950 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3951 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3952 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3953 }
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2341
diff changeset
3954 Chest::OnChestLeftClick();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3955 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3956 case UIMSG_InventoryLeftClick:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3957 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3958 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3959 case UIMSG_MouseLeftClickInGame:
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3960 /*if ( !pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3961 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3962 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3963 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3964 OnGameViewportClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3965 continue;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3966 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3967 v115 = pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3968 if ( !pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3969 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3970 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3971 /*if ( (signed int)v115 < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3972 //goto LABEL_769;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3973 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3974 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3975 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3976 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3977 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3978 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3979 }*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3980 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3981 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3982 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3983 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3984 pMessageQueue_50CBD0->uNumMessages = 1;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3985 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3986 /*v115 = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3987 pMessageQueue_50CBD0->uNumMessages = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3988 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3989 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3990 //goto LABEL_771;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3991 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3992 ++pMessageQueue_50CBD0->uNumMessages;*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3993 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3994 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3995 v115 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3996 pMessageQueue_50CBD0->uNumMessages = 0;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3997 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3998 /*if ( (signed int)v115 < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3999 //goto LABEL_769;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4000 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4001 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4002 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4003 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4004 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4005 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4006 }*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4007 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4008 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4009 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4010 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4011 OnGameViewportClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4012 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4013 case UIMSG_F:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4014 __debugbreak();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4015 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4016 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4017 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4018 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4019 /*else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4020 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4021 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4022 pPoint3 = pMouse->GetCursorPos(&v204);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4023 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4024 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4025 pButton2 = (GUIButton *)(unsigned __int16)v116;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4026 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4027 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4028 case UIMSG_54:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4029 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4030 pButton2 = (GUIButton *)uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4031 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4032 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4033 case UIMSG_Game_Action:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4034 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4035 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4036 OnPressSpace();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4037 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4038 case UIMSG_ClickZoomOutBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4039 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4040 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4041 pParty->uFlags |= 2u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4042 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4043 uNumSeconds = 131072;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4044 v118 = 2 * viewparams->uMinimapZoom;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4045 ++viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4046 viewparams->uMinimapZoom *= 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4047 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4048 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4049 if ( (signed int)v118 > 4096 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4050 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4051 viewparams->uMinimapZoom = 4096;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4052 viewparams->field_28 = 12;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4053 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4054 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4055 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4056 v119 = 2048;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4057 if ( (signed int)v118 <= 2048 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4058 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4059 _576E2C_current_minimap_zoom = v118;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4060 dword_576E28 = viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4061 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4062 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4063 viewparams->field_28 = 11;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4064 viewparams->uMinimapZoom = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4065 _576E2C_current_minimap_zoom = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4066 dword_576E28 = viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4067 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4068 case UIMSG_ClickZoomInBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4069 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4070 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4071 pParty->uFlags |= 2u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4072 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4073 uNumSeconds = 32768;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4074 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4075 --viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4076 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4077 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4078 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4079 v119 = 512;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4080 if ( (signed int)v118 < 512 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4081 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4082 viewparams->field_28 = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4083 v118 = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4084 viewparams->uMinimapZoom = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4085 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4086 _576E2C_current_minimap_zoom = v118;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4087 dword_576E28 = viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4088 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4089 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4090 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4091 if ( (signed int)v118 < 256 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4092 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4093 viewparams->uMinimapZoom = 256;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4094 viewparams->field_28 = 8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4095 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4096 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4097 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4098 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4099 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4100 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4101 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4102 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4103 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4104 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4105 //dword_50C9E8 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4106
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4107
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4108 pMessageQueue_50C9E8->uNumMessages=0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4109 if ( dword_50C9DC )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4110 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4111 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4112 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4113 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4114 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4115 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4116 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4117 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4118 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4119 dword_50C9DC = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4120 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4121 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4122 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4123 if ( _50C9D0_AfterEnchClickEventId > 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4124 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4125 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4126 if ( _50C9D8_AfterEnchClickEventTimeout <= 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4127 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4128 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4129 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4130 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4131 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4132 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4133 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4134 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4135 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4136 _50C9D0_AfterEnchClickEventId = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4137 _50C9D4_AfterEnchClickEventSecondParam = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4138 _50C9D8_AfterEnchClickEventTimeout = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4139 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4140 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4141 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4142 CastSpellInfoHelpers::_427E01_cast_spell();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4143 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4144 //----- (00435748) --------------------------------------------------------
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4145 void GUI_MainMenuMessageProc()
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4146 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4147 Player *pPlayer; // ebx@2
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4148 void *v3; // edi@21
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4149 signed int v4; // eax@29
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4150 // int v5; // ecx@29
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4151 // PLAYER_SKILL_TYPE v6; // edi@37
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4152 GUIWindow *pWindow; // eax@56
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4153 GUIButton *pButton; // eax@59
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4154 int v15; // edi@70
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4155 char v20; // dl@116
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4156 unsigned int v21; // eax@116
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4157 unsigned int v25; // eax@120
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4158 unsigned int v26; // ecx@127
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4159 // SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4160 // signed int v41; // [sp-10h] [bp-20h]@29
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4161 int pParam; // [sp+4h] [bp-Ch]@3
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4162 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4163 int pSex; // [sp+Ch] [bp-4h]@3
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4164
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4165 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4166 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4167 pPlayer = pParty->pPlayers.data();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4168 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4169 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4170 int param2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4171 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &param2);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4172 //auto player = &pParty->pPlayers[pParam];
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4173
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4174 switch (pUIMessageType) // For buttons of window MainMenu
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4175 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4176 case UIMSG_MainMenu_ShowPartyCreationWnd:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4177 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4178 SetCurrentMenuID(MENU_NEWGAME);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4179 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4180 case UIMSG_MainMenu_ShowLoadWindow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4181 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4182 SetCurrentMenuID(MENU_SAVELOAD);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4183 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4184 case UIMSG_ShowCredits:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4185 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4186 SetCurrentMenuID(MENU_CREDITS);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4187 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4188 case UIMSG_ExitToWindows:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4189 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4190 SetCurrentMenuID(MENU_EXIT_GAME);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4191 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4192 case UIMSG_PlayerCreation_SelectAttribute:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4193 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4194 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4195 uPlayerCreationUI_SelectedCharacter = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4196 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4197 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4198 case UIMSG_PlayerCreation_VoicePrev:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4199 pSex = pParty->pPlayers[pParam].GetSexByVoice();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4200 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4201 {
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4202 if (pParty->pPlayers[pParam].uVoiceID == 0)
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4203 pParty->pPlayers[pParam].uVoiceID = 19;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4204 else --pParty->pPlayers[pParam].uVoiceID;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4205 }
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4206 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4207 pButton = pCreationUI_BtnPressLeft2[pParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4208 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4209 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4210 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4211 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4212 case UIMSG_PlayerCreation_VoiceNext:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4213 pSex = pParty->pPlayers[pParam].GetSexByVoice();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4214 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4215 {
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4216 pParty->pPlayers[pParam].uVoiceID = (pParty->pPlayers[pParam].uVoiceID + 1) % 20;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4217 }
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4218 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4219 pButton = pCreationUI_BtnPressRight2[pParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4220 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4221 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4222 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4223 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4224 case UIMSG_PlayerCreation_FacePrev:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4225 //pPlayer = &pParty->pPlayers[pParam];
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4226 if (!pParty->pPlayers[pParam].uCurrentFace)
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4227 pParty->pPlayers[pParam].uCurrentFace = 19;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4228 else
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4229 pParty->pPlayers[pParam].uCurrentFace -= 1;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4230 pParty->pPlayers[pParam].uVoiceID = pParty->pPlayers[pParam].uCurrentFace;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4231 pParty->pPlayers[pParam].SetInitialStats();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4232 pParty->pPlayers[pParam].SetSexByVoice();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4233 pParty->pPlayers[pParam].RandomizeName();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4234 v25 = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4235 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4236 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4237 uPlayerCreationUI_SelectedCharacter = v25;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4238 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4239 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4240 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4241 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4242 case UIMSG_PlayerCreation_FaceNext:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4243 //pPlayer = &pParty->pPlayers[pParam];
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4244 v20 = (char)((int)pParty->pPlayers[pParam].uCurrentFace + 1) % 20;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4245 pParty->pPlayers[pParam].uCurrentFace = v20;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4246 pParty->pPlayers[pParam].uVoiceID = v20;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4247 pParty->pPlayers[pParam].SetInitialStats();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4248 pParty->pPlayers[pParam].SetSexByVoice();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4249 pParty->pPlayers[pParam].RandomizeName();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4250 v21 = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4251 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4252 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4253 uPlayerCreationUI_SelectedCharacter = v21;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4254 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4255 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4256 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4257 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4258 case UIMSG_PlayerCreationClickPlus:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4259 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4260 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4261 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4262 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4263 case UIMSG_PlayerCreationClickMinus:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4264 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4265 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4266 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4267 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4268 case UIMSG_PlayerCreationSelectActiveSkill:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4269 if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4270 pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pParam + 4)] = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4271 pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4272 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4273 case UIMSG_PlayerCreationSelectClass:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4274 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4275 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4276 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4277 case UIMSG_PlayerCreationClickOK:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4278 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4279 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4280 GameUI_Footer_TimeLeft = GetTickCount() + 4000;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4281 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4282 uGameState = GAME_STATE_STARTING_NEW_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4283 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4284 case UIMSG_PlayerCreationClickReset:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4285 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4286 pParty->Reset();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4287 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4288 case UIMSG_PlayerCreationRemoveUpSkill:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4289 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4290 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
2110
18b0ff5e1bf1 pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents: 2101
diff changeset
4291 if ( pPlayer[pParam].GetSkillIdxByOrder(2) != 37 )//37 - None(Íåò)
18b0ff5e1bf1 pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents: 2101
diff changeset
4292 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(2)] = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4293 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4294 case UIMSG_PlayerCreationRemoveDownSkill:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4295 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4296 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
2110
18b0ff5e1bf1 pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents: 2101
diff changeset
4297 if ( pPlayer[pParam].GetSkillIdxByOrder(3) != 37 )//37 - None(Íåò)
18b0ff5e1bf1 pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents: 2101
diff changeset
4298 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4299 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4300 case UIMSG_PlayerCreationChangeName:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4301 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4302 v3 = (void *)pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4303 uPlayerCreationUI_SelectedCharacter = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4304 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4305 pGUIWindow_CurrentMenu->ptr_1C = v3;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4306 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4307 case UIMSG_ChangeGameState:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4308 uGameState = GAME_FINISHED;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4309 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4310 case UIMSG_ChangeCursor:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4311 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4312 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4313 case UIMSG_3A:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4314 SetCurrentMenuID(MENU_DebugBLVLevel);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4315 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4316 case UIMSG_LoadGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4317 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4318 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4319 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4320 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4321 case UIMSG_SelectLoadSlot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4322 //main menu save/load wnd clicking on savegame lines
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4323 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4324 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4325 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4326 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4327 //load clicked line
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4328 v26 = pParam + pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4329 if ( dword_6BE138 == pParam + pSaveListPosition )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4330 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4331 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4332 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4333 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4334 uLoadGameUI_SelectedSlot = v26;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4335 dword_6BE138 = v26;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4336 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4337 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4338 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4339 //typing in the line
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4340 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
4341 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
4342 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4343 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4344 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4345 case UIMSG_SaveLoadBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4346 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4347 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4348 case UIMSG_DownArrow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4349 ++pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4350 if ( pSaveListPosition >= pParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4351 pSaveListPosition = pParam - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4352 if ( pSaveListPosition < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4353 pSaveListPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4354 pWindow = pGUIWindow_CurrentMenu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4355 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4356 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4357 case UIMSG_Cancel:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4358 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4359 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4360 case UIMSG_ArrowUp:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4361 --pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4362 if ( pSaveListPosition < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4363 pSaveListPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4364 pWindow = pGUIWindow_CurrentMenu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4365 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4366 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4367 case UIMSG_AD:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4368 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4369 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4370 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4371 case UIMSG_AE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4372 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4373 SetCurrentMenuID(MENU_DebugBLVLevel);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4374 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4375 case UIMSG_Escape:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4376 if ( pModalWindow )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4377 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4378 ModalWindow_Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4379 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4380 }
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
4381 if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000))
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4382 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4383 v15 = 1;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2445
diff changeset
4384 pMediaPlayer->bStopBeforeSchedule = 1;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4385 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4386 viewparams->field_48 = 1;
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4387 if ( GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_MMT_MAIN_MENU
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4388 || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4389 {
2137
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2132
diff changeset
4390 //if ( pCurrentScreen == SCREEN_VIDEO )
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2132
diff changeset
4391 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4392 if (GetCurrentMenuID() == MENU_NAMEPANELESC) //èç ïàíåëè èçìåíåíèÿ èìåíè
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4393 {
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4394 SetCurrentMenuID(MENU_CREATEPARTY);//â îêíî ñîçäàíèÿ ãðóïïû
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4395 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4396 }
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4397 if (GetCurrentMenuID() == MENU_CREDITSPROC) //èç îêíà Ñîçäàòåëè
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4398 {
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4399 SetCurrentMenuID(MENU_CREDITSCLOSE);//â çàêðûòèå Ñîçäàòåëè
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4400 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4401 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4402 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4403 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4404 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4405 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4406 {
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2137
diff changeset
4407 //if ( pCurrentScreen == SCREEN_VIDEO )
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2137
diff changeset
4408 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4409 if (GetCurrentMenuID() == MENU_NAMEPANELESC)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4410 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4411 SetCurrentMenuID(MENU_CREATEPARTY);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4412 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4413 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4414 if (GetCurrentMenuID() == MENU_CREDITSPROC)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4415 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4416 SetCurrentMenuID(MENU_CREDITSCLOSE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4417 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4418 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4419 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4420 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4421 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4422 if ( pCurrentScreen == SCREEN_LOADGAME )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4423 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4424 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4425 //crt_deconstruct_ptr_6A0118();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4426 pTexture_PCX.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4427 pTexture_PCX.Load("title.pcx", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4428 SetCurrentMenuID(MENU_MAIN);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4429 v15 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4430 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4431 pGUIWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4432 pGUIWindow2 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4433 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4434 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4435 viewparams->bRedrawGameUI = v15;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4436 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4437 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4438 if ( pCurrentScreen == SCREEN_VIDEO )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4439 {
2432
99e7bd7ec0a2 * Fixed OpenAL crash for videos
a.parshin
parents: 2415
diff changeset
4440 //pVideoPlayer->Unload();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4441 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4442 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4443 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4444 if ( pCurrentScreen != SCREEN_1B )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4445 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4446 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4447 pGUIWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4448 pGUIWindow2 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4449 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4450 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4451 viewparams->bRedrawGameUI = v15;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4452 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4453 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4454 //VideoPlayer::dtor();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4455 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4456 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4457 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4458 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4459 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4460 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4461 while ( pMessageQueue_50CBD0->uNumMessages );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4462 }
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4463 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4464
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4465
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4466
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4467 //----- (0042FBDD) --------------------------------------------------------
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4468 void sub_42FBDD()
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4469 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4470 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4471 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4472 pRenderer->Present();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4473 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4474
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4475 //----- (0042FC15) --------------------------------------------------------
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4476 void CloseWindowBackground()
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4477 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4478 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4479 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4480 pRenderer->Present();
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4481 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4482
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
4483
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4484 //----- (0046BDC0) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4485 void UpdateUserInput_and_MapSpecificStuff()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4486 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4487 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4488 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4489 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4490 return;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4491 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4492
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4493 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4494 BLV_UpdateUserInputAndOther();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4495 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4496 ODM_UpdateUserInputAndOther();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4497
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4498 area_of_effect__damage_evaluate();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4499 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4500
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4501 //----- (004646F0) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4502 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4503 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4504 //if ( pRenderer->pRenderD3D )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4505 pGame->pVisInstance->_4C1A02();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4506 pEventTimer->Pause();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4507 pMiscTimer->Pause();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4508 pParty->uFlags = 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4509 CastSpellInfoHelpers::_427D48();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4510 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4511 DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4512 pMiscTimer->Resume();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4513 pEventTimer->Resume();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4514 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4515
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4516 //----- (00464866) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4517 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4518 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4519 char *v3; // eax@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4520 unsigned int v5; // eax@3
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4521 char Str1[20]; // [sp+Ch] [bp-18h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4522 unsigned int v9; // [sp+20h] [bp-4h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4523
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4524 v9 = bLoading;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4525 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4526 pDecalBuilder->Reset(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4527 pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1 ? GUIProgressBar::TYPE_Fullscreen :
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4528 GUIProgressBar::TYPE_Box);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4529 strcpy(Str1, pCurrentMapName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4530 v3 = strtok(Str1, ".");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4531 strcpy(Str1, v3);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4532 Level_LoadEvtAndStr(Str1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4533 LoadLevel_InitializeLevelEvt();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4534 strcpy(Str1, pCurrentMapName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4535 _strrev(Str1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4536 strtok(Str1, ".");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4537 _strrev(Str1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4538
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4539 for (uint i = 0; i < 1000; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4540 pSpriteObjects[i].uObjectDescID = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4541
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4542 v5 = pMapStats->GetMapInfo(pCurrentMapName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4543 bUnderwater = false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4544 uLevelMapStatsID = v5;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4545 pGame->uFlags2 &= 0xFFFFFFF7u;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4546 if (!_stricmp(pCurrentMapName, "out15.odm"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4547 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4548 bUnderwater = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4549 pGame->uFlags2 |= GAME_FLAGS_2_ALTER_GRAVITY;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4550 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4551 pParty->floor_face_pid = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4552 if (_stricmp(Str1, "blv"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4553 PrepareToLoadODM(v9, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4554 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4555 PrepareToLoadBLV(v9);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4556 pAudioPlayer->SetMapEAX();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4557 _461103_load_level_sub();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4558 if (!_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4559 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4560 //spawning grounds & walls of mist - no loot & exp from monsters
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4561
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4562 for (uint i = 0; i < uNumActors; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4563 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4564 pActors[i].pMonsterInfo.uTreasureType = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4565 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4566 pActors[i].pMonsterInfo.uExp = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4567 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4568 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4569 bDialogueUI_InitializeActor_NPC_ID = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4570 OnMapLoad();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4571 pGameLoadingUI_ProgressBar->Progress();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4572 memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4573 pGameLoadingUI_ProgressBar->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4574 _flushall();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4575 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4576
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4577 void IntegrityTest()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4578 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4579 static_assert(sizeof(MovieHeader) == 44, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4580 static_assert(sizeof(SoundDesc_mm6) == 112, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4581 static_assert(sizeof(SoundDesc) == 120, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4582 static_assert(sizeof(OverlayDesc) == 8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4583 static_assert(sizeof(ChestDesc) == 36, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4584 static_assert(sizeof(ObjectDesc_mm6) == 52, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4585 static_assert(sizeof(ObjectDesc) == 56, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4586 static_assert(sizeof(DecorationDesc) == 84, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4587 static_assert(sizeof(IconFrame) == 32, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4588 static_assert(sizeof(PlayerFrame) == 10, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4589 static_assert(sizeof(TextureFrame) == 20, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4590 static_assert(sizeof(SpriteFrame) == 60, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4591 static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4592 static_assert(sizeof(RenderBillboard) == 0x34, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4593 static_assert(sizeof(Texture) == 0x48, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4594 static_assert(sizeof(RGBTexture) == 0x28, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4595 //static_assert(sizeof(LODFile_IconsBitmaps) == 0x11BB8 + 4, "Wrong type size"); // + virtual dtor ptr
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4596 static_assert(sizeof(AudioPlayer) == 0xC84, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4597 static_assert(sizeof(SoundDesc) == 0x78, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4598 static_assert(sizeof(stru339_spell_sound) == 0xAFD8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4599 //static_assert(sizeof(VideoPlayer) == 0x108 + 4, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4600 static_assert(sizeof(MovieHeader) == 0x2C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4601 static_assert(sizeof(DecorationDesc) == 0x54, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4602 static_assert(sizeof(ObjectDesc) == 0x38, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4603 static_assert(sizeof(OverlayDesc) == 0x8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4604 static_assert(sizeof(ChestDesc) == 0x24, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4605 static_assert(sizeof(TileDesc) == 0x1A, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4606 static_assert(sizeof(MonsterDesc_mm6) == 148, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4607 static_assert(sizeof(MonsterDesc) == 152, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4608 static_assert(sizeof(Timer) == 0x28, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4609 static_assert(sizeof(OtherOverlay) == 0x14, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4610 static_assert(sizeof(ItemGen) == 0x24, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4611 static_assert(sizeof(SpriteObject) == 0x70, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4612 static_assert(sizeof(ItemDesc) == 0x30, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4613 static_assert(sizeof(ItemsTable) == 0x117A0, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4614 static_assert(sizeof(Chest) == 0x14CC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4615 static_assert(sizeof(MapInfo) == 0x44, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4616 static_assert(sizeof(SpellInfo) == 0x24, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4617 static_assert(sizeof(SpellData) == 0x14, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4618 static_assert(sizeof(SpellBuff) == 0x10, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4619 static_assert(sizeof(AIDirection) == 0x1C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4620 static_assert(sizeof(ActorJob) == 0xC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4621 static_assert(sizeof(Actor) == 0x344, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4622 static_assert(sizeof(LevelDecoration) == 0x20, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4623 static_assert(sizeof(KeyboardActionMapping) == 0x20C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4624 static_assert(sizeof(UIAnimation) == 0xD, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4625 static_assert(sizeof(SpawnPointMM7) == 0x18, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4626 static_assert(sizeof(ODMFace) == 0x134, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4627 static_assert(sizeof(BSPNode) == 0x8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4628 static_assert(sizeof(BSPModel) == 0xBC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4629 static_assert(sizeof(OutdoorLocation) == 0x1C28C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4630 static_assert(sizeof(BLVFace) == 0x60, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4631 static_assert(sizeof(BLVFaceExtra) == 0x24, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4632 static_assert(sizeof(BLVSector) == 0x74, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4633 static_assert(sizeof(BLVLightMM7) == 0x10, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4634 static_assert(sizeof(BLVDoor) == 0x50, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4635 static_assert(sizeof(IndoorLocation) == 0x690, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4636 //static_assert(sizeof(ODMRenderParams) == 0x74, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4637 static_assert(sizeof(Mouse) == 0x114, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4638 static_assert(sizeof(Particle_sw) == 0x68, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4639 static_assert(sizeof(Particle) == 0x68, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4640 static_assert(sizeof(ParticleEngine) == 0xE430, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4641 static_assert(sizeof(Lightmap) == 0xC1C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4642 static_assert(sizeof(LightmapBuilder) == 0x3CBC38, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4643 static_assert(sizeof(Vis_SelectionList) == 0x2008, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4644 static_assert(sizeof(Vis) == 0x20D0, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4645 static_assert(sizeof(PlayerBuffAnim) == 0x10, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4646 static_assert(sizeof(ProjectileAnim) == 0x1C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4647 static_assert(sizeof(stru6) == 0x5F8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4648 static_assert(sizeof(IndoorCameraD3D_Vec3) == 0x10, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4649 static_assert(sizeof(IndoorCameraD3D_Vec4) == 0x18, "Wrong type size"); //should be 14 (10 vec3 + 4 vdtor) but 18 coz of his +4 from own vdtor, but it is odd since vdtor already present from vec3
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4650 //static_assert(sizeof(IndoorCameraD3D) == 0x1A1384, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4651 static_assert(sizeof(StationaryLight) == 0xC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4652 static_assert(sizeof(LightsStack_StationaryLight_) == 0x12C8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4653 static_assert(sizeof(MobileLight) == 0x12, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4654 static_assert(sizeof(LightsStack_MobileLight_) == 0x1C28, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4655 static_assert(sizeof(Game) == 0xE78, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4656 static_assert(sizeof(stru141_actor_collision_object) == 0xA8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4657 static_assert(sizeof(ActionQueue) == 0x7C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4658 static_assert(sizeof(NPCData) == 0x4C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4659 static_assert(sizeof(NPCStats) == 0x17FFC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4660 static_assert(sizeof(BspRenderer) == 0x53740, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4661 static_assert(sizeof(PaletteManager) == 0x267AF0, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4662 static_assert(sizeof(ViewingParams) == 0x26C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4663 //static_assert(sizeof(IndoorCamera) == 0x50, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4664 static_assert(sizeof(Bloodsplat) == 0x28, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4665 static_assert(sizeof(BloodsplatContainer) == 0xA0C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4666 static_assert(sizeof(TrailParticle) == 0x18, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4667 static_assert(sizeof(EventIndex) == 0xC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4668 static_assert(sizeof(_2devent) == 0x34, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4669 static_assert(sizeof(MapsLongTimer) == 0x20, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4670 static_assert(sizeof(SavegameHeader) == 0x64, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4671 static_assert(sizeof(SavegameList) == 0x3138, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4672 static_assert(sizeof(StorylineText) == 0x160, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4673 static_assert(sizeof(FactionTable) == 0x1EF1, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4674 static_assert(sizeof(Decal) == 0xC20, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4675 static_assert(sizeof(DecalBuilder) == 0x30C038, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4676 static_assert(sizeof(MonsterInfo) == 0x58, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4677 static_assert(sizeof(MonsterStats) == 0x5BA0, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4678 static_assert(sizeof(RenderD3D) == 0x148, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4679 // static_assert(sizeof(Render) == 0x129844, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4680 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4681 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4682 static_assert(sizeof(Party) == 0x16238, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4683 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4684 static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4685 static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4686 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4687 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4688 static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4689 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4690 static_assert(sizeof(ArcomageCard) == 0x6C, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4691 static_assert(sizeof(stru320) == 0x3FC, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4692 static_assert(sizeof(TravelInfo) == 0x20, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4693 static_assert(sizeof(stru336) == 0x798, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4694 static_assert(sizeof(Vec3_short_) == 6, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4695 static_assert(sizeof(BLVFace) == 96, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4696 static_assert(sizeof(BLVFaceExtra) == 36, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4697 static_assert(sizeof(BLVSector) == 116, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4698 static_assert(sizeof(LevelDecoration) == 32, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4699 static_assert(sizeof(BLVLightMM7) == 16, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4700 static_assert(sizeof(BSPNode) == 8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4701 static_assert(sizeof(SpawnPointMM7) == 24, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4702 static_assert(sizeof(DDM_DLV_Header) == 40, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4703 static_assert(sizeof(Actor) == 836, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4704 static_assert(sizeof(SpriteObject) == 112, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4705 static_assert(sizeof(Chest) == 5324, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4706 static_assert(sizeof(stru123) == 0xC8, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4707 static_assert(sizeof(BLVMapOutline) == 12, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4708 static_assert(sizeof(LODSprite) == 0x28, "Wrong type size");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4709 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4710
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4711
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4712 //----- (00464761) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4713 void Game_DeinitializeAndTerminate(int exitCode)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4714 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4715 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4716 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4717 pGame->Deinitialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4718 pRenderer->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4719 delete window;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4720 //if ( !DestroyWindow(hWnd) )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4721 // GetLastError();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4722 exit(exitCode);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4723 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4724
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4725 //----- (004647AB) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4726 void FinalInitialization()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4727 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4728 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4729 pViewport->SetFOV(flt_6BE3A0 * 65536.0f);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4730
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4731 //pIndoorCamera = new IndoorCamera;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4732 //pIndoorCamera->Initialize(65, viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X + 1,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4733 // viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4734
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4735 InitializeTurnBasedAnimations(&stru_50C198);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4736 pBitmaps_LOD->_inlined_sub1();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4737 pSprites_LOD->_inlined_sub1();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4738 pIcons_LOD->_inlined_sub1();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4739 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4740 // 6BE3A0: using guessed type float flt_6BE3A0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4741
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4742
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4743
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4744 //----- (00464E17) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4745 bool __fastcall CheckMM7CD(char c)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4746 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4747 char DstBuf[256] = { 0 };
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4748 char strCommand[256] = { 0 }; // [sp+10Ch] [bp-118h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4749 char Filename[20] = { 0 }; // [sp+20Ch] [bp-18h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4750
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4751 wchar_t pMagicPath[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4752 swprintf(pMagicPath, wcslen(L"%C:\\anims\\magic7.vid"), L"%C:\\anims\\magic7.vid", c);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4753 if (GetFileAttributesW(pMagicPath) == -1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4754 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4755
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4756 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4757 if (!mciSendStringA(strCommand, DstBuf, 255, 0))//Uninitialized memory access
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4758
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4759 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4760 wsprintfA(strCommand, "info CD UPC wait");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4761 mciSendStringA(strCommand, DstBuf, 255, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4762 wsprintfA(strCommand, "close CD");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4763 mciSendStringA(strCommand, DstBuf, 255, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4764 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4765
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4766 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4767 *Filename = c;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4768
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4769 FILE* f = fopen(Filename, "rb");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4770 if (!f)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4771 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4772
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4773 if (!fseek(f, 0, SEEK_END))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4774 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4775 if (!fseek(f, -100, SEEK_CUR))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4776 fread(DstBuf, 1, 0x64u, f);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4777
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4778 fclose(f);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4779 return true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4780 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4781 fclose(f);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4782 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4783 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4784
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4785 //----- (00464F1B) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4786 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4787 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4788 char v4; // zf@3
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4789 int v6; // eax@10
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4790 int v7; // eax@11
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4791 int v8; // eax@12
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4792 int v9; // eax@13
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4793 BOOL(__stdcall *v10)(HWND, int, LPCSTR); // edi@15
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4794 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4795 INT_PTR v12; // [sp-4h] [bp-4h]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4796
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4797 if (a2 == 272)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4798 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4799 hInsertCDWindow = hDlg;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4800 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4801 if (v6)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4802 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4803 v7 = v6 - 3;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4804 if (v7)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4805 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4806 v8 = v7 - 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4807 if (v8)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4808 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4809 v9 = v8 - 4;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4810 if (v9)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4811 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4812 if (v9 != 5)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4813 return 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4814 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4815 v10 = SetDlgItemTextA;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4816 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII.");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4817 v11 = "Odwolaj";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4818 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4819 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4820 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4821 SetWindowTextA(hDlg, "Inserire il secondo CD");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4822 v10 = SetDlgItemTextA;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4823 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII.");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4824 v11 = "Annulla";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4825 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4826 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4827 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4828 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4829 SetWindowTextA(hDlg, "Insérez le CD 2");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4830 v10 = SetDlgItemTextA;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4831 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2.");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4832 v11 = "Supprimer";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4833 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4834 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4835 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4836 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4837 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4838 v10 = SetDlgItemTextA;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4839 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII.");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4840 v11 = "Cancelar";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4841 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4842 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4843 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4844 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4845 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4846 v10 = SetDlgItemTextA;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4847 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen.");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4848 v11 = "Abbrechen";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4849 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4850 v10(hDlg, 2, v11);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4851 return 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4852 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4853 if (a2 == 273)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4854 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4855 if (a3 == 2)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4856 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4857 v12 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4858 EndDialog(hDlg, v12);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4859 return 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4860 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4861 v4 = a3 == 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4862 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4863 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4864 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4865 v4 = a2 == 1025;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4866 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4867 if (v4)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4868 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4869 v12 = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4870 EndDialog(hDlg, v12);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4871 return 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4872 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4873 return 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4874 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4875
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4876 //----- (00465061) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4877 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4878 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4879 char drive[4] = { 'X', ':', '\\', 0 };
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4880
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4881 bool bGotCDFromRegistry = false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4882
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4883 HKEY hSoftware = nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4884 hNWC = nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4885 hMM7 = nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4886 hVersion = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4887 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4888 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4889 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4890 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4891 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4892 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4893 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4894 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4895 DWORD cbData = 3;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4896 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4897 bGotCDFromRegistry = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4898 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4899 RegCloseKey(hVersion);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4900 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4901 RegCloseKey(hMM7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4902 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4903 RegCloseKey(hNWC);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4904 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4905 RegCloseKey(hSoftware);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4906
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4907 if (bGotCDFromRegistry)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4908 if (CheckMM7CD(*drive))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4909 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4910 cMM7GameCDDriveLetter = *drive;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4911 return true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4912 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4913
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4914 while (true)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4915 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4916 for (uint i = 0; i < 26; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4917 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4918 drive[0] = 'A' + i;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4919
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4920 if (GetDriveTypeA(drive) == DRIVE_CDROM)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4921 if (CheckMM7CD(*drive))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4922 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4923 cMM7GameCDDriveLetter = *drive;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4924 WriteWindowsRegistryString("CDDrive", drive);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4925 return true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4926 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4927 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4928
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4929 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4930 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4931 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4932 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4933 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4934
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4935 //----- (004651F4) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4936 bool MM7_Initialize(int game_width, int game_height)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4937 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4938 wchar_t pCurrentDir[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4939 _wgetcwd(pCurrentDir, 1024);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4940
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4941 wchar_t pMM6IniFile[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4942 wsprintfW(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4943
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4944 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4945 if (bNoCD)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4946 bCanLoadFromCD = false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4947 if (bCanLoadFromCD)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4948 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4949 Log::Warning(L"Checking for CD...");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4950 if (!FindMM7CD(nullptr, &cMM7GameCDDriveLetter))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4951 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4952 Log::Warning(L"...done.");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4953 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4954
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4955
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4956 srand(GetTickCount());
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4957
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4958 pEventTimer = Timer::Create();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4959 pEventTimer->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4960 window = OSWindow::Create(L"Might and Magic® Trilogy", game_width, game_height);//Create game window
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4961
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4962 bool use_d3d11 = false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4963 if (use_d3d11)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4964 pRenderer = RenderD3D11::Create();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4965 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4966 pRenderer = Render::Create();//Create DirectX
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4967 if (!pRenderer)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4968 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4969 Log::Warning(L"Render creation failed");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4970 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4971 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4972 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4973 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4974 //bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4975 //uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4976
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4977 if (!pRenderer->Initialize(window/*, bColoredLights, uLevelOfDetail, bTinting*/))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4978 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4979 Log::Warning(L"Render failed to initialize");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4980 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4981 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4982 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4983
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4984 game_starting_year = 1168;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4985
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4986 pParty = new Party;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4987 memset(&pParty->pHirelings, 0, sizeof(pParty->pHirelings));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4988 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4989 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4990 pParty->sEyelevel = pParty->uDefaultEyelevel;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4991 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4992 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4993
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4994 MM6_Initialize(pMM6IniFile);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4995
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4996 pKeyActionMap = new KeyboardActionMapping;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4997
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4998 OnTimer(1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
4999 GameUI_StatusBar_UpdateTimedString(1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5000 pGame = Game::Create();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5001 pMouse = pGame->pMouseInstance;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5002
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5003
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5004 pIcons_LOD = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5005 if (!pIcons_LOD->Load("data\\icons.lod", "icons"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5006 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5007 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.",
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5008 L"Files Missing", MB_ICONEXCLAMATION);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5009 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5010 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5011 pIcons_LOD->dword_011BA4 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5012
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5013 pEvents_LOD = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5014 if (!pEvents_LOD->Load("data\\events.lod", "icons"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5015 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5016 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.",
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5017 L"Files Missing", MB_ICONEXCLAMATION);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5018 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5019 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5020
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5021 InitializeGameText();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5022
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5023 pBitmaps_LOD = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5024 if (!pBitmaps_LOD->Load("data\\bitmaps.lod", "bitmaps"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5025 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5026 MessageBoxA(nullptr, pGlobalTXT_LocalizationStrings[63],
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5027 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5028 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5029 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5030
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5031 pSprites_LOD = new LODFile_Sprites;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5032 if (!pSprites_LOD->LoadSprites("data\\sprites.lod"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5033 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5034 MessageBoxA(nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5035 pGlobalTXT_LocalizationStrings[63],
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5036 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5037 return false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5038 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5039
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5040
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5041 #if 0
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5042 if (_access("../MM_VI/data/icons.lod", 0) == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5043 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5044 pIcons_LOD_mm6 = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5045 if (!pIcons_LOD_mm6->Load("../MM_VI/data/icons.lod", "icons"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5046 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5047 delete pIcons_LOD_mm6;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5048 pIcons_LOD_mm6 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5049 Log::Warning(L"Unable to load mm6:icons.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5050 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5051 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5052 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5053 Log::Warning(L"Unable to find mm6:icons.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5054
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5055 if (_access("../MM_VI/data/bitmaps.lod", 0) == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5056 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5057 pBitmaps_LOD_mm6 = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5058 if (!pBitmaps_LOD_mm6->Load("../MM_VI/data/bitmaps.lod", "bitmaps"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5059 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5060 delete pBitmaps_LOD_mm6;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5061 pBitmaps_LOD_mm6 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5062 Log::Warning(L"Unable to load mm6:bitmaps.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5063 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5064 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5065 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5066 Log::Warning(L"Unable to find mm6:bitmaps.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5067
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5068 auto mm6_sprite_container_name = bUseLoResSprites ? "../MM_VI/data/spriteLO.lod"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5069 : "../MM_VI/data/sprites.lod";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5070 if (_access(mm6_sprite_container_name, 0) == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5071 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5072 pSprites_LOD_mm6 = new LODFile_Sprites;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5073 if (!pSprites_LOD_mm6->LoadSprites(mm6_sprite_container_name))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5074 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5075 delete pSprites_LOD_mm6;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5076 pSprites_LOD_mm6 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5077 Log::Warning(L"Unable to load mm6:sprites.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5078 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5079 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5080 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5081 Log::Warning(L"Unable to find mm6:sprites.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5082
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5083
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5084 if (_access("../mm8/data/icons.lod", 0) == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5085 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5086 pIcons_LOD_mm8 = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5087 if (!pIcons_LOD_mm8->Load("../mm8/data/icons.lod", "icons"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5088 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5089 delete pIcons_LOD_mm8;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5090 pIcons_LOD_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5091 Log::Warning(L"Unable to load mm8:icons.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5092 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5093 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5094 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5095 Log::Warning(L"Unable to find mm8:icons.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5096
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5097
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5098 if (_access("../mm8/data/bitmaps.lod", 0) == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5099 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5100 pBitmaps_LOD_mm8 = new LODFile_IconsBitmaps;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5101 if (!pBitmaps_LOD_mm8->Load("../mm8/data/bitmaps.lod", "bitmaps"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5102 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5103 delete pBitmaps_LOD_mm8;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5104 pBitmaps_LOD_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5105 Log::Warning(L"Unable to load mm8:bitmaps.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5106 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5107 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5108 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5109 Log::Warning(L"Unable to find mm8:bitmaps.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5110
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5111
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5112 if (_access("../mm8/data/sprites.lod", 0) == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5113 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5114 pSprites_LOD_mm8 = new LODFile_Sprites;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5115 if (!pSprites_LOD_mm8->LoadSprites("../mm8/data/sprites.lod"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5116 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5117 delete pSprites_LOD_mm8;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5118 pSprites_LOD_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5119 Log::Warning(L"Unable to load mm8:sprites.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5120 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5121 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5122 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5123 Log::Warning(L"Unable to find mm8:sprites.lod");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5124 #endif
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5125
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5126 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5127 void *sft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsft.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5128 *sft_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5129 void *sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5130 pSpriteFrameTable = new SpriteFrameTable;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5131 pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5132 free(sft_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5133 free(sft_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5134 free(sft_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5135
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5136 void *tft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtft.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5137 *tft_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5138 void *tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5139 pTextureFrameTable = new TextureFrameTable;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5140 pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5141 free(tft_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5142 free(tft_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5143 free(tft_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5144
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5145 void *tiles_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtile.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5146 *tiles_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5147 void *tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5148 pTileTable = new TileTable;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5149 pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5150 free(tiles_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5151 free(tiles_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5152 free(tiles_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5153
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5154 void *pft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dpft.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5155 *pft_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5156 void *pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5157 pPlayerFrameTable = new PlayerFrameTable;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5158 pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5159 free(pft_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5160 free(pft_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5161 free(pft_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5162
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5163 void *ift_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dift.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5164 *ift_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5165 void *ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5166 pIconsFrameTable = new IconFrameTable;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5167 pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5168 free(ift_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5169 free(ift_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5170 free(ift_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5171
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5172 void *decs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("ddeclist.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5173 *decs_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5174 void *decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5175 pDecorationList = new DecorationList;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5176 pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5177 free(decs_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5178 free(decs_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5179 free(decs_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5180
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5181 void *objs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dobjlist.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5182 *objs_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5183 void *objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5184 pObjectList = new ObjectList;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5185 pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5186 free(objs_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5187 free(objs_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5188 free(objs_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5189
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5190 void *mons_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dmonlist.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5191 *mons_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5192 void *mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5193 pMonsterList = new MonsterList;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5194 pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5195 free(mons_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5196 free(mons_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5197 free(mons_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5198
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5199 void *chests_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dchest.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5200 *chests_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5201 void *chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5202 pChestList = new ChestList;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5203 pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5204 free(chests_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5205 free(chests_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5206 free(chests_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5207
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5208 void *overlays_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("doverlay.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5209 *overlays_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5210 void *overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5211 pOverlayList = new OverlayList;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5212 pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5213 free(overlays_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5214 free(overlays_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5215 free(overlays_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5216
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5217 void *sounds_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsounds.bin", 1) : nullptr,
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5218 *sounds_mm8 = nullptr;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5219 void *sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5220 pSoundList = new SoundList;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5221 pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5222 free(sounds_mm6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5223 free(sounds_mm7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5224 free(sounds_mm8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5225 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5226
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5227
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5228
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5229
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5230 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5231 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5232 //window->SetWindowedMode(game_width, game_height);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5233 pRenderer->SwitchToWindow();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5234 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5235 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5236 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5237 __debugbreak(); // Nomad
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5238 window->SetFullscreenMode();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5239 pRenderer->InitializeFullscreen();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5240 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5241
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5242 uSoundVolumeMultiplier = min(9, ReadWindowsRegistryInt("soundflag", 9));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5243 uMusicVolimeMultiplier = min(9, ReadWindowsRegistryInt("musicflag", 9));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5244 uVoicesVolumeMultiplier = min(9, ReadWindowsRegistryInt("CharVoices", 9));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5245 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5246
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5247 uGammaPos = min(4, ReadWindowsRegistryInt("GammaPos", 4));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5248 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5249
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5250 if (ReadWindowsRegistryInt("Bloodsplats", 1))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5251 pGame->uFlags2 |= GAME_FLAGS_2_DRAW_BLOODSPLATS;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5252 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5253 pGame->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5254
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5255 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 3);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5256
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5257 if (!bNoSound)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5258 pAudioPlayer->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5259
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5260 pMediaPlayer = new Media::MPlayer();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5261 pMediaPlayer->Initialize(window);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5262
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5263 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5264
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5265 switch (uTurnSpeed)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5266 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5267 case 0: // undefined turn option
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5268 __debugbreak(); // really shouldn't use this mode
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5269 uTurnSpeed = (unsigned int)uCPUSpeed < 199 ? 128 : 64; // adjust turn speed to estimated fps
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5270 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5271
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5272 case 1u: // 16x
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5273 Log::Warning(L"x16 Turn Speed"); // really shouldn't use this mode
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5274 uTurnSpeed = 128;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5275 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5276
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5277 case 2u: // 32x
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5278 Log::Warning(L"x32 Turn Speed"); // really shouldn't use this mode
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5279 uTurnSpeed = 64;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5280 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5281
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5282 case 3u: // smooth
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5283 uTurnSpeed = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5284 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5285 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5286
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5287 return true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5288 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5289
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5290 //----- (00465D0B) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5291 void SecondaryInitialization()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5292 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5293 pMouse->Initialize(window);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5294
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5295 pItemsTable = new ItemsTable;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5296 pItemsTable->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5297
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5298 //pBitmaps_LOD->can_load_hardware_sprites = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5299 //pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5300 pBitmaps_LOD->SetupPalettes(5, 6, 5);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5301 //pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5302 pIcons_LOD->SetupPalettes(5, 6, 5);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5303 //pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5304 pPaletteManager->SetColorChannelInfo(5, 6, 5);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5305
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5306 pPaletteManager->SetMistColor(128, 128, 128);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5307 pPaletteManager->RecalculateAll();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5308 //pSprites_LOD->can_load_hardware_sprites = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5309 pObjectList->InitializeSprites();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5310 pOverlayList->InitializeSprites();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5311
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5312 if (!bNoSound)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5313 pSoundList->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5314
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5315
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5316 for (uint i = 0; i < 4; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5317 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5318 static const char *pUIAnimNames[4] =
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5319 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5320 "glow03", "glow05",
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5321 "torchA", "wizeyeA"
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5322 };
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5323 static unsigned short _4E98D0[4][4] =
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5324 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5325 { 479, 0, 329, 0 },
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5326 { 585, 0, 332, 0 },
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5327 { 468, 0, 0, 0 },
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5328 { 606, 0, 0, 0 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5329 };
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5330
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5331 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5332 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5333
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5334 pUIAnims[i]->uAnimLength = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5335 pUIAnims[i]->uAnimTime = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5336 pUIAnims[i]->x = _4E98D0[i][0];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5337 pUIAnims[i]->y = _4E98D0[i][2];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5338 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5339
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5340 for (unsigned int i = 0; i < pObjectList->uNumObjects; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5341 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5342 pObjectList->pObjects[i].uParticleTrailColor = pObjectList->pObjects[i].uParticleTrailColorB |
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5343 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorG << 8) |
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5344 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorR << 16);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5345 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5346
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5347 MainMenuUI_Create();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5348 pGame->pStru6Instance->LoadAnimations();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5349
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5350 for (uint i = 0; i < 7; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5351 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5352 char container_name[64];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5353 sprintf(container_name, "HDWTR%03u", i);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5354 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(container_name);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5355 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5356
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5357 pNPCStats = new NPCStats;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5358 memset(pNPCStats->pNPCData, 0, 0x94BCu);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5359 pNPCStats->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5360
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5361 Initialize_GlobalEVT();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5362 pBitmaps_LOD->_inlined_sub0();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5363 pSprites_LOD->_inlined_sub0();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5364 pPaletteManager->LockAll();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5365
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5366 _mkdir("Saves");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5367 for (uint i = 0; i < 5; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5368 for (uint j = 0; j < 6; ++j)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5369 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5370 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5371 remove(pTmpBuf.data());
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5372 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5373
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5374 Initialize_GamesLOD_NewLOD();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5375 _576E2C_current_minimap_zoom = 512;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5376 dword_576E28 = 9;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5377 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5378
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5379 bool new_sky = false; //new sky(need texture)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5380 int max_flight_height = 4000; //maximum altitude
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5381
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5382
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5383 //----- (00462C94) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5384 bool MM_Main(const wchar_t *pCmdLine)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5385 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5386 IntegrityTest();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5387
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5388 char test[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5389 sprintfex(test, "^Pi[%s]: çíàõàð^R[ü;êà;]", "Çîëòàí");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5390
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5391 lua = new LuaVM;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5392 lua->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5393
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5394 bool bNoMargareth = false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5395 if (pCmdLine && *pCmdLine)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5396 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5397 //if (wcsstr(pCmdLine, L"-usedefs"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5398 // bDebugResouces = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5399 if (wcsstr(pCmdLine, L"-window"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5400 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5401
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5402 if (wcsstr(pCmdLine, L"-nointro"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5403 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5404 if (wcsstr(pCmdLine, L"-nologo"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5405 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5406 if (wcsstr(pCmdLine, L"-nosound"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5407 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5408
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5409 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5410 if (wcsstr(pCmdLine, L"-nowalksound"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5411 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5412 if (wcsstr(pCmdLine, L"-novideo"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5413 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5414 dword_6BE364_game_settings_1 |= GAME_SETTINGS_NO_HOUSE_ANIM;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5415 bNoVideo = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5416 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5417 if (wcsstr(pCmdLine, L"-nocd"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5418 bNoCD = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5419 if (wcsstr(pCmdLine, L"-new_sky"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5420 new_sky = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5421 if (wcsstr(pCmdLine, L"-nomarg"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5422 bNoMargareth = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5423 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5424
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5425 /*v8 = _4AC1C9_get_cpu_speed(0, (Vec4_int_ *)a2);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5426 Rect.left = *(int *)v8;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5427 Rect.top = *(int *)(v8 + 4);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5428 Rect.right = *(int *)(v8 + 8);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5429 Rect.bottom = *(int *)(v8 + 12);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5430 uCPUSpeed = Rect.bottom;*/
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5431 uCPUSpeed = 2048; // about 2GHz
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5432
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5433 //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF );//Ritor1: for memory test
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5434
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5435 if (!MM7_Initialize(640, 480))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5436 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5437 Log::Warning(L"MM init: failed");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5438 pGame->Deinitialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5439 return 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5440 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5441
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5442 pEventTimer->Pause();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5443
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5444 SetUserInterface(PartyAlignment_Neutral, false);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5445 ShowLogoVideo();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5446 //ShowIntroVideo_and_LoadingScreen();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5447 WriteWindowsRegistryInt("Ran once", 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5448 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5449 pGame->InitializeGammaController();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5450 SecondaryInitialization();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5451 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5452 FinalInitialization();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5453
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5454 //Ritor1: include
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5455 MMT_MainMenu_Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5456
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5457 Log::Warning(L"MM: entering main loop");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5458 while (1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5459 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5460 MainMenuWindow* main_menu_window = MainMenuWindow::Create();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5461 window->AddControl(main_menu_window);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5462 MainMenu_Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5463 uGameState = GAME_STATE_PLAYING;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5464 while (1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5465 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5466 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5467 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5468 pGame->Deinitialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5469 return true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5470 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5471
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5472 if (GetCurrentMenuID() == MENU_NEWGAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5473 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5474 if (pAudioPlayer->hAILRedbook)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5475 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5476 pParty->Reset();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5477 pOtherOverlayList->Reset();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5478 strcpy(pCurrentMapName, pStartingMapName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5479 pParty->CreateDefaultParty(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5480 PlayerCreationUI_Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5481 if (PlayerCreationUI_Loop())
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5482 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5483 DeleteCCharFont();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5484 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5485 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5486 DeleteCCharFont();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5487 bFlashQuestBook = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5488 pMediaPlayer->PlayFullscreenMovie(MOVIE_Emerald, true);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5489 SaveNewGame();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5490 if (bNoMargareth)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5491 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_MARGARETH_OFF, 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5492 pGame->Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5493 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5494 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5495 SetCurrentMenuID(MENU_NEWGAME);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5496 uGameState = GAME_STATE_PLAYING;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5497 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5498 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5499 else if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5500 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5501 assert(false && "Invalid game state");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5502 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5503 if (GetCurrentMenuID() == MENU_CREDITS)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5504 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5505 if (pAudioPlayer->hAILRedbook)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5506 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5507 MainMenuUI_Credits_Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5508 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5509 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5510 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LoadingProcInMainMenu)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5511 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5512 uGameState = GAME_STATE_PLAYING;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5513 pGame->Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5514 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5515 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5516 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5517 if (GetCurrentMenuID() == MENU_DebugBLVLevel)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5518 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5519 pMouse->ChangeActivation(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5520 pParty->Reset();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5521 pParty->CreateDefaultParty(1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5522
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5523 __debugbreak();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5524 /*extern void CreateDefaultBLVLevel();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5525 CreateDefaultBLVLevel();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5526
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5527 OPENFILENAMEA ofn;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5528 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5529 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5530 pMouse->ChangeActivation(1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5531 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5532 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5533 _chdir("..\\");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5534 strcpy(pCurrentMapName, ofn.lpstrFileTitle);*/
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5535 pMouse->ChangeActivation(1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5536 pGame->Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5537 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5538 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5539 if (uGameState == GAME_STATE_LOADING_GAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5540 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5541 SetCurrentMenuID(MENU_5);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5542 uGameState = GAME_STATE_PLAYING;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5543 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5544 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5545 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5546 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5547 SetCurrentMenuID(MENU_NEWGAME);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5548 uGameState = GAME_STATE_PLAYING;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5549 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5550 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5551 if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)// from the loaded game
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5552 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5553 pAudioPlayer->StopChannels(-1, -1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5554 uGameState = GAME_STATE_PLAYING;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5555 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5556 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5557 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5558 if (!bNoSound && pAudioPlayer->hAILRedbook)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5559 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5560 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5561 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5562 unsigned int startms, end_ms;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5563 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &startms, &end_ms);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5564 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5565 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5566 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5567 //lua_close(L);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5568 pGame->Deinitialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5569 return 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5570 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5571
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5572
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5573
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5574 //----- (00466082) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5575 void MM6_Initialize(const wchar_t *pIniFilename)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5576 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5577 size_t v2; // eax@31
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5578 size_t v3; // ebx@32
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5579 size_t v4; // edi@36
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5580 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5581 unsigned int v9; // [sp+184h] [bp-4h]@28
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5582
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5583 //_getcwd(v5, 120);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5584 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5585 viewparams = new ViewingParams;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5586 game_viewport_x = viewparams->uScreen_topL_X = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5587 game_viewport_y = viewparams->uScreen_topL_Y = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5588 game_viewport_z = viewparams->uScreen_BttmR_X = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5589 game_viewport_w = viewparams->uScreen_BttmR_Y = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5590 game_viewport_width = game_viewport_z - game_viewport_x;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5591 game_viewport_height = game_viewport_w - game_viewport_y + 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5592
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5593
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5594 pAudioPlayer = new AudioPlayer;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5595 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5596 if (pAudioPlayer->uMixerChannels > 16)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5597 pAudioPlayer->uMixerChannels = 16;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5598
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5599
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5600 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5601 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_ACTORS;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5602 if (ReadWindowsRegistryInt("startinwindow", 0))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5603 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5604 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5605 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_0002_SHOW_FR;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5606 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5607 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DAMAGE;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5608 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5609 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DECORATIONS;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5610
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5611 wchar_t pStartingMapNameW[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5612 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5613 sprintf(pStartingMapName, "%S", pStartingMapNameW);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5614
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5615 v9 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5616 if (strlen(pStartingMapName))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5617 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5618 do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5619 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5620 if (pStartingMapName[v9] == ' ')
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5621 pStartingMapName[v9] = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5622 ++v9;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5623 v2 = strlen(pStartingMapName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5624 } while (v9 < v2);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5625 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5626
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5627 pODMRenderParams = new ODMRenderParams;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5628 pODMRenderParams->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5629 pODMRenderParams->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5630 pODMRenderParams->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5631 pODMRenderParams->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5632 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5633 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5634 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5635 pODMRenderParams->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5636 pODMRenderParams->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5637 pODMRenderParams->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5638 pODMRenderParams->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5639
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5640 pODMRenderParams->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 0x2000, pIniFilename);//drawing dist 0x2000
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5641
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5642 wchar_t pDefaultSkyTextureW[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5643 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5644 sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5645
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5646 wchar_t pDefaultGroundTextureW[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5647 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5648 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5649
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5650 wchar_t pFloat[1024];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5651 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5652 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5653
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5654 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5655 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5656
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5657 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5658
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5659 v3 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5660 if (strlen(pDefaultSkyTexture.data()))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5661 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5662 do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5663 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5664 if (pDefaultSkyTexture[v3] == ' ')
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5665 pDefaultSkyTexture[v3] = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5666 ++v3;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5667 } while (v3 < strlen(pDefaultSkyTexture.data()));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5668 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5669 v4 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5670 if (strlen(pDefaultGroundTexture))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5671 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5672 do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5673 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5674 if (pDefaultGroundTexture[v4] == ' ')
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5675 pDefaultGroundTexture[v4] = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5676 ++v4;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5677 } while (v4 < strlen(pDefaultGroundTexture));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5678 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5679
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5680 MM7Initialization();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5681 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5682
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5683 //----- (004666D5) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5684 void MM7Initialization()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5685 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5686 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5687 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5688 /*if (byte_6BE388_graphicsmode == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5689 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5690 outdoor_grid_band_1 = 10;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5691 outdoor_grid_band_2 = 15;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5692 outdoor_grid_band_3 = 20;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5693 pODMRenderParams->shading_dist_mist = 8192;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5694 pODMRenderParams->bNoSky = false;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5695 LOBYTE(viewparams->field_20) = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5696 }*/
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5697 pODMRenderParams->shading_dist_shade = 2048;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5698 pODMRenderParams->terrain_gamma = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5699 pODMRenderParams->building_gamme = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5700 pODMRenderParams->shading_dist_shademist = 4096;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5701 pODMRenderParams->outdoor_no_wavy_water = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5702 //_47F4D3_initialize_terrain_bezier_stuff(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5703 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5704 pODMRenderParams->outdoor_grid_band_3 = outdoor_grid_band_3;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5705 pODMRenderParams->uPickDepth = outdoor_grid_band_3 * 512;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5706 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5707 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5708 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5709 LOBYTE(viewparams->field_20) = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5710 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5711 viewparams->uSomeY = viewparams->uScreen_topL_Y;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5712 viewparams->uSomeX = viewparams->uScreen_topL_X;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5713 viewparams->uSomeZ = viewparams->uScreen_BttmR_X;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5714 viewparams->uSomeW = viewparams->uScreen_BttmR_Y;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5715
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5716 pViewport->SetScreen(viewparams->uScreen_topL_X, viewparams->uScreen_topL_Y, viewparams->uScreen_BttmR_X, viewparams->uScreen_BttmR_Y);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5717 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5718 pODMRenderParams->Initialize();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5719 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5720
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5721 //----- (004610AA) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5722 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5723 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5724 pGameLoadingUI_ProgressBar->Reset(27);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5725 pSoundList->_4A9D79(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5726 uCurrentlyLoadedLevelType = LEVEL_Outdoor;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5727 ODM_LoadAndInitialize(pCurrentMapName, a2);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5728 if (!bLoading)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5729 TeleportToStartingPoint(uLevel_StartingPointType);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5730 viewparams->_443365();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5731 PlayLevelMusic();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5732 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5733 // 6BE35C: using guessed type int uLevel_StartingPointType;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5734
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5735
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5736 //----- (004627B7) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5737 void MainMenu_Loop()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5738 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5739 GUIButton *pButton; // eax@27
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5740 unsigned int pControlParam; // ecx@35
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5741 unsigned int pY; // [sp-18h] [bp-54h]@39
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5742 Texture *pTexture; // [sp-14h] [bp-50h]@39
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5743 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5744 MSG msg;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5745
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5746 pCurrentScreen = SCREEN_GAME;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5747
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5748 pGUIWindow2 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5749 pAudioPlayer->StopChannels(-1, -1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5750 pMouse->RemoveHoldingItem();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5751
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5752 pIcons_LOD->_inlined_sub2();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5753
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5754 pWindow_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5755 Texture* pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5756 Texture* pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5757 Texture* pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5758 Texture* pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5759
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5760 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", pNew, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5761 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowLoadWindow, 1, 'L', "", pLoad, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5762 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282, pCredits->uTextureWidth, pCredits->uTextureHeight, 1, 0, UIMSG_ShowCredits, 2, 'C', "", pCredits, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5763 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337, pExit->uTextureWidth, pExit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 3, 0, "", pExit, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5764
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5765 pTexture_PCX.Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5766 pTexture_PCX.Load("title.pcx", 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5767 SetCurrentMenuID(MENU_MAIN);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5768 SetForegroundWindow(window->GetApiHandle());
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5769 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5770 while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5771 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5772 POINT pt;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5773 pMouse->GetCursorPos(&pt);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5774 pWindow = pWindow_MainMenu;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5775 if (GetCurrentMenuID() == MENU_SAVELOAD)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5776 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5777 if (pCurrentScreen != SCREEN_LOADGAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5778 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5779 pTexture_PCX.Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5780 pTexture_PCX.Load("lsave640.pcx", 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5781 pGUIWindow2 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5782 pCurrentScreen = SCREEN_LOADGAME;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5783 LoadUI_Load(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5784 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5785 pWindow = pGUIWindow_CurrentMenu;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5786 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5787
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5788 while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5789 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5790 if (msg.message == WM_QUIT)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5791 Game_DeinitializeAndTerminate(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5792 TranslateMessage(&msg);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5793 DispatchMessageW(&msg);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5794 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5795
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5796 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5797 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5798 WaitMessage();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5799 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5800 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5801
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5802 pRenderer->BeginScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5803 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5804
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5805 GUI_MainMenuMessageProc();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5806 GUI_UpdateWindows();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5807
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5808 if (GetCurrentMenuID() != MENU_MAIN)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5809 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5810 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5811 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5812 pIcons_LOD->RemoveTexturesPackFromTextureList();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5813 pGUIWindow_CurrentMenu->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5814 pGUIWindow_CurrentMenu = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5815 pCurrentScreen = SCREEN_GAME;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5816 viewparams->bRedrawGameUI = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5817 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5818 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5819 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5820 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5821 if (!pModalWindow)// ???
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5822 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5823 pButton = pWindow->pControlsHead;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5824 for (pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5825 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5826 if (pt.x >= (signed int)pButton->uX && pt.x <= (signed int)pButton->uZ
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5827 && pt.y >= (signed int)pButton->uY && pt.y <= (signed int)pButton->uW
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5828 && pWindow == pWindow_MainMenu)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5829 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5830 pControlParam = pButton->msg_param;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5831 switch (pControlParam) // backlight for buttons
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5832 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5833 case 0:
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5834 pTexture = pNew;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5835 pY = 172;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5836 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5837 case 1:
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5838 pTexture = pLoad;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5839 pY = 227;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5840 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5841 case 2:
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5842 pTexture = pCredits;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5843 pY = 282;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5844 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5845 case 3:
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5846 pTexture = pExit;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5847 pY = 337;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5848 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5849 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5850 pRenderer->DrawTextureIndexed(495, pY, pTexture);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5851 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5852 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5853 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5854 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5855 pRenderer->EndScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5856 pRenderer->Present();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5857 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5858 GUI_MainMenuMessageProc();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5859 pRenderer->BeginScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5860 GUI_UpdateWindows();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5861 pRenderer->EndScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5862 pRenderer->Present();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5863 pTexture_PCX.Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5864 if (pGUIWindow2)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5865 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5866 pGUIWindow2->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5867 pGUIWindow2 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5868 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5869 pWindow_MainMenu->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5870 pIcons_LOD->RemoveTexturesPackFromTextureList();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5871 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5872
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5873 //----- (004BF91E) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5874 unsigned int GameOverMenu(void *ecx0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5875 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5876 const char *v1; // eax@2
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5877 unsigned int result; // eax@3
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5878 const char *v6; // eax@10
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5879 const char *v7; // edx@10
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5880 const char *v8; // ecx@12
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5881 const char *v9; // eax@14
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5882 unsigned int v10; // eax@25
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5883 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5884 unsigned int v14; // [sp+A4h] [bp-2Ch]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5885 void *v15; // [sp+A8h] [bp-28h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5886 const char *pInString; // [sp+ACh] [bp-24h]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5887 unsigned int v17; // [sp+B0h] [bp-20h]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5888 unsigned int v18; // [sp+B4h] [bp-1Ch]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5889 unsigned int v19; // [sp+B8h] [bp-18h]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5890 int v20; // [sp+BCh] [bp-14h]@7
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5891 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5892 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5893 MSG msg;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5894
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5895 v15 = ecx0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5896
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5897 RGBTexture _this; // [sp+Ch] [bp-C4h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5898 //RGBTexture::RGBTexture(&this);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5899
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5900 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_4000;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5901 bGameoverLoop = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5902 pMediaPlayer->bStopBeforeSchedule = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5903 pAudioPlayer->StopChannels(-1, -1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5904 pRenderer->BeginScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5905 pRenderer->ClearBlack();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5906 pRenderer->EndScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5907 pRenderer->Present();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5908 //pMediaPlayer->pResetflag = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5909 _449B57_test_bit(pParty->_quest_bits, 99);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5910 _this.Load("winbg.pcx", 2);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5911 pRenderer->BeginScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5912 pRenderer->DrawTextureRGB(0, 0, &_this);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5913 pRenderer->EndScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5914 free(_this.pPixels);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5915 _this.pPixels = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5916 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5917 pWindow.uFrameX = 75;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5918 pWindow.uFrameY = 60;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5919 pWindow.uFrameWidth = 469;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5920 pWindow.uFrameHeight = 338;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5921 pWindow.uFrameZ = 543;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5922 pWindow.uFrameW = 397;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5923 pFont = LoadFont("endgame.fnt", "FONTPAL", NULL);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5924 if (pParty->IsPartyGood())
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5925 v1 = pGlobalTXT_LocalizationStrings[675];//"Splendid job! With the activation of the Gate, a thousand worlds lie at your feet. Perhaps on one of them you will find the Ancients themselves, and return with the fruits their great civilization has to offer your world and your kingdom."
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5926 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5927 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5928 result = pParty->IsPartyEvil();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5929 if (!(short)result)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5930 return result;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5931 v1 = pGlobalTXT_LocalizationStrings[676];//"Brilliant! The completion of the Heavenly Forge has provided enough Ancient weapons to crush all resistance to your plans. Soon the world will bow to your every whim! Still, you can't help but wonder what was beyond the Gate the other side was trying so hard to build."
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5932 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5933 pInString = v1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5934 v23 = pParty->uTimePlayed - 138240;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5935 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5936 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C / 0xC;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5937 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C % 0xC;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5938 v17 = v19 % 0x1C;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5939 if (!v19)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5940 v19 = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5941 pRenderer->BeginScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5942 pWindow.DrawTitleText(pFont, 1, 0x23, 1, pGlobalTXT_LocalizationStrings[9], 3);//Congratulations!
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5943 v23 = 0i64;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5944 v20 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5945 for (uint i = 0; i < 4; i++)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5946 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5947 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[129], pParty->pPlayers[i].pName, pParty->pPlayers[i].GetBaseLevel(), pClassNames[pParty->pPlayers[i].classType]);//%s the Level %u %s
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5948 pWindow.DrawTitleText(pFont, 1, i * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46, 1, pTmpBuf.data(), 3);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5949 v23 += pParty->pPlayers[i].uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5950 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5951 v23 = (signed __int64)v23 / v19;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5952 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xC, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5953 pWindow.DrawTitleText(pFont, 1, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1, v6, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5954 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]);//Total Time:
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5955
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5956 v7 = pGlobalTXT_LocalizationStrings[56];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5957 if (v17 != 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5958 v7 = pGlobalTXT_LocalizationStrings[57];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5959
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5960 v8 = pGlobalTXT_LocalizationStrings[146];//Month
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5961 if (v18 != 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5962 v8 = pGlobalTXT_LocalizationStrings[148];//Months
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5963
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5964 v9 = pGlobalTXT_LocalizationStrings[245];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5965 if (v14 != 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5966 v9 = pGlobalTXT_LocalizationStrings[132];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5967
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5968 sprintf(pTmpBuf2.data(), " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5969 strcat(pTmpBuf.data(), pTmpBuf2.data());
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5970 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1, pTmpBuf.data(), 3);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5971 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5972 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight, 1, pTmpBuf.data(), 3);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5973 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5974 pRenderer->EndScene();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5975 pRenderer->Present();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5976 //if ( pRenderer->pRenderD3D )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5977 pRenderer->pBeforePresentFunction();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5978 pRenderer->SaveWinnersCertificate("MM7_Win.Pcx");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5979 free(pFont);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5980 window_SpeakInHouse->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5981 window_SpeakInHouse = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5982 if (v15 == (void *)2)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5983 result = pMessageQueue_50CBD0->uNumMessages;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5984 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5985 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5986 LODWORD(v23) = GetTickCount() + 5000;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5987 while ((unsigned int)v23 > GetTickCount())
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5988 ;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5989 while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5990 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5991 if (msg.message == WM_QUIT)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5992 Game_DeinitializeAndTerminate(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5993 TranslateMessage(&msg);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5994 DispatchMessage(&msg);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5995 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5996 if (pMessageQueue_50CBD0->uNumMessages)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5997 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5998 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
5999 pMessageQueue_50CBD0->uNumMessages = v10;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6000 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6001 pKeyActionMap->ResetKeys();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6002 pKeyActionMap->uLastKeyPressed = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6003 do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6004 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6005 while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6006 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6007 if (msg.message == WM_QUIT)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6008 Game_DeinitializeAndTerminate(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6009 TranslateMessage(&msg);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6010 DispatchMessage(&msg);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6011 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6012 } while (!pKeyActionMap->uLastKeyPressed);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6013 result = pMessageQueue_50CBD0->uNumMessages;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6014 if (pMessageQueue_50CBD0->uNumMessages)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6015 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6016 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6017 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6018 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6019 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6020 if (v15)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6021 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6022 /*if ( (signed int)result < 40 )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6023 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6024 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_Quit;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6025 }*/
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6026 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Quit, 1, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6027 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6028 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6029 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6030 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ShowFinalWindow, 1, 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6031 /*if ( (signed int)result < 40 )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6032 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6033 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_C5;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6034 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6035 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6036 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6037 ++pMessageQueue_50CBD0->uNumMessages;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6038 }*/
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6039 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6040 bGameoverLoop = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6041 return result;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6042 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6043
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6044 //----- (00464479) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6045 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6046 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6047 int v0; // esi@9
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6048
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6049 if (pMouse)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6050 pMouse->SetCursorBitmap("MICON1");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6051
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6052 pPaletteManager->ResetNonLocked();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6053 pBitmaps_LOD->ReleaseAll2();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6054 pSprites_LOD->DeleteSomeOtherSprites();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6055 pIcons_LOD->ReleaseAll2();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6056
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6057 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6058 pIndoor->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6059 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6060 pOutdoor->Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6061
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6062 pAudioPlayer->StopChannels(-1, -1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6063 pSoundList->_4A9D79(0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6064 uCurrentlyLoadedLevelType = LEVEL_null;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6065 pSpriteFrameTable->ResetSomeSpriteFlags();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6066 v0 = uNumVisibleWindows;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6067 pParty->armageddon_timer = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6068 while (v0 > 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6069 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6070 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6071
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6072 //----- (00461103) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6073 void _461103_load_level_sub()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6074 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6075 int v4; // edx@8
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6076 signed int v6; // esi@14
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6077 signed int v8; // ecx@16
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6078 int v12; // esi@25
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6079 int v13; // eax@26
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6080 __int16 v14; // ax@41
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6081 signed int v17; // [sp+14h] [bp-48h]@3
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6082 signed int v18; // [sp+14h] [bp-48h]@23
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6083 int v19; // [sp+18h] [bp-44h]@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6084 signed int v20; // [sp+18h] [bp-44h]@14
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6085 int v21[16]; // [sp+1Ch] [bp-40h]@17
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6086
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6087 GenerateItemsInChest();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6088 pGameLoadingUI_ProgressBar->Progress();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6089 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6090 pParty->field_7B5_in_arena_quest = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6091 dword_5C6DF8 = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6092 pNPCStats->uNewlNPCBufPos = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6093 v19 = pMapStats->GetMapInfo(pCurrentMapName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6094
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6095 //v15 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6096 for (uint i = 0; i < uNumActors; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6097 //if ( (signed int)uNumActors > 0 )
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6098 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6099 //Actor* pActor = &pActors[i];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6100 //v2 = (char *)&pActors[0].uNPC_ID;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6101 //do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6102 //{
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6103 //v3 = pActors[i].pMonsterInfo.uID;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6104 v17 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6105 if (pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6106 || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6107 v17 = 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6108 //v1 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6109 v4 = (pActors[i].pMonsterInfo.uID - 1) % 3;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6110 if (2 == v4)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6111 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6112 if (pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6113 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6114 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6115 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6116 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6117 if (v4 != 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6118 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6119 if (v4 == 0 && pActors[i].sNPC_ID == 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6120 pActors[i].sNPC_ID = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6121 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6122 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6123 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6124 if (pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6125 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6126 if (v17)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6127 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6128 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], pActors[i].pMonsterInfo.uID, 0, v19);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6129 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6130 ++pNPCStats->uNewlNPCBufPos;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6131 pActors[i].sNPC_ID = v14;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6132 continue;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6133 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6134 pActors[i].sNPC_ID = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6135 //++v15;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6136 //v2 += 836;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6137 //}
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6138 //while ( v15 < (signed int)uNumActors );
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6139 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6140
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6141 pGameLoadingUI_ProgressBar->Progress();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6142
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6143 //v5 = uNumActors;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6144 v6 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6145 v20 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6146 //v16 = v1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6147
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6148 for (uint i = 0; i < uNumActors; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6149 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6150 //v7 = (char *)&pActors[0].pMonsterInfo;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6151 //do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6152 //{
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6153 for (v8 = 0; v8 < v6; ++v8)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6154 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6155 if (v21[v8] == pActors[i].pMonsterInfo.uID - 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6156 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6157 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6158
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6159 if (v8 == v6)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6160 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6161 v21[v6++] = pActors[i].pMonsterInfo.uID - 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6162 v20 = v6;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6163 if (v6 == 16)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6164 break;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6165 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6166 //++v16;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6167 //v7 += 836;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6168 //}
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6169 //while ( v16 < (signed int)v5 );
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6170 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6171
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6172 pGameLoadingUI_ProgressBar->Progress();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6173
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6174 for (int _v0 = 0; _v0 < v6; ++_v0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6175 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6176 for (v18 = 4; v18; --v18)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6177 pSoundList->LoadSound(pMonsterList->pMonsters[v21[_v0]].pSoundSampleIDs[4 - v18], 0);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6178 v12 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6179 do
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6180 v13 = pSoundList->LoadSound(v12++ + word_4EE088_sound_ids[pMonsterStats->pInfos[v21[_v0] + 1].uSpell1ID], 1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6181 while (v13);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6182 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6183 //v0 = pGameLoadingUI_ProgressBar;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6184 //v1 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6185
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6186 pGameLoadingUI_ProgressBar->Progress();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6187
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6188 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_ACTORS)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6189 uNumActors = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6190 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DECORATIONS)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6191 uNumLevelDecorations = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6192 init_event_triggers();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6193
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6194 pGameLoadingUI_ProgressBar->Progress();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6195
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6196 pGame->pIndoorCameraD3D->vPartyPos.x = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6197 pGame->pIndoorCameraD3D->vPartyPos.y = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6198 pGame->pIndoorCameraD3D->vPartyPos.z = 100;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6199 pGame->pIndoorCameraD3D->sRotationX = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6200 pGame->pIndoorCameraD3D->sRotationY = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6201 viewparams->bRedrawGameUI = true;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6202 uLevel_StartingPointType = MapStartPoint_Party;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6203 pSprites_LOD->_461397();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6204 pPaletteManager->LockTestAll();
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6205 if (pParty->pPickedItem.uItemID != 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6206 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6207 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6208
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6209 //----- (0042F3D6) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6210 void InitializeTurnBasedAnimations(void *_this)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6211 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6212 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6213 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6214 char icon_name[32];
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6215 sprintf(icon_name, "turn%u", i);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6216 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6217 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6218 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6219
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6220 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6221 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6222 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6223 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6224 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6225
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6226 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6227 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6228 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6229 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6230 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6231
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6232 //----- (00466C40) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6233 const wchar_t *MENU_STATE_to_string(MENU_STATE m)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6234 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6235 switch (m)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6236 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6237 case -1: return L"-1";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6238 case MENU_MAIN: return L"MENU_MAIN";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6239 case MENU_NEWGAME: return L"MENU_NEWGAME";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6240 case MENU_CREDITS: return L"MENU_CREDITS";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6241 case MENU_SAVELOAD: return L"MENU_SAVELOAD";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6242 case MENU_EXIT_GAME: return L"MENU_EXIT_GAME";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6243 case MENU_5: return L"MENU_5";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6244 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6245 case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6246 case MENU_CREDITSPROC: return L"MENU_CREDITSPROC";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6247 case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6248 case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6249 case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6250 case MENU_MMT_MAIN_MENU: return L"MENU_MMT_MAIN_MENU";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6251 default: return L"unk";
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6252 };
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6253 };
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6254 void SetCurrentMenuID(MENU_STATE uMenu)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6255 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6256 sCurrentMenuID = uMenu;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6257
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6258 Log::Warning(L"CurrentMenu = %s \n", MENU_STATE_to_string(uMenu));
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6259 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6260
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6261 //----- (00466CA0) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6262 MENU_STATE GetCurrentMenuID()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6263 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6264 return sCurrentMenuID;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6265 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6266
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6267 //----- (0046BDA8) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6268 unsigned int GetGravityStrength()
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6269 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6270 int v0; // eax@1
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6271
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6272 v0 = ~LOBYTE(pGame->uFlags2) & 8;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6273 LOBYTE(v0) = v0 | 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6274 return (unsigned int)v0 >> 1;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6275 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6276
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6277 //----- (00448B45) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6278 void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6279 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6280 if (bForceHide || GameUI_Footer_TimeLeft && GetTickCount() >= GameUI_Footer_TimeLeft)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6281 GameUI_Footer_TimeLeft = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6282 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6283
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6284 //----- (0044861E) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6285 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6286 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6287 unsigned int texture; // eax@2
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6288
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6289 if (uFaceCog)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6290 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6291 texture = pBitmaps_LOD->LoadTexture(pFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6292 if (texture != -1 ? (int)&pBitmaps_LOD->pTextures[texture] : 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6293 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6294 pBitmaps_LOD->pTextures[texture].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[texture].palette_id1);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6295
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6296 if (uCurrentlyLoadedLevelType == 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6297 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6298 if ((signed int)pIndoor->uNumFaceExtras > 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6299 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6300 for (uint i = 1; i < (signed int)pIndoor->uNumFaceExtras; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6301 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6302 if (pIndoor->pFaceExtras[i].sCogNumber == uFaceCog)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6303 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6304 if (pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes & FACE_TEXTURE_FRAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6305 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6306 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(pFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6307 if (pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6308 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6309 pTextureFrameTable->LoadAnimationSequenceAndPalettes(pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6310 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6311 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6312 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6313 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6314 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= 0xBF00;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6315 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6316 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6317 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6318 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6319 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6320 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6321 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6322 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6323 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6324 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6325 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6326 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6327 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6328 for (uint j = 0; j < (unsigned int)pOutdoor->uNumBModels; ++j)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6329 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6330 for (uint i = 0; i < pOutdoor->pBModels[j].uNumFaces; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6331 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6332 if (pOutdoor->pBModels[j].pFaces[i].sCogNumber == uFaceCog)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6333 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6334 if (pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_TEXTURE_FRAME)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6335 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6336 pOutdoor->pBModels[j].pFaces[i].uTextureID = pTextureFrameTable->FindTextureByName(pFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6337 if (pOutdoor->pBModels[j].pFaces[i].uTextureID)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6338 pTextureFrameTable->LoadAnimationSequenceAndPalettes(pOutdoor->pBModels[j].pFaces[i].uTextureID);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6339 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6340 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6341 pOutdoor->pBModels[j].pFaces[i].uTextureID = texture;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6342 pOutdoor->pBModels[j].pFaces[i].uAttributes &= 0xBF00;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6343 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6344 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6345 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6346 pOutdoor->pBModels[j].pFaces[i].uTextureID = texture;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6347 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6348 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6349 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6350 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6351 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6352 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6353 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6354 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6355
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6356 //----- (0044892E) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6357 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6358 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6359 if (sCogNumber)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6360 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6361 if (uCurrentlyLoadedLevelType == 1)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6362 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6363 for (uint i = 1; i < (unsigned int)pIndoor->uNumFaceExtras; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6364 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6365 if (pIndoor->pFaceExtras[i].sCogNumber == sCogNumber)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6366 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6367 if (on)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6368 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes |= bit;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6369 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6370 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= ~bit;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6371 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6372 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6373 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6374 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6375 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6376 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6377 for (uint j = 0; j < (unsigned int)pOutdoor->uNumBModels; ++j)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6378 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6379 for (uint i = 0; i < (unsigned int)pOutdoor->pBModels[j].uNumFaces; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6380 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6381 if (pOutdoor->pBModels[j].pFaces[i].sCogNumber == sCogNumber)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6382 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6383 if (on)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6384 pOutdoor->pBModels[j].pFaces[i].uAttributes |= bit;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6385 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6386 pOutdoor->pBModels[j].pFaces[i].uAttributes &= ~bit;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6387 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6388 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6389 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6390 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6391 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6392 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6393 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6394
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6395 //----- (0044882F) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6396 void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6397 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6398 for (size_t i = 0; i < uNumLevelDecorations; i++)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6399 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6400 if (pLevelDecorations[i].uCog == uCog)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6401 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6402 if (pFileName && strcmp(pFileName, "0"))
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6403 {
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6404 pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pFileName);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6405 pDecorationList->InitializeDecorationSprite(pLevelDecorations[i].uDecorationDescID);
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6406 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6407
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6408 if (bHide)
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6409 pLevelDecorations[i].uFlags &= ~LEVEL_DECORATION_INVISIBLE;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6410 else
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6411 pLevelDecorations[i].uFlags |= LEVEL_DECORATION_INVISIBLE;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6412
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6413 pParty->uFlags |= 2;
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6414 }
0f17a30149ec cleaning project part 1
zipi
parents: 2461
diff changeset
6415 }
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6416 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6417
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6418 //----- (004356FF) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6419 void back_to_game()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6420 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6421 dword_507BF0_is_there_popup_onscreen = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6422 dword_4E455C = 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6423
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6424 extern int no_rightlick_in_inventory;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6425 no_rightlick_in_inventory = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6426
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6427 if (pGUIWindow_ScrollWindow)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6428 free_book_subwindow();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6429 if (!pCurrentScreen && !pGUIWindow_Settings)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6430 pEventTimer->Resume();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6431 viewparams->bRedrawGameUI = 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6432 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6433
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6434 //----- (00494035) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6435 void _494035_timed_effects__water_walking_damage__etc()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6436 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6437 signed __int64 v0; // qax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6438 unsigned int v4; // edi@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6439 // signed int v12; // edi@29
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6440 int v24; // ecx@60
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6441 int v26; // ecx@64
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6442 int v28; // ecx@68
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6443 int v30; // ecx@72
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6444 int v32; // ecx@76
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6445 int v34; // ecx@80
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6446 int v36; // ecx@84
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6447 int v38; // ecx@88
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6448 int v40; // ecx@92
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6449 int v42; // ecx@96
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6450 bool v43; // ebx@102
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6451 bool v46; // edi@111
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6452 // unsigned int v56; // [sp-8h] [bp-38h]@55
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6453 // int v59; // [sp-4h] [bp-34h]@55
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6454 // unsigned int v61; // [sp+14h] [bp-1Ch]@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6455 signed int a2a; // [sp+18h] [bp-18h]@47
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6456 signed int old_day; // [sp+1Ch] [bp-14h]@47
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6457 signed int old_hour;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6458
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6459 old_day = pParty->uDaysPlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6460 old_hour = pParty->uCurrentHour;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6461 //auto prev_time = pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6462 pParty->uTimePlayed += pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6463 v0 = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) / 60i64;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6464 v4 = (unsigned int)(((unsigned int)v0 / 24) / 7) >> 2;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6465 pParty->uCurrentTimeSecond = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) % 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6466 pParty->uCurrentMinute = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) % 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6467 pParty->uCurrentHour = v0 % 24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6468 pParty->uCurrentMonthWeek = ((unsigned int)v0 / 24) / 7 & 3;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6469 pParty->uDaysPlayed = (unsigned int)((unsigned int)v0 / 24) % 28;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6470 pParty->uCurrentMonth = v4 % 12;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6471 pParty->uCurrentYear = v4 / 0xC + game_starting_year;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6472 if (pParty->uCurrentHour >= 3 && (old_hour < 3 || pParty->uDaysPlayed > old_day)) // new day dawns
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6473 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6474 pParty->pHirelings[0].bHasUsedTheAbility = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6475 pParty->pHirelings[1].bHasUsedTheAbility = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6476
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6477 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6478 pNPCStats->pNewNPCData[i].bHasUsedTheAbility = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6479
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6480 ++pParty->days_played_without_rest;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6481 if (pParty->days_played_without_rest > 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6482 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6483 for (uint i = 0; i < 4; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6484 pParty->pPlayers[i].SetCondWeakWithBlockCheck(0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6485
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6486 if (pParty->uNumFoodRations)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6487 Party::TakeFood(1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6488 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6489 for (uint i = 0; i < 4; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6490 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].sHealth / (pParty->days_played_without_rest + 1) + 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6491
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6492 if (pParty->days_played_without_rest > 3)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6493 for (uint i = 0; i < 4; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6494 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6495 pParty->pPlayers[i].Zero();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6496 if (!pParty->pPlayers[i].IsPertified() && !pParty->pPlayers[i].IsEradicated()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6497 && !pParty->pPlayers[i].IsDead())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6498 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6499 if (rand() % 100 < 5 * pParty->days_played_without_rest)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6500 pParty->pPlayers[i].SetCondDeadWithBlockCheck(0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6501 if (rand() % 100 < 10 * pParty->days_played_without_rest)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6502 pParty->pPlayers[i].SetCondInsaneWithBlockCheck(0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6503 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6504 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6505 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6506 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6507 pOutdoor->SetFog();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6508
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6509 for (uint i = 0; i < 4; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6510 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6511 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6512
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6513 if (pParty->uFlags & 4 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed)//water damage
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6514 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6515 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6516 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6517 for (uint pl = 1; pl <= 4; ++pl)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6518 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6519 if (pPlayers[pl]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6520 || pPlayers[pl]->HasEnchantedItemEquipped(71)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6521 || pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].uExpireTime > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6522 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6523 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6524 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6525 if (!pPlayers[pl]->HasUnderwaterSuitEquipped())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6526 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6527 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6528 if (pParty->uFlags & 4)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6529 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6530 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]);// Âû òîíåòå!
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6531 GameUI_Footer_TimeLeft = 128;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6532 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6533 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6534 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6535 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6536 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6537 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6538 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6539 if (pParty->uFlags & 0x200 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed) //lava damage
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6540 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6541 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6542 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6543
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6544 for (uint pl = 1; pl <= 4; pl++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6545 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6546 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6547 if (pParty->uFlags & 0x200)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6548 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6549 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]); //Âû ãîðèòå!
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6550 GameUI_Footer_TimeLeft = 128;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6551 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6552 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6553 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6554 _493938_regenerate();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6555 uint party_condition_flag = 4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6556 a2a = pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6557 if (pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)//çàìåäëåíèå âîññòàíîâëåíèÿ ïðè áåãå
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6558 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6559 a2a *= 0.5f;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6560 if (a2a < 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6561 a2a = 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6562 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6563
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6564 for (uint pl = 1; pl <= 4; pl++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6565 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6566 if (pPlayers[pl]->uTimeToRecovery)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6567 pPlayers[pl]->Recover(a2a);//âîññòàíîâëåíèå àêòèâíîñòè
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6568 if (pPlayers[pl]->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) + pPlayers[pl]->sHealth + pPlayers[pl]->uEndurance >= 1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6569 || (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6570 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6571 if (pPlayers[pl]->sHealth < 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6572 pPlayers[pl]->SetCondition(Condition_Unconcious, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6573 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6574 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6575 pPlayers[pl]->SetCondition(Condition_Dead, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6576 if (pPlayers[pl]->field_E0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6577 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6578 v24 = pPlayers[pl]->field_E0 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6579 if (v24 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6580 pPlayers[pl]->field_E0 = v24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6581 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6582 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6583 pPlayers[pl]->field_E0 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6584 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6585 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6586 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6587 if (pPlayers[pl]->field_E4)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6588 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6589 v26 = pPlayers[pl]->field_E4 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6590 if (v26 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6591 pPlayers[pl]->field_E4 = v26;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6592 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6593 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6594 pPlayers[pl]->field_E4 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6595 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6596 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6597 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6598 if (pPlayers[pl]->field_E8)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6599 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6600 v28 = pPlayers[pl]->field_E8 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6601 if (v28 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6602 pPlayers[pl]->field_E8 = v28;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6603 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6604 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6605 pPlayers[pl]->field_E8 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6606 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6607 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6608 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6609 if (pPlayers[pl]->field_EC)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6610 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6611 v30 = pPlayers[pl]->field_EC - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6612 if (v30 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6613 pPlayers[pl]->field_EC = v30;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6614 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6615 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6616 pPlayers[pl]->field_EC = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6617 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6618 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6619 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6620 if (pPlayers[pl]->field_F0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6621 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6622 v32 = pPlayers[pl]->field_F0 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6623 if (v32 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6624 pPlayers[pl]->field_F0 = v32;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6625 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6626 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6627 pPlayers[pl]->field_F0 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6628 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6629 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6630 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6631 if (pPlayers[pl]->field_F4)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6632 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6633 v34 = pPlayers[pl]->field_F4 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6634 if (v34 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6635 pPlayers[pl]->field_F4 = v34;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6636 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6637 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6638 pPlayers[pl]->field_F4 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6639 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6640 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6641 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6642 if (pPlayers[pl]->field_F8)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6643 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6644 v36 = pPlayers[pl]->field_F8 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6645 if (v36 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6646 pPlayers[pl]->field_F8 = v36;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6647 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6648 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6649 pPlayers[pl]->field_F8 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6650 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6651 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6652 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6653 if (pPlayers[pl]->field_FC)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6654 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6655 v38 = pPlayers[pl]->field_FC - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6656 if (v38 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6657 pPlayers[pl]->field_FC = v38;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6658 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6659 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6660 pPlayers[pl]->field_FC = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6661 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6662 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6663 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6664 if (pPlayers[pl]->field_100)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6665 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6666 v40 = pPlayers[pl]->field_100 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6667 if (v40 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6668 pPlayers[pl]->field_100 = v40;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6669 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6670 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6671 pPlayers[pl]->field_100 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6672 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6673 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6674 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6675 if (pPlayers[pl]->field_104)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6676 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6677 v42 = pPlayers[pl]->field_104 - pEventTimer->uTimeElapsed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6678 if (v42 > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6679 pPlayers[pl]->field_104 = v42;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6680 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6681 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6682 pPlayers[pl]->field_104 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6683 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6684 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6685 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6686 if (pPlayers[pl]->pConditions[Condition_Sleep] | pPlayers[pl]->pConditions[Condition_Paralyzed]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6687 | pPlayers[pl]->pConditions[Condition_Unconcious] | pPlayers[pl]->pConditions[Condition_Dead]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6688 | pPlayers[pl]->pConditions[Condition_Pertified] | pPlayers[pl]->pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6689 --party_condition_flag;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6690 v43 = (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0; //ñïåøêà
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6691
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6692 for (uint k = 0; k < 24; ++k)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6693 pPlayers[pl]->pPlayerBuffs[k].IsBuffExpiredToTime(pParty->uTimePlayed);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6694
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6695 if (v43 && (signed __int64)pPlayers[pl]->pPlayerBuffs[7].uExpireTime <= 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6696 pPlayers[pl]->SetCondition(Condition_Weak, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6697 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6698
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6699 v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6700
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6701 for (uint i = 0; i < 20; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6702 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6703 if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed) == 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6704 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6705 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6706
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6707 if (v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6708 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6709 for (uint i = 0; i < 4; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6710 pParty->pPlayers[i].SetCondition(1, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6711 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6712
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6713 for (uint i = 0; i < 2; ++i)//Ïðîâåðêà â ñîçíàíèè ëè ïåðñ ñäåëàâøèé çàêë íà ïîë¸ò è õîæäåíèå ïî âîäå
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6714 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6715 SpellBuff* pBuf = &pParty->pPartyBuffs[Party_Spec_Motion_status_ids[i]];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6716 if (pBuf->uExpireTime == 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6717 continue;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6718
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6719 if (!(pBuf->uFlags & 1))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6720 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6721 if (!pPlayers[pBuf->uCaster]->CanAct())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6722 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6723 pBuf->Reset();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6724 if (Party_Spec_Motion_status_ids[i] == PARTY_BUFF_FLY)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6725 pParty->bFlying = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6726 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6727 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6728 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6729
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6730 if (!party_condition_flag)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6731 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6732 if (pCurrentScreen != SCREEN_REST)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6733 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6734 for (uint pl = 1; pl <= 4; pl++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6735 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6736 if (pPlayers[pl]->pConditions[Condition_Sleep])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6737 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6738 pPlayers[pl]->pConditions[Condition_Sleep] = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6739 party_condition_flag = 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6740 break;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6741 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6742 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6743 if (!party_condition_flag || _5C35C0_force_party_death)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6744 uGameState = GAME_STATE_PARTY_DIED;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6745 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6746 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6747
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6748 if (uActiveCharacter)//âûáîð ñëåäóþùåãî ïîñëå ïðîïóñêàþùåãî õîä
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6749 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6750 if (pCurrentScreen != SCREEN_REST)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6751 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6752 if (pPlayers[uActiveCharacter]->pConditions[Condition_Sleep]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6753 || pPlayers[uActiveCharacter]->pConditions[Condition_Paralyzed]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6754 || pPlayers[uActiveCharacter]->pConditions[Condition_Unconcious]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6755 || pPlayers[uActiveCharacter]->pConditions[Condition_Dead]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6756 || pPlayers[uActiveCharacter]->pConditions[Condition_Pertified]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6757 || pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6758 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6759 viewparams->bRedrawGameUI = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6760 uActiveCharacter = pParty->GetNextActiveCharacter();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6761 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6762 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6763 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6764 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6765
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6766 //----- (00493938) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6767 void _493938_regenerate()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6768 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6769 int current_time; // edi@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6770 int last_reg_time; // qax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6771 int v4; // eax@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6772 int v5; // edi@5
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6773 long long *v6; // ecx@5
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6774 char v7; // sf@5
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6775 int *v8; // ecx@10
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6776 int v9; // edi@15
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6777 signed int v10; // eax@15
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6778 // __int16 *v11; // edx@16
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6779 // int v12; // eax@20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6780 int numberOfActorsAffected; // ebx@20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6781 unsigned int v14; // esi@21
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6782 //unsigned int v15; // ecx@21
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6783 //unsigned int v16; // eax@21
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6784 // int v18; // eax@21
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6785 signed int v19; // eax@21
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6786 bool recovery_HP; // ebx@25
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6787 // ITEM_EQUIP_TYPE v22; // edi@30
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6788 signed int v25; // eax@33
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6789 // int v26; // eax@35
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6790 // int v27; // eax@36
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6791 // int v28; // eax@37
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6792 signed int v31; // ecx@53
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6793 int actorsAffectedByImmolation[100]; // [sp+4h] [bp-22Ch]@20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6794 SpriteObject a1; // [sp+194h] [bp-9Ch]@15
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6795 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6796 bool has_dragon_flag; // [sp+210h] [bp-20h]@22
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6797 bool lich_jar_flag; // [sp+214h] [bp-1Ch]@25
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6798 bool zombie_flag; // [sp+218h] [bp-18h]@25
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6799 bool decrease_HP; // [sp+21Ch] [bp-14h]@25
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6800 bool lich_flag; // [sp+220h] [bp-10h]@25
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6801 int v49; // [sp+224h] [bp-Ch]@24
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6802 bool recovery_SP; // [sp+228h] [bp-8h]@25
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6803 bool redraw_flag; // [sp+22Ch] [bp-4h]@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6804
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6805 current_time = (signed int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6806 last_reg_time = (signed int)(signed __int64)((double)pParty->uLastRegenerationTime * 0.234375) / 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6807 if (current_time >= (signed int)last_reg_time + 5)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6808 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6809 redraw_flag = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6810 v4 = (current_time - last_reg_time) / 5;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6811 if (pParty->FlyActive())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6812 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6813 if (pParty->bFlying)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6814 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6815 if (!(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6816 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6817 v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6818 //cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];//cursed
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6819 //v7 = cursed_flag < v5;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6820 //cursed_flag -= v5;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6821
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6822 v6 = &pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6823
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6824 if (*v6 < v5)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6825 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6826 v6 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6827 pParty->uFlags &= 0xFFFFFFBFu;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6828 pParty->bFlying = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6829 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6830 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6831 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6832 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6833 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6834
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6835 if (pParty->WaterWalkActive())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6836 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6837 if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6838 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6839 if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6840 { // taking on water
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6841 v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster - 1].pConditions[Condition_Cursed];//&AA1058_PartyQuickSpellSound[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 2000];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6842 v7 = *v8 < v4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6843 *v8 -= v4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6844 if (v7)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6845 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6846 *v8 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6847 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6848 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6849 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6850 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6851 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6852 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6853
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6854 if (pParty->ImmolationActive())//Æåðòâà
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6855 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6856 a3.z = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6857 a3.y = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6858 a3.x = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6859 a1.stru_24.Reset();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6860 a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6861 a1.spell_skill = pParty->ImmolationSkillLevel();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6862 v10 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6863 a1.uType = 1070;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6864 a1.spell_id = SPELL_FIRE_IMMOLATION;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6865 v10 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6866 for (uint i = 0; i > pObjectList->uNumObjects; i++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6867 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6868 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[8].uType)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6869 v10 = i;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6870 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6871 a1.uObjectDescID = v10;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6872 a1.field_60_distance_related_prolly_lod = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6873 a1.uAttributes = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6874 a1.uSectorID = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6875 a1.uSpriteFrameID = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6876 a1.spell_caster_pid = PID(OBJECT_Player, pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6877 a1.uFacing = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6878 a1.uSoundID = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6879 numberOfActorsAffected = pParty->_46A89E_immolation_effect(actorsAffectedByImmolation, 100, 307);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6880 for (v9 = 0; v9 < numberOfActorsAffected; ++v9)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6881 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6882 v14 = actorsAffectedByImmolation[v9];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6883 a1.vPosition.x = pActors[v14].vPosition.x;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6884 a1.vPosition.y = pActors[v14].vPosition.y;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6885 a1.vPosition.z = pActors[v14].vPosition.z;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6886 a1.spell_target_pid = PID(OBJECT_Actor, v14);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6887 v19 = a1.Create(0, 0, 0, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6888 Actor::DamageMonsterFromParty(PID(OBJECT_Item, v19), v14, &a3);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6889 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6890 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6891
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6892 has_dragon_flag = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6893 if (PartyHasDragon())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6894 has_dragon_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6895
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6896 for (v49 = 0; v49 < 4; v49++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6897 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6898 recovery_HP = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6899 recovery_SP = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6900 decrease_HP = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6901 lich_flag = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6902 lich_jar_flag = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6903 zombie_flag = false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6904
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6905 for (int v22 = 0; (signed int)v22 < 16; v22++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6906 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6907 if (pParty->pPlayers[v49].HasItemEquipped((ITEM_EQUIP_TYPE)v22))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6908 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6909 uint _idx = pParty->pPlayers[v49].pEquipment.pIndices[v22];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6910 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID > 134)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6911 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6912 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_RELIC_ETHRICS_STAFF)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6913 decrease_HP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6914 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HERMES_SANDALS)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6915 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6916 recovery_HP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6917 recovery_SP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6918 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6919 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_MINDS_EYE)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6920 recovery_SP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6921 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HEROS_BELT)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6922 recovery_HP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6923 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6924 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6925 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6926 v25 = pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uSpecEnchantmentType;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6927 if (v25 == 37 //of Regeneration("Regenerate 1hp/x while walking, etc")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6928 || v25 == 44 //of Life("HP (+10), Regen hpts")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6929 || v25 == 50 //of The Phoenix("Fire Res (+30), Regen hpts") &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6930 || v25 == 54)// of The Troll("End (+15), Regen hpts")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6931 recovery_HP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6932 if (v25 == 38 //of Mana("Regenerate 1sp/x while walking, etc")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6933 || v25 == 47 //of The Eclipse("SP (+10), Regen spts")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6934 || v25 == 55)//of The Unicorn("Luck (+15), Regen spts")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6935 recovery_SP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6936 if (v25 == 66)// of Plenty("Regenerate 1 hp/x and 1 sp/x while walking, etc.")
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6937 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6938 recovery_HP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6939 recovery_SP = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6940 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6941 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6942
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6943 if (recovery_HP &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6944 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6945 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6946 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6947 if (pParty->pPlayers[v49].sHealth < pParty->pPlayers[v49].GetMaxHealth())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6948 ++pParty->pPlayers[v49].sHealth;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6949 if (pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6950 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6951 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6952 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6953
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6954 if (recovery_SP &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6955 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6956 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6957 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6958 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6959 ++pParty->pPlayers[v49].sMana;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6960 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6961 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6962
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6963 if (decrease_HP &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6964 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6965 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6966 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6967 --pParty->pPlayers[v49].sHealth;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6968 if (!(pParty->pPlayers[v49].pConditions[Condition_Unconcious]) && pParty->pPlayers[v49].sHealth < 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6969 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6970 if (pParty->pPlayers[v49].sHealth < 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6971 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6972 if (pParty->pPlayers[v49].sHealth + pParty->pPlayers[v49].uEndurance + pParty->pPlayers[v49].GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) >= 1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6973 || (signed __int64)pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6974 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6975 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6976 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6977 if (!pParty->pPlayers[v49].pConditions[Condition_Dead])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6978 pParty->pPlayers[v49].pConditions[Condition_Dead] = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6979 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6980 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6981 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6982 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6983 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6984 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6985
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6986 //regeneration
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6987 if (pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uExpireTime > 0
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6988 && !pParty->pPlayers[v49].pConditions[Condition_Dead]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6989 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6990 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6991 pParty->pPlayers[v49].sHealth += 5 * pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uPower;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6992 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6993 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].GetMaxHealth();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6994 if (pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6995 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6996 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6997 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6998
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6999 //for warlock
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7000 if (has_dragon_flag && pParty->pPlayers[v49].classType == PLAYER_CLASS_WARLOCK)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7001 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7002 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7003 ++pParty->pPlayers[v49].sMana;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7004 redraw_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7005 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7006
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7007 //for lich
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7008 if (pParty->pPlayers[v49].classType == PLAYER_CLASS_LICH)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7009 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7010 for (v31 = 0; v31 < 126; ++v31)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7011 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7012 if (pParty->pPlayers[v49].pInventoryItemList[v31].uItemID == ITEM_LICH_JAR_FULL)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7013 lich_jar_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7014 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7015 lich_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7016 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7017 if (lich_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7018 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7019 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7020 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7021 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 2;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7022 if (pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() / 2)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7023 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 2;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7024 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7025 if (lich_jar_flag)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7026 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7027 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7028 ++pParty->pPlayers[v49].sMana;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7029 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7030
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7031 //for zombie
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7032 if (pParty->pPlayers[v49].pConditions[Condition_Zombie])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7033 zombie_flag = true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7034 if (zombie_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7035 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7036 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7037 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7038 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7039 if (pParty->pPlayers[v49].sMana > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7040 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7041 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7042 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7043 pParty->uLastRegenerationTime = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7044 if (!viewparams->bRedrawGameUI)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7045 viewparams->bRedrawGameUI = redraw_flag;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7046 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7047 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7048
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7049 //----- (00491E3A) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7050 void sub_491E3A()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7051 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7052 signed int v1; // esi@3
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7053 unsigned int v3; // eax@7
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7054 unsigned int v4; // edx@8
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7055 int v6; // edi@17
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7056
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7057 //__debugbreak();//Ritor1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7058 for (uint pl = 0; pl < 4; pl++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7059 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7060 if (SoundSetAction[24][0])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7061 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7062 v3 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7063 for (v1 = 0; v1 < (signed int)pSoundList->sNumSounds; ++v1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7064 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7065 int ps = 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4998;//6728
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7066 if (pSoundList->pSL_Sounds[v1].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4998)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7067 v3 = v1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7068 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7069 pSoundList->UnloadSound(v3, 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7070 for (v4 = 0; (signed int)v4 < (signed int)pSoundList->sNumSounds; ++v4)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7071 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7072 if (pSoundList->pSL_Sounds[v4].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4999)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7073 pSoundList->UnloadSound(v4, 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7074 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7075 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7076 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7077 v6 = pIcons_LOD->uNumLoadedFiles - 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7078 if (v6 >= pIcons_LOD->pFacesLock)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7079 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7080 do
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7081 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7082 pIcons_LOD->pTextures[v6].Release();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7083 if (pIcons_LOD->pHardwareTextures)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7084 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7085 if (pIcons_LOD->pHardwareTextures[v6])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7086 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7087 pIcons_LOD->pHardwareTextures[v6]->Release();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7088 pIcons_LOD->pHardwareTextures[v6] = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7089 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7090 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7091 if (pIcons_LOD->pHardwareSurfaces)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7092 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7093 if (pIcons_LOD->pHardwareSurfaces[v6])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7094 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7095 pIcons_LOD->pHardwareSurfaces[v6]->Release();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7096 pIcons_LOD->pHardwareSurfaces[v6] = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7097 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7098 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7099 --v6;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7100 } while (v6 >= pIcons_LOD->pFacesLock);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7101 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7102 pIcons_LOD->uNumLoadedFiles = pIcons_LOD->pFacesLock;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7103 pIcons_LOD->pFacesLock = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7104 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7105 // 4ED498: using guessed type char byte_4ED498;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7106
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7107 //----- (00494820) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7108 unsigned int __fastcall _494820_training_time(unsigned int a1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7109 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7110 signed int v1; // eax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7111
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7112 v1 = 5;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7113 if (a1 % 24 >= 5)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7114 v1 = 29;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7115 return v1 - a1 % 24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7116 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7117
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7118 //----- (00494836) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7119 int stru339_spell_sound::AddPartySpellSound(int uSoundID, int a6)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7120 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7121 int v3; // esi@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7122 int result; // eax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7123 //stru339_spell_sound *v5; // ebx@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7124 //int *v6; // edi@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7125 unsigned int v7; // eax@3
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7126 int v8; // [sp+Ch] [bp-8h]@3
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7127 int v9; // [sp+10h] [bp-4h]@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7128 int a2a; // [sp+1Ch] [bp+8h]@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7129 //return 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7130 v3 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7131 result = word_4EE088_sound_ids[uSoundID];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7132 //v5 = this;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7133 a2a = word_4EE088_sound_ids[uSoundID];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7134 if (word_4EE088_sound_ids[uSoundID])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7135 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7136 //v6 = this->pSoundsOffsets;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7137 for (v9 = 0; v9 < 2; ++v9)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7138 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7139 v7 = a2a++;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7140 result = pSoundList->LoadSound(v7, (char *)this + v3, 44744 - v3, &v8, a6);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7141 if (!result)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7142 break;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7143 a6 += 4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7144 result = v8 + 256;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7145 this->pSoundsOffsets[v9] = v3;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7146 v3 += result;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7147 this->pSoundsSizes[v9] = v8 + 256;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7148 //++v6;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7149 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7150 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7151 return result;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7152 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7153 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7154
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7155 //----- (00443E31) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7156 void LoadLevel_InitializeLevelStr()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7157 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7158
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7159 // char Args[100];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7160 int string_num;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7161 int max_string_length;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7162 // int current_string_length;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7163 int prev_string_offset;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7164
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7165 if (sizeof(pLevelStrOffsets) != 2000)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7166 Log::Warning(L"pLevelStrOffsets: deserialization warning");
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7167 memset(pLevelStrOffsets.data(), 0, 2000);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7168
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7169 max_string_length = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7170 string_num = 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7171 prev_string_offset = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7172 pLevelStrOffsets[0] = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7173 for (uint i = 0; i < uLevelStrFileSize; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7174 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7175 if (!pLevelStr[i])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7176 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7177 pLevelStrOffsets[string_num] = i + 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7178 ++string_num;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7179 if (i - prev_string_offset > max_string_length)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7180 max_string_length = i - prev_string_offset;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7181 prev_string_offset = i;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7182 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7183 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7184
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7185 uLevelStrNumStrings = string_num - 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7186 if (max_string_length > 800)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7187 Error("MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", max_string_length + 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7188
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7189 if (uLevelStrNumStrings > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7190 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7191 for (uint i = 0; i <uLevelStrNumStrings; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7192 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7193 if (RemoveQuotes(&pLevelStr[pLevelStrOffsets[i]]) != &pLevelStr[pLevelStrOffsets[i]])
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7194 ++pLevelStrOffsets[i];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7195 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7196 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7197 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7198
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7199 //----- (00443F95) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7200 void OnMapLeave()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7201 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7202 _evt_raw *test_event;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7203 if (uLevelEVT_NumEvents > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7204 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7205 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7206 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7207 test_event = (_evt_raw*)&pLevelEVT[pLevelEVT_Index[i].uEventOffsetInEVT];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7208 if (test_event->_e_type == EVENT_OnMapLeave)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7209 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7210 EventProcessor(pLevelEVT_Index[i].uEventID, 0, 1, pLevelEVT_Index[i].event_sequence_num);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7211 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7212 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7213 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7214 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7215
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7216 //----- (00443FDC) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7217 void OnMapLoad()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7218 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7219 int v6; // eax@9
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7220 unsigned __int64 v8; // qax@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7221 int hours; // ebx@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7222 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7223 unsigned int seconds; // [sp+14h] [bp-3Ch]@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7224 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7225 unsigned int minutes; // [sp+2Ch] [bp-24h]@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7226 unsigned int years; // [sp+34h] [bp-1Ch]@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7227 unsigned int weeks; // [sp+38h] [bp-18h]@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7228 int v26; // [sp+3Ch] [bp-14h]@15
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7229 unsigned int days; // [sp+3Ch] [bp-14h]@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7230 unsigned int months; // [sp+40h] [bp-10h]@26
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7231
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7232 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7233 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7234 EventIndex pEvent = pLevelEVT_Index[i];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7235
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7236 _evt_raw* _evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7237
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7238 if (_evt->_e_type == EVENT_PlaySound)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7239 pSoundList->LoadSound(EVT_DWORD(_evt->v5), 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7240 else if (_evt->_e_type == EVENT_OnMapReload)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7241 EventProcessor(pEvent.uEventID, 0, 0, pEvent.event_sequence_num);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7242 else if (_evt->_e_type == EVENT_OnTimer || _evt->_e_type == EVENT_Initialize)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7243 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7244 //v3 = &MapsLongTimersList[MapsLongTimers_count];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7245 v20 = pOutdoor->loc_time.uLastVisitDay;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7246 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7247 v20 = pIndoor->stru1.uLastVisitDay;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7248
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7249 MapsLongTimersList[MapsLongTimers_count].timer_evt_type = _evt->_e_type;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7250 MapsLongTimersList[MapsLongTimers_count].timer_evt_ID = pEvent.uEventID;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7251 MapsLongTimersList[MapsLongTimers_count].timer_evt_seq_num = pEvent.event_sequence_num;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7252
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7253 MapsLongTimersList[MapsLongTimers_count].YearsInterval = _evt->v5;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7254 MapsLongTimersList[MapsLongTimers_count].MonthsInterval = _evt->v6;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7255 MapsLongTimersList[MapsLongTimers_count].WeeksInterval = _evt->v7;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7256 MapsLongTimersList[MapsLongTimers_count].HoursInterval = _evt->v8;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7257 MapsLongTimersList[MapsLongTimers_count].MinutesInterval = _evt->v9;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7258 MapsLongTimersList[MapsLongTimers_count].SecondsInterval = _evt->v10;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7259
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7260
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7261 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7262
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7263 MapsLongTimersList[MapsLongTimers_count].time_left_to_fire = ((unsigned short)_evt->v12 << 8) + _evt->v11;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7264 MapsLongTimersList[MapsLongTimers_count].IntervalHalfMins = ((unsigned short)_evt->v12 << 8) + _evt->v11;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7265 if (MapsLongTimersList[MapsLongTimers_count].timer_evt_type == EVENT_Initialize && !(short)v6)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7266 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7267 if (v20)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7268 v18 = pParty->uTimePlayed - v20;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7269 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7270 v18 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7271 v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7272
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7273 if (v26 / 7 / 4 / 12 != 0 && MapsLongTimersList[MapsLongTimers_count].YearsInterval ||
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7274 v26 / 7 / 4 != 0 && MapsLongTimersList[MapsLongTimers_count].MonthsInterval != 0 ||
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7275 v26 / 7 != 0 && MapsLongTimersList[MapsLongTimers_count].WeeksInterval != 0 ||
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7276 v26 != 0 || !v20)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7277 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7278 ++MapsLongTimers_count;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7279 MapsLongTimersList[MapsLongTimers_count].NextStartTime = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7280 continue;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7281 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7282 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7283 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7284 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7285 v8 = (__int64)((double)pParty->uTimePlayed * 0.234375);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7286 seconds = v8 % 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7287 minutes = (v8 / 60) % 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7288 hours = ((v8 / 60) / 60) % 24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7289 days = (((v8 / 60) / 60) / 24) % 7;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7290 weeks = ((((v8 / 60) / 60) / 24) / 7) % 4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7291 months = (((((v8 / 60) / 60) / 24) / 7) / 4) % 12;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7292 years = (((((v8 / 60) / 60) / 24) / 7) / 4) / 12;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7293
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7294 if (MapsLongTimersList[MapsLongTimers_count].YearsInterval)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7295 ++years;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7296 else if (MapsLongTimersList[MapsLongTimers_count].MonthsInterval)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7297 ++months;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7298 else if (MapsLongTimersList[MapsLongTimers_count].WeeksInterval)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7299 ++weeks;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7300 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7301 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7302 ++days;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7303 hours = MapsLongTimersList[MapsLongTimers_count].HoursInterval;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7304 minutes = MapsLongTimersList[MapsLongTimers_count].MinutesInterval;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7305 seconds = MapsLongTimersList[MapsLongTimers_count].SecondsInterval;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7306 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7307 MapsLongTimersList[MapsLongTimers_count].NextStartTime = (signed __int64)((double)((seconds
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7308 + 60 * minutes
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7309 + 3600 * hours
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7310 + 86400 * days
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7311 + 604800 * weeks
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7312 + 2419200 * months
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7313 + 29030400 * years) << 7)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7314 * 0.033333335);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7315
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7316 ++MapsLongTimers_count;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7317 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7318 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7319 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7320 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7321
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7322 //----- (00444360) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7323 void Level_LoadEvtAndStr(const char *pLevelName)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7324 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7325 char pContainerName[120]; // [sp+8h] [bp-98h]@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7326
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7327 sprintf(pContainerName, "%s.evt", pLevelName);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7328 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT.data(), 9216);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7329
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7330 sprintf(pContainerName, "%s.str", pLevelName);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7331 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr.data(), 9216);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7332 if (uLevelStrFileSize)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7333 LoadLevel_InitializeLevelStr();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7334 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7335
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7336 //----- (004452BB) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7337 void sub_4452BB()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7338 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7339 pGUIWindow2->Release();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7340 pGUIWindow2 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7341 activeLevelDecoration = _591094_decoration;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7342 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7343 activeLevelDecoration = nullptr;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7344 pEventTimer->Resume();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7345 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7346
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7347 //----- (0044100D) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7348 bool _44100D_should_alter_right_panel()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7349 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7350 return pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHARACTERS ||
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7351 pCurrentScreen == SCREEN_HOUSE || pCurrentScreen == SCREEN_E ||
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7352 pCurrentScreen == SCREEN_CHANGE_LOCATION || pCurrentScreen == SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_CASTING;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7353 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7354
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7355 //----- (0044987B) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7356 void Transition_StopSound_Autosave(const char *pMapName, MapStartPoint start_point)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7357 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7358 pAudioPlayer->StopChannels(-1, -1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7359 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_None);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7360 if (_stricmp(pCurrentMapName, pMapName))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7361 SaveGame(1, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7362
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7363 uGameState = GAME_STATE_CHANGE_LOCATION;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7364 strcpy(pCurrentMapName, pMapName);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7365 uLevel_StartingPointType = start_point;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7366 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7367 // 6BE35C: using guessed type int uLevel_StartingPointType;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7368
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7369 //----- (004451A8) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7370 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7371 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7372 if (!pGUIWindow2)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7373 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7374 if (pParty->uFlags & 2)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7375 pGame->Draw();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7376 pAudioPlayer->StopChannels(-1, -1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7377 pMiscTimer->Pause();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7378 pEventTimer->Pause();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7379 dword_5C3418 = a1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7380 dword_5C341C = a2;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7381 _591094_decoration = activeLevelDecoration;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7382 pGUIWindow2 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_GreetingNPC, a4, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7383 pGUIWindow2->CreateButton(61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7384 pGUIWindow2->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7385 pGUIWindow2->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7386 pGUIWindow2->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7387 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7388 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7389
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7390
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7391
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7392
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7393 //----- (00448B67) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7394 void OnTimer(int)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7395 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7396 if (pEventTimer->bPaused)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7397 return;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7398
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7399 long long v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7400 if (!v13)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7401 return;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7402
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7403 //uint _v2v3 = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7404 //v3 = HIDWORD(pParty->uTimePlayed);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7405 //v2 = LODWORD(pParty->uTimePlayed);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7406
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7407 _5773B8_event_timer = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7408
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7409 for (uint i = 0; i < MapsLongTimers_count; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7410 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7411 //v4 = (char *)&array_5B5928_timers[0].field_C;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7412 MapsLongTimer* timer = &MapsLongTimersList[i];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7413 //while ( 1 )
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7414 //{
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7415 //v5 = *(short *)v4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7416 if (timer->time_left_to_fire)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7417 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7418 if (v13 < timer->time_left_to_fire)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7419 timer->time_left_to_fire -= v13;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7420 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7421 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7422 timer->time_left_to_fire = timer->IntervalHalfMins;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7423 EventProcessor(timer->timer_evt_ID, 0, 1, timer->timer_evt_seq_num);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7424 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7425 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7426 else
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7427 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7428 if (timer->NextStartTime < pParty->uTimePlayed)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7429 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7430 uint next_trigger_time = 1 * 60 * 60 * 24; // 1 day
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7431 if (timer->YearsInterval)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7432 next_trigger_time = 336 * 60 * 60 * 24; // 1 year
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7433 else if (timer->MonthsInterval)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7434 next_trigger_time = 28 * 60 * 60 * 24; // 1 month
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7435 else if (timer->WeeksInterval)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7436 next_trigger_time = 7 * 60 * 60 * 24; // 1 week
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7437
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7438 timer->NextStartTime += (next_trigger_time * 128) / 3.0f;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7439 if (timer->NextStartTime < pParty->uTimePlayed) // make sure in wont fire several times in a row if big time interval has lapsed
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7440 timer->NextStartTime = pParty->uTimePlayed;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7441
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7442 EventProcessor(timer->timer_evt_ID, 0, 1, timer->timer_evt_seq_num);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7443 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7444 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7445 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7446 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7447
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7448
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7449
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7450
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7451
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7452
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7453
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7454 //----- (0044C28F) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7455 bool TeleportToNWCDungeon()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7456 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7457 if (!_stricmp("nwc.blv", pCurrentMapName))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7458 return false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7459
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7460 _5B65A8_npcdata_uflags_or_other = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7461 _5B65AC_npcdata_fame_or_other = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7462 _5B65B0_npcdata_rep_or_other = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7463 _5B65B4_npcdata_loword_house_or_other = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7464 _5B65B8_npcdata_hiword_house_or_other = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7465 dword_5B65BC = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7466 dword_5B65C0 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7467
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7468 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7469 Transition_StopSound_Autosave("nwc.blv", MapStartPoint_Party);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7470 pCurrentScreen = SCREEN_GAME;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7471 return true;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7472 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7473
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7474 //----- (00401000) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7475 void mm7__vector_constructor(void *a1, int objSize, int numObjs, int(*constructor)(int))
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7476 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7477 void *v4; // esi@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7478
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7479 if (numObjs > 0)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7480 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7481 v4 = a1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7482 for (int i = numObjs; i; --i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7483 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7484 constructor((int)v4);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7485 v4 = (char *)v4 + objSize;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7486 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7487 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7488 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7489
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7490
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7491