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