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