annotate Game.cpp @ 2415:f4af3b203f65

LOD.cpp cleaned and search memory corrupt
author Ritor1
date Sun, 20 Jul 2014 22:38:31 +0600
parents 8cee51ce4382
children 99e7bd7ec0a2
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"
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2334
diff changeset
7 #include "mm7_unsorted_subs.h"
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 "CShow.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
16 #include "GammaControl.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
17 #include "stru6.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
18 #include "stru9.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 994
diff changeset
19 #include "stru10.h"
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"
1277
1803172dffd9 header stuff
Grumpy7
parents: 1262
diff changeset
26 #include "Outdoor_stuff.h"
0
Ritor1
parents:
diff changeset
27 #include "Overlays.h"
Ritor1
parents:
diff changeset
28 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
29 #include "LOD.h"
Ritor1
parents:
diff changeset
30 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
31 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
32 #include "VideoPlayer.h"
Ritor1
parents:
diff changeset
33 #include "Bink_Smacker.h"
Ritor1
parents:
diff changeset
34 #include "Events.h"
Ritor1
parents:
diff changeset
35 #include "Arcomage.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 165
diff changeset
36 #include "texts.h"
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
37 #include "GUIFont.h"
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
38 #include "Log.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1214
diff changeset
39 #include "Lights.h"
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1214
diff changeset
40 #include "mm7_data.h"
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
41 #include "MapInfo.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
42 #include "CastSpellInfo.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
43 #include "FrameTableInc.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
44 #include "Actor.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
45 #include "Events2D.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
46 #include "GUIProgressBar.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
47 #include "ObjectList.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
48 #include "Level/Decoration.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
49 #include "PaletteManager.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
50 #include "UI\UIHouses.h"
2350
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2348
diff changeset
51 #include "UI\UIShops.h"
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2348
diff changeset
52 #include "UI\UIPartyCreation.h"
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
53 #include "SaveLoad.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
54 #include "SpriteObject.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
55 #include "mm7.h"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
56 #include "Sprites.h"
2341
d6407efaa4ea Moving registry access stuff to Registry.h/cpp
Grumpy7
parents: 2339
diff changeset
57 #include "Registry.h"
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2341
diff changeset
58 #include "Chest.h"
0
Ritor1
parents:
diff changeset
59
2348
4100fb5c4913 Created header files for UI cpp files
Grumpy7
parents: 2347
diff changeset
60 #include "UI\UIGame.h"
0
Ritor1
parents:
diff changeset
61
Ritor1
parents:
diff changeset
62
Ritor1
parents:
diff changeset
63
Ritor1
parents:
diff changeset
64
Ritor1
parents:
diff changeset
65 Game *pGame;
Ritor1
parents:
diff changeset
66
Ritor1
parents:
diff changeset
67
Ritor1
parents:
diff changeset
68
Ritor1
parents:
diff changeset
69
Ritor1
parents:
diff changeset
70
Ritor1
parents:
diff changeset
71 //----- (00435694) --------------------------------------------------------
Ritor1
parents:
diff changeset
72 void Game::ToggleFlags2(unsigned int uFlag)
Ritor1
parents:
diff changeset
73 {
Ritor1
parents:
diff changeset
74 unsigned int v2; // eax@1
Ritor1
parents:
diff changeset
75
Ritor1
parents:
diff changeset
76 v2 = this->uFlags2;
Ritor1
parents:
diff changeset
77 if ( v2 & uFlag )
Ritor1
parents:
diff changeset
78 this->uFlags2 = v2 & ~uFlag;
Ritor1
parents:
diff changeset
79 else
Ritor1
parents:
diff changeset
80 this->uFlags2 = uFlag | v2;
Ritor1
parents:
diff changeset
81 }
Ritor1
parents:
diff changeset
82
Ritor1
parents:
diff changeset
83 //----- (0044103C) --------------------------------------------------------
Ritor1
parents:
diff changeset
84 void Game::Draw()
Ritor1
parents:
diff changeset
85 {
Ritor1
parents:
diff changeset
86 int v4; // edi@26
Ritor1
parents:
diff changeset
87
1556
e668660457dc Some more cleaning
Nomad
parents: 1545
diff changeset
88 uFlags2 &= ~0x02;
0
Ritor1
parents:
diff changeset
89 if ( pParty->_497FC5_check_party_perception_against_level() )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2259
diff changeset
90 uFlags2 |= 2;
1638
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1556
diff changeset
91
1640
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
92 pGame->pIndoorCameraD3D->sRotationX = pParty->sRotationX;
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
93 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY;
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
94 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
95 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
96 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
97
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1556
diff changeset
98 //pIndoorCamera->Initialize2();
1642
8971dc85b8fb More camera unifications.
Nomad
parents: 1640
diff changeset
99 pIndoorCameraD3D->CalculateRotations(pParty->sRotationX, pParty->sRotationY);
0
Ritor1
parents:
diff changeset
100 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
Ritor1
parents:
diff changeset
101 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
Ritor1
parents:
diff changeset
102
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
103 if ( pMovie_Track )
0
Ritor1
parents:
diff changeset
104 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
105 /*if ( !pRenderer->pRenderD3D )
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
106 {
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
107 pRenderer->BeginSceneD3D();
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
108 pMouse->DrawCursorToTarget();
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
109 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
110 }*/
0
Ritor1
parents:
diff changeset
111 }
Ritor1
parents:
diff changeset
112 else
Ritor1
parents:
diff changeset
113 {
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
114 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
115 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel )
0
Ritor1
parents:
diff changeset
116 pParty->uFlags |= 2u;
847
e398541aee60 fixed party save position
Gloval
parents: 831
diff changeset
117 pParty->vPrevPosition.x = pParty->vPosition.x;
78
d56c13146285 Rotate fixed correct
Ritor1
parents: 77
diff changeset
118 pParty->vPrevPosition.y = pParty->vPosition.y;
847
e398541aee60 fixed party save position
Gloval
parents: 831
diff changeset
119 pParty->vPrevPosition.z = pParty->vPosition.z;
0
Ritor1
parents:
diff changeset
120 //v0 = &pRenderer;
Ritor1
parents:
diff changeset
121 pParty->sPrevRotationY = pParty->sRotationY;
Ritor1
parents:
diff changeset
122 pParty->sPrevRotationX = pParty->sRotationX;
847
e398541aee60 fixed party save position
Gloval
parents: 831
diff changeset
123
0
Ritor1
parents:
diff changeset
124 pParty->sPrevEyelevel = pParty->sEyelevel;
Ritor1
parents:
diff changeset
125 pRenderer->BeginSceneD3D();
Ritor1
parents:
diff changeset
126
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
127 //if ( !pRenderer->pRenderD3D )
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
128 //pMouse->DrawCursorToTarget();
265
96bc024a5fed Render overflows
Nomad
parents: 227
diff changeset
129 if ( !PauseGameDrawing() || viewparams->field_48 == 1 )
0
Ritor1
parents:
diff changeset
130 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
131 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
132 {
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
133 float v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0;
0
Ritor1
parents:
diff changeset
134 //v3 = v2 + 6.7553994e15;
Ritor1
parents:
diff changeset
135 //pRenderer->field_1036A8_bitmapid = LODWORD(v3);
265
96bc024a5fed Render overflows
Nomad
parents: 227
diff changeset
136 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f);
0
Ritor1
parents:
diff changeset
137 }
Ritor1
parents:
diff changeset
138
Ritor1
parents:
diff changeset
139 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
140 pIndoor->Draw();
Ritor1
parents:
diff changeset
141 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
142 pOutdoor->Draw();
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1507
diff changeset
143 else Error("Invalid level type: %u", uCurrentlyLoadedLevelType);
0
Ritor1
parents:
diff changeset
144
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
145 //if (pRenderer->pRenderD3D)
0
Ritor1
parents:
diff changeset
146 {
Ritor1
parents:
diff changeset
147 pDecalBuilder->DrawBloodsplats();
1394
8ea496564034 Some LightmapBuilder renames.
Nomad
parents: 1391
diff changeset
148 pGame->pLightmapBuilder->DrawLightmapsType(2);
0
Ritor1
parents:
diff changeset
149 }
Ritor1
parents:
diff changeset
150 }
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
151 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
0
Ritor1
parents:
diff changeset
152 }
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
153
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
154 //DEBUG: force redraw gui
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
155 viewparams->bRedrawGameUI = true;
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
156
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
157
0
Ritor1
parents:
diff changeset
158 pRenderer->BeginScene();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
159 //if (pRenderer->pRenderD3D)
0
Ritor1
parents:
diff changeset
160 pMouse->DrawCursorToTarget();
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
161 if (pOtherOverlayList->bRedraw)
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
162 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
163 v4 = viewparams->bRedrawGameUI;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
164 GameUI_Footer();
0
Ritor1
parents:
diff changeset
165 if (!viewparams->bRedrawGameUI)
Ritor1
parents:
diff changeset
166 GameUI_DrawRightPanelItems();
Ritor1
parents:
diff changeset
167 else
Ritor1
parents:
diff changeset
168 {
Ritor1
parents:
diff changeset
169 GameUI_DrawRightPanelFrames();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
170 GameUI_Footer_2();
0
Ritor1
parents:
diff changeset
171 viewparams->bRedrawGameUI = false;
Ritor1
parents:
diff changeset
172 }
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
173 if (!pMovie_Track)//!pVideoPlayer->pSmackerMovie)
0
Ritor1
parents:
diff changeset
174 {
2070
4231fdf46dde Minimap's drawing
Nomad
parents: 2069
diff changeset
175 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true);//redraw = pParty->uFlags & 2);
0
Ritor1
parents:
diff changeset
176 if (v4)
Ritor1
parents:
diff changeset
177 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
178 if ( !PauseGameDrawing() /*&& pRenderer->pRenderD3D*/) // clear game viewport with transparent color
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
179 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pViewport->uViewportBR_X - pViewport->uViewportTL_X,
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
180 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
181 0x7FF);
0
Ritor1
parents:
diff changeset
182 viewparams->field_48 = 0;
Ritor1
parents:
diff changeset
183 }
Ritor1
parents:
diff changeset
184 }
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
185
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
186 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw;
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
187 pOtherOverlayList->bRedraw = 0;
8b8fd4d83fdc Various things here and there
Nomad
parents: 137
diff changeset
188
0
Ritor1
parents:
diff changeset
189 GameUI_DrawPartySpells();
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 271
diff changeset
190 if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C )
994
3431f6abc786 GameUI clean
Nomad
parents: 983
diff changeset
191 GameUI_DrawHiredNPCs();
0
Ritor1
parents:
diff changeset
192 GameUI_DrawPortraits(v4);
Ritor1
parents:
diff changeset
193 GameUI_DrawLifeManaBars();
Ritor1
parents:
diff changeset
194 GameUI_DrawCharacterSelectionFrame();
2205
db94443ea4e7 _44100D_should_alter_right_panel()
Ritor1
parents: 2202
diff changeset
195 if ( _44100D_should_alter_right_panel() )
994
3431f6abc786 GameUI clean
Nomad
parents: 983
diff changeset
196 GameUI_DrawRightPanel();
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
197 if ( !pMovie_Track )
0
Ritor1
parents:
diff changeset
198 {
Ritor1
parents:
diff changeset
199 pStru6Instance->DrawPlayerBuffAnims();
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 484
diff changeset
200 pOtherOverlayList->DrawTurnBasedIcon(v4);
0
Ritor1
parents:
diff changeset
201 GameUI_DrawTorchlightAndWizardEye();
Ritor1
parents:
diff changeset
202 }
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
203
794
Nomad
parents: 791
diff changeset
204
Nomad
parents: 791
diff changeset
205 static bool render_framerate = false;
Nomad
parents: 791
diff changeset
206 static float framerate = 0.0f;
Nomad
parents: 791
diff changeset
207 static uint frames_this_second = 0;
Nomad
parents: 791
diff changeset
208 static uint last_frame_time = GetTickCount();
Nomad
parents: 791
diff changeset
209 static uint framerate_time_elapsed = 0;
2123
de5cdcb03fda sky for snow
Ritor1
parents: 2122
diff changeset
210 if ( pCurrentScreen == SCREEN_GAME && uCurrentlyLoadedLevelType == LEVEL_Outdoor)
2122
5b654c03a11e for snow in house
Ritor1
parents: 2121
diff changeset
211 pWeather->Draw();//Ritor1: my include
794
Nomad
parents: 791
diff changeset
212
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
213 uint frame_dt = GetTickCount() - last_frame_time;
794
Nomad
parents: 791
diff changeset
214 last_frame_time = GetTickCount();
Nomad
parents: 791
diff changeset
215
Nomad
parents: 791
diff changeset
216 framerate_time_elapsed += frame_dt;
Nomad
parents: 791
diff changeset
217 if (framerate_time_elapsed >= 1000)
Nomad
parents: 791
diff changeset
218 {
Nomad
parents: 791
diff changeset
219 framerate = frames_this_second * (1000.0f / framerate_time_elapsed);
Nomad
parents: 791
diff changeset
220
Nomad
parents: 791
diff changeset
221 framerate_time_elapsed = 0;
Nomad
parents: 791
diff changeset
222 frames_this_second = 0;
Nomad
parents: 791
diff changeset
223 render_framerate = true;
Nomad
parents: 791
diff changeset
224 }
Nomad
parents: 791
diff changeset
225
Nomad
parents: 791
diff changeset
226 ++frames_this_second;
Nomad
parents: 791
diff changeset
227
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
228 if ( debug_information )
794
Nomad
parents: 791
diff changeset
229 {
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
230 if (render_framerate)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
231 {
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
232 sprintf(pTmpBuf.data(), "FPS: % .4f", framerate);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
233 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
234 }
794
Nomad
parents: 791
diff changeset
235
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
236 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
237 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
238 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
239 sprintf(pTmpBuf.data(), "Party Sector ID: %u/%u\n", sector_id, pIndoor->uNumSectors);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
240 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
241 }
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
242 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
243 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
244
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
245 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
246 {
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
247 uint uFaceID;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
248 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
249 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
250 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
251 }
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1477
diff changeset
252 else
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 int on_water, _a6;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
255 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
256 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
257 }
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
258 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
259 }
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
260
0
Ritor1
parents:
diff changeset
261 GUI_UpdateWindows();
130
1c471f3629fb Party expressions update
Nomad
parents: 121
diff changeset
262 pParty->UpdatePlayersAndHirelingsEmotions();
937
ae747684f644 stru279 removed.
Nomad
parents: 872
diff changeset
263
434
137c59c3dbc4 Temple of Moon and Dragon Lair can now be entered.
Nomad
parents: 378
diff changeset
264 _unused_5B5924_is_travel_ui_drawn = false;
0
Ritor1
parents:
diff changeset
265 if (v4)
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 783
diff changeset
266 pMouse->bRedraw = true;
2216
3f375342de12 window->GetWidth() continue
Ritor1
parents: 2215
diff changeset
267 pMouse->ReadCursorWithItem();
0
Ritor1
parents:
diff changeset
268 pMouse->DrawCursor();
2216
3f375342de12 window->GetWidth() continue
Ritor1
parents: 2215
diff changeset
269 pMouse->Activate();
0
Ritor1
parents:
diff changeset
270 pRenderer->EndScene();
Ritor1
parents:
diff changeset
271 pRenderer->Present();
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 484
diff changeset
272 pParty->uFlags &= ~2;
0
Ritor1
parents:
diff changeset
273 }
Ritor1
parents:
diff changeset
274
Ritor1
parents:
diff changeset
275 //----- (0047A815) --------------------------------------------------------
Ritor1
parents:
diff changeset
276 void Game::DrawParticles()
Ritor1
parents:
diff changeset
277 {
Ritor1
parents:
diff changeset
278 pParticleEngine->Draw();
Ritor1
parents:
diff changeset
279 }
Ritor1
parents:
diff changeset
280
Ritor1
parents:
diff changeset
281 //----- (00463149) --------------------------------------------------------
Ritor1
parents:
diff changeset
282 void Game::Loop()
Ritor1
parents:
diff changeset
283 {
Ritor1
parents:
diff changeset
284 const char *pLocationName; // [sp-4h] [bp-68h]@74
Ritor1
parents:
diff changeset
285 bool bLoading; // [sp+10h] [bp-54h]@1
Ritor1
parents:
diff changeset
286 signed int v16; // [sp+14h] [bp-50h]@8
Ritor1
parents:
diff changeset
287 MSG Msg; // [sp+28h] [bp-3Ch]@20
Ritor1
parents:
diff changeset
288 char Source[64]; // [sp+44h] [bp-20h]@76
Ritor1
parents:
diff changeset
289
2006
30c2b575d25c signed fixes
zipi
parents: 1994
diff changeset
290 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu;
0
Ritor1
parents:
diff changeset
291 SetCurrentMenuID((MENU_STATE)-1);
2126
a2da7afb41b4 fix for previous commit load error
zipi
parents: 2124
diff changeset
292 if (bLoading)
0
Ritor1
parents:
diff changeset
293 {
Ritor1
parents:
diff changeset
294 pParty->Reset();
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
295 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
296 LoadGame(uLoadGameUI_SelectedSlot);
Ritor1
parents:
diff changeset
297 }
Ritor1
parents:
diff changeset
298
Ritor1
parents:
diff changeset
299 for (uint i = 1; i < 5; ++i)
Ritor1
parents:
diff changeset
300 for (uint j = 1; j < 6; ++j)
Ritor1
parents:
diff changeset
301 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
302 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
303 remove(pTmpBuf.data());
0
Ritor1
parents:
diff changeset
304 }
Ritor1
parents:
diff changeset
305
Ritor1
parents:
diff changeset
306 LoadPlayerPortraintsAndVoices();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
307 pIcons_LOD->_inlined_sub1();
328
8e23edf57e27 little fix
Ritor1
parents: 323
diff changeset
308 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
0
Ritor1
parents:
diff changeset
309
Ritor1
parents:
diff changeset
310 while ( 2 )
Ritor1
parents:
diff changeset
311 {
Ritor1
parents:
diff changeset
312 v16 = 1;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
313 pMessageQueue_50CBD0->Flush();
0
Ritor1
parents:
diff changeset
314
Ritor1
parents:
diff changeset
315 pPartyActionQueue->uNumActions = 0;
Ritor1
parents:
diff changeset
316 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
317 {
Ritor1
parents:
diff changeset
318 pTurnEngine->End(false);
Ritor1
parents:
diff changeset
319 pParty->bTurnBasedModeOn = false;
Ritor1
parents:
diff changeset
320 }
Ritor1
parents:
diff changeset
321 DoPrepareWorld(bLoading, 1);
Ritor1
parents:
diff changeset
322 pEventTimer->Resume();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
323 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
0
Ritor1
parents:
diff changeset
324 // 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
325 pCurrentScreen = SCREEN_GAME;
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
326
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
327 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
328 pGame->pVisInstance->_4C1A02();
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
329
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
330 bool game_finished = false;
0
Ritor1
parents:
diff changeset
331 do
Ritor1
parents:
diff changeset
332 {
Ritor1
parents:
diff changeset
333 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) )
Ritor1
parents:
diff changeset
334 {
Ritor1
parents:
diff changeset
335 if ( Msg.message == WM_QUIT )
Ritor1
parents:
diff changeset
336 Game_DeinitializeAndTerminate(0);
Ritor1
parents:
diff changeset
337 TranslateMessage(&Msg);
Ritor1
parents:
diff changeset
338 DispatchMessageA(&Msg);
Ritor1
parents:
diff changeset
339 }
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
340 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
0
Ritor1
parents:
diff changeset
341 {
Ritor1
parents:
diff changeset
342 WaitMessage();
Ritor1
parents:
diff changeset
343 continue;
Ritor1
parents:
diff changeset
344 }
Ritor1
parents:
diff changeset
345 pGame->_44EEA7();
Ritor1
parents:
diff changeset
346 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
347 Keyboard::ProcessInputActions();
0
Ritor1
parents:
diff changeset
348 GameUI_MsgProc();
Ritor1
parents:
diff changeset
349 if ( pArcomageGame->bGameInProgress )
Ritor1
parents:
diff changeset
350 {
Ritor1
parents:
diff changeset
351 ArcomageGame::Loop();
Ritor1
parents:
diff changeset
352 pRenderer->Present();
Ritor1
parents:
diff changeset
353 continue;
Ritor1
parents:
diff changeset
354 }
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1642
diff changeset
355
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1642
diff changeset
356 pVideoPlayer->_inlined_in_463149();
983
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
357
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
358 pEventTimer->Update();
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
359 pMiscTimer->Update();
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
360
0
Ritor1
parents:
diff changeset
361 OnTimer(0);
Ritor1
parents:
diff changeset
362 GameUI_StatusBar_UpdateTimedString(0);
Ritor1
parents:
diff changeset
363 if ( pMiscTimer->bPaused && !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
364 pMiscTimer->Resume();
Ritor1
parents:
diff changeset
365 if ( pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn )
Ritor1
parents:
diff changeset
366 pEventTimer->bTackGameTime = 0;
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
367 if ( !pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING)
0
Ritor1
parents:
diff changeset
368 {
Ritor1
parents:
diff changeset
369 if ( !pEventTimer->bTackGameTime )
Ritor1
parents:
diff changeset
370 _494035_timed_effects__water_walking_damage__etc();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
371
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
372 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001)
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
373 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001;
0
Ritor1
parents:
diff changeset
374 else
Ritor1
parents:
diff changeset
375 {
2338
1e865e8690ba Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents: 2336
diff changeset
376 Actor::UpdateActorAI();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
377 UpdateUserInput_and_MapSpecificStuff();
0
Ritor1
parents:
diff changeset
378 }
Ritor1
parents:
diff changeset
379 }
Ritor1
parents:
diff changeset
380 if ( v16 )
Ritor1
parents:
diff changeset
381 {
Ritor1
parents:
diff changeset
382 v16 = 0;
Ritor1
parents:
diff changeset
383 viewparams->bRedrawGameUI = true;
Ritor1
parents:
diff changeset
384 }
378
50875632e776 AudioPlayer::UpdateSounds (004AAFCF) take 1
Nomad
parents: 328
diff changeset
385 pAudioPlayer->UpdateSounds();
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
386 if ( (signed int)uGameState == GAME_STATE_PLAYING )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
387 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
388 pGame->Draw();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
389 continue;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
390 }
978
9334a8c59c8d uGameState
Ritor1
parents: 961
diff changeset
391 if (uGameState == GAME_FINISHED)
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 0
diff changeset
392 {
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
393 game_finished = true;
0
Ritor1
parents:
diff changeset
394 continue;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 0
diff changeset
395 }
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
396 if (uGameState == GAME_STATE_CHANGE_LOCATION)// смена локации
0
Ritor1
parents:
diff changeset
397 {
Ritor1
parents:
diff changeset
398 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
399 PrepareWorld(0);
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
400 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
401 continue;
Ritor1
parents:
diff changeset
402 }
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2131
diff changeset
403 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
404 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
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_FINAL_WINDOW )
0
Ritor1
parents:
diff changeset
409 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
410 pRenderer->BeginScene();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
411 GUI_UpdateWindows();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
412 pRenderer->EndScene();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
413 pRenderer->Present();
0
Ritor1
parents:
diff changeset
414 continue;
Ritor1
parents:
diff changeset
415 }
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
416 if ( uGameState != GAME_STATE_PARTY_DIED )
0
Ritor1
parents:
diff changeset
417 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
418 pGame->Draw();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
419 continue;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
420 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
421 if ( uGameState == GAME_STATE_PARTY_DIED )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
422 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
423 pAudioPlayer->StopChannels(-1, -1);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
424 memset(&pParty->pHirelings[0], 0, 0x4Cu);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
425 memset(&pParty->pHirelings[1], 0, 0x4Cu);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
426 for ( int i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i )
0
Ritor1
parents:
diff changeset
427 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
428 if ( pNPCStats->pNewNPCData[i].field_24 )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
429 pNPCStats->pNewNPCData[i].uFlags &= 0xFFFFFF7Fu;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
430 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
431 pVideoPlayer->PlayDeathMovie();
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2389
diff changeset
432 if ( pMovie_Track )
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
433 pVideoPlayer->Unload();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
434 SaveGame(0, 0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
435 ++pParty->uNumDeaths;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
436 for ( uint i = 0; i < 4; ++i )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
437 pParty->pPlayers[i].SetVariable(VAR_Award, 85);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
438 pParty->days_played_without_rest = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
439 pParty->uTimePlayed += 0x276000ui64;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
440 LOWORD(pParty->uFlags) &= ~0x204;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
441 pParty->SetGold(0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
442 pOtherOverlayList->Reset();
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
443 memset(pParty->pPartyBuffs.data(), 0, 0x140u);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
444
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
445 if ( pParty->bTurnBasedModeOn == 1 )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
446 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
447 pTurnEngine->End(true);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
448 pParty->bTurnBasedModeOn = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
449 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
450 for( int i = 0; i < 4; ++i)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
451 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
452 memset(pParty->pPlayers[i].pConditions.data(), 0, 0xA0u);//(pConditions, 0, 160)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
453 memset(pParty->pPlayers[i].pPlayerBuffs.data(), 0, 0x180u);//(pPlayerBuffs[0], 0, 384)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
454 pParty->pPlayers[i].sHealth = 1;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
455 uActiveCharacter = 1;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
456 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
457 if (_449B57_test_bit(pParty->_quest_bits, PARTY_QUEST_FINISHED_EMERALD_ISLE))
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
458 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
459 pParty->vPosition.x = -17331; // respawn in harmondale
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
460 pParty->vPosition.y = 12547;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
461 pParty->vPosition.z = 465;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
462 pParty->sRotationY = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
463 pLocationName = "out02.odm";
0
Ritor1
parents:
diff changeset
464 }
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
465 else
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
466 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
467 pParty->vPosition.x = 12552; // respawn on emerald isle
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
468 pParty->vPosition.y = 1816;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
469 pParty->vPosition.z = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
470 pParty->sRotationY = 512;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
471 pLocationName = "out01.odm";
0
Ritor1
parents:
diff changeset
472 }
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
473 strcpy(Source, pLocationName);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
474 pParty->uFallStartY = pParty->vPosition.z;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
475 pParty->sRotationX = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
476 pParty->uFallSpeed = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
477 pParty->field_6E4 = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
478 pParty->field_6E0 = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
479 if ( _stricmp(Source, pCurrentMapName) )
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
480 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
481 strcpy(pCurrentMapName, Source);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
482 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
483 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
484 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
485 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
486 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
487 dword_5B65C0 = 1;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
488 PrepareWorld(1);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
489 }
2338
1e865e8690ba Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents: 2336
diff changeset
490 Actor::InitializeActors();
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 978
diff changeset
491
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
492 int num_conscious_players = 0;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
493 int conscious_players_ids[4] = {-1, -1, -1, -1};
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
494 for (int i = 0; i < 4; ++i)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
495 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
496 if (pParty->pPlayers[i].CanAct())
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
497 conscious_players_ids[num_conscious_players++] = i;
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
498 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
499 if (num_conscious_players)
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
500 {
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
501 int idx = conscious_players_ids[rand() % num_conscious_players];
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
502 Assert(idx >= 0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
503 pParty->pPlayers[idx].PlaySound(SPEECH_99, 0);
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
504 }
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
505
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
506 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2);// "Once again you've cheated death!.." "Вы снова обхитрили смерть! …"
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
507 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
508 }
Ritor1
parents:
diff changeset
509 }
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
510 while (!game_finished);
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
511
0
Ritor1
parents:
diff changeset
512 pEventTimer->Pause();
Ritor1
parents:
diff changeset
513 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
1214
0d6c7ff3cddd simplified stru193_math constructor and class definition
Grumpy7
parents: 1205
diff changeset
514 if ( uGameState == GAME_STATE_LOADING_GAME )
0
Ritor1
parents:
diff changeset
515 {
Ritor1
parents:
diff changeset
516 sub_491E3A();
Ritor1
parents:
diff changeset
517 LoadPlayerPortraintsAndVoices();
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
518 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
519 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
Ritor1
parents:
diff changeset
520 bLoading = true;
Ritor1
parents:
diff changeset
521 continue;
Ritor1
parents:
diff changeset
522 }
Ritor1
parents:
diff changeset
523 break;
Ritor1
parents:
diff changeset
524 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
525 pCurrentScreen = SCREEN_VIDEO;
0
Ritor1
parents:
diff changeset
526 sub_491E3A();
Ritor1
parents:
diff changeset
527 }
Ritor1
parents:
diff changeset
528
Ritor1
parents:
diff changeset
529
Ritor1
parents:
diff changeset
530 //----- (0044F192) --------------------------------------------------------
Ritor1
parents:
diff changeset
531 void Game::PrepareBloodsplats()
Ritor1
parents:
diff changeset
532 {
Ritor1
parents:
diff changeset
533 for (uint i = 0; i < uNumBloodsplats; ++i)
Ritor1
parents:
diff changeset
534 {
2210
Ritor1
parents: 2205
diff changeset
535 pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z,
Ritor1
parents: 2205
diff changeset
536 pBloodsplats[i].radius, pBloodsplats[i].r, pBloodsplats[i].g, pBloodsplats[i].b);
0
Ritor1
parents:
diff changeset
537 }
Ritor1
parents:
diff changeset
538 }
Ritor1
parents:
diff changeset
539
Ritor1
parents:
diff changeset
540
Ritor1
parents:
diff changeset
541 //----- (0044F120) --------------------------------------------------------
Ritor1
parents:
diff changeset
542 void Game::PushStationaryLights(int a2)
Ritor1
parents:
diff changeset
543 {
1094
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
544 Game__StationaryLight* pLight;
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
545
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
546 for( int i=0; i<uNumStationaryLights; ++i )
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
547 {
c40d40027b77 npc some clean
Gloval
parents: 1063
diff changeset
548 pLight=&pStationaryLights[i];
2210
Ritor1
parents: 2205
diff changeset
549 pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z,
Ritor1
parents: 2205
diff changeset
550 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
551 }
0
Ritor1
parents:
diff changeset
552 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
553 // 4E94D0: using guessed type char _4E94D0_light_type;
0
Ritor1
parents:
diff changeset
554
Ritor1
parents:
diff changeset
555 //----- (0044F0FD) --------------------------------------------------------
Ritor1
parents:
diff changeset
556 void Game::_44F0FD()
Ritor1
parents:
diff changeset
557 {
Ritor1
parents:
diff changeset
558 ToggleFlags(0x40u);
Ritor1
parents:
diff changeset
559
Ritor1
parents:
diff changeset
560 if ( !(uFlags & 0x40) )
Ritor1
parents:
diff changeset
561 {
Ritor1
parents:
diff changeset
562 uNumBloodsplats = 0;
Ritor1
parents:
diff changeset
563 field_E0C = 0;
Ritor1
parents:
diff changeset
564 }
Ritor1
parents:
diff changeset
565 }
Ritor1
parents:
diff changeset
566
Ritor1
parents:
diff changeset
567 //----- (0044F0D8) --------------------------------------------------------
Ritor1
parents:
diff changeset
568 void Game::ToggleFlags(uint uMask)
Ritor1
parents:
diff changeset
569 {
Ritor1
parents:
diff changeset
570 if (uFlags & uMask)
Ritor1
parents:
diff changeset
571 uFlags &= ~uMask;
Ritor1
parents:
diff changeset
572 else
Ritor1
parents:
diff changeset
573 uFlags |= uMask;
Ritor1
parents:
diff changeset
574 }
Ritor1
parents:
diff changeset
575
Ritor1
parents:
diff changeset
576
Ritor1
parents:
diff changeset
577 //----- (0044F07B) --------------------------------------------------------
Ritor1
parents:
diff changeset
578 bool Game::_44F07B()
Ritor1
parents:
diff changeset
579 {
2210
Ritor1
parents: 2205
diff changeset
580 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
Ritor1
parents: 2205
diff changeset
581 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
0
Ritor1
parents:
diff changeset
582 pKeyboardInstance->WasKeyPressed(VK_F11)))
Ritor1
parents:
diff changeset
583 return true;
Ritor1
parents:
diff changeset
584 return false;
Ritor1
parents:
diff changeset
585 }
Ritor1
parents:
diff changeset
586
Ritor1
parents:
diff changeset
587 //----- (0044EEA7) --------------------------------------------------------
Ritor1
parents:
diff changeset
588 bool Game::_44EEA7()
Ritor1
parents:
diff changeset
589 {
Ritor1
parents:
diff changeset
590 //Game *v1; // esi@1
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
591 //double v2; // st7@2
0
Ritor1
parents:
diff changeset
592 float depth; // ST00_4@9
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
593 //bool result; // eax@9
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
594 //unsigned int v5; // eax@14
0
Ritor1
parents:
diff changeset
595 __int64 v6; // kr00_8@21
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
596 //unsigned int y; // [sp+4h] [bp-24h]@2
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
597 //unsigned int x; // [sp+8h] [bp-20h]@2
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
598 Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
599 Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
600 POINT cursor; // [sp+20h] [bp-8h]@1
0
Ritor1
parents:
diff changeset
601
Ritor1
parents:
diff changeset
602 //v1 = this;
Ritor1
parents:
diff changeset
603 ++qword_5C6DF0;
Ritor1
parents:
diff changeset
604 pParticleEngine->UpdateParticles();
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
605 pMouseInstance->GetCursorPos(&cursor);
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
606
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
607 //x = cursor.y;
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
608 //y = cursor.x;
0
Ritor1
parents:
diff changeset
609 if ( sub_4637E0_is_there_popup_onscreen() )
Ritor1
parents:
diff changeset
610 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
611 v11 = &vis_face_filter;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
612 v10 = &vis_sprite_filter_2;
871
710cf848ad24 Particle engine made working.
Nomad
parents: 831
diff changeset
613 depth = pGame->pIndoorCameraD3D->GetPickDepth();
0
Ritor1
parents:
diff changeset
614 }
Ritor1
parents:
diff changeset
615 else
Ritor1
parents:
diff changeset
616 {
592
96f48cfdd657 some flags
Nomad
parents: 569
diff changeset
617 if ( uFlags2 & GAME_FLAGS_2_TARGETING_MODE )
0
Ritor1
parents:
diff changeset
618 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
619 v11 = &vis_face_filter;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
620 v10 = &vis_sprite_filter_1;
0
Ritor1
parents:
diff changeset
621 }
Ritor1
parents:
diff changeset
622 else
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_4;
0
Ritor1
parents:
diff changeset
626 }
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
627 depth = 5120.0;
0
Ritor1
parents:
diff changeset
628 }
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
629 //depth = v2;
0
Ritor1
parents:
diff changeset
630
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
631 PickMouse(depth, cursor.x, cursor.y, false, v10, v11);
0
Ritor1
parents:
diff changeset
632 pLightmapBuilder->std__vector_000004_size = 0;
Ritor1
parents:
diff changeset
633 pLightmapBuilder->std__vector_183808_size = 0;
Ritor1
parents:
diff changeset
634 pDecalBuilder->std__vector_pDecals_size = 0;
Ritor1
parents:
diff changeset
635 pDecalBuilder->field_308008 = 0;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
636 if (!_44F07B())
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
637 return false;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
638
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 638
diff changeset
639 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
794
Nomad
parents: 791
diff changeset
640 pStru10Instance->bDoNotDrawPortalFrustum = false;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
641 if ( /*pRenderer->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor)
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
642 pRenderer->uFogColor = GetLevelFogColor() & 0xFFFFFF;
0
Ritor1
parents:
diff changeset
643 if (uFlags & 0x0400)
Ritor1
parents:
diff changeset
644 uFlags2 |= 0x01;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
645 /*if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive )
0
Ritor1
parents:
diff changeset
646 {
Ritor1
parents:
diff changeset
647 uFlags2 |= 0x01;
Ritor1
parents:
diff changeset
648 field_E10 = qword_5C6DF0;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
649 }*/
0
Ritor1
parents:
diff changeset
650 v6 = qword_5C6DF0 - field_E10;
Ritor1
parents:
diff changeset
651 if ( qword_5C6DF0 - field_E10 == 1 )
Ritor1
parents:
diff changeset
652 uFlags2 |= v6;
Ritor1
parents:
diff changeset
653 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive )
Ritor1
parents:
diff changeset
654 {
2210
Ritor1
parents: 2205
diff changeset
655 uFlags2 |= 1;
0
Ritor1
parents:
diff changeset
656 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive;
Ritor1
parents:
diff changeset
657 }
Ritor1
parents:
diff changeset
658 _44E904();
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
659 return true;
0
Ritor1
parents:
diff changeset
660 }
Ritor1
parents:
diff changeset
661
Ritor1
parents:
diff changeset
662
Ritor1
parents:
diff changeset
663 //----- (0044EDE4) --------------------------------------------------------
2006
30c2b575d25c signed fixes
zipi
parents: 1994
diff changeset
664 bool Game::AlterGamma_BLV(BLVFace *pFace, signed int *pColor)
0
Ritor1
parents:
diff changeset
665 {
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
666 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
667 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
0
Ritor1
parents:
diff changeset
668 {
Ritor1
parents:
diff changeset
669 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
Ritor1
parents:
diff changeset
670 return true;
Ritor1
parents:
diff changeset
671 }
Ritor1
parents:
diff changeset
672 else
Ritor1
parents:
diff changeset
673 return false;
Ritor1
parents:
diff changeset
674 }
Ritor1
parents:
diff changeset
675
Ritor1
parents:
diff changeset
676 //----- (0044EE30) --------------------------------------------------------
2006
30c2b575d25c signed fixes
zipi
parents: 1994
diff changeset
677 bool Game::AlterGamma_ODM(ODMFace *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 {
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 621
diff changeset
682 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
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
Ritor1
parents:
diff changeset
690 //----- (004645FA) --------------------------------------------------------
Ritor1
parents:
diff changeset
691 void Game::Deinitialize()
Ritor1
parents:
diff changeset
692 {
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
693 WriteWindowsRegistryInt("startinwindow", 1);//pRenderer->bWindowMode);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
694 //if (pRenderer->bWindowMode)
0
Ritor1
parents:
diff changeset
695 {
2052
71a814f4482a Moved implementation to cpp
Nomad
parents: 2044
diff changeset
696 WriteWindowsRegistryInt("window X", window->GetX());
71a814f4482a Moved implementation to cpp
Nomad
parents: 2044
diff changeset
697 WriteWindowsRegistryInt("window Y", window->GetY());
1984
b00f5bb7d930 Added back window position saving
zipi
parents: 1980
diff changeset
698 }
0
Ritor1
parents:
diff changeset
699 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
Ritor1
parents:
diff changeset
700 pItemsTable->Release();
Ritor1
parents:
diff changeset
701 pNPCStats->Release();
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
702
0
Ritor1
parents:
diff changeset
703 if (pMouse)
Ritor1
parents:
diff changeset
704 pMouse->Deactivate();
Ritor1
parents:
diff changeset
705
1093
c59ac5ea63f5 * stru154::GetFacePlane mistake fixed
zipi
parents: 1063
diff changeset
706 delete pRenderer;
0
Ritor1
parents:
diff changeset
707 pAudioPlayer->Release();//error
Ritor1
parents:
diff changeset
708 pNew_LOD->FreeSubIndexAndIO();
Ritor1
parents:
diff changeset
709 pGames_LOD->FreeSubIndexAndIO();
Ritor1
parents:
diff changeset
710 ClipCursor(0);
Ritor1
parents:
diff changeset
711 Game::Destroy();
Ritor1
parents:
diff changeset
712 }
Ritor1
parents:
diff changeset
713
Ritor1
parents:
diff changeset
714 //----- (0044EE7C) --------------------------------------------------------
Ritor1
parents:
diff changeset
715 bool Game::draw_debug_outlines()
Ritor1
parents:
diff changeset
716 {
Ritor1
parents:
diff changeset
717 if (uFlags & 0x04)
Ritor1
parents:
diff changeset
718 {
Ritor1
parents:
diff changeset
719 pLightmapBuilder->DrawDebugOutlines(-1);
Ritor1
parents:
diff changeset
720 pDecalBuilder->DrawDecalDebugOutlines();
Ritor1
parents:
diff changeset
721 }
Ritor1
parents:
diff changeset
722 return true;
Ritor1
parents:
diff changeset
723 }
Ritor1
parents:
diff changeset
724
Ritor1
parents:
diff changeset
725 //----- (0044EC23) --------------------------------------------------------
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
726 int Game::_44EC23(struct Polygon *a2, int *a3, signed int a4)
0
Ritor1
parents:
diff changeset
727 {
Ritor1
parents:
diff changeset
728 double v4; // st7@4
Ritor1
parents:
diff changeset
729 //double v5; // ST00_8@4
Ritor1
parents:
diff changeset
730 signed int v6; // eax@5
Ritor1
parents:
diff changeset
731 //double v7; // ST00_8@6
Ritor1
parents:
diff changeset
732 signed int result; // eax@8
Ritor1
parents:
diff changeset
733 //double v9; // ST00_8@9
Ritor1
parents:
diff changeset
734 //double v10; // ST00_8@11
Ritor1
parents:
diff changeset
735 float a2a; // [sp+14h] [bp+8h]@4
Ritor1
parents:
diff changeset
736 float a3a; // [sp+18h] [bp+Ch]@4
Ritor1
parents:
diff changeset
737 float a3b; // [sp+18h] [bp+Ch]@6
Ritor1
parents:
diff changeset
738 float a4a; // [sp+1Ch] [bp+10h]@9
Ritor1
parents:
diff changeset
739 float a4b; // [sp+1Ch] [bp+10h]@11
Ritor1
parents:
diff changeset
740
Ritor1
parents:
diff changeset
741 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 )
Ritor1
parents:
diff changeset
742 {
Ritor1
parents:
diff changeset
743 v4 = (double)a4;
Ritor1
parents:
diff changeset
744 a2a = v4;
Ritor1
parents:
diff changeset
745 *a3 |= 2u;
Ritor1
parents:
diff changeset
746 a3a = (1.0 - this->fSaturation) * v4;
Ritor1
parents:
diff changeset
747 //v5 = a3a + 6.7553994e15;
Ritor1
parents:
diff changeset
748 //if ( SLODWORD(v5) >= 0 )
Ritor1
parents:
diff changeset
749 if (floorf(a3a + 0.5f) >= 0 )
Ritor1
parents:
diff changeset
750 {
Ritor1
parents:
diff changeset
751 a3b = (1.0 - this->fSaturation) * a2a;
Ritor1
parents:
diff changeset
752 //v7 = a3b + 6.7553994e15;
Ritor1
parents:
diff changeset
753 //v6 = LODWORD(v7);
Ritor1
parents:
diff changeset
754 v6 = floorf(a3b + 0.5f);
Ritor1
parents:
diff changeset
755 }
Ritor1
parents:
diff changeset
756 else
Ritor1
parents:
diff changeset
757 v6 = 0;
Ritor1
parents:
diff changeset
758 if ( a4 >= v6 )
Ritor1
parents:
diff changeset
759 {
Ritor1
parents:
diff changeset
760 a4a = (1.0 - fSaturation) * a2a;
Ritor1
parents:
diff changeset
761 //v9 = a4a + 6.7553994e15;
Ritor1
parents:
diff changeset
762 //if ( SLODWORD(v9) >= 0 )
Ritor1
parents:
diff changeset
763 if (floorf(a4a + 0.5f) >= 0)
Ritor1
parents:
diff changeset
764 {
Ritor1
parents:
diff changeset
765 a4b = (1.0 - fSaturation) * a2a;
Ritor1
parents:
diff changeset
766 //v10 = a4b + 6.7553994e15;
Ritor1
parents:
diff changeset
767 //result = LODWORD(v10);
Ritor1
parents:
diff changeset
768 result = floorf(a4b + 0.5f);
Ritor1
parents:
diff changeset
769 }
Ritor1
parents:
diff changeset
770 else
Ritor1
parents:
diff changeset
771 result = 0;
Ritor1
parents:
diff changeset
772 }
Ritor1
parents:
diff changeset
773 else
Ritor1
parents:
diff changeset
774 result = a4;
Ritor1
parents:
diff changeset
775 }
Ritor1
parents:
diff changeset
776 else
Ritor1
parents:
diff changeset
777 result = -1;
Ritor1
parents:
diff changeset
778 return result;
Ritor1
parents:
diff changeset
779 }
Ritor1
parents:
diff changeset
780
Ritor1
parents:
diff changeset
781
Ritor1
parents:
diff changeset
782
Ritor1
parents:
diff changeset
783 //----- (00465C8B) --------------------------------------------------------
Ritor1
parents:
diff changeset
784 Game *Game::Create()
Ritor1
parents:
diff changeset
785 {
Ritor1
parents:
diff changeset
786 return new Game;
Ritor1
parents:
diff changeset
787 }
Ritor1
parents:
diff changeset
788
Ritor1
parents:
diff changeset
789 //----- (00465CF3) --------------------------------------------------------
Ritor1
parents:
diff changeset
790 void Game::Destroy()
Ritor1
parents:
diff changeset
791 {
2370
bbf8a522dcec removing non-nullptr conditions before deletes
Grumpy7
parents: 2369
diff changeset
792 delete pGame;
0
Ritor1
parents:
diff changeset
793 pGame = nullptr;
Ritor1
parents:
diff changeset
794 }
Ritor1
parents:
diff changeset
795
Ritor1
parents:
diff changeset
796 //----- (0044ED0A) --------------------------------------------------------
Ritor1
parents:
diff changeset
797 signed int Game::_44ED0A(BLVFace *a2, int *a3, signed int a4)
Ritor1
parents:
diff changeset
798 {
Ritor1
parents:
diff changeset
799 double v4; // st7@3
Ritor1
parents:
diff changeset
800 //double v5; // ST00_8@3
Ritor1
parents:
diff changeset
801 signed int v6; // eax@4
Ritor1
parents:
diff changeset
802 //double v7; // ST00_8@5
Ritor1
parents:
diff changeset
803 signed int result; // eax@7
Ritor1
parents:
diff changeset
804 //double v9; // ST00_8@8
Ritor1
parents:
diff changeset
805 //double v10; // ST00_8@10
Ritor1
parents:
diff changeset
806 float v11; // [sp+14h] [bp+8h]@3
Ritor1
parents:
diff changeset
807 float v12; // [sp+18h] [bp+Ch]@3
Ritor1
parents:
diff changeset
808 float v13; // [sp+18h] [bp+Ch]@5
Ritor1
parents:
diff changeset
809 float v14; // [sp+1Ch] [bp+10h]@8
Ritor1
parents:
diff changeset
810 float v15; // [sp+1Ch] [bp+10h]@10
Ritor1
parents:
diff changeset
811
Ritor1
parents:
diff changeset
812 if ( this->uFlags2 & 2 && a2->uAttributes & 2 )
Ritor1
parents:
diff changeset
813 {
Ritor1
parents:
diff changeset
814 v4 = (double)a4;
Ritor1
parents:
diff changeset
815 v11 = v4;
Ritor1
parents:
diff changeset
816 *a3 |= 2u;
Ritor1
parents:
diff changeset
817 v12 = (1.0 - this->fSaturation) * v4;
Ritor1
parents:
diff changeset
818 //v5 = v12 + 6.7553994e15;
Ritor1
parents:
diff changeset
819 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 )
Ritor1
parents:
diff changeset
820 {
Ritor1
parents:
diff changeset
821 v13 = (1.0 - this->fSaturation) * v11;
Ritor1
parents:
diff changeset
822 //v7 = v13 + 6.7553994e15;
Ritor1
parents:
diff changeset
823 //v6 = LODWORD(v7);
Ritor1
parents:
diff changeset
824 v6 = floorf(v13 + 0.5f);
Ritor1
parents:
diff changeset
825 }
Ritor1
parents:
diff changeset
826 else
Ritor1
parents:
diff changeset
827 v6 = 0;
Ritor1
parents:
diff changeset
828 if ( a4 >= v6 )
Ritor1
parents:
diff changeset
829 {
Ritor1
parents:
diff changeset
830 v14 = (1.0 - fSaturation) * v11;
Ritor1
parents:
diff changeset
831 //v9 = v14 + 6.7553994e15;
Ritor1
parents:
diff changeset
832 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 )
Ritor1
parents:
diff changeset
833 {
Ritor1
parents:
diff changeset
834 v15 = (1.0 - fSaturation) * v11;
Ritor1
parents:
diff changeset
835 //v10 = v15 + 6.7553994e15;
Ritor1
parents:
diff changeset
836 //result = LODWORD(v10);
Ritor1
parents:
diff changeset
837 result = floorf(v15 + 0.5f);
Ritor1
parents:
diff changeset
838 }
Ritor1
parents:
diff changeset
839 else
Ritor1
parents:
diff changeset
840 result = 0;
Ritor1
parents:
diff changeset
841 }
Ritor1
parents:
diff changeset
842 else
Ritor1
parents:
diff changeset
843 result = a4;
Ritor1
parents:
diff changeset
844 }
Ritor1
parents:
diff changeset
845 else
Ritor1
parents:
diff changeset
846 result = -1;
Ritor1
parents:
diff changeset
847 return result;
Ritor1
parents:
diff changeset
848 }
Ritor1
parents:
diff changeset
849
Ritor1
parents:
diff changeset
850
Ritor1
parents:
diff changeset
851 //----- (0044E4B7) --------------------------------------------------------
Ritor1
parents:
diff changeset
852 Game::Game()
Ritor1
parents:
diff changeset
853 {
Ritor1
parents:
diff changeset
854 uNumStationaryLights = 0;
Ritor1
parents:
diff changeset
855 uNumBloodsplats = 0;
Ritor1
parents:
diff changeset
856 field_E0C = 0;
Ritor1
parents:
diff changeset
857 field_E10 = 0;
Ritor1
parents:
diff changeset
858 uNumStationaryLights_in_pStationaryLightsStack = 0;
Ritor1
parents:
diff changeset
859 bGammaControlInitialized = false;
Ritor1
parents:
diff changeset
860 uFlags = 0;
Ritor1
parents:
diff changeset
861 uFlags2 = 0;
Ritor1
parents:
diff changeset
862 uSomeGammaStartTime = 0;
Ritor1
parents:
diff changeset
863 uSomeGammaDeltaTime = 0;
Ritor1
parents:
diff changeset
864
1397
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
865 //pThreadWardInstance = new ThreadWard;
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
866 pThreadWardInstance = nullptr;
0
Ritor1
parents:
diff changeset
867 pParticleEngine = new ParticleEngine;
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1642
diff changeset
868 pMouse = pMouseInstance = new Mouse;
0
Ritor1
parents:
diff changeset
869 pLightmapBuilder = new LightmapBuilder;
Ritor1
parents:
diff changeset
870 pVisInstance = new Vis;
Ritor1
parents:
diff changeset
871 pStru6Instance = new stru6;
Ritor1
parents:
diff changeset
872 pIndoorCameraD3D = new IndoorCameraD3D;
Ritor1
parents:
diff changeset
873 pStru9Instance = new stru9;
Ritor1
parents:
diff changeset
874 pStru10Instance = new stru10;
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
875 //pStru11Instance = new stru11;
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
876 pStru11Instance = nullptr;
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
877 //pStru12Instance = new stru12(pStru11Instance);
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
878 pStru12Instance = nullptr;
1397
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
879 //pCShow = new CShow;
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
880 pCShow = nullptr;
0
Ritor1
parents:
diff changeset
881 pKeyboardInstance = new Keyboard;
Ritor1
parents:
diff changeset
882 pGammaController = new GammaController;
Ritor1
parents:
diff changeset
883
Ritor1
parents:
diff changeset
884 uFlags |= 0x0800;
Ritor1
parents:
diff changeset
885 uFlags2 |= 0x24;
Ritor1
parents:
diff changeset
886
Ritor1
parents:
diff changeset
887 _44F0FD();
Ritor1
parents:
diff changeset
888 }
Ritor1
parents:
diff changeset
889
Ritor1
parents:
diff changeset
890 //----- (0044E7F3) --------------------------------------------------------
Ritor1
parents:
diff changeset
891 Game::~Game()
Ritor1
parents:
diff changeset
892 {
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
893 delete pGammaController;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
894 delete pKeyboardInstance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
895 /*delete pCShow;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
896 delete pStru12Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
897 delete pStru11Instance;*/
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
898 delete pStru10Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
899 delete pStru9Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
900 delete pIndoorCameraD3D;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
901 delete pStru6Instance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
902 delete pVisInstance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
903 delete pLightmapBuilder;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
904 delete pMouseInstance;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
905 delete pParticleEngine;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2358
diff changeset
906 //delete pThreadWardInstance;
0
Ritor1
parents:
diff changeset
907 }
Ritor1
parents:
diff changeset
908
Ritor1
parents:
diff changeset
909 //----- (0044E904) --------------------------------------------------------
Ritor1
parents:
diff changeset
910 void Game::_44E904()
Ritor1
parents:
diff changeset
911 {
Ritor1
parents:
diff changeset
912 //Game *v1; // esi@1
Ritor1
parents:
diff changeset
913 unsigned __int64 v2; // qax@1
Ritor1
parents:
diff changeset
914 unsigned int v3; // ecx@1
Ritor1
parents:
diff changeset
915 int v4; // edi@1
Ritor1
parents:
diff changeset
916 unsigned __int8 v5; // cf@7
Ritor1
parents:
diff changeset
917 double v6; // st7@13
Ritor1
parents:
diff changeset
918 double v7; // st7@15
Ritor1
parents:
diff changeset
919 signed __int64 v8; // [sp+Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
920
Ritor1
parents:
diff changeset
921 //v1 = this;
Ritor1
parents:
diff changeset
922 v2 = pEventTimer->Time();
Ritor1
parents:
diff changeset
923 v4 = (v2 - uSomeGammaStartTime) >> 32;
Ritor1
parents:
diff changeset
924 v3 = v2 - LODWORD(uSomeGammaStartTime);
Ritor1
parents:
diff changeset
925 v8 = v2 - uSomeGammaStartTime;
Ritor1
parents:
diff changeset
926 if ( v4 < 0
Ritor1
parents:
diff changeset
927 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0
Ritor1
parents:
diff changeset
928 && v3 <= 0x80 )
Ritor1
parents:
diff changeset
929 {
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
930 if ( v4 < 0 )
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
931 {
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
932 v3 = 0;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
933 v4 = 0;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
934 uSomeGammaStartTime = v2;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
935 v8 = __PAIR__(v4, v3);
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
936 }
0
Ritor1
parents:
diff changeset
937 }
Ritor1
parents:
diff changeset
938 else
Ritor1
parents:
diff changeset
939 {
Ritor1
parents:
diff changeset
940 if ( uSomeGammaDeltaTime )
Ritor1
parents:
diff changeset
941 {
Ritor1
parents:
diff changeset
942 LODWORD(uSomeGammaDeltaTime) = 0;
Ritor1
parents:
diff changeset
943 HIDWORD(uSomeGammaDeltaTime) = 0;
Ritor1
parents:
diff changeset
944 }
Ritor1
parents:
diff changeset
945 else
Ritor1
parents:
diff changeset
946 {
Ritor1
parents:
diff changeset
947 LODWORD(uSomeGammaDeltaTime) = v3;
Ritor1
parents:
diff changeset
948 HIDWORD(uSomeGammaDeltaTime) = v4;
Ritor1
parents:
diff changeset
949 }
Ritor1
parents:
diff changeset
950 v5 = __CFADD__(v3, -128);
Ritor1
parents:
diff changeset
951 v3 -= 128;
Ritor1
parents:
diff changeset
952 v4 = v5 + v4 - 1;
1421
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
953 uSomeGammaStartTime = v2;
4fff79f04dbd more label cleaning 4
zipi
parents: 1397
diff changeset
954 v8 = __PAIR__(v4, v3);
0
Ritor1
parents:
diff changeset
955 }
Ritor1
parents:
diff changeset
956 if ( uSomeGammaDeltaTime )
Ritor1
parents:
diff changeset
957 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3));
Ritor1
parents:
diff changeset
958 else
Ritor1
parents:
diff changeset
959 v6 = (double)v8;
Ritor1
parents:
diff changeset
960 v7 = v6 * 0.0078125;
Ritor1
parents:
diff changeset
961 if ( v7 < 0.0 || v7 <= 1.0 )
Ritor1
parents:
diff changeset
962 {
Ritor1
parents:
diff changeset
963 if ( v7 < 0.0 )
Ritor1
parents:
diff changeset
964 v7 = 0.0;
Ritor1
parents:
diff changeset
965 }
Ritor1
parents:
diff changeset
966 else
Ritor1
parents:
diff changeset
967 v7 = 1.0;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
968 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
969 fSaturation = v7;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
970 //else
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
971 // fSaturation = (1.0 - 0.5) * v7 + 0.5;
0
Ritor1
parents:
diff changeset
972 }
Ritor1
parents:
diff changeset
973
Ritor1
parents:
diff changeset
974 //----- (0044EA17) --------------------------------------------------------
Ritor1
parents:
diff changeset
975 bool Game::InitializeGammaController()
Ritor1
parents:
diff changeset
976 {
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2151
diff changeset
977 //if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT ||
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2151
diff changeset
978 //pVersion->pVersionInfo.dwMajorVersion != 4 )
0
Ritor1
parents:
diff changeset
979 pGammaController->InitializeFromSurface(pRenderer->pFrontBuffer4);
Ritor1
parents:
diff changeset
980
Ritor1
parents:
diff changeset
981 bGammaControlInitialized = true;
Ritor1
parents:
diff changeset
982 uSomeGammaStartTime = pEventTimer->Time();
Ritor1
parents:
diff changeset
983 return true;
Ritor1
parents:
diff changeset
984 }
Ritor1
parents:
diff changeset
985
Ritor1
parents:
diff changeset
986 //----- (0044EA5E) --------------------------------------------------------
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
987 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
988 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
989 /*if (pCurrentScreen != SCREEN_GAME|| !pRenderer->pRenderD3D)
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
990 return false;*/
0
Ritor1
parents:
diff changeset
991
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
992 if (!pVisInstance)
0
Ritor1
parents:
diff changeset
993 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
994 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
995 return false;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
996 }
0
Ritor1
parents:
diff changeset
997
692
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
998 if (uMouseX >= (signed int)pViewport->uScreen_TL_X &&
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
999 uMouseX <= (signed int)pViewport->uScreen_BR_X &&
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
1000 uMouseY >= (signed int)pViewport->uScreen_TL_Y &&
066e2b29b30f viewport.cpp added
Gloval
parents: 676
diff changeset
1001 uMouseY <= (signed int)pViewport->uScreen_BR_Y)
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1002 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1003 pVisInstance->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter);
0
Ritor1
parents:
diff changeset
1004
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1005 if (bOutline)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1006 OutlineSelection();
0
Ritor1
parents:
diff changeset
1007 }
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1008
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1009 return true;
0
Ritor1
parents:
diff changeset
1010 }
Ritor1
parents:
diff changeset
1011 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
1012
Ritor1
parents:
diff changeset
1013 //----- (0044EB12) --------------------------------------------------------
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1014 bool Game::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
0
Ritor1
parents:
diff changeset
1015 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1016 if (pCurrentScreen == SCREEN_GAME && pVisInstance /*&& pRenderer->pRenderD3D*/)
0
Ritor1
parents:
diff changeset
1017 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1018 bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter);
0
Ritor1
parents:
diff changeset
1019
Ritor1
parents:
diff changeset
1020 if (bOutline)
Ritor1
parents:
diff changeset
1021 OutlineSelection();
Ritor1
parents:
diff changeset
1022 return r;
Ritor1
parents:
diff changeset
1023 }
Ritor1
parents:
diff changeset
1024 return false;
Ritor1
parents:
diff changeset
1025 }
123
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1026 /*
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1027 Result::Code Game::PickKeyboard(bool bOutline, struct unnamed_F93E6C *a3, struct unnamed_F93E6C *a4)
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1028 {
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1029 if (dword_4E28F8_PartyCantJumpIfTrue)
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1030 return Result::Generic;
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1031
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1032 pVis->PickKeyboard(a3, a4);
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1033 if (bOutline)
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1034 Game_outline_selection((int)this);
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1035 return Result::Success;
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1036 }
4e35bb416dea 11.02.13
Ritor1
parents: 101
diff changeset
1037 */
0
Ritor1
parents:
diff changeset
1038 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
1039
Ritor1
parents:
diff changeset
1040 //----- (0044EB5A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1041 void Game::OutlineSelection()
Ritor1
parents:
diff changeset
1042 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1043 if (!pVisInstance)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1044 return;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1045
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1046 if (!pVisInstance->default_list.uNumPointers)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1047 return;
0
Ritor1
parents:
diff changeset
1048
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1049 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
1050 if (object_info)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1051 switch (object_info->object_type)
0
Ritor1
parents:
diff changeset
1052 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1053 case VisObjectType_Sprite:
0
Ritor1
parents:
diff changeset
1054 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1055 Log::Warning(L"Sprite outline currently unsupported");
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1056 return;
0
Ritor1
parents:
diff changeset
1057 }
Ritor1
parents:
diff changeset
1058
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1059 case VisObjectType_Face:
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1060 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1061 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0
Ritor1
parents:
diff changeset
1062 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1063 ODMFace* face = (ODMFace *)object_info->object;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1064 if (face->uAttributes & FACE_OUTLINED)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1065 face->uAttributes &= ~FACE_OUTLINED;
0
Ritor1
parents:
diff changeset
1066 else
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1067 face->uAttributes |= FACE_OUTLINED;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1068 }
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1069 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1070 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1071 BLVFace* face = (BLVFace *)object_info->object;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1072 if (face->uAttributes & FACE_OUTLINED)
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1073 face->uAttributes &= ~FACE_OUTLINED;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1074 else
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1075 face->uAttributes |= FACE_OUTLINED;
0
Ritor1
parents:
diff changeset
1076 }
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1507
diff changeset
1077 else Error("Invalid level type", uCurrentlyLoadedLevelType);
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1078 }
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 293
diff changeset
1079 break;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1080
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1081 default:
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 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
1084 ExitProcess(0);
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 190
diff changeset
1085 }
0
Ritor1
parents:
diff changeset
1086 }
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1087 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1088 //----- (004304E7) --------------------------------------------------------
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1089 void GameUI_MsgProc()
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1090 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1091 //signed int v0; // edi@6
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1092 //char *v1; // esi@6
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1093 unsigned int v2; // edx@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1094 Actor *pActor; // ecx@13
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1095 int v4; // ecx@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1096 //NPCData *pNPCData0; // eax@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1097 //int v6; // edx@20
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1098 //int v7; // ecx@29
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1099 //unsigned int v8; // edx@59
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1100 //unsigned int v9; // ecx@60
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1101 unsigned int v10; // ecx@73
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1102 //unsigned int v11; // eax@75
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1103 unsigned __int8 v12; // sf@75
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1104 unsigned __int8 v13; // of@75
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1105 int v14; // eax@98
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1106 unsigned int v15; // eax@102
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1107 unsigned __int8 v16; // al@104
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1108 unsigned __int8 v17; // al@105
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1109 int v18; // eax@106
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1110 float v19; // ST64_4@121
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1111 // unsigned int v20; // ecx@121
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1112 float v21; // ST64_4@126
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1113 float v22; // ST64_4@127
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1114 // unsigned int v23; // ecx@135
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1115 unsigned int v24; // ecx@149
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1116 // unsigned int v25; // ecx@165
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1117 // GUIWindow *pWindow; // eax@204
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1118 // unsigned int v27; // edx@204
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1119 // unsigned int v28; // ecx@204
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1120 GUIWindow *pWindow2; // ecx@248
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1121 //int v30; // edx@258
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1122 //const char *v31; // ecx@262
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1123 signed int v32; // eax@269
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1124 unsigned int v33; // eax@277
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1125 unsigned __int8 v34; // al@279
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1126 unsigned __int8 v35; // al@280
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1127 //GUIWindow *pWindow3; // ecx@332
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1128 int v37; // eax@341
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1129 int v38; // eax@358
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1130 SHORT v39; // ax@365
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1131 //signed int v40; // eax@365
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1132 char *v41; // eax@380
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1133 int v42; // eax@396
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1134 // POINT *pPoint; // eax@397
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1135 signed int v44; // eax@398
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1136 int v45; // edx@398
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1137 signed int v46; // ecx@398
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1138 char v47; // zf@399
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1139 char v48; // zf@405
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1140 BLVFace *pBLVFace; // ecx@410
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1141 ODMFace *pODMFace; // ecx@412
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1142 CastSpellInfo *pSpellInfo; // ecx@415
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1143 // void *v52; // eax@424
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1144 __int16 v53; // ax@431
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1145 int v54; // eax@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1146 int v55; // ecx@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1147 int v56; // edx@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1148 int v57; // eax@432
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1149 Player *pPlayer; // edx@442
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1150 unsigned int pMapNum; // eax@445
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1151 signed int v60; // ST64_4@459
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1152 //NPCData *pNPCData2; // eax@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1153 //unsigned __int64 v62; // kr00_8@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1154 __int16 v63; // dx@479
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1155 unsigned int v64; // eax@486
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1156 int v65; // ecx@486
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1157 int v66; // eax@488
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1158 char *v67; // eax@489
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1159 __int16 v68; // dx@498
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1160 char *v69; // eax@512
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1161 int v70; // eax@525
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1162 int v71; // edi@527
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1163 NPCData *pNPCData3; // esi@527
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1164 char *v73; // ecx@533
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1165 signed int v74; // edi@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1166 int v75; // eax@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1167 int v76; // esi@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1168 int v77; // eax@537
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1169 Player *pPlayer2; // ecx@549
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1170 //int v79; // ecx@550
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1171 //unsigned int v80; // edx@550
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1172 signed int v81; // eax@552
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1173 // POINT *pPoint2; // eax@553
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1174 signed int v83; // ecx@554
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1175 signed int v84; // ecx@554
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1176 GUIButton *pButton; // eax@578
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1177 unsigned int v86; // eax@583
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1178 const char *v87; // ecx@595
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1179 const char *v88; // ecx@596
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1180 //unsigned int v89; // eax@598
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1181 unsigned int v90; // eax@602
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1182 int v91; // edx@605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1183 int v92; // eax@605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1184 int v93; // edx@605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1185 int pPlayerNum; // edx@611
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1186 int v95; // eax@611
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1187 //const char *v96; // ecx@621
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1188 unsigned int v97; // eax@624
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1189 int v98; // eax@636
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1190 // unsigned __int8 v99; // al@643
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1191 // Player *pPlayer3; // eax@648
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1192 // int v101; // ecx@648
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1193 // int v102; // edx@652
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1194 int v103; // eax@671
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1195 Player *pPlayer4; // ecx@718
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1196 int v105; // eax@718
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1197 Player *pPlayer5; // ST78_4@758
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1198 unsigned int v107; // eax@758
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1199 unsigned int v108; // eax@758
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1200 unsigned int v115; // eax@764
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1201 int v116; // eax@776
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1202 // POINT *pPoint3; // eax@777
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1203 unsigned int v118; // eax@785
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1204 unsigned int v119; // ecx@786
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1205 // unsigned int v120; // [sp-28h] [bp-624h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1206 unsigned int v121; // [sp-28h] [bp-624h]@711
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1207 // unsigned int v122; // [sp-24h] [bp-620h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1208 unsigned int v123; // [sp-24h] [bp-620h]@711
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1209 // unsigned int v124; // [sp-20h] [bp-61Ch]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1210 unsigned int v125; // [sp-20h] [bp-61Ch]@711
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1211 // unsigned int v126; // [sp-1Ch] [bp-618h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1212 int v127; // [sp-1Ch] [bp-618h]@107
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1213 unsigned int v128; // [sp-1Ch] [bp-618h]@711
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1214 // int v129; // [sp-18h] [bp-614h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1215 //signed int v130; // [sp-18h] [bp-614h]@107
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1216 // int v131; // [sp-14h] [bp-610h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1217 //unsigned int v132; // [sp-14h] [bp-610h]@107
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1218 //unsigned int v133; // [sp-10h] [bp-60Ch]@60
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1219 // unsigned int v134; // [sp-10h] [bp-60Ch]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1220 //signed int v135; // [sp-10h] [bp-60Ch]@107
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1221 // unsigned int v136; // [sp-10h] [bp-60Ch]@121
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1222 //unsigned int v137; // [sp-Ch] [bp-608h]@60
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1223 // unsigned int v138; // [sp-Ch] [bp-608h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1224 //signed int v139; // [sp-Ch] [bp-608h]@107
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1225 // unsigned int v140; // [sp-Ch] [bp-608h]@121
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1226 // enum WindowType pWindowType; // [sp-8h] [bp-604h]@56
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1227 //enum WindowType pWindowType1; // [sp-8h] [bp-604h]@60
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1228 // unsigned __int8 v143; // [sp-8h] [bp-604h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1229 //int v144; // [sp-8h] [bp-604h]@107
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1230 // enum WindowType pWindowType2; // [sp-8h] [bp-604h]@121
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1231 //const char *v146; // [sp-8h] [bp-604h]@449
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1232 //unsigned int v147; // [sp-8h] [bp-604h]@550
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1233 //int v148; // [sp-4h] [bp-600h]@56
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1234 GUIButton *pButton2; // [sp-4h] [bp-600h]@59
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1235 // const char *v150; // [sp-4h] [bp-600h]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1236 //unsigned int v151; // [sp-4h] [bp-600h]@107
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1237 // int v152; // [sp-4h] [bp-600h]@121
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1238 // int v153; // [sp-4h] [bp-600h]@135
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1239 //int v154; // [sp-4h] [bp-600h]@149
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1240 // int v155; // [sp-4h] [bp-600h]@165
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1241 // int v156; // [sp-4h] [bp-600h]@204
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1242 //const char *v157; // [sp-4h] [bp-600h]@444
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1243 //unsigned int v158; // [sp-4h] [bp-600h]@449
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1244 //__int16 v159; // [sp-4h] [bp-600h]@550
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1245 // int v160; // [sp-4h] [bp-600h]@599
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1246 const char *v161; // [sp-4h] [bp-600h]@637
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1247 //int v162; // [sp+0h] [bp-5FCh]@56
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1248 //int v163; // [sp+0h] [bp-5FCh]@59
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1249 // Texture *pTexture; // [sp+0h] [bp-5FCh]@86
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1250 //int v165; // [sp+0h] [bp-5FCh]@107
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1251 // int v166; // [sp+0h] [bp-5FCh]@121
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1252 // int v167; // [sp+0h] [bp-5FCh]@135
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1253 //int v168; // [sp+0h] [bp-5FCh]@149
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1254 // int v169; // [sp+0h] [bp-5FCh]@165
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1255 // int v170; // [sp+0h] [bp-5FCh]@204
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1256 //signed int v171; // [sp+0h] [bp-5FCh]@259
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1257 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1258 char *v173; // [sp+0h] [bp-5FCh]@444
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1259 char *v174; // [sp+0h] [bp-5FCh]@449
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1260 //int v175; // [sp+0h] [bp-5FCh]@550
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1261 // int v176; // [sp+0h] [bp-5FCh]@599
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1262 const char *v177; // [sp+0h] [bp-5FCh]@629
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1263 char *v178; // [sp+0h] [bp-5FCh]@637
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1264 // int v179; // [sp+4h] [bp-5F8h]@0
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1265 //signed int _this; // [sp+14h] [bp-5E8h]@22
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1266 // signed int thisa; // [sp+14h] [bp-5E8h]@251
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1267 signed int thisb; // [sp+14h] [bp-5E8h]@272
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1268 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1269 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1270 char *pMapName; // [sp+14h] [bp-5E8h]@445
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1271 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1272 int thisg; // [sp+14h] [bp-5E8h]@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1273 int thish; // [sp+14h] [bp-5E8h]@528
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1274 signed int thisi; // [sp+14h] [bp-5E8h]@535
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1275 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1276 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1277 // int thisl; // [sp+14h] [bp-5E8h]@648
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1278 int uMessageParam; // [sp+18h] [bp-5E4h]@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1279 int uAction; // [sp+1Ch] [bp-5E0h]@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1280 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1281 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1282 char v197; // [sp+2Bh] [bp-5D1h]@101
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1283 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1284 unsigned int v199; // [sp+30h] [bp-5CCh]@7
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1285 char *v200; // [sp+34h] [bp-5C8h]@518
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1286 // POINT v201; // [sp+38h] [bp-5C4h]@553
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1287 POINT v202; // [sp+40h] [bp-5BCh]@141
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1288 POINT a2; // [sp+48h] [bp-5B4h]@127
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1289 // POINT v204; // [sp+50h] [bp-5ACh]@777
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1290 POINT v205; // [sp+58h] [bp-5A4h]@171
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1291 // POINT v206; // [sp+60h] [bp-59Ch]@553
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1292 POINT v207; // [sp+68h] [bp-594h]@155
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1293 // POINT v208; // [sp+70h] [bp-58Ch]@397
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1294 // POINT v209; // [sp+78h] [bp-584h]@777
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
1295 // POINT v210; // [sp+80h] [bp-57Ch]@397
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1296 POINT v211; // [sp+88h] [bp-574h]@704
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1297 //__int64 v212; // [sp+90h] [bp-56Ch]@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1298 int v213; // [sp+98h] [bp-564h]@385
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1299 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1300 char pOut[32]; // [sp+BCh] [bp-540h]@370
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1301 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1302 int v217[9]; // [sp+158h] [bp-4A4h]@652
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1303 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1304 char a1[64]; // [sp+1F8h] [bp-404h]@467
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1305 char Str2[128]; // [sp+238h] [bp-3C4h]@527
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1306 Actor actor; // [sp+2B8h] [bp-344h]@4
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1307 //unsigned short* screenshot;
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
1308 int currHour;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1309
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1310 dword_50CDC8 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1311 if ( !pEventTimer->bPaused )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1312 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1313 pParty->sEyelevel = pParty->uDefaultEyelevel;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1314 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1315 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1316 if ( bDialogueUI_InitializeActor_NPC_ID )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1317 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1318 //Actor::Actor(&actor);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1319 memset(&actor, 0, 0x344u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1320 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1321 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1322 GameUI_InitializeDialogue(&actor, false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1323 bDialogueUI_InitializeActor_NPC_ID = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1324 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1325 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1326 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1327 //v1 = "";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1328 while ( 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1329 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1330 if ( !pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1331 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1332
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1333 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1334 switch ( uMessage )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1335 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1336 case UIMSG_ChangeGameState:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1337 uGameState = GAME_FINISHED;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1338 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1339 case UIMSG_PlayArcomage:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1340 pVideoPlayer->_4BF5B2();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1341 pArcomageGame->bGameInProgress = 1;
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2338
diff changeset
1342 ArcomageGame::PrepareArcomage();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1343 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1344 case UIMSG_StartNPCDialogue:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1345 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1346 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1347 viewparams->field_48 = 1;
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 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1351 pActor = &pActors[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1352 //goto _actor_init_dlg;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1353 GameUI_InitializeDialogue(pActor, true);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1354 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1355 case UIMSG_StartHireling1Dialogue:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1356 case UIMSG_StartHireling2Dialogue:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1357 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1358 if (bNoNPCHiring || pCurrentScreen)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1359 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1360
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1361 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1362 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1363 uAction = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1364 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1365 v4 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1366
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1367 for (uint i = 0; i < 2; ++i)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1368 //pNPCData0 = pParty->pHirelings;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1369 //do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1370 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1371 if (pParty->pHirelings[i].pName)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1372 //{
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1373 //v6 = uAction++;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1374 pTmpBuf[uAction++] = i;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1375 //}
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1376 //++pNPCData0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1377 //++v4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1378 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1379 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1380
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1381 //_this = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1382 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1383 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
1384 NPCData* npc = &pNPCStats->pNewNPCData[i];
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1385 //do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1386 //{
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1387 if (npc->Hired() &&
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1388 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) &&
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1389 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1390 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1391 //v7 =;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1392 pTmpBuf[uAction++] = i + 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1393 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1394 //++_this;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1395 //++pNPCData4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1396 //}
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1397 //while ( _this < (signed int)pNPCStats->uNumNewNPCs );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1398 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1399
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1400 if ( (signed int)(hireling_idx + pParty->hirelingScrollPosition) < uAction )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1401 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1402 //Actor::Actor(&actor);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1403 memset(&actor, 0, 0x344u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1404 actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_idx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1405 pActor = &actor;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1406 GameUI_InitializeDialogue(&actor, true);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1407 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1408 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1409 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1410
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1411 case UIMSG_BuyInShop_Identify_Repair:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1412 UIShop_Buy_Identify_Repair();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1413 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1414 case UIMSG_ClickNPCTopic:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1415 ClickNPCTopic(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1416 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1417 case UIMSG_SelectShopDialogueOption:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1418 OnSelectShopDialogueOption(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1419 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1420 case UIMSG_SelectNPCDialogueOption:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1421 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1422 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1423 case UIMSG_ClickHouseNPCPortrait:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1424 _4B4224_UpdateNPCTopics(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1425 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1426 case UIMSG_StartNewGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1427 if ( dword_6BE138 == 124 || uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1428 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1429 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1430 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1431 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1432 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1433 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1434 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1435 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1436 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1437 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1438 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1439 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1440 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1441 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1442 dword_6BE138 = 124;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1443 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1444 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1445 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1446 case UIMSG_Game_OpenLoadGameDialog:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1447 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1448 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1449 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1450 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1451 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1452 pCurrentScreen = SCREEN_LOADGAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1453 LoadUI_Load(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1454 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1455 case UIMSG_Quit:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1456 if ( dword_6BE138 == 132 || uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1457 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1458 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1459 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1460 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1461 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1462 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1463 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1464 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1465 if ( !uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1466 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1467 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1468 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1469 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1470 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1472 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1473 dword_6BE138 = 132;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1474 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1475 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1476 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1477 case UIMSG_80:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1478 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1479 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1480 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1481 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1482 pCurrentScreen = SCREEN_OPTIONS;
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1483 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1484 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1485 case UIMSG_ArrowUp:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1486 --pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1487 if ( pSaveListPosition < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1488 pSaveListPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1489 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1490 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1491 case UIMSG_DownArrow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1492 ++pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1493 if ( pSaveListPosition >= uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1494 pSaveListPosition = uMessageParam - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1495 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1496 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1497 case UIMSG_Cancel:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1498 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1499 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1500 case UIMSG_SaveLoadBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1501 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1502 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1503 case UIMSG_SelectLoadSlot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1504 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1505 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1506 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1507 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1508 v10 = pSaveListPosition + uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1509 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1510 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
1511 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
1512 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1513 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1514 uLoadGameUI_SelectedSlot = v10;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1515 dword_6BE138 = v10;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1516 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1517 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1518 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1519 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1520 if ( strcmp(pSavegameHeader[uLoadGameUI_SelectedSlot].pName, pGlobalTXT_LocalizationStrings[72]) )// "Empty"
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1521 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1522 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1523 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1524 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1525 case UIMSG_LoadGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1526 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1527 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1528 LoadGame(uLoadGameUI_SelectedSlot);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1529 uGameState = GAME_STATE_LOADING_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1530 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1531 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1532 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1533 case UIMSG_SaveGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1534 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1535 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1536 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
1537 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pKeyActionMap->pPressedKeysBuffer);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1538 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1539 DoSavegame(uLoadGameUI_SelectedSlot);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1540 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1541 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1542 case UIMSG_Game_OpenSaveGameDialog:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1543 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1544 pCurrentScreen = SCREEN_SAVEGAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1545 SaveUI_Load();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1546 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1547 case UIMSG_Game_OpenOptionsDialog://Open
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1548 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1549 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1550 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1551 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1552 pCurrentScreen = SCREEN_OPTIONS;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1553
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1554 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1555 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1556 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1557 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1558 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1559 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1560 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1561 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1562 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1563 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1564 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1565 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1566 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1567 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1568 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1569 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1570 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1571 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1572 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1573 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1574
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1575 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Options, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1576 pGUIWindow_CurrentMenu->CreateButton(22, 270,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1577 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1578 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1579 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1580 pGUIWindow_CurrentMenu->CreateButton(93, 270,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1581 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1582 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1583 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1584 pGUIWindow_CurrentMenu->CreateButton(164, 270,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1585 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1586 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1587 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1588
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1589 pGUIWindow_CurrentMenu->CreateButton(20, 303,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1590 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1591 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1592 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1593 pGUIWindow_CurrentMenu->CreateButton(128, 303,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1594 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1595 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1596 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1597 pGUIWindow_CurrentMenu->CreateButton(20, 325,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1598 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1599 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1600 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1601 pGUIWindow_CurrentMenu->CreateButton(128, 325,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1602 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1603 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1604 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1605
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1606 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
1607 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
1608 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1609
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1610 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
1611 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
1612 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1613
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1614 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
1615 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
1616 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1617
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1618 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
1619 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1620 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1621 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1622
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1623 case UIMSG_OpenKeyMappingOptions://Open
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1624 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1625 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1626 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1627 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1628 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1629 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1630 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1631 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1632 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1633 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
1634 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_KeyMappingOptions, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1635 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1636 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1637 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1638 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1639 pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1640 pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1641 pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 1u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1642 pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 2u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1643 pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 3u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1644 pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, UIMSG_ChangeKeyButton, 4u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1645 pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 5u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1646 pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 6u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1647 pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 7u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1648 pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 8u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1649 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1650 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1651 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1652 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1653 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1654 uGameMenuUI_CurentlySelectedKeyIdx = -1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1655 KeyboardPageNum = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1656 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1657 //*(_WORD *)KeyButtonArray[28] = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1658 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1659 //v1 = "";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1660 //v0 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1661 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1662 case UIMSG_ChangeKeyButton:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1663 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1664 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1665 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1666 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1667 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1668 v14 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1669 if ( KeyboardPageNum != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1670 v14 = uMessageParam + 14;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1671 uGameMenuUI_CurentlySelectedKeyIdx = v14;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1672 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1673 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1674 case UIMSG_ResetKeyMapping:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1675 v197 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1676 pKeyActionMap->SetDefaultMapping();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1677 uAction = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1678 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1679 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1680 v15 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1681 if ( v15 != pPrevVirtualCidesMapping[uAction] )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1682 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1683 if ( v197 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1684 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1685 v16 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1686 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1687 v197 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1688 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1689 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1690 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1691 v17 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1692 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v17, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1693 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1694 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1695 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1696 v18 = uAction++;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1697 v13 = uAction > 28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1698 v12 = uAction - 28 < 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1699 GameMenuUI_InvaligKeyBindingsFlags[v18] = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1700 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1701 while ( v12 ^ v13 );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1702 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1703 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1704 case UIMSG_SelectKeyPage1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1705 KeyboardPageNum = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1706 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1707 case UIMSG_SelectKeyPage2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1708 KeyboardPageNum = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1709 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1710 case UIMSG_OpenVideoOptions:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1711 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1712 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1713 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1714 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1715 pCurrentScreen = SCREEN_VIDEO_OPTIONS;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1716 optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1717 bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1718 us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1719 tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1720 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1721 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1722 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1723 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1724 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1725 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1726 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1727 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1728 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1729 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1730 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1731 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1732 not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1733 not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1734 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
1735 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_VideoOptions, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1736 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
1737 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1738 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1739 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1740 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1741 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1742 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
1743 /*if ( !pRenderer->bWindowMode )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1744 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1745 //v0 = 1;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
1746 if ( pRenderer->IsGammaSupported() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1747 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1748 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
1749 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
1750 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1751 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
1752 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1753 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1754 case UIMSG_1A9:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1755 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1756 if ( uMessageParam == 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1757 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1758 //--uGammaPos;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1759 if ( (uGammaPos -- -1) < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1760 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1761 uGammaPos = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1762 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1763 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1764 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1765 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1766 pGame->pGammaController->Initialize(v19);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1767 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1768 pAudioPlayer->PlaySound((SoundID)21, 0, 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 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1771 if ( uMessageParam == 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1772 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1773 ++uGammaPos;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1774 if ( (signed int)uGammaPos <= 9 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1775 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1776 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1777 pGame->pGammaController->Initialize(v21);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1778 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1779 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1780 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1781 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1782 uGammaPos = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1783 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1784 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1785 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1786 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1787 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1788 pGame->pGammaController->Initialize(v22);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1789 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1790 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1791 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1792 case UIMSG_ToggleBloodsplats:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1793 pGame->ToggleFlags2(0x20u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1794 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1795 case UIMSG_ToggleColoredLights:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
1796 pRenderer->ToggleColoredLights();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1797 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1798 case UIMSG_ToggleTint:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
1799 pRenderer->ToggleTint();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1800 continue;
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1801 case UIMSG_ChangeMusicVolume: //громкость музыки
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1802 if ( uMessageParam == 4 )//кнопка понижения
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1803 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1804 --uMusicVolimeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1805 if ( (char)uMusicVolimeMultiplier < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1806 uMusicVolimeMultiplier = 0;
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1807 GUIWindow::Create(243, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1808 if ( uMusicVolimeMultiplier )
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1809 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1810 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1811 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1812 }
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1813 if ( uMessageParam == 5 )//кнопка повышения
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1814 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1815 ++uMusicVolimeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1816 if ( (char)uMusicVolimeMultiplier > 9 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1817 uMusicVolimeMultiplier = 9;
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1818 GUIWindow::Create(435, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1819 if ( uMusicVolimeMultiplier )
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1820 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1821 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1822 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1823 }
2113
a94c5bee0225 SoundVolume options
Ritor1
parents: 2110
diff changeset
1824 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//для задания громкости мышкой
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1825 if ( (char)uMusicVolimeMultiplier > 9 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1826 uMusicVolimeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1827 if ( uMusicVolimeMultiplier )
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1828 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2113
diff changeset
1829 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1830 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1831 case UIMSG_ChangeSoundVolume:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1832 if ( uMessageParam == 4 )//reduce sound level button left
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1833 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1834 --uSoundVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1835 if ( (char)uSoundVolumeMultiplier < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1836 uSoundVolumeMultiplier = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1837 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1838 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1839 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1840 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1841 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1842 if ( uMessageParam == 5 )//Increase sound level button right
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1843 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1844 ++uSoundVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1845 if ( (char)uSoundVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1846 uSoundVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1847 //v168 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1848 v24 = 435;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1849 //v154 = (int)pBtn_SliderRight;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1850 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1851 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1852 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1853 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1854 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1855 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1856 if ( (char)uSoundVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1857 uSoundVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1858 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1859 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1860 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1861 case UIMSG_ToggleFlipOnExit:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1862 bFlipOnExit = bFlipOnExit == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1863 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1864 case UIMSG_ToggleAlwaysRun:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1865 bAlwaysRun = bAlwaysRun == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1866 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1867 case UIMSG_ToggleWalkSound:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1868 bWalkSound = bWalkSound == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1869 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1870 case UIMSG_ToggleShowDamage:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1871 bShowDamage = bShowDamage == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1872 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1873 case UIMSG_ChangeVoiceVolume:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1874 if ( uMessageParam == 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1875 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1876 --uVoicesVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1877 if ( (char)uVoicesVolumeMultiplier < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1878 uVoicesVolumeMultiplier = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1879 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1880 if ( !uVoicesVolumeMultiplier )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1881 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1882 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1883 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1884 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1885 if ( uMessageParam == 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1886 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1887 ++uVoicesVolumeMultiplier;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1888 if ( (char)uVoicesVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1889 uVoicesVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1890 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1891 if ( !uVoicesVolumeMultiplier )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1892 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1893 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1894 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1895 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1896 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1897 if ( (char)uVoicesVolumeMultiplier > 8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1898 uVoicesVolumeMultiplier = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1899 if ( !uVoicesVolumeMultiplier )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1900 continue;
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
1901 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
1902 continue;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1903 case UIMSG_SetTurnSpeed:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1904 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1905 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1906 uTurnSpeed = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1907 continue;
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1908
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1909 case UIMSG_SetGraphicsMode:
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1910 /*if ( !bUseLoResSprites )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1911 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1912 byte_6BE388_graphicsmode = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1913 MM7Initialization();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1914 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1915 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1916 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1917 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1918 if ( uMessageParam == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1919 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1920 byte_6BE388_graphicsmode = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1921 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1922 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1923 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1924 if ( uMessageParam != 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1925 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1926 byte_6BE388_graphicsmode = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1927 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1928 MM7Initialization();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1929 continue;
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1930 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1931 ModalWindow(pNPCTopics[453].pText, UIMSG_0);
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1932 __debugbreak(); // Nomad: graphicsmode as it was now removed
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1933 continue;
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
1934
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1935 case UIMSG_GameMenu_ReturnToGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1936 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1937 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1938 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1939 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1940 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1941 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1942 case UIMSG_OpenQuestBook:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1943 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1944 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1945 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1946 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1947 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1948 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1949 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1950 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1951 bFlashQuestBook = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1952 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1953 case UIMSG_OpenAutonotes:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1954 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1955 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1956 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1957 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1958 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1959 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1960 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1961 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1962 bFlashAutonotesBook = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1963 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1964 case UIMSG_OpenMapBook:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1965 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1966 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1967 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1968 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1969 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1970 viewparams->sViewCenterX = pParty->vPosition.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1971 viewparams->sViewCenterY = pParty->vPosition.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1972 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1973 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1974 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1975 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1976 case UIMSG_OpenCalendar:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1977 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1978 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1979 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1980 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1981 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1982 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1983 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1984 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1985 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1986 case UIMSG_OpenHistoryBook:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1987 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1988 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1989 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1990 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1991 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1992 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
1993 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1994 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1995 bFlashHistoryBook = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1996 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1997 case UIMSG_Escape:// нажатие Escape and return to game
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1998 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
1999 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2000 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2001 switch ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2002 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2003 case SCREEN_E:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2004 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2005 case SCREEN_NPC_DIALOGUE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2006 case SCREEN_CHEST:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2007 case SCREEN_CHEST_INVENTORY:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2008 case SCREEN_CHANGE_LOCATION:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2009 case SCREEN_INPUT_BLV:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2010 case SCREEN_QUICK_REFERENCE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2011 if ( dword_50CDC8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2012 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2013 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2014 uMessageParam = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2015 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2016 case SCREEN_HOUSE:
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2017 if ( !dword_50CDC8 )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2018 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2019 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2020 uMessageParam = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2021 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2022 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2023 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2024 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2025 if ( !pModalWindow )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2026 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2027 pRenderer->ClearZBuffer(0, 479);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2028 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2029 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2030 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2031 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2032 if ( pCurrentScreen > SCREEN_67 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2033 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2034 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2035 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2036 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2037 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2038 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2039 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2040 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2041 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2042 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2043 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2044 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2045 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2046 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2047 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2048 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2049 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2050 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2051 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2052 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2053 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2054 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2055 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2056 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2057 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2058 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2059 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2060 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2061 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2062 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2063 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2064 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2065 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2066 if ( pCurrentScreen < SCREEN_64 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2067 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2068 switch ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2069 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2070 case SCREEN_CASTING:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2071 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2072 if ( some_active_character )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2073 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2074 uActiveCharacter = some_active_character;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2075 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2076 some_active_character = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2077 if ( pParty->bTurnBasedModeOn )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2078 pTurnEngine->ApplyPlayerAction();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2079 _50C9D0_AfterEnchClickEventId = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2080 _50C9D4_AfterEnchClickEventSecondParam = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2081 _50C9D8_AfterEnchClickEventTimeout = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2082 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2083 if ( ptr_50C9A4_ItemToEnchant && ptr_50C9A4_ItemToEnchant->uItemID )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2084 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2085 LOBYTE(ptr_50C9A4_ItemToEnchant->uAttributes) &= 0xFu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2086 _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
2087 ptr_50C9A4_ItemToEnchant = nullptr;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2088 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2089 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2090 {
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2091 if ( pCurrentScreen == SCREEN_CHARACTERS )
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2092 pMouse->SetCursorBitmap("MICON2");
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2093 else
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2094 {
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2095 pGUIWindow_Settings->Release();
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2096 pGUIWindow_Settings = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2097 pMouse->SetCursorBitmap("MICON1");
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2098 GameUI_Footer_TimeLeft = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2099 _50C9A0_IsEnchantingInProgress = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2100 back_to_game();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2101 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2102 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2103 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2104 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2105 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2106 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2107 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2108 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2109 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2110 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2111 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2112 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2113 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2114 case SCREEN_BOOKS:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2115 pBooksWindow->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2116 //crt_deconstruct_ptr_6A0118();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2117 pBooksWindow = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2118 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2119 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2120 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2121 if ( pCurrentScreen == SCREEN_CHARACTERS )
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2122 pMouse->SetCursorBitmap("MICON2");
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2123 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2124 {
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2125 pGUIWindow_Settings->Release();
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2126 pGUIWindow_Settings = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2127 pMouse->SetCursorBitmap("MICON1");
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2128 GameUI_Footer_TimeLeft = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2129 _50C9A0_IsEnchantingInProgress = 0;
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2130 back_to_game();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2131 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2132 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2133 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2134 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2135 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2136 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2137 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2138 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2139 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2140 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2141 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2142 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2143 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2144 case SCREEN_SAVEGAME:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2145 case SCREEN_LOADGAME:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2146 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2147 //crt_deconstruct_ptr_6A0118();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2148 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2149 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2150 case SCREEN_CHEST_INVENTORY:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2151 pCurrentScreen = SCREEN_CHEST;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2152 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2153 case SCREEN_CHEST:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2154 pWindow2 = pChestWindow;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2155 pWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2156 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2157 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2158 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2159 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2160 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2161 case SCREEN_19:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2162 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2163 pWindow2 = ptr_507BC8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2164 pWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2165 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2166 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2167 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2168 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2169 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2170 case SCREEN_OPTIONS://Close
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2171 options_menu_skin.Relaease();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2172 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2173 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2174 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2175 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2176 WriteWindowsRegistryInt("WalkSound", bWalkSound);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2177 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
2151
92511cd8fcdb Cleaned some variables.
Nomad
parents: 2142
diff changeset
2178 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2179 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2180 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2181 if ( !uTurnSpeed )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2182 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2183 WriteWindowsRegistryInt("TurnDelta", 3);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2184 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2185 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2186 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2187 if ( uTurnSpeed == 64 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2188 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2189 WriteWindowsRegistryInt("TurnDelta", 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2190 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2191 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2192 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2193 if ( uTurnSpeed != 128 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2194 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2195 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2196 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2197 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2198 WriteWindowsRegistryInt("TurnDelta", 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2199 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2200 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2201 case SCREEN_MENU:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2202 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2203 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2204 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2205 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2206 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2207 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2208 case SCREEN_VIDEO_OPTIONS:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2209 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2210 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2211 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2212 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2213 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2214 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
2215 /*if ( !pRenderer->bWindowMode )
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
2216 WriteWindowsRegistryInt("GammaPos", uGammaPos);*/
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2217
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2218 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2219 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2220
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2221 case SCREEN_KEYBOARD_OPTIONS://Return to game
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2222 v197 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2223 v32 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2224 while ( !GameMenuUI_InvaligKeyBindingsFlags[v32])
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2225 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2226 ++v32;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2227 if ( v32 >= 28 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2228 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2229 thisb = (signed int)&uTextureID_Optkb;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2230 assert(false && "Invalid condition values");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2231 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2232 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2233 if ( *(int *)thisb )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2234 pIcons_LOD->pTextures[*(int *)thisb].Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2235 thisb += 4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2236 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2237 while ( thisb < (signed int)0x00507C08 );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2238
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2239 memset(&uTextureID_Optkb, 0, 0x14u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2240 pIcons_LOD->SyncLoadedFilesCount();
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2210
diff changeset
2241 for ( uAction = 0; uAction < 28; ++uAction )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2242 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2243 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2244 if ( v33 != pPrevVirtualCidesMapping[uAction] )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2245 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2246 if ( v197 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2247 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2248 v34 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2249 GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2250 v197 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2251 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2252 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2253 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2254 v35 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2255 GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2256 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2257 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2258 if ( uAction && uAction != 2 && uAction != 3 && uAction != 1 && uAction != 25 && uAction != 26 )
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2186
diff changeset
2259 pKeyToggleType = TOGGLE_OneTimePress;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2260 else
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2186
diff changeset
2261 pKeyToggleType = TOGGLE_Continuously;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2262 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2263 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2264 pKeyActionMap->StoreMappings();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2265 stru_506E40.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2266 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2267 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2268 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2269 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2270 case SCREEN_REST://close rest screen
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2271 if ( dword_506F14 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2272 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2273 Rest(_506F18_num_minutes_to_sleep);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2274 pParty->pPlayers[3].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2275 pParty->pPlayers[2].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2276 pParty->pPlayers[1].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2277 pParty->pPlayers[0].SetAsleep(false);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2278 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2279 pTexture_RestUI_CurrentSkyFrame->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2280 pTexture_RestUI_CurrentHourglassFrame->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2281 pTexture_RestUI_CurrentHourglassFrame = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2282 pTexture_RestUI_CurrentSkyFrame = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2283 pIcons_LOD->SyncLoadedFilesCount();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2284 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2285 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2286 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2287 pOutdoor->UpdateSunlightVectors();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2288 pOutdoor->UpdateFog();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2289 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2290 _506F18_num_minutes_to_sleep = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2291 dword_506F14 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2292 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2293 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2294 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2295 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2296 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2297 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2298 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2299 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2300 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2301 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2302 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2303 back_to_game();
2217
744ed51880ed expand button
Ritor1
parents: 2216
diff changeset
2304 }
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2305 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2306 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2307 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2308 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2309 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2310 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2311 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2312 pEventTimer->Resume();
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 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2315 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2316 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2317 case SCREEN_E:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2318 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2319 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2320 pCurrentScreen = SCREEN_HOUSE;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2321 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2322 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2323 case SCREEN_HOUSE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2324 if ( uDialogueType )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2325 uDialogueType = 0;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2326 if ( uGameState == GAME_STATE_CHANGE_LOCATION )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2327 {
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1916
diff changeset
2328 while ( HouseDialogPressCloseBtn() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2329 ;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2330 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2331 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2332 {
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1916
diff changeset
2333 if ( HouseDialogPressCloseBtn() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2334 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2335 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2336 GetHouseGoodbyeSpeech();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2337 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2338 pVideoPlayer->Unload();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2339 pGUIWindow_CurrentMenu = window_SpeakInHouse;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2340 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2341 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2342 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2343 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2344 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2345 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2346 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2347 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2348 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2349 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2350 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2351 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2352 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2353 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2354 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2355 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2356 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2357 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2358 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2359 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2360 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2361 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2362 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2363 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2364 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2365 case SCREEN_INPUT_BLV://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2366 if ( uCurrentHouse_Animation == 153 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2367 PlayHouseSound(0x99u, HouseSound_Greeting_2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2368 pVideoPlayer->Unload();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2369 if ( npcIdToDismissAfterDialogue )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2370 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2371 pParty->hirelingScrollPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2372 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2373 pParty->CountHirelings();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2374 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2375 npcIdToDismissAfterDialogue = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2376 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2377 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2378 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2379 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2380 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2381 case SCREEN_NPC_DIALOGUE://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2382 if ( npcIdToDismissAfterDialogue )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2383 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2384 pParty->hirelingScrollPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2385 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2386 pParty->CountHirelings();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2387 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2388 npcIdToDismissAfterDialogue = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2389 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2390 //goto LABEL_317;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2391 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2392 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2393 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2394 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2395 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2396 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2397 sub_4452BB();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2398 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2399 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2400 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2401 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2402 case SCREEN_CHANGE_LOCATION://click escape
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2403 if ( pParty->vPosition.x < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2404 pParty->vPosition.x = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2405 if ( pParty->vPosition.x > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2406 pParty->vPosition.x = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2407 if ( pParty->vPosition.y < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2408 pParty->vPosition.y = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2409 if ( pParty->vPosition.y > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2410 pParty->vPosition.y = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2411 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2412 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2413 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2414 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2415 case SCREEN_VIDEO:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2416 pVideoPlayer->Unload();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2417 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2418 case SCREEN_CHARACTERS:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2419 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2420 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2421 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2422 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2423 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2424 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2425 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2426 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2427 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2428 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2429 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2430 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2431 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2432 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2433 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2434 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2435 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2436 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2437 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2438 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2439 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2440 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2441 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2442 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2443 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2444 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2445 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2446 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2447 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2448 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2449 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2450 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2451 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2452 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2453 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2454 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2455 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2456 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2457 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2458 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2459 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2460 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2461 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2462 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2463 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2464 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2465 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2466 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2467 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2468 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2469 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2470 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2471 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2472 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2473 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2474 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2475 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2476 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2477 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2478 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2479 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2480 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2481 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2482 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2483 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2484 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2485 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2486 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2487 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2488 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2489 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2490 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2491 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2492 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2493 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2494 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2495 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2496 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2497 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2498 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2499 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2500 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2501 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2502 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2503 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2504 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2505 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2506 if ( pCurrentScreen == SCREEN_CHARACTERS )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2507 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2508 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2509 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2510 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2511 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2512 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2513 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2514 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2515 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2516 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2517 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2518 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2519 uActiveCharacter = pParty->GetNextActiveCharacter();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2520 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2521 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2522 window_SpeakInHouse = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2523 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2524 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2525 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2526 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2527 pIcons_LOD->RemoveTexturesFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2528 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2529 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2530 if ( !pGUIWindow_Settings )//Draw Menu
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2531 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2532 dword_6BE138 = -1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2533 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2534 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2535 pAudioPlayer->StopChannels(-1, -1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2536 pCurrentScreen = SCREEN_MENU;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2537
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2538 ++pIcons_LOD->uTexturePacksCount;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2539 if ( !pIcons_LOD->uNumPrevLoadedFiles )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2540 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2541
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
2542 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2543 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2544 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2545 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2546 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2547 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2548 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2549 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2550 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2551 pGlobalTXT_LocalizationStrings[614],// "New Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2552 pIcons_LOD->GetTexture(uTextureID_New1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2553 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
2554 pGlobalTXT_LocalizationStrings[615],// "Save Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2555 pIcons_LOD->GetTexture(uTextureID_Save1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2556 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
2557 pGlobalTXT_LocalizationStrings[616],// "Load Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2558 pIcons_LOD->GetTexture(uTextureID_Load1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2559 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
2560 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2561 pIcons_LOD->GetTexture(uTextureID_Controls1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2562 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2563 pGlobalTXT_LocalizationStrings[618],// "Quit"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2564 pIcons_LOD->GetTexture(uTextureID_Quit1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2565 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
2566 pGlobalTXT_LocalizationStrings[619],// "Return to Game"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2567 pIcons_LOD->GetTexture(uTextureID_Resume1), 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2568 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2569 viewparams->field_48 = 1;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2570
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2571 stru_506E40.Release();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2572 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
2131
651b24553ae9 savegame screenshot fix
Ritor1
parents: 2130
diff changeset
2573 stru_506E40.LoadPCXFile("gamma.pcx", 0);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
2574
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2575 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2576 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2577 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2578 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2579 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2580 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2581 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2582 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2583 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2584 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2585 ModalWindow_Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2586 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2587 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2588 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2589 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2590 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2591 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
2592 if ( pParty->hirelingScrollPosition < v37 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2593 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2594 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell???
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2595 if ( pParty->hirelingScrollPosition >= v37 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2596 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
2597 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2598 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2599 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2600 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2601 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2602 /*if ( pParty->field_709 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2603 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2604 --pParty->field_709;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2605 if ( pParty->field_709 < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2606 pParty->field_709 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2607 }*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2608 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2609 GameUI_DrawHiredNPCs();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2610 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2611 case UIMSG_TransitionUI_Confirm:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2612 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2613 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2614 dword_50CDC8 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2615 sub_42FBDD();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2616 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2617 pVideoPlayer->Unload();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2618 DialogueEnding();
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2619 viewparams->bRedrawGameUI = true;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2620 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
2621 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2622 if ( dword_59117C_teleportx )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2623 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2624 pParty->vPosition.x = dword_59117C_teleportx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2625 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2626 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2627 if ( dword_591178_teleporty )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2628 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2629 pParty->vPosition.y = dword_591178_teleporty;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2630 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2631 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2632 if ( dword_591174_teleportz )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2633 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2634 pParty->vPosition.z = dword_591174_teleportz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2635 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2636 pParty->uFallStartY = dword_591174_teleportz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2637 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2638 if ( dword_591170_teleport_directiony )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2639 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2640 pParty->sRotationY = dword_591170_teleport_directiony;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2641 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2642 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2643 if ( dword_59116C_teleport_directionx )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2644 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2645 pParty->sRotationX = dword_59116C_teleport_directionx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2646 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2647 v38 = dword_591168_teleport_speedz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2648 pParty->uFallSpeed = dword_591168_teleport_speedz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2649 dword_5B65BC = dword_591168_teleport_speedz;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2650 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2651 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2652 v38 = dword_5B65BC;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2653 if ( *dword_591164_teleport_map_name != 48 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2654 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2655 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2656 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
2657 OnMapLeave();
2101
ee2724b9ca05 RasterLine2D fix and etc.
Ritor1
parents: 2092
diff changeset
2658 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2659 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2660 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2661 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2662 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2663 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2664 pParty->uTimePlayed += 1474560i64;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2665 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2666 case UIMSG_TransitionWindowCloseBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2667 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2668 pVideoPlayer->Unload();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2669 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2670 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2671 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2672 case UIMSG_CycleCharacters:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2673 v39 = GetAsyncKeyState(VK_SHIFT);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2674 uActiveCharacter = CycleCharacter(v39);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2675 viewparams->bRedrawGameUI = true;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2676 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2677 case UIMSG_OnTravelByFoot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2678 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2679 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2680 dword_50CDC8 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2681 sub_42FBDD();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2682 //pNPCData4 = (NPCData *)GetTravelTime();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2683 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2684 if ( bUnderwater != 1 && pParty->bFlying
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2685 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2686 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2687 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2688 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2689 if ( pParty->vPosition.x < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2690 pParty->vPosition.x = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2691 if ( pParty->vPosition.x > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2692 pParty->vPosition.x = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2693 if ( pParty->vPosition.y < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2694 pParty->vPosition.y = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2695 if ( pParty->vPosition.y > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2696 pParty->vPosition.y = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2697 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2698 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2699 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2700 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2701 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2702 pParty->field_6E4 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2703 pParty->field_6E0 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2704 CastSpellInfoHelpers::_427D48();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2705 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2706 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2707 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2708 ++pGameLoadingUI_ProgressBar->uProgressMax;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2709 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2710 pGameLoadingUI_ProgressBar->Progress();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2711 RestAndHeal(1440 * (signed int)GetTravelTime());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2712 if ( pParty->uNumFoodRations )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2713 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2714 pParty->RestAndHeal();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2715 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2716 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2717 pPlayer7 = pParty->pPlayers.data();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2718 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2719 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2720 pPlayer7->SetCondition(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2721 ++pPlayer7;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2722 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2723 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings.data() );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2724 ++pParty->days_played_without_rest;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2725 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2726 Party::TakeFood((unsigned int)GetTravelTime());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2727 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2728 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2729 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2730 pPlayer8 = pParty->pPlayers.data();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2731 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2732 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2733 pPlayer8->SetCondition(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2734 ++pPlayer8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2735 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2736 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings.data() );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2737 ++pParty->days_played_without_rest;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2738 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2739 pPaletteManager->ResetNonLocked();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2740 pSpriteFrameTable->ResetSomeSpriteFlags();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2741 strcpy(pCurrentMapName, pOut);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2742 strcpy(pLevelName, pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2743 v41 = strtok(pLevelName, ".");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2744 strcpy(pLevelName, v41);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2745 Level_LoadEvtAndStr(pLevelName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2746 pDecalBuilder->Reset(0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2747 LoadLevel_InitializeLevelEvt();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2748 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2749 bUnderwater = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2750 bNoNPCHiring = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2751 pGame->uFlags2 &= 0xFFFFFFF7u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2752 if ( Is_out15odm_underwater() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2753 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2754 bUnderwater = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2755 pGame->uFlags2 |= 8u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2756 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2757 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2758 bNoNPCHiring = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2759 PrepareToLoadODM(1u, (ODMRenderParams *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2760 pAudioPlayer->SetMapEAX();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2761 bDialogueUI_InitializeActor_NPC_ID = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2762 OnMapLoad();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2763 pOutdoor->SetFog();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2764 TeleportToStartingPoint(uLevel_StartingPointType);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2765 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2766 pParty->uFallStartY = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2767 _461103_load_level_sub();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2768 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2769 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2770 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2771 pGameLoadingUI_ProgressBar->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2772 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2773 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2774 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2775 case UIMSG_CHANGE_LOCATION_ClickCencelBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2776 CloseWindowBackground();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2777 if ( pParty->vPosition.x < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2778 pParty->vPosition.x = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2779 if ( pParty->vPosition.x > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2780 pParty->vPosition.x = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2781 if ( pParty->vPosition.y < -22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2782 pParty->vPosition.y = -22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2783 if ( pParty->vPosition.y > 22528 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2784 pParty->vPosition.y = 22528;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2785 DialogueEnding();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2786 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2787 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2788 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2789 case UIMSG_CastSpell_Telekinesis:
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2790 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2791 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val();
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2792 /*else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2793 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2794 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2795 pPoint = pMouse->GetCursorPos(&v208);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2796 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]];
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
2797 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2798 v44 = (unsigned __int16)v42;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2799 v45 = PID_TYPE(v44);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2800 uNumSeconds = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2801 v46 = PID_ID(v44);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2802 if ( v45 == 3 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2803 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2804 v47 = pActors[v46].uAIState == Dead;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2805 if ( !v47 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2806 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2807 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2808 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2809 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2810 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2811 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2812 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2813 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2814 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2815 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2816 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2817 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2818 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2819 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2820 if ( v45 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2821 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2822 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2823 if ( !v47 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2824 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2825 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2826 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2827 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2828 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2829 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2830 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2831 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2832 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2833 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2834 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2835 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2836 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2837 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2838 if ( v45 == 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2839 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2840 v48 = pLevelDecorations[v46].uEventID == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2841 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2842 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2843 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2844 if ( v45 != 6 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2845 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2846 if ( uCurrentlyLoadedLevelType != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2847 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2848 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
2092
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2070
diff changeset
2849 if ( !pODMFace->Clickable() || !pODMFace->sCogTriggeredID )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2850 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2851 v44 = uNumSeconds;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2852 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2853 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2854 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2855 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2856 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2857 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2858 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2859 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2860 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2861 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2862 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2863 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2864 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2865 pBLVFace = &pIndoor->pFaces[v46];
2092
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2070
diff changeset
2866 if ( !pBLVFace->Clickable() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2867 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2868 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2869 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2870 if ( v48 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2871 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2872 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2873 pSpellInfo->uFlags &= ~0x40u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2874 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2875 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2876 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2877 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2878 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2879 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2880 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2881 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2882 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2883 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2884 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2885 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2886 case UIMSG_HiredNPC_CastSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2887 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2888 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2889 if ( _50C9A0_IsEnchantingInProgress )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2890 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2891 uActiveCharacter = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2892 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2893 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2894 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2895 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2896 if ( pGUIWindow_Settings )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2897 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2898 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2899 switch ( uMessage )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2900 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2901 case UIMSG_CastSpell_Character_Big_Improvement:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2902 pSpellInfo->uFlags &= ~0x02u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2903 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2904 case UIMSG_CastSpell_Character_Small_Improvement:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2905 pSpellInfo->uFlags &= ~0x0100u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2906 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2907 case UIMSG_HiredNPC_CastSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2908 pSpellInfo->uFlags &= ~0x0200u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2909 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2910 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2911 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2912 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2913 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2914 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2915 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2916 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2917 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2918 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2919 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2920 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2921 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2922 case UIMSG_BF:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2923 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2924 dword_50CDC8 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2925 sub_42FBDD();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2926 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2927 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
2928 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
2929 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2930 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2931 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2932 if ( v53 < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2933 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2934 v54 = abs(v53) - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2935 _5B65B8_npcdata_hiword_house_or_other = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2936 dword_5B65BC = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2937 v55 = dword_4E4560[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2938 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2939 v56 = dword_4E4590[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2940 v57 = dword_4E45A8[v54];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2941 _5B65A8_npcdata_uflags_or_other = v55;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2942 _5B65B4_npcdata_loword_house_or_other = v57;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2943 _5B65B0_npcdata_rep_or_other = v56;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2944 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2945 }
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1916
diff changeset
2946 HouseDialogPressCloseBtn();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2947 //goto LABEL_434;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2948 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2949 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2950 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2951 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2952 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2953 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2954 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
2955 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2956 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2957
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2958 case UIMSG_OnCastTownPortal:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2959 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
2960 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
2961 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2962
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2963 case UIMSG_OnCastLloydsBeacon:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2964 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
2965 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
2966 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2967
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2968 case UIMSG_LloydsBeacon_FlippingBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2969 bRecallingBeacon = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2970 v127 = uMessageParam + 204;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2971 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2972 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2973 case UIMSG_HintBeaconSlot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2974 if ( !pGUIWindow_CurrentMenu )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2975 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2976 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2977 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2978 if ( bRecallingBeacon )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2979 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2980 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2981 continue;
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents: 2253
diff changeset
2982 v173 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2983 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2984 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2985 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2986 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2987 pMapNum = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2988 pMapName = "Not in Map Stats";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2989 if ( pMapNum )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2990 pMapName = pMapStats->pInfos[pMapNum].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2991 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2992 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2993 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2994 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2995 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2996 }
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents: 2253
diff changeset
2997 v174 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2998 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
2999 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3000 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3001 case UIMSG_CloseAfterInstallBeacon:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3002 dword_50CDC8 = 1;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3003 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3004 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3005 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3006 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3007 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3008 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3009 ++pMessageQueue_50CBD0->uNumMessages;*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3010 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3011 case UIMSG_InstallBeacon:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3012 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3013 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3014 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3015 byte_506360 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3016 pPlayer9->CanCastSpell(uRequiredMana);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3017 if ( pParty->bTurnBasedModeOn )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3018 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3019 v60 = sRecoveryTime;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3020 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3021 pPlayer9->SetRecoveryTime(v60);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3022 pTurnEngine->ApplyPlayerAction();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3023 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3024 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3025 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3026 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3027 }
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3028 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
3029 if ( bRecallingBeacon )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3030 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3031 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3032 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3033 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3034 OnMapLeave();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3035 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
3036 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
3037 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3038 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3039 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3040 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3041 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3042 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3043 dword_5B65C0 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3044 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3045 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3046 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3047 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3048 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3049 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3050 pParty->uFallStartY = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3051 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3052 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3053 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3054 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3055 pBooksWindow->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3056 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3057 pBooksWindow = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3058 pGUIWindow_CurrentMenu = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3059 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3060 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3061 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3062 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3063 pRenderer->SaveScreenshot(a1, 92, 68);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3064 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1);
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3065 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
3066 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3067 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3068 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3069 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3070 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3071 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3072 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3073 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3074 {
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3075 if ( !_stricmp(pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName) )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3076 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3077 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3078 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3079 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3080 case UIMSG_ClickTownInTP:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3081 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3082 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3083 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3084 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3085 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3086 v63 = 208;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3087 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3088 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3089 v63 = 207;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3090 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3091 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3092 v63 = 211;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3093 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3094 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3095 v63 = 209;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3096 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3097 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3098 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3099 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3100 LABEL_486:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3101 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3102 v64 = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3103 v65 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3104 if ( v64 == TownPortalList[uMessageParam].uMapInfoID )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3105 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3106 pParty->vPosition.x = TownPortalList[v65].pos.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3107 pParty->vPosition.y = TownPortalList[v65].pos.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3108 pParty->vPosition.z = TownPortalList[v65].pos.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3109 pParty->uFallStartY = pParty->vPosition.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3110 pParty->sRotationY = TownPortalList[v65].rot_y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3111 pParty->sRotationX = TownPortalList[v65].rot_x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3112 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3113 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3114 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3115 SaveGame(1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3116 OnMapLeave();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
3117 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
3118 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3119 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3120 dword_5B65C0 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3121 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3122 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3123 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3124 v66 = TownPortalList[uMessageParam].rot_x;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3125 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3126 _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
3127 Actor::InitializeActors();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3128 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3129 v67 = (char*)pGUIWindow_CurrentMenu->Hint;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3130 if ( v67 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3131 *((int *)v67 + 17) = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3132 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3133 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3134 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3135 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3136 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3138 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3139 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3140 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3141 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3142 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3143 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3144 v63 = 210;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3145 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3146 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3147 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3148 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3149 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3150 v63 = 206;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3151 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3152 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3153 return;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3154 goto LABEL_486;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3155 case UIMSG_HintTownPortal:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3156 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3157 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3158 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3159 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3160 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3161 v68 = 208;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3162 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3163 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3164 v68 = 207;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3165 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3166 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3167 v68 = 211;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3168 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3169 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3170 v68 = 209;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3171 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3172 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3173 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3174 //goto LABEL_506;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3175 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3176 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3177 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3178 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3179 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3180 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3181 v69 = pMapStats->pInfos[4].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3182 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3183 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3184 v69 = pMapStats->pInfos[3].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3185 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3186 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3187 v69 = pMapStats->pInfos[10].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3188 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3189 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3190 v69 = pMapStats->pInfos[7].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3191 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3192 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3193 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3194 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3195 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3196 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3197 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3198 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3199 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3200 v69 = pMapStats->pInfos[8].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3201 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3202 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3203 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3204 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3205 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3206 v69 = pMapStats->pInfos[21].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3207 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3208 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3209 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3210 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3211 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3212 v68 = 210;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3213 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3214 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3215 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3216 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3217 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3218 v68 = 206;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3219 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3220 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3221 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3222 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3223 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3224 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3225 //LABEL_506:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3226 if ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3227 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3228 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3229 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3230 case 1:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3231 v69 = pMapStats->pInfos[4].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3232 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3233 case 2:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3234 v69 = pMapStats->pInfos[3].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3235 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3236 case 3:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3237 v69 = pMapStats->pInfos[10].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3238 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3239 case 4:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3240 v69 = pMapStats->pInfos[7].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3241 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3242 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3243 if ( uMessageParam != 5 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3244 //goto LABEL_519;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3245 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3246 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3247 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3248 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3249 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3250 v69 = pMapStats->pInfos[8].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3251 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3252 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3253 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3254 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3255 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3256 v69 = pMapStats->pInfos[21].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3257 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3258 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3259 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3260 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3261 case UIMSG_ShowFinalWindow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3262 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3263 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
3264 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3265 ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3266 uGameState = GAME_STATE_FINAL_WINDOW;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3267 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3268 case UIMSG_OnFinalWindowClose:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3269 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3270 uGameState = GAME_STATE_PLAYING;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3271 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3272 __debugbreak(); // missed break/continue?
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3273 case UIMSG_DD:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3274 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3275 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3276 memcpy(&v216, txt_file_frametable_parser(pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3277 if ( v216.uPropCount == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3278 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3279 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3280 v70 = atoi(v216.pProperties[0]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3281 if ( v70 <= 0 || v70 >= 77 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3282 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3283 v71 = v70;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3284 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3285 pNPCData3 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3286 if ( (signed int)pNPCData4 > 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3287 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3288 thish = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3289 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3290 {
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3291 if ( !_stricmp(pGames_LOD->pSubIndices[thish].pFilename, Str2) )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3292 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3293 ++thish;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3294 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3295 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3296 while ( (signed int)pNPCData3 < (signed int)pNPCData4 );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3297 if ( (signed int)pNPCData3 < (signed int)pNPCData4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3298 {
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
3299 strcpy(pCurrentMapName, pGames_LOD->pSubIndices[(int)pNPCData3].pFilename);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
3300 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2123
diff changeset
3301 uGameState = GAME_STATE_CHANGE_LOCATION;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3302 OnMapLeave();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3303 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3304 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3305 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3306 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3307 v73 = Str2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3308 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3309 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3310 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3311 if ( v216.uPropCount != 3 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3312 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3313 v74 = atoi(v216.pProperties[0]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3314 thisi = atoi(v216.pProperties[1]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3315 v75 = atoi(v216.pProperties[2]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3316 v76 = v75;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3317 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3318 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3319 if ( pIndoor->GetSector(v74, thisi, v75) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3320 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3321 v77 = thisi;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3322 pParty->vPosition.x = v74;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3323 pParty->vPosition.y = v77;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3324 pParty->vPosition.z = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3325 pParty->uFallStartY = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3326 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3327 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3328 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3329 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3330 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3331 if ( v74 > -32768 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3332 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3333 if ( v74 < 32768 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3334 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3335 v77 = thisi;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3336 if ( thisi > -32768 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3337 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3338 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3339 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3340 pParty->vPosition.x = v74;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3341 pParty->vPosition.y = v77;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3342 pParty->vPosition.z = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3343 pParty->uFallStartY = v76;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3344 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3345 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3346 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3347 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3348 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3349 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3350 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3351 v73 = "Can't jump to that location!";
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3352 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3353 ShowStatusBarString(v73, 6u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3354 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3355 case UIMSG_CastQuickSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3356 if ( bUnderwater == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3357 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3358 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3359 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3360 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3361 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3362 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3363 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3364 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3365 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3366 case UIMSG_CastSpell_Monster_Improvement:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3367 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm,
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3368 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3369 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3370 v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3371 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3372 /*else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3373 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3374 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3375 pPoint2 = pMouse->GetCursorPos(&v201);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3376 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]];
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3377 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3378 v83 = v81;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3379 v44 = (unsigned __int16)v81;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3380 v84 = v83 >> 16;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3381 if ( PID_TYPE(v44) != 3 || v84 >= 5120 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3382 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3383 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3384 if ( uMessage == UIMSG_CastSpell_Shoot_Monster )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3385 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3386 pSpellInfo->uFlags &= ~0x08;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3387 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3388 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3389 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3390 if ( uMessage == UIMSG_CastSpell_Monster_Improvement )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3391 pSpellInfo->uFlags &= ~0x0100u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3392 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3393 pSpellInfo->uFlags &= ~0x0200u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3394 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3395 pSpellInfo->uPlayerID_2 = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3396 pSpellInfo->spell_target_pid = v44;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3397 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3398 pGUIWindow_Settings->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3399 pGUIWindow_Settings = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3400 pMouse->SetCursorBitmap("MICON1");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3401 GameUI_Footer_TimeLeft = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3402 _50C9A0_IsEnchantingInProgress = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3403 back_to_game();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3404 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3405 case UIMSG_1C:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3406 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3407 if ( !uActiveCharacter || pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3408 continue;
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3409 ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3410 pCurrentScreen = SCREEN_19;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3411 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3412 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3413 case UIMSG_STEALFROMACTOR:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3414 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3415 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3416 if ( pParty->bTurnBasedModeOn != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3417 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3418 if ( pActors[uMessageParam].uAIState == 5 )
1966
7840fe323f67 stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents: 1936
diff changeset
3419 pActors[uMessageParam].LootActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3420 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3421 Actor::StealFrom(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3422 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3423 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3424 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3425 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3426 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3427 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3428 if ( pActors[uMessageParam].uAIState == 5 )
1966
7840fe323f67 stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents: 1936
diff changeset
3429 pActors[uMessageParam].LootActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3430 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3431 Actor::StealFrom(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3432 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3433 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3434
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3435 case UIMSG_Attack:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3436 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3437 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3438 if ( pParty->bTurnBasedModeOn != 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3439 {
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
3440 Player::_42ECB5_PlayerAttacksActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3441 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3442 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3443 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3444 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3445 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
3446 Player::_42ECB5_PlayerAttacksActor();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3447 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3448 case UIMSG_ExitRest:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3449 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
3450 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3451 case UIMSG_Wait5Minutes:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3452 if ( dword_506F14 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3453 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3454 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3455 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3456 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3457 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3458 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3459 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3460 dword_506F14 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3461 _506F18_num_minutes_to_sleep = 5;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3462 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3463 case UIMSG_Wait1Hour:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3464 if ( dword_506F14 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3465 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3466 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3467 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3468 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3469 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3470 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3471 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3472 dword_506F14 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3473 _506F18_num_minutes_to_sleep = 60;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3474 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3475 case UIMSG_RentRoom:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3476 dword_506F14 = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3477 RestUI_Load();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3478 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3479 _506F18_num_minutes_to_sleep = v86;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3480 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3481 _506F18_num_minutes_to_sleep = v86 + 12 * 60;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3482 dword_506F14 = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3483 pParty->RestAndHeal();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3484 pParty->days_played_without_rest = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3485 pParty->pPlayers[3].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3486 pParty->pPlayers[2].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3487 pParty->pPlayers[1].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3488 pParty->pPlayers[0].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3489 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3490 case UIMSG_RestWindow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3491 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3492 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3493 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3494 continue;
1936
68f2d9d3a1d9 MSVS 2010 project file
Ritor1
parents: 1919
diff changeset
3495 if ( CheckActors_proximity() )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3496 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3497 if ( pParty->bTurnBasedModeOn == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3498 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3499 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3500 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3501 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3502 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3503 if ( pParty->uFlags & 0x88 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3504 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3505 ShowStatusBarString(v88, 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3506 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3507 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3508 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3509 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3510 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3511 if ( pParty->bTurnBasedModeOn == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3512 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3513 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3514 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3515 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3516 if ( !(pParty->uFlags & 0x88) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3517 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3518 RestUI_Load();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3519 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3520 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3521 if ( pParty->bTurnBasedModeOn == 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3522 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3523 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3524 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3525 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3526 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3527 if ( pParty->uFlags & 0x88 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3528 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3529 ShowStatusBarString(v88, 2u);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3530 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3531 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3532 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3533 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3534 case UIMSG_Rest8Hour:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3535 if ( dword_506F14 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3536 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3537 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3538 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3539 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3540 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3541 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3542 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3543 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3544 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3545 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3546 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3547 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3548 {
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3549 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed;
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3550 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed;
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3551 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed;
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3552 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3553 v90 = pMapStats->GetMapInfo(pCurrentMapName);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3554 if ( !v90 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3555 v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3556 pMapInfo = &pMapStats->pInfos[v90];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3557 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3558 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3559 v91 = rand() % 100;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3560 v92 = pMapInfo->EncM1percent;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3561 v93 = v91 + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3562 if ( v93 > v92 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3563 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3564 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3565 pNPCData4 = (NPCData *)1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3566 if ( !_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3567 pNPCData4 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3568 if ( pNPCData4 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3569 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3570 pPlayerNum = rand() % 4;
2185
385040580292 CastSpell continue
Ritor1
parents: 2184
diff changeset
3571 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3572 v95 = rand();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3573 Rest(v95 % 6 + 60);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3574 _506F18_num_minutes_to_sleep = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3575 dword_506F14 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3576 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3577 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3578 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3579 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3580 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3581 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3582 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3583 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3584 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3585 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3586 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3587 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3588 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3589 Party::TakeFood(uRestUI_FoodRequiredToRest);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3590 _506F18_num_minutes_to_sleep = 480;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3591 dword_506F14 = 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3592 pParty->RestAndHeal();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3593 pParty->days_played_without_rest = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3594 pParty->pPlayers[3].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3595 pParty->pPlayers[2].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3596 pParty->pPlayers[1].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3597 pParty->pPlayers[0].SetAsleep(1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3598 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3599 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3600 case UIMSG_AlreadyResting:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3601 if ( dword_506F14 == 2 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3602 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3603 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3604 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3605 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3606 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3607 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3608 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3609 v97 = _494820_training_time(pParty->uCurrentHour);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3610 dword_506F14 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3611 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3612 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3613 case UIMSG_HintSelectRemoveQuickSpellBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3614 if ( quick_spell_at_page && byte_506550 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3615 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3616 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3617 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3618 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3619 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3620 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3621 if ( pPlayers[uActiveCharacter]->uQuickSpell )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3622 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3623 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3624 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3625 strcpy(pTmpBuf.data(), v177);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3626 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3627 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3628 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3629 case UIMSG_SPellbook_ShowHightlightedSpellInfo:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3630 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3631 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3632 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3633 if ( sub_4637E0_is_there_popup_onscreen() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3634 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3635 v98 = *(char *)(uNumSeconds + 6734);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3636 if ( quick_spell_at_page - 1 == uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3637 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3638 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3639 v161 = pGlobalTXT_LocalizationStrings[485];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3640 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3641 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3642 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3643 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3644 v161 = pGlobalTXT_LocalizationStrings[486];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3645 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3646 sprintfex(pTmpBuf.data(), v161, v178);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3647 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3648 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3649 case UIMSG_ClickInstallRemoveQuickSpellBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3650 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
3651 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3652 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3653 pPlayer10 = pPlayers[uActiveCharacter];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3654 if ( !byte_506550 || !quick_spell_at_page )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3655 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3656 pPlayer10->uQuickSpell = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3657 quick_spell_at_page = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3658 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3659 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3660 }
2184
e0863f5beee0 SPELL_WATER_RECHARGE_ITEM
Ritor1
parents: 2155
diff changeset
3661 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage;
e0863f5beee0 SPELL_WATER_RECHARGE_ITEM
Ritor1
parents: 2155
diff changeset
3662 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3663 if ( uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3664 pPlayer10->PlaySound(SPEECH_12, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3665 byte_506550 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3666 continue;
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3667 case UIMSG_SpellBook_PressTab://перелистывание страниц клавишей Tab
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3668 {
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3669 if ( !uActiveCharacter )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3670 continue;
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3671 int skill_count = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3672 uAction = 0;
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3673 for ( uint i = 0; i < 9; i++ )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3674 {
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3675 if ( pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i] )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3676 {
2197
42c8807225a2 UIMSG_SpellBook_PressTab continue
Ritor1
parents: 2186
diff changeset
3677 if ( pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i )
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3678 uAction = skill_count;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3679 v217[skill_count++] = i;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3680 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3681 }
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3682 if ( !skill_count )//нет скиллов
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3683 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3684 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3685 {
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3686 if ( GetAsyncKeyState(16) )
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3687 {
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3688 --uAction;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3689 if ( uAction < 0 )
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3690 uAction = skill_count - 1;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3691 }
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3692 else
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3693 {
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3694 ++uAction;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3695 if ( uAction >= skill_count )
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3696 uAction = 0;
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3697 }
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3698 OnCloseSpellBookPage();
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3699 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]);
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3700 pGUIWindow_CurrentMenu->OpenSpellBook();
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3701 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3702 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3703 continue;
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3704 }
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3705 case UIMSG_OpenSpellbookPage:
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3706 if ( pTurnEngine->turn_stage == TE_MOVEMENT || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3707 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3708 OnCloseSpellBookPage();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3709 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3710 pGUIWindow_CurrentMenu->OpenSpellBook();
2198
d9caf2b3d8d5 draw FlyAction and WaterWalk icons
Ritor1
parents: 2197
diff changeset
3711 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3712 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3713 case UIMSG_SelectSpell:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3714 {
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3715 if (pTurnEngine->turn_stage == TE_MOVEMENT)
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3716 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3717 if (!uActiveCharacter)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3718 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3719
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3720 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1966
diff changeset
3721 Player* player = pPlayers[uActiveCharacter];
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3722 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3723 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3724 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3725 if ( quick_spell_at_page - 1 == uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3726 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3727 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3728 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3729 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3730 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3731 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3732 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3733 /*if ( dword_50C9E8 < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3734 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3735 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3736 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3737 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3738 ++dword_50C9E8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3739 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3740 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3741 // pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3742 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3743 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3744 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3745 byte_506550 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3746 quick_spell_at_page = uMessageParam + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3747 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3748 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3749 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3750 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3751
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3752 case UIMSG_CastSpellFromBook:
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3753 if ( pTurnEngine->turn_stage != TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3754 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3755 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3756
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3757 case UIMSG_SpellScrollUse:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3758 __debugbreak();
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3759 if ( pTurnEngine->turn_stage != TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3760 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3761 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3762 case UIMSG_SpellBookWindow:
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2225
diff changeset
3763 if ( pTurnEngine->turn_stage == TE_MOVEMENT )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3764 continue;
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3765 if ( bUnderwater == true )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3766 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3767 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3768 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3769 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3770 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3771 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3772 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3773 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3774 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3775 {
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3776 if ( pCurrentScreen == SCREEN_GAME )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3777 {
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3778 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3779 pCurrentScreen = SCREEN_SPELL_BOOK;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3780 pEventTimer->Pause();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3781 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3782 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3783 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3784 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3785 }
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3786 if ( pCurrentScreen != SCREEN_REST && pCurrentScreen != SCREEN_CHARACTERS
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3787 && (pCurrentScreen <= SCREEN_63 || pCurrentScreen > SCREEN_67) )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3788 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3789 pGUIWindow_CurrentMenu->Release();
2186
7a517c9a1d5b CastSpell continue
Ritor1
parents: 2185
diff changeset
3790 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3791 pCurrentScreen = SCREEN_SPELL_BOOK;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3792 pEventTimer->Pause();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3793 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3794 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3795 viewparams->field_48 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3796 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3797 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3798 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3799 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3800 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3801 case UIMSG_QuickReference:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3802 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3803 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3804 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3805 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3806 ++pIcons_LOD->uTexturePacksCount;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3807 if ( !pIcons_LOD->uNumPrevLoadedFiles )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3808 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3809 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3810 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3811 pEventTimer->Pause();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3812 pAudioPlayer->StopChannels(-1, -1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3813 pCurrentScreen = SCREEN_QUICK_REFERENCE;
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2212
diff changeset
3814 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_QuickReference, 5, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3815 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3816 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3817 pGlobalTXT_LocalizationStrings[79],// "Exit"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3818 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3819 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3820 case UIMSG_GameMenuButton:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3821 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3822 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3823 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3824 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3825 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3826 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3827 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3828
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3829 stru_506E40.Release();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3830 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
2131
651b24553ae9 savegame screenshot fix
Ritor1
parents: 2130
diff changeset
3831 stru_506E40.LoadPCXFile("gamma.pcx", 0);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
3832
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3833 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3834 //LABEL_453:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3835 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3836 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3837 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3838 //goto LABEL_770;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3839 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3840 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3841 ++pMessageQueue_50CBD0->uNumMessages;*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
3842 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3843 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3844 case UIMSG_ClickAwardScrollBar:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3845 books_page_number = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3846 if ( pMouse->GetCursorPos(&v211)->y > 178 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3847 books_page_number = -1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3848 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3849 case UIMSG_ClickAwardsUpBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3850 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
3851 BtnUp_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3852 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3853 case UIMSG_ClickAwardsDownBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3854 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
3855 BtnDown_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3856 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3857 case UIMSG_ChangeDetaliz:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3858 bRingsShownInCharScreen ^= 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3859 pCharacterScreen_DetalizBtn->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3860 pCharacterScreen_DollBtn->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3861 if ( bRingsShownInCharScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3862 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3863 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3864 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3865 v123 = 445;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3866 v121 = 470;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3867 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3868 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3869 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3870 v128 = 30;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3871 v125 = 30;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3872 v123 = 300;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3873 v121 = 600;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3874 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3875 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0,
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3876 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3877 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3878 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
3879 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3880 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3881 case UIMSG_ClickPaperdoll:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3882 OnPaperdollLeftClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3883 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3884 case UIMSG_ClickStatsBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3885 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3886 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3887 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3888 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
3889 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3890 case UIMSG_ClickSkillsBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3891 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3892 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3893 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3894 CharacterUI_SkillsTab_CreateButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3895 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
3896 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3897 case UIMSG_SkillUp:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3898 pPlayer4 = pPlayers[uActiveCharacter];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3899 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3900 LOWORD(v2) = *(short *)v105;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3901 uNumSeconds = v2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3902 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3903 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3904 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3905 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3906 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3907 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3908 if ( (uNumSeconds & 0x3F) < 0x3C )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3909 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3910 *(short *)v105 = uNumSeconds + 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3911 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3912 pPlayer4->PlaySound(SPEECH_14, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3913 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3914 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3915 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3916 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3917 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3918 ShowStatusBarString(v87, 2);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3919 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3920 case UIMSG_ClickInventoryBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3921 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3922 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3923 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3924 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
3925 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3926 case UIMSG_ClickExitCharacterWindowBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3927 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
3928 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3929 case UIMSG_ClickAwardsBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3930 ReleaseAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3931 CharacterUI_ReleaseButtons();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3932 CreateAwardsScrollBar();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3933 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3934 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
3935 FillAwardsData();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3936 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3937 case UIMSG_ClickBooksBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3938 switch ( uMessageParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3939 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3940 case 11://Page UP
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3941 BtnUp_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3942 pButton = pBtn_Book_2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3943 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3944 case 10://Page DOWN
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3945 BtnDown_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3946 pButton = pBtn_Book_1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3947 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3948 case 0://Zoom plus
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3949 pButton = pBtn_Book_1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3950 BtnDown_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3951 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3952 case 1://Zoom minus
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3953 pButton = pBtn_Book_2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3954 BtnUp_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3955 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3956 case 2://Potions
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3957 Book_PageBtn3_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3958 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3959 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3960 pButton = pBtn_Book_3;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3961 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3962 case 3://fountains
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3963 Book_PageBtn4_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3964 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3965 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3966 pButton = pBtn_Book_4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3967 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3968 case 4://obelisks
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3969 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3970 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3971 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3972 pButton = pBtn_Book_5;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3973 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3974 case 5://seer
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3975 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3976 if ( dword_506364 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3977 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3978 pButton = pBtn_Book_6;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3979 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3980 case 6://misc
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3981 pButton = pBtn_Autonotes_Misc;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3982 Autonotes_Misc_page_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3983 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3984 case 7://Instructors
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3985 pButton = pBtn_Autonotes_Instructors;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3986 Autonotes_Instructors_page_flag = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3987 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3988 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3989 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3990 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3991 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3992 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3993 case UIMSG_SelectCharacter:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3994 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3995 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3996 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3997 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3998 case UIMSG_ShowStatus_Funds:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
3999 v174 = (char *)pParty->uNumGoldInBank;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4000 //v158 = pParty->uNumGold + pParty->uNumGoldInBank;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4001 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
4002 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4003 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4004 case UIMSG_ShowStatus_DateTime:
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4005 currHour = pParty->uCurrentHour;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4006 uNumSeconds = 1;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4007 if (pParty->uCurrentHour > 12 )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4008 {
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4009 if (pParty->uCurrentHour >= 24)
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4010 uNumSeconds = 0;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4011 currHour = (currHour - 12);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4012 }
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4013 else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4014 {
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4015 if (pParty->uCurrentHour < 12) // 12:00 is PM
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4016 uNumSeconds = 0;
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4017 if (pParty->uCurrentHour == 0)
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4018 currHour = 12;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4019 }
2224
c2eeeb991a87 some more pvs warning fixes
Grumpy7
parents: 2202
diff changeset
4020 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
4021 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4022 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4023 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4024 case UIMSG_ShowStatus_Food:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4025 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4026 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4027 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4028 case UIMSG_ShowStatus_Player:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4029 pPlayer5 = pPlayers[uMessageParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4030 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4031 strcat(pTmpBuf.data(), ": ");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4032 v107 = pPlayer5->GetMajorConditionIdx();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4033 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4034 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4035 v108 = 8 * uMessageParam - 8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4036 LOBYTE(v108) = v108 | 4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4037 pMouse->uPointingObjectID = PID(OBJECT_Player,v108);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4038 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4039 case UIMSG_ShowStatus_ManaHP:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4040 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(),
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4041 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(),
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4042 pGlobalTXT_LocalizationStrings[212]);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4043 GameUI_SetFooterString(pTmpBuf.data());
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4044 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4045 case UIMSG_CHEST_ClickItem:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4046 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4047 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4048 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4049 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4050 }
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2341
diff changeset
4051 Chest::OnChestLeftClick();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4052 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4053 case UIMSG_InventoryLeftClick:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4054 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4055 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4056 case UIMSG_MouseLeftClickInGame:
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4057 /*if ( !pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4058 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4059 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4060 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4061 OnGameViewportClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4062 continue;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4063 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4064 v115 = pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4065 if ( !pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4066 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4067 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4068 /*if ( (signed int)v115 < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4069 //goto LABEL_769;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4070 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4071 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4072 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4073 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4074 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4075 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4076 }*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4077 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4078 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4079 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4080 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4081 pMessageQueue_50CBD0->uNumMessages = 1;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4082 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4083 /*v115 = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4084 pMessageQueue_50CBD0->uNumMessages = v0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4085 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4086 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4087 //goto LABEL_771;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4088 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4089 ++pMessageQueue_50CBD0->uNumMessages;*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4090 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4091 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4092 v115 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4093 pMessageQueue_50CBD0->uNumMessages = 0;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4094 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4095 /*if ( (signed int)v115 < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4096 //goto LABEL_769;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4097 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4098 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4099 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4100 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4101 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4102 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4103 }*/
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4104 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4105 case UIMSG_MouseLeftClickInScreen://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4106 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4107 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4108 OnGameViewportClick();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4109 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4110 case UIMSG_F:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4111 __debugbreak();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4112 //if ( pRenderer->pRenderD3D )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4113 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4114 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4115 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4116 /*else
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4117 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4118 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4119 pPoint3 = pMouse->GetCursorPos(&v204);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4120 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
4121 }*/
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4122 pButton2 = (GUIButton *)(unsigned __int16)v116;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4123 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4124 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4125 case UIMSG_54:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4126 __debugbreak();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4127 pButton2 = (GUIButton *)uMessageParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4128 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4129 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4130 case UIMSG_Game_Action:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4131 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4132 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4133 OnPressSpace();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4134 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4135 case UIMSG_ClickZoomOutBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4136 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4137 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4138 pParty->uFlags |= 2u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4139 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4140 uNumSeconds = 131072;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4141 v118 = 2 * viewparams->uMinimapZoom;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4142 ++viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4143 viewparams->uMinimapZoom *= 2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4144 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4145 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4146 if ( (signed int)v118 > 4096 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4147 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4148 viewparams->uMinimapZoom = 4096;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4149 viewparams->field_28 = 12;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4150 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4151 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4152 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4153 v119 = 2048;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4154 if ( (signed int)v118 <= 2048 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4155 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4156 _576E2C_current_minimap_zoom = v118;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4157 dword_576E28 = viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4158 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4159 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4160 viewparams->field_28 = 11;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4161 viewparams->uMinimapZoom = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4162 _576E2C_current_minimap_zoom = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4163 dword_576E28 = viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4164 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4165 case UIMSG_ClickZoomInBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4166 if ( pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4167 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4168 pParty->uFlags |= 2u;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4169 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4170 uNumSeconds = 32768;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4171 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4172 --viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4173 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4174 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4175 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4176 v119 = 512;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4177 if ( (signed int)v118 < 512 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4178 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4179 viewparams->field_28 = 9;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4180 v118 = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4181 viewparams->uMinimapZoom = v119;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4182 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4183 _576E2C_current_minimap_zoom = v118;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4184 dword_576E28 = viewparams->field_28;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4185 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4186 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4187 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4188 if ( (signed int)v118 < 256 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4189 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4190 viewparams->uMinimapZoom = 256;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4191 viewparams->field_28 = 8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4192 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4193 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4194 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4195 continue;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4196 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4197 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4198 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4199 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4200 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4201 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4202 //dword_50C9E8 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4203
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4204
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4205 pMessageQueue_50C9E8->uNumMessages=0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4206 if ( dword_50C9DC )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4207 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4208 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4209 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4210 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4211 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4212 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4213 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4214 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4215 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4216 dword_50C9DC = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4217 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4218 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4219 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4220 if ( _50C9D0_AfterEnchClickEventId > 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4221 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4222 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4223 if ( _50C9D8_AfterEnchClickEventTimeout <= 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4224 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4225 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4226 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4227 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4228 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4229 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4230 ++pMessageQueue_50CBD0->uNumMessages;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4231 }*/
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4232 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4233 _50C9D0_AfterEnchClickEventId = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4234 _50C9D4_AfterEnchClickEventSecondParam = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4235 _50C9D8_AfterEnchClickEventTimeout = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4236 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4237 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4238 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4239 CastSpellInfoHelpers::_427E01_cast_spell();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4240 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4241 //----- (00435748) --------------------------------------------------------
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4242 void GUI_MainMenuMessageProc()
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4243 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4244 Player *pPlayer; // ebx@2
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4245 void *v3; // edi@21
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4246 signed int v4; // eax@29
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4247 // int v5; // ecx@29
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4248 // PLAYER_SKILL_TYPE v6; // edi@37
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4249 GUIWindow *pWindow; // eax@56
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4250 GUIButton *pButton; // eax@59
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4251 int v15; // edi@70
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4252 char v20; // dl@116
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4253 unsigned int v21; // eax@116
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4254 unsigned int v25; // eax@120
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4255 unsigned int v26; // ecx@127
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4256 // SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
4257 // signed int v41; // [sp-10h] [bp-20h]@29
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4258 int pParam; // [sp+4h] [bp-Ch]@3
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4259 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4260 int pSex; // [sp+Ch] [bp-4h]@3
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4261
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4262 if ( pMessageQueue_50CBD0->uNumMessages )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4263 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4264 pPlayer = pParty->pPlayers.data();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4265 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4266 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4267 int param2;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4268 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &param2);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4269 //auto player = &pParty->pPlayers[pParam];
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4270
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4271 switch (pUIMessageType) // For buttons of window MainMenu
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4272 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4273 case UIMSG_MainMenu_ShowPartyCreationWnd:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4274 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4275 SetCurrentMenuID(MENU_NEWGAME);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4276 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4277 case UIMSG_MainMenu_ShowLoadWindow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4278 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4279 SetCurrentMenuID(MENU_SAVELOAD);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4280 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4281 case UIMSG_ShowCredits:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4282 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4283 SetCurrentMenuID(MENU_CREDITS);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4284 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4285 case UIMSG_ExitToWindows:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4286 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4287 SetCurrentMenuID(MENU_EXIT_GAME);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4288 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4289 case UIMSG_PlayerCreation_SelectAttribute:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4290 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4291 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4292 uPlayerCreationUI_SelectedCharacter = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4293 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4294 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4295 case UIMSG_PlayerCreation_VoicePrev:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4296 pSex = pParty->pPlayers[pParam].GetSexByVoice();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4297 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4298 {
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4299 if (pParty->pPlayers[pParam].uVoiceID == 0)
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4300 pParty->pPlayers[pParam].uVoiceID = 19;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4301 else --pParty->pPlayers[pParam].uVoiceID;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4302 }
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4303 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4304 pButton = pCreationUI_BtnPressLeft2[pParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4305 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4306 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4307 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4308 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4309 case UIMSG_PlayerCreation_VoiceNext:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4310 pSex = pParty->pPlayers[pParam].GetSexByVoice();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4311 do
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4312 {
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4313 pParty->pPlayers[pParam].uVoiceID = (pParty->pPlayers[pParam].uVoiceID + 1) % 20;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4314 }
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4315 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4316 pButton = pCreationUI_BtnPressRight2[pParam];
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4317 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4318 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4319 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4320 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4321 case UIMSG_PlayerCreation_FacePrev:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4322 //pPlayer = &pParty->pPlayers[pParam];
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4323 if (!pParty->pPlayers[pParam].uCurrentFace)
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4324 pParty->pPlayers[pParam].uCurrentFace = 19;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4325 else
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4326 pParty->pPlayers[pParam].uCurrentFace -= 1;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4327 pParty->pPlayers[pParam].uVoiceID = pParty->pPlayers[pParam].uCurrentFace;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4328 pParty->pPlayers[pParam].SetInitialStats();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4329 pParty->pPlayers[pParam].SetSexByVoice();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4330 pParty->pPlayers[pParam].RandomizeName();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4331 v25 = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4332 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4333 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4334 uPlayerCreationUI_SelectedCharacter = v25;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4335 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
4336 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4337 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4338 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4339 case UIMSG_PlayerCreation_FaceNext:
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4340 //pPlayer = &pParty->pPlayers[pParam];
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4341 v20 = (char)((int)pParty->pPlayers[pParam].uCurrentFace + 1) % 20;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4342 pParty->pPlayers[pParam].uCurrentFace = v20;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4343 pParty->pPlayers[pParam].uVoiceID = v20;
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4344 pParty->pPlayers[pParam].SetInitialStats();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4345 pParty->pPlayers[pParam].SetSexByVoice();
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4346 pParty->pPlayers[pParam].RandomizeName();
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4347 v21 = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4348 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4349 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4350 uPlayerCreationUI_SelectedCharacter = v21;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4351 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
4352 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
1916
918a8cebd7a4 LoadGame slots error fix
Ritor1
parents: 1915
diff changeset
4353 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4354 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4355 case UIMSG_PlayerCreationClickPlus:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4356 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4357 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4358 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4359 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4360 case UIMSG_PlayerCreationClickMinus:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4361 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4362 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4363 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4364 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4365 case UIMSG_PlayerCreationSelectActiveSkill:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4366 if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4367 pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pParam + 4)] = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4368 pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4369 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4370 case UIMSG_PlayerCreationSelectClass:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4371 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4372 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4373 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4374 case UIMSG_PlayerCreationClickOK:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4375 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4376 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4377 GameUI_Footer_TimeLeft = GetTickCount() + 4000;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4378 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4379 uGameState = GAME_STATE_STARTING_NEW_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4380 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4381 case UIMSG_PlayerCreationClickReset:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4382 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4383 pParty->Reset();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4384 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4385 case UIMSG_PlayerCreationRemoveUpSkill:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4386 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4387 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
4388 if ( pPlayer[pParam].GetSkillIdxByOrder(2) != 37 )//37 - None(Нет)
18b0ff5e1bf1 pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Нет)
Ritor1
parents: 2101
diff changeset
4389 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(2)] = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4390 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4391 case UIMSG_PlayerCreationRemoveDownSkill:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4392 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4393 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
4394 if ( pPlayer[pParam].GetSkillIdxByOrder(3) != 37 )//37 - None(Нет)
18b0ff5e1bf1 pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Нет)
Ritor1
parents: 2101
diff changeset
4395 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0;
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4396 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4397 case UIMSG_PlayerCreationChangeName:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4398 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4399 v3 = (void *)pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4400 uPlayerCreationUI_SelectedCharacter = pParam;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4401 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4402 pGUIWindow_CurrentMenu->ptr_1C = v3;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4403 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4404 case UIMSG_ChangeGameState:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4405 uGameState = GAME_FINISHED;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4406 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4407 case UIMSG_ChangeCursor:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4408 pMouse->SetCursorBitmap("MICON2");
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4409 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4410 case UIMSG_3A:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4411 SetCurrentMenuID(MENU_DebugBLVLevel);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4412 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4413 case UIMSG_LoadGame:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4414 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4415 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4416 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4417 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4418 case UIMSG_SelectLoadSlot:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4419 //main menu save/load wnd clicking on savegame lines
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4420 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4421 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4422 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4423 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4424 //load clicked line
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4425 v26 = pParam + pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4426 if ( dword_6BE138 == pParam + pSaveListPosition )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4427 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4428 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4429 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4430 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4431 uLoadGameUI_SelectedSlot = v26;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4432 dword_6BE138 = v26;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4433 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4434 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4435 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4436 //typing in the line
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4437 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
2389
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
4438 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
6a7309a847ea removing some (const char *) casts
Grumpy7
parents: 2370
diff changeset
4439 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4440 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4441 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4442 case UIMSG_SaveLoadBtn:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4443 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
4444 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4445 case UIMSG_DownArrow:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4446 ++pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4447 if ( pSaveListPosition >= pParam )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4448 pSaveListPosition = pParam - 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4449 if ( pSaveListPosition < 1 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4450 pSaveListPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4451 pWindow = pGUIWindow_CurrentMenu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4452 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
4453 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4454 case UIMSG_Cancel:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4455 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
4456 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4457 case UIMSG_ArrowUp:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4458 --pSaveListPosition;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4459 if ( pSaveListPosition < 0 )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4460 pSaveListPosition = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4461 pWindow = pGUIWindow_CurrentMenu;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4462 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
4463 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4464 case UIMSG_AD:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4465 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
4466 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4467 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4468 case UIMSG_AE:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4469 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
4470 SetCurrentMenuID(MENU_DebugBLVLevel);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4471 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4472 case UIMSG_Escape:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4473 if ( pModalWindow )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4474 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4475 ModalWindow_Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4476 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4477 }
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
4478 if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000))
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4479 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4480 v15 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4481 pVideoPlayer->bStopBeforeSchedule = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4482 viewparams->bRedrawGameUI = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4483 viewparams->field_48 = 1;
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4484 if ( GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_MMT_MAIN_MENU
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4485 || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC )
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4486 {
2137
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2132
diff changeset
4487 //if ( pCurrentScreen == SCREEN_VIDEO )
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2132
diff changeset
4488 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4489 if (GetCurrentMenuID() == MENU_NAMEPANELESC) //из панели изменения имени
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4490 {
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4491 SetCurrentMenuID(MENU_CREATEPARTY);//в окно создания группы
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4492 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4493 }
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4494 if (GetCurrentMenuID() == MENU_CREDITSPROC) //из окна Создатели
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4495 {
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2346
diff changeset
4496 SetCurrentMenuID(MENU_CREDITSCLOSE);//в закрытие Создатели
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4497 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4498 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4499 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4500 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4501 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4502 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4503 {
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2137
diff changeset
4504 //if ( pCurrentScreen == SCREEN_VIDEO )
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2137
diff changeset
4505 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4506 if (GetCurrentMenuID() == MENU_NAMEPANELESC)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4507 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4508 SetCurrentMenuID(MENU_CREATEPARTY);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4509 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4510 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4511 if (GetCurrentMenuID() == MENU_CREDITSPROC)
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4512 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4513 SetCurrentMenuID(MENU_CREDITSCLOSE);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4514 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4515 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
4516 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0);
1915
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4517 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4518 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4519 if ( pCurrentScreen == SCREEN_LOADGAME )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4520 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4521 pIcons_LOD->RemoveTexturesPackFromTextureList();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4522 //crt_deconstruct_ptr_6A0118();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4523 pTexture_PCX.Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4524 pTexture_PCX.Load("title.pcx", 0);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4525 SetCurrentMenuID(MENU_MAIN);
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4526 v15 = 1;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4527 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4528 pGUIWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4529 pGUIWindow2 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4530 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4531 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4532 viewparams->bRedrawGameUI = v15;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4533 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4534 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4535 if ( pCurrentScreen == SCREEN_VIDEO )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4536 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4537 pVideoPlayer->Unload();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4538 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4539 else
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4540 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4541 if ( pCurrentScreen != SCREEN_1B )
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4542 {
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4543 pGUIWindow_CurrentMenu->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4544 pGUIWindow2->Release();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4545 pGUIWindow2 = 0;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4546 pEventTimer->Resume();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4547 pCurrentScreen = SCREEN_GAME;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4548 viewparams->bRedrawGameUI = v15;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4549 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4550 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4551 //VideoPlayer::dtor();
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4552 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4553 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4554 default:
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4555 break;
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4556 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4557 }
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4558 while ( pMessageQueue_50CBD0->uNumMessages );
6e39bf5f13dd GameUI_MsgProc() movement
Ritor1
parents: 1861
diff changeset
4559 }
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4560 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4561
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4562
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4563
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4564 //----- (0042FBDD) --------------------------------------------------------
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4565 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
4566 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4567 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
4568 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
4569 pRenderer->Present();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4570 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4571
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4572 //----- (0042FC15) --------------------------------------------------------
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4573 void CloseWindowBackground()
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4574 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2290
diff changeset
4575 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
4576 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
4577 pRenderer->Present();
0
Ritor1
parents:
diff changeset
4578 }