World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Engine.cpp
См. документацию.
1 #include "Engine/Engine.h"
2 
3 #ifdef _WINDOWS
4 #include <direct.h>
5 #include <io.h>
6 #endif
7 
8 #include <algorithm>
9 
10 #include "src/Application/Game.h"
11 
12 #include "Engine/EngineConfig.h"
13 #include "Engine/Events.h"
14 #include "Engine/LOD.h"
15 #include "Engine/Localization.h"
16 #include "Engine/MapsLongTimer.h"
17 #include "Engine/OurMath.h"
18 #include "Engine/Party.h"
19 #include "Engine/SaveLoad.h"
20 #include "Engine/SpellFxRenderer.h"
21 #include "Engine/Time.h"
22 #include "Engine/stru123.h"
23 
31 #include "Engine/Graphics/Lights.h"
38 #include "Engine/Graphics/Vis.h"
40 #include "Engine/Graphics/stru10.h"
41 #include "Engine/Graphics/stru9.h"
42 
43 #include "Engine/Objects/Actor.h"
44 #include "Engine/Objects/Chest.h"
47 
53 
55 
57 
58 #include "Arcomage/Arcomage.h"
59 
60 #include "IO/Keyboard.h"
61 #include "IO/Mouse.h"
62 
63 #include "GUI/GUIButton.h"
64 #include "GUI/GUIFont.h"
65 #include "GUI/GUIProgressBar.h"
66 #include "GUI/GUIWindow.h"
67 #include "GUI/UI/UICredits.h"
68 #include "GUI/UI/UIDialogue.h"
69 #include "GUI/UI/UIGame.h"
70 #include "GUI/UI/UIHouses.h"
71 #include "GUI/UI/UIMainMenu.h"
72 #include "GUI/UI/UIPartyCreation.h"
73 #include "GUI/UI/UISaveLoad.h"
74 #include "GUI/UI/UIStatusBar.h"
75 
77 #include "Media/MediaPlayer.h"
78 
79 #include "Platform/Api.h"
81 
83 
85 
86 /*
87 
88 static bool b = false;
89 static UIAnimation torchA;
90 static UIAnimation torchB;
91 static UIAnimation torchC;
92 if (!b)
93 {
94 torchA.icon = pIconsFrameTable->GetIcon("torchA");
95 torchA.uAnimTime = 0;
96 torchA.uAnimLength = torchA.icon->GetAnimLength();
97 
98 torchB.icon = pIconsFrameTable->GetIcon("torchB");
99 torchB.uAnimTime = 0;
100 torchB.uAnimLength = torchB.icon->GetAnimLength();
101 
102 torchC.icon = pIconsFrameTable->GetIcon("torchC");
103 torchC.uAnimTime = 0;
104 torchC.uAnimLength = torchC.icon->GetAnimLength();
105 
106 b = true;
107 }
108 
109 auto icon = pIconsFrameTable->GetFrame(torchA.icon->id, GetTickCount()/2);
110 render->DrawTextureAlphaNew(64 / 640.0f, 48 / 480.0f, icon->texture);
111 
112 icon = pIconsFrameTable->GetFrame(torchB.icon->id, GetTickCount() / 2);
113 render->DrawTextureAlphaNew((64 + torchA.icon->texture->GetWidth())/ 640.0f, 48
114 / 480.0f, icon->texture);
115 
116 icon = pIconsFrameTable->GetFrame(torchC.icon->id, GetTickCount() / 2);
117 render->DrawTextureAlphaNew((64 + torchA.icon->texture->GetWidth() +
118 torchB.icon->texture->GetWidth()) / 640.0f, 48 / 480.0f, icon->texture);
119 
120 */
121 
123 
124 void SetDataPath(const char *data_path) { s_data_path = data_path; }
125 
126 std::string MakeDataPath(const char *file_rel_path) {
127  return s_data_path + "\\" + file_rel_path;
128 }
129 
130 std::shared_ptr<Engine> engine;
131 
132 
133 
134 
136  uint32_t c = color16;
137  uint32_t b = (c & 31) * 8;
138  uint32_t g = ((c >> 5) & 63) * 4;
139  uint32_t r = ((c >> 11) & 31) * 8;
140 
141  return Color32(r, g, b);
142 }
143 
145  return (a << 24) | (r << 16) | (g << 8) | b;
146 }
147 
149  return (b >> (8 - 5)) | 0x7E0 & (g << (6 + 5 - 8)) |
150  0xF800 & (r << (6 + 5 + 5 - 8));
151 }
152 
153 bool FileExists(const char *fname) {
154  return access(fname, 0) != -1;
155 }
156 
158  engine->ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
159  engine->Deinitialize();
160  render->Release();
161  delete window;
162  exit(exitCode);
163 }
164 
165 //----- (0044103C) --------------------------------------------------------
166 void Engine::Draw() {
169 
172  pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * pi_double * pParty->sRotationY / 2048.0);
173  pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * pi_double * pParty->sRotationY / 2048.0);
174  pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel; // 193, but real 353
175 
176  // pIndoorCamera->Initialize2();
180 
181  if (pMovie_Track) {
182  /*if ( !render->pRenderD3D )
183  {
184  render->BeginSceneD3D();
185  pMouse->DrawCursorToTarget();
186  render->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
187  }*/
188  } else {
189  if (pParty->vPosition.x != pParty->vPrevPosition.x ||
195  pParty->uFlags |= 2u;
199  // v0 = &render;
202 
204  render->BeginSceneD3D();
205 
206  // if ( !render->pRenderD3D )
207  // pMouse->DrawCursorToTarget();
208  if (!PauseGameDrawing() || viewparams->field_48 == 1) {
209  // if ( render->pRenderD3D )
210  {
211  float v2 =
212  (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0;
213  // v3 = v2 + 6.7553994e15;
214  // render->field_1036A8_bitmapid = LODWORD(v3);
215  render->hd_water_current_frame = floorf(v2 + 0.5f);
216  }
217 
219  pIndoor->Draw();
221  pOutdoor->Draw();
222  else
223  Error("Invalid level type: %u", uCurrentlyLoadedLevelType);
224 
226  lightmap_builder->DrawLightmapsType(2); // mobile lights - sparks ??
227  }
228  render->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
229  }
230 
231  // 2d from now on
232  // DEBUG: force redraw gui
233  viewparams->bRedrawGameUI = true;
234 
235  render->BeginScene();
236  DrawGUI();
237  int v4 = viewparams->bRedrawGameUI;
241 
242  if (v4)
243  mouse->bRedraw = true;
245  mouse->DrawCursor();
246  mouse->Activate();
247  render->EndScene();
248  render->Present();
249  pParty->uFlags &= ~2;
250 }
251 
253  render->ResetUIClipRect();
254 
255  // if (render->pRenderD3D)
258  viewparams->bRedrawGameUI = true;
259  int v4 = viewparams->bRedrawGameUI;
261  if (!viewparams->bRedrawGameUI) {
263  } else {
266  viewparams->bRedrawGameUI = false;
267  }
268 
269 
270  if (!pMovie_Track) { // ! pVideoPlayer->pSmackerMovie)
271  GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true); // redraw = pParty->uFlags & 2);
272  if (v4) {
273  if (!PauseGameDrawing() /*&& render->pRenderD3D*/) { // clear game
274  // viewport with
275  // transparent
276  // color
277 
278  if (!(config->renderer_name == "OpenGL")) { // do not want in opengl mode
279  render->FillRectFast(
283  0x7FF);
284  }
285  viewparams->field_48 = 0;
286  }
287  }
288  }
289 
292 
294  if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C)
300  if (!pMovie_Track) {
304  }
305 
306  static bool render_framerate = false;
307  static float framerate = 0.0f;
308  static uint frames_this_second = 0;
309  static uint last_frame_time = OS_GetTime();
310  static uint framerate_time_elapsed = 0;
311 
314  pWeather->Draw(); // Ritor1: my include
315 
316  // while(GetTickCount() - last_frame_time < 33 );//FPS control
317  uint frame_dt = OS_GetTime() - last_frame_time;
318  last_frame_time = OS_GetTime();
319  framerate_time_elapsed += frame_dt;
320  if (framerate_time_elapsed >= 1000) {
321  framerate = frames_this_second * (1000.0f / framerate_time_elapsed);
322 
323  framerate_time_elapsed = 0;
324  frames_this_second = 0;
325  render_framerate = true;
326  }
327 
328  ++frames_this_second;
329 
330  if (engine->config->show_fps) {
331  if (render_framerate) {
332  pPrimaryWindow->DrawText(pFontArrus, 494, 0, Color16(0, 0, 0),
333  StringPrintf("FPS: % .4f", framerate), 0,
334  0, 0);
335  }
336 
337  int debug_info_offset = 0;
339  int sector_id = pIndoor->GetSector(
342  pFontArrus, 16, debug_info_offset = 16, Color16(255, 255, 255),
343  StringPrintf("Party Sector ID: %u/%u\n", sector_id,
345  0, 0, 0);
346  }
348  pFontArrus, 16, debug_info_offset + 16, Color16(255, 255, 255),
349  StringPrintf("Party Position: % d % d % d",
351  pParty->vPosition.z),
352  0, 0, 0);
353 
354  String floor_level_str;
356  uint uFaceID;
357  int sector_id = pIndoor->GetSector(
359  int floor_level = BLV_GetFloorLevel(
361  pParty->vPosition.z + 40, sector_id, &uFaceID);
362  floor_level_str = StringPrintf(
363  "BLV_GetFloorLevel: %d face_id %d\n", floor_level, uFaceID);
365  bool on_water = false;
366  int _a6;
367  int floor_level = ODM_GetFloorLevel(
369  0, &on_water, &_a6, false);
370  floor_level_str = StringPrintf(
371  "ODM_GetFloorLevel: %d on_water: %s a6 = %d\n",
372  floor_level, on_water ? "true" : "false", _a6);
373  }
374  pPrimaryWindow->DrawText(pFontArrus, 16, debug_info_offset + 16 + 16,
375  Color16(255, 255, 255), floor_level_str, 0, 0,
376  0);
377  }
378 }
379 
380 //----- (0047A815) --------------------------------------------------------
383 }
384 
385 //----- (0044F120) --------------------------------------------------------
387  Game__StationaryLight *pLight;
388 
389  for (int i = 0; i < uNumStationaryLights; ++i) {
390  pLight = &pStationaryLights[i];
392  pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z,
393  pLight->flt_18, pLight->vRGBColor.x, pLight->vRGBColor.y,
394  pLight->vRGBColor.z, _4E94D0_light_type);
395  }
396 }
397 
398 //----- (0044EEA7) --------------------------------------------------------
399 bool Engine::_44EEA7() { // cursor picking - particle update
400  float depth; // ST00_4@9
401  __int64 v6; // kr00_8@21
402  Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2
403  Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2
404 
405  ++qword_5C6DF0;
407  Point pt = mouse->GetCursorPos();
408 
409  // x = cursor.y;
410  // y = cursor.x;
412  v11 = &vis_face_filter;
413  v10 = &vis_sprite_filter_2;
415  } else {
416  if (config->IsTargetingMode()) {
417  v11 = &vis_face_filter;
418  v10 = &vis_sprite_filter_1;
419  } else {
420  v11 = &vis_face_filter;
421  v10 = &vis_sprite_filter_4;
422  }
423  depth = 5120.0;
424  }
425  // depth = v2;
426 
427  PickMouse(depth, pt.x, pt.y, false, v10, v11);
432  if (!_44F07B())
433  return false;
434 
435  if (engine->config->DrawBlvDebugs())
437  if (/*render->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor)
438  render->uFogColor = GetLevelFogColor() & 0xFFFFFF;
439  // if (uFlags & GAME_FLAGS_1_400)
440  // engine->config->SetForceRedraw(true);
441  /*if ( !render->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor &&
442  pMobileLightsStack->uNumLightsActive )
443  {
444  uFlags2 |= 0x01;
445  field_E10 = qword_5C6DF0;
446  }*/
447  // v6 = qword_5C6DF0 - field_E10;
448  if (qword_5C6DF0/* - field_E10 == 1*/)
449  engine->SetForceRedraw(true);
450 
452  engine->SetForceRedraw(true);
454  }
455  return true;
456 }
457 
458 //----- (0044EDE4) --------------------------------------------------------
459 bool Engine::AlterGamma_BLV(BLVFace *pFace, unsigned int *pColor) {
460  if (CanSaturateFaces() && pFace->uAttributes & FACE_CAN_SATURATE_COLOR) {
461  *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
462  return true;
463  } else {
464  return false;
465  }
466 }
467 
468 bool Engine::AlterGamma_ODM(ODMFace *pFace, unsigned int *pColor) {
469  if (engine->CanSaturateFaces() && pFace->uAttributes & FACE_CAN_SATURATE_COLOR) {
470  *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
471  return true;
472  } else {
473  return false;
474  }
475 }
476 
477 //----- (004645FA) --------------------------------------------------------
479  OS_SetAppInt("startinwindow", 1); // render->bWindowMode);
480  // if (render->bWindowMode)
481  {
482  OS_SetAppInt("window X", window->GetX());
483  OS_SetAppInt("window Y", window->GetY());
484  }
485  OS_SetAppInt("valAlwaysRun", config->always_run ? 1 : 0);
486  pItemsTable->Release();
487  pNPCStats->Release();
488 
489  if (mouse)
490  mouse->Deactivate();
491 
492  render = nullptr;
493 
495 
496  delete pEventTimer;
497 }
498 
499 //----- (0044EE7C) --------------------------------------------------------
501  if (/*uFlags & 0x04*/ engine->config->debug_lightmaps_decals) {
504  }
505  return true;
506 }
507 
508 //----- (0044EC23) --------------------------------------------------------
509 int Engine::_44EC23_saturate_face_odm(Polygon *a2, int *a3, signed int a4) {
510  double v4; // st7@4
511  // double v5; // ST00_8@4
512  signed int v6; // eax@5
513  // double v7; // ST00_8@6
514  signed int result; // eax@8
515  // double v9; // ST00_8@9
516  // double v10; // ST00_8@11
517  float a2a; // [sp+14h] [bp+8h]@4
518  float a3a; // [sp+18h] [bp+Ch]@4
519  float a3b; // [sp+18h] [bp+Ch]@6
520  float a4a; // [sp+1Ch] [bp+10h]@9
521  float a4b; // [sp+1Ch] [bp+10h]@11
522 
523  if (CanSaturateFaces() && a2->field_59 == 5 &&
524  a2->pODMFace->uAttributes & FACE_CAN_SATURATE_COLOR) {
525  v4 = (double)a4;
526  a2a = v4;
527  *a3 |= 2u;
528  a3a = (1.0 - this->fSaturation) * v4;
529  // v5 = a3a + 6.7553994e15;
530  // if ( SLODWORD(v5) >= 0 )
531  if (floorf(a3a + 0.5f) >= 0) {
532  a3b = (1.0 - this->fSaturation) * a2a;
533  // v7 = a3b + 6.7553994e15;
534  // v6 = LODWORD(v7);
535  v6 = floorf(a3b + 0.5f);
536  } else {
537  v6 = 0;
538  }
539  if (a4 >= v6) {
540  a4a = (1.0 - fSaturation) * a2a;
541  // v9 = a4a + 6.7553994e15;
542  // if ( SLODWORD(v9) >= 0 )
543  if (floorf(a4a + 0.5f) >= 0) {
544  a4b = (1.0 - fSaturation) * a2a;
545  // v10 = a4b + 6.7553994e15;
546  // result = LODWORD(v10);
547  result = floorf(a4b + 0.5f);
548  } else {
549  result = 0;
550  }
551  } else {
552  result = a4;
553  }
554  } else {
555  result = -1;
556  }
557  return result;
558 }
559 
560 //----- (0044ED0A) --------------------------------------------------------
561 int Engine::_44ED0A_saturate_face_blv(BLVFace *a2, int *a3, signed int a4) {
562  double v4; // st7@3
563  // double v5; // ST00_8@3
564  int v6; // eax@4
565  // double v7; // ST00_8@5
566  int result; // eax@7
567  // double v9; // ST00_8@8
568  // double v10; // ST00_8@10
569  float v11; // [sp+14h] [bp+8h]@3
570  float v12; // [sp+18h] [bp+Ch]@3
571  float v13; // [sp+18h] [bp+Ch]@5
572  float v14; // [sp+1Ch] [bp+10h]@8
573  float v15; // [sp+1Ch] [bp+10h]@10
574 
575  if (engine->CanSaturateFaces() && a2->uAttributes & FACE_CAN_SATURATE_COLOR) {
576  v4 = (double)a4;
577  v11 = v4;
578  *a3 |= 2u;
579  v12 = (1.0 - this->fSaturation) * v4;
580  // v5 = v12 + 6.7553994e15;
581  if (floorf(v12 + 0.5f) /* SLODWORD(v5)*/ >= 0) {
582  v13 = (1.0 - this->fSaturation) * v11;
583  // v7 = v13 + 6.7553994e15;
584  // v6 = LODWORD(v7);
585  v6 = floorf(v13 + 0.5f);
586  } else {
587  v6 = 0;
588  }
589  if (a4 >= v6) {
590  v14 = (1.0 - fSaturation) * v11;
591  // v9 = v14 + 6.7553994e15;
592  if (floorf(v14 + 0.5f) /* SLODWORD(v9)*/ >= 0) {
593  v15 = (1.0 - fSaturation) * v11;
594  // v10 = v15 + 6.7553994e15;
595  // result = LODWORD(v10);
596  result = floorf(v15 + 0.5f);
597  } else {
598  result = 0;
599  }
600  } else {
601  result = a4;
602  }
603  } else {
604  result = -1;
605  }
606  return result;
607 }
608 
609 //----- (0044E4B7) --------------------------------------------------------
611  this->log = EngineIoc::ResolveLogger();
616  this->mouse = EngineIoc::ResolveMouse();
619  this->vis = EngineIoc::ResolveVis();
620 
623 
624  // pThreadWardInstance = nullptr;
625  // pParticleEngine = new ParticleEngine;
626  // pMouse = pMouseInstance = new Mouse;
627  // pLightmapBuilder = new LightmapBuilder;
628  // pVisInstance = new Vis;
629  // spellfx = new SpellFxRenderer;
631  pStru9Instance = new stru9;
632  pStru10Instance = new stru10;
633  // pStru11Instance = new stru11;
634  // pStru11Instance = nullptr;
635  // pStru12Instance = new stru12(pStru11Instance);
636  // pStru12Instance = nullptr;
637  // pCShow = new CShow;
638  // pCShow = nullptr;
639  // pKeyboardInstance = new Keyboard;
640  // pGammaController = new GammaController;
641 }
642 
643 //----- (0044E7F3) --------------------------------------------------------
645  // delete pGammaController;
646  // delete pKeyboardInstance;
647  /*delete pCShow;
648  delete pStru12Instance;
649  delete pStru11Instance;*/
650  delete pStru10Instance;
651  delete pStru9Instance;
652  delete pIndoorCameraD3D;
653  // delete spellfx;
654  // delete pVisInstance;
655  // delete pLightmapBuilder;
656  // delete pMouseInstance;
657  // delete pParticleEngine;
658  // delete pThreadWardInstance;
659 }
660 
661 //----- (0044EA5E) --------------------------------------------------------
662 bool Engine::PickMouse(float fPickDepth, unsigned int uMouseX,
663  unsigned int uMouseY, bool bOutline,
664  Vis_SelectionFilter *sprite_filter,
665  Vis_SelectionFilter *face_filter) {
666  /*if (current_screen_type != SCREEN_GAME|| !render->pRenderD3D)
667  return false;*/
668 
669  // if (!vis) {
670  // log->Warning(
671  // L"The 'Vis' object pointer has not been instatiated, but "
672  // L"CGame::Pick() is trying to call through it.");
673  // return false;
674  // }
675 
676  if (uMouseX >= (signed int)pViewport->uScreen_TL_X &&
677  uMouseX <= (signed int)pViewport->uScreen_BR_X &&
678  uMouseY >= (signed int)pViewport->uScreen_TL_Y &&
679  uMouseY <= (signed int)pViewport->uScreen_BR_Y) {
680  vis->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter);
681 
682  if (bOutline)
684  }
685 
686  return true;
687 }
688 // 4E28F8: using guessed type int current_screen_type;
689 
690 //----- (0044EB12) --------------------------------------------------------
691 bool Engine::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter,
692  Vis_SelectionFilter *face_filter) {
694  bool r = vis->PickKeyboard(&vis->default_list, sprite_filter, face_filter);
695 
696  if (bOutline)
698  return r;
699  }
700  return false;
701 }
702 /*
703 Result::Code Game::PickKeyboard(bool bOutline, struct unnamed_F93E6C *a3, struct
704 unnamed_F93E6C *a4)
705 {
706 if (dword_4E28F8_PartyCantJumpIfTrue)
707 return Result::Generic;
708 
709 pVis->PickKeyboard(a3, a4);
710 if (bOutline)
711 Game_outline_selection((int)this);
712 return Result::Success;
713 }
714 */
715 // 4E28F8: using guessed type int current_screen_type;
716 
717 //----- (0044EB5A) --------------------------------------------------------
720  return;
721 
722  Vis_ObjectInfo *object_info = vis->default_list.object_pointers[0];
723  if (object_info) {
724  switch (object_info->object_type) {
725  case VisObjectType_Sprite: {
726  log->Warning(L"Sprite outline currently unsupported");
727  return;
728  }
729 
730  case VisObjectType_Face: {
732  ODMFace *face = (ODMFace *)object_info->object;
733  if (face->uAttributes & FACE_OUTLINED)
734  face->uAttributes &= ~FACE_OUTLINED;
735  else
736  face->uAttributes |= FACE_OUTLINED;
737  } else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) {
738  BLVFace *face = (BLVFace *)object_info->object;
739  if (face->uAttributes & FACE_OUTLINED)
740  face->uAttributes &= ~FACE_OUTLINED;
741  else
742  face->uAttributes |= FACE_OUTLINED;
743  } else {
744  Error("Invalid level type", uCurrentlyLoadedLevelType);
745  }
746  } break;
747 
748  default: {
749  Error(
750  "Undefined CObjectInfo type requested in "
751  "CGame::outline_selection()");
753  }
754  }
755  }
756 }
757 
758 
759 
760 //----- (0042FC15) --------------------------------------------------------
763 }
764 
765 //----- (0046BDC0) --------------------------------------------------------
767  if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME) {
768  dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
769  return;
770  }
771 
776 
778 }
779 
780 //----- (004646F0) --------------------------------------------------------
781 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen) {
782  Vis *vis = EngineIoc::ResolveVis();
783  vis->_4C1A02();
784 
785  pEventTimer->Pause();
786  pMiscTimer->Pause();
787  pParty->uFlags = 2;
789  engine->ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
790  DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1);
791  pMiscTimer->Resume();
792  pEventTimer->Resume();
793 }
794 
795 //----- (00464866) --------------------------------------------------------
796 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box) {
797  char *v3; // eax@1
798  unsigned int v5; // eax@3
799 
800  // v9 = bLoading;
801  engine->ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
802  pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1
805  char Str1[20]; // [sp+Ch] [bp-18h]@1
806  strcpy(Str1, pCurrentMapName.c_str());
807  v3 = strtok(Str1, ".");
808  strcpy(Str1, v3);
809  Level_LoadEvtAndStr(Str1);
811  strcpy(Str1, pCurrentMapName.c_str());
812  _strrev(Str1);
813  strtok(Str1, ".");
814  _strrev(Str1);
815 
816  for (uint i = 0; i < 1000; ++i)
817  pSpriteObjects[i].uObjectDescID = 0;
818 
820 
821  uLevelMapStatsID = v5;
822 
823  engine->SetUnderwater(Is_out15odm_underwater());
824 
825  pParty->floor_face_pid = 0;
826  if (_stricmp(Str1, "blv"))
827  PrepareToLoadODM(bLoading, 0);
828  else
829  PrepareToLoadBLV(bLoading);
830 
831  engine->_461103_load_level_sub();
832  if ((pCurrentMapName == "d11.blv") ||
833  (pCurrentMapName == "d10.blv")) {
834  // spawning grounds & walls of mist - no loot & exp from monsters
835 
836  for (uint i = 0; i < uNumActors; ++i) {
837  pActors[i].pMonsterInfo.uTreasureType = 0;
838  pActors[i].pMonsterInfo.uTreasureDiceRolls = 0;
839  pActors[i].pMonsterInfo.uExp = 0;
840  }
841  }
843  OnMapLoad();
845  memset(&render->pBillboardRenderListD3D, 0,
846  sizeof(render->pBillboardRenderListD3D));
848  _flushall();
849 }
850 
851 //----- (004647AB) --------------------------------------------------------
856 
857  // pIndoorCamera = new IndoorCamera;
858  // pIndoorCamera->Initialize(65, viewparams->uScreen_BttmR_X -
859  // viewparams->uScreen_topL_X + 1,
860  // viewparams->uScreen_BttmR_Y -
861  // viewparams->uScreen_topL_Y + 1);
862 
867 }
868 
869 bool MM7_LoadLods(const char *mm7_path) {
871  if (!pIcons_LOD->Load(StringPrintf("%s\\data\\icons.lod", mm7_path),
872  "icons")) {
873  Error("Some files are missing\n\nPlease Reinstall.");
874  return false;
875  }
877 
879  if (!pEvents_LOD->Load(
880  StringPrintf("%s\\data\\events.lod", mm7_path).c_str(), "icons")) {
881  Error("Some files are missing\n\nPlease Reinstall.");
882  return false;
883  }
884 
886  if (!pBitmaps_LOD->Load(
887  StringPrintf("%s\\data\\bitmaps.lod", mm7_path).c_str(),
888  "bitmaps")) {
889  Error(localization->GetString(63), localization->GetString(184));
890  return false;
891  }
892 
894  if (!pSprites_LOD->LoadSprites(StringPrintf("%s\\data\\sprites.lod", mm7_path))) {
895  Error(localization->GetString(63), localization->GetString(184));
896  return false;
897  }
898 
899  return true;
900 }
901 
902 //----- (004651F4) --------------------------------------------------------
903 bool Engine::MM7_Initialize(const std::string &mm7_path) {
904  srand(OS_GetTime());
905 
908 
909  IRenderFactory renderFactory;
910  render = renderFactory.Create(
911  config->renderer_name,
912  !config->RunInWindow());
913 
914  if (!render) {
915  log->Warning(L"Render creation failed");
916  return false;
917  } else {
919  "Might and Magic® Trilogy",
920  render->config->render_width,
921  render->config->render_height);
922 
923  if (!render->Initialize(window)) {
924  log->Warning(L"Render failed to initialize");
925  return false;
926  }
927  }
928 
929  game_starting_year = 1168;
930 
931  pParty = new Party;
932  memset(&pParty->pHirelings, 0, sizeof(pParty->pHirelings));
933  pParty->uWalkSpeed = 384;
934  pParty->uDefaultEyelevel = 160;
938 
939  MM6_Initialize();
940 
942 
943  OnTimer(1);
945 
946  MM7_LoadLods(mm7_path.c_str());
947 
948  localization = new Localization();
950 
951  {
952  void *sft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadCompressedTexture("dsft.bin")
953  : nullptr,
954  *sft_mm8 = nullptr;
955  void *sft_mm7 = pEvents_LOD->LoadCompressedTexture("dsft.bin");
957  pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8);
958  free(sft_mm6);
959  free(sft_mm7);
960  free(sft_mm8);
961 
962  void *tft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadCompressedTexture("dtft.bin")
963  : nullptr,
964  *tft_mm8 = nullptr;
965  void *tft_mm7 = pEvents_LOD->LoadCompressedTexture("dtft.bin");
967  pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8);
968  free(tft_mm6);
969  free(tft_mm7);
970  free(tft_mm8);
971 
972  void *tiles_mm6 = pIcons_LOD_mm6
973  ? pIcons_LOD_mm6->LoadCompressedTexture("dtile.bin")
974  : nullptr,
975  *tiles_mm8 = nullptr;
976  void *tiles_mm7 = pEvents_LOD->LoadCompressedTexture("dtile.bin");
977  pTileTable = new TileTable;
978  pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8);
979  free(tiles_mm6);
980  free(tiles_mm7);
981  free(tiles_mm8);
982 
983  void *pft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadCompressedTexture("dpft.bin")
984  : nullptr,
985  *pft_mm8 = nullptr;
986  void *pft_mm7 = pEvents_LOD->LoadCompressedTexture("dpft.bin");
988  pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8);
989  free(pft_mm6);
990  free(pft_mm7);
991  free(pft_mm8);
992 
993  void *ift_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadCompressedTexture("dift.bin")
994  : nullptr,
995  *ift_mm8 = nullptr;
996  void *ift_mm7 = pEvents_LOD->LoadCompressedTexture("dift.bin");
998  pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8);
999  free(ift_mm6);
1000  free(ift_mm7);
1001  free(ift_mm8);
1002 
1003  void *decs_mm6 = pIcons_LOD_mm6
1004  ? pIcons_LOD_mm6->LoadCompressedTexture("ddeclist.bin")
1005  : nullptr,
1006  *decs_mm8 = nullptr;
1007  void *decs_mm7 = pEvents_LOD->LoadCompressedTexture("ddeclist.bin");
1009  pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8);
1010  free(decs_mm6);
1011  free(decs_mm7);
1012  free(decs_mm8);
1013 
1014  void *objs_mm6 = pIcons_LOD_mm6
1015  ? pIcons_LOD_mm6->LoadCompressedTexture("dobjlist.bin")
1016  : nullptr,
1017  *objs_mm8 = nullptr;
1018  void *objs_mm7 = pEvents_LOD->LoadCompressedTexture("dobjlist.bin");
1019  pObjectList = new ObjectList;
1020  pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8);
1021  free(objs_mm6);
1022  free(objs_mm7);
1023  free(objs_mm8);
1024 
1025  void *mons_mm6 = pIcons_LOD_mm6
1026  ? pIcons_LOD_mm6->LoadCompressedTexture("dmonlist.bin")
1027  : nullptr,
1028  *mons_mm8 = nullptr;
1029  void *mons_mm7 = pEvents_LOD->LoadCompressedTexture("dmonlist.bin");
1030  pMonsterList = new MonsterList;
1031  pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8);
1032  free(mons_mm6);
1033  free(mons_mm7);
1034  free(mons_mm8);
1035 
1036  void *chests_mm6 = pIcons_LOD_mm6
1037  ? pIcons_LOD_mm6->LoadCompressedTexture("dchest.bin")
1038  : nullptr,
1039  *chests_mm8 = nullptr;
1040  void *chests_mm7 = pEvents_LOD->LoadCompressedTexture("dchest.bin");
1041  pChestList = new ChestList;
1042  pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8);
1043  free(chests_mm6);
1044  free(chests_mm7);
1045  free(chests_mm8);
1046 
1047  void *overlays_mm6 = pIcons_LOD_mm6
1048  ? pIcons_LOD_mm6->LoadCompressedTexture("doverlay.bin")
1049  : nullptr,
1050  *overlays_mm8 = nullptr;
1051  void *overlays_mm7 = pEvents_LOD->LoadCompressedTexture("doverlay.bin");
1052  pOverlayList = new OverlayList;
1053  pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8);
1054  free(overlays_mm6);
1055  free(overlays_mm7);
1056  free(overlays_mm8);
1057 
1058  void *sounds_mm6 = pIcons_LOD_mm6
1059  ? pIcons_LOD_mm6->LoadCompressedTexture("dsounds.bin")
1060  : nullptr,
1061  *sounds_mm8 = nullptr;
1062  void *sounds_mm7 = pEvents_LOD->LoadCompressedTexture("dsounds.bin");
1063  pSoundList = new SoundList;
1064  pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8);
1065  free(sounds_mm6);
1066  free(sounds_mm7);
1067  free(sounds_mm8);
1068  }
1069 
1070  if (!config->NoSound())
1072 
1073  pMediaPlayer = new MPlayer();
1075 
1076  dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
1077 
1078  return true;
1079 }
1080 
1081 //----- (00465D0B) --------------------------------------------------------
1084 
1085  pItemsTable = new ItemsTable;
1087 
1088  // pBitmaps_LOD->can_load_hardware_sprites = 1;
1089  // pBitmaps_LOD->SetupPalettes(render->uTargetRBits, render->uTargetGBits,
1090  // render->uTargetBBits);
1091  pBitmaps_LOD->SetupPalettes(5, 6, 5);
1092  // pIcons_LOD->SetupPalettes(render->uTargetRBits, render->uTargetGBits,
1093  // render->uTargetBBits);
1094  pIcons_LOD->SetupPalettes(5, 6, 5);
1095  // pPaletteManager->SetColorChannelInfo(render->uTargetRBits,
1096  // render->uTargetGBits, render->uTargetBBits);
1098 
1099  pPaletteManager->SetMistColor(128, 128, 128);
1101  // pSprites_LOD->can_load_hardware_sprites = 1;
1104 
1105  if (!engine->config->NoSound())
1107 
1108  for (uint i = 0; i < 4; ++i) {
1109  static const char *pUIAnimNames[4] = {"glow03", "glow05", "torchA",
1110  "wizeyeA"};
1111  static unsigned short _4E98D0[4][4] = {
1112  {479, 0, 329, 0}, {585, 0, 332, 0}, {468, 0, 0, 0}, {606, 0, 0, 0}};
1113 
1114  // pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
1115  pUIAnims[i]->icon = pIconsFrameTable->GetIcon(pUIAnimNames[i]);
1117 
1118  pUIAnims[i]->uAnimLength = 0;
1119  pUIAnims[i]->uAnimTime = 0;
1120  pUIAnims[i]->x = _4E98D0[i][0];
1121  pUIAnims[i]->y = _4E98D0[i][2];
1122  }
1123 
1125 
1126  UI_Create();
1127 
1129 
1130  for (uint i = 0; i < 7; ++i) {
1131  char container_name[64];
1132  sprintf(container_name, "HDWTR%03u", i);
1133  render->pHDWaterBitmapIDs[i] =
1134  pBitmaps_LOD->LoadTexture(container_name);
1135  render->hd_water_tile_anim[i] = assets->GetBitmap(container_name);
1136  }
1137 
1138  pNPCStats = new NPCStats;
1139  memset(pNPCStats->pNPCData, 0, 0x94BCu);
1140  pNPCStats->Initialize();
1141 
1146 
1149  dword_576E28 = 9;
1150 }
1151 
1152 const char *FindMm7Directory(char *mm7_path) {
1153  bool mm7_installation_found = false;
1154 
1155  // env variable override to a custom folder
1156  if (!mm7_installation_found) {
1157  if (const char *path = std::getenv("WOMM_PATH_OVERRIDE")) {
1158  strcpy(mm7_path, path);
1159  mm7_installation_found = true;
1160  logger->Info(L"MM7 Custom Folder (ENV path override)");
1161  }
1162  }
1163 
1164  // standard 1.0 installation
1165  if (!mm7_installation_found) {
1166  mm7_installation_found = OS_GetAppString(
1167  "HKEY_LOCAL_MACHINE/SOFTWARE/New World Computing/Might and Magic VII/1.0/AppPath",
1168  mm7_path, 2048);
1169 
1170  if (mm7_installation_found) {
1171  logger->Info(L"Standard MM7 installation found");
1172  }
1173  }
1174 
1175  // GoG old version
1176  if (!mm7_installation_found) {
1177  mm7_installation_found = OS_GetAppString(
1178  "HKEY_LOCAL_MACHINE/SOFTWARE/GOG.com/GOGMM7/PATH",
1179  mm7_path, 2048);
1180 
1181  if (mm7_installation_found) {
1182  logger->Info(L"GoG MM7 installation found");
1183  }
1184  }
1185 
1186  // GoG new version ( 2018 builds )
1187  if (!mm7_installation_found) {
1188  mm7_installation_found = OS_GetAppString(
1189  "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/GOG.com/Games/1207658916/Path",
1190  mm7_path, 2048);
1191 
1192  if (mm7_installation_found) {
1193  logger->Info(L"GoG MM7 2018 build installation found");
1194  }
1195  }
1196 
1197  // Hack path fix - if everything else fails, set your path here.
1198  if (!mm7_installation_found) {
1199  __debugbreak();
1200  mm7_installation_found = 1;
1201  strcpy(mm7_path, "E:/Programs/GOG Galaxy/Games/Might and Magic 7");
1202  logger->Info(L"Hack Path MM7 installation found");
1203  }
1204 
1205  return mm7_path;
1206 }
1207 
1208 
1210  char mm7_path[2048];
1211  FindMm7Directory(mm7_path);
1212  SetDataPath(mm7_path);
1213 
1214  if (!MM7_Initialize(std::string(mm7_path))) {
1215  log->Warning(L"MM7_Initialize: failed");
1216  if (engine != nullptr) {
1217  engine->Deinitialize();
1218  }
1219  exit(-1);
1220  }
1221 
1222  pEventTimer->Pause();
1223 
1225 }
1226 
1227 //----- (00466082) --------------------------------------------------------
1229  size_t v3; // ebx@32
1230  size_t v4; // edi@36
1231  char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
1232 
1233  viewparams = new ViewingParams;
1240 
1241  pAudioPlayer = new AudioPlayer;
1242 
1243  sprintf(pStartingMapName, "%s", "out01.odm");
1244 
1247  pODMRenderParams->bNoSky = 0;
1250  // outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10,
1251  // pIniFilename); outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor",
1252  // L"gridband2", 15, pIniFilename); outdoor_grid_band_3 =
1253  // GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
1258 
1259  // pODMRenderParams->shading_dist_mist = 0x2000;//drawing dist 0x2000
1260 
1261  sprintf(pDefaultSkyTexture.data(), "%s", "plansky1");
1262  sprintf(pDefaultGroundTexture, "%s", "dirt");
1263 
1267 
1268  v3 = 0;
1269  if (strlen(pDefaultSkyTexture.data())) {
1270  do {
1271  if (pDefaultSkyTexture[v3] == ' ') pDefaultSkyTexture[v3] = 0;
1272  ++v3;
1273  } while (v3 < strlen(pDefaultSkyTexture.data()));
1274  }
1275  v4 = 0;
1276  if (strlen(pDefaultGroundTexture)) {
1277  do {
1278  if (pDefaultGroundTexture[v4] == ' ') pDefaultGroundTexture[v4] = 0;
1279  ++v4;
1280  } while (v4 < strlen(pDefaultGroundTexture));
1281  }
1282 
1284 }
1285 
1286 //----- (004666D5) --------------------------------------------------------
1294  // _47F4D3_initialize_terrain_bezier_stuff(outdoor_grid_band_1,
1295  // outdoor_grid_band_2, outdoor_grid_band_3);
1296  {
1297  pODMRenderParams->outdoor_grid_band_3 = 25; // outdoor_grid_band_3;
1299  25 * 512; // outdoor_grid_band_3 * 512;
1300  }
1301  } else {
1302  viewparams->field_20 &= 0xFFFFFF00;
1303  }
1304 
1305  pParty->uFlags |= 2;
1310 
1316 }
1317 
1318 //----- (004610AA) --------------------------------------------------------
1319 void PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2) {
1322 
1324  if (!bLoading)
1326 
1327  viewparams->_443365();
1328  PlayLevelMusic();
1329 
1330  // level decoration sound
1332  for (int i = 0; i < _6807E0_num_decorations_with_sounds_6807B8; i++) {
1333  int ind = _6807B8_level_decorations_ids[i];
1336  pAudioPlayer->PlaySound(SoundID(decoration->uSoundID), PID(OBJECT_Decoration, ind), 0, 0, 0, 0);
1337  }
1338  }
1339 }
1340 
1341 //----- (00464479) --------------------------------------------------------
1343  if (mouse)
1344  mouse->SetCursorImage("MICON1");
1345 
1350 
1352  pIndoor->Release();
1354  pOutdoor->Release();
1355 
1356  pAudioPlayer->StopChannels(-1, -1);
1359  pParty->armageddon_timer = 0;
1360 
1362 }
1363 
1364 //----- (00461103) --------------------------------------------------------
1366  int v4; // edx@8
1367  int v6; // esi@14
1368  int v8; // ecx@16
1369  int v12; // esi@25
1370  int v13; // eax@26
1371  __int16 v14; // ax@41
1372  int v17; // [sp+14h] [bp-48h]@3
1373  int v18; // [sp+14h] [bp-48h]@23
1374  int v19; // [sp+18h] [bp-44h]@1
1375  int v20; // [sp+18h] [bp-44h]@14
1376  int v21[16]; // [sp+1Ch] [bp-40h]@17
1377 
1378  if (engine->config->no_actors)
1379  uNumActors = 0;
1380 
1383  pParty->uFlags |= 2;
1385  dword_5C6DF8 = 1;
1388 
1389  // v15 = 0;
1390  for (uint i = 0; i < uNumActors; ++i) {
1391  // Actor* pActor = &pActors[i];
1392  // v2 = (char *)&pActors[0].uNPC_ID;
1393  // do
1394  //{
1395  // v3 = pActors[i].pMonsterInfo.uID;
1396  v17 = 0;
1397  if (pActors[i].pMonsterInfo.uID >= 115 &&
1398  pActors[i].pMonsterInfo.uID <= 186 ||
1399  pActors[i].pMonsterInfo.uID >= 232 &&
1400  pActors[i].pMonsterInfo.uID <= 249)
1401  v17 = 1;
1402  // v1 = 0;
1403  v4 = (pActors[i].pMonsterInfo.uID - 1) % 3;
1404  if (2 == v4) {
1405  if (pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000) continue;
1406  } else {
1407  if (v4 != 1) {
1408  if (v4 == 0 && pActors[i].sNPC_ID == 0) pActors[i].sNPC_ID = 0;
1409  continue;
1410  }
1411  }
1412  if (pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000) continue;
1413  if (v17) {
1416  pActors[i].pMonsterInfo.uID, 0, v19);
1417  v14 = (unsigned short)pNPCStats->uNewlNPCBufPos + 5000;
1419  pActors[i].sNPC_ID = v14;
1420  continue;
1421  }
1422  pActors[i].sNPC_ID = 0;
1423  // ++v15;
1424  // v2 += 836;
1425  //}
1426  // while ( v15 < (signed int)uNumActors );
1427  }
1428 
1430 
1431  // v5 = uNumActors;
1432  v6 = 0;
1433  v20 = 0;
1434  // v16 = v1;
1435 
1436  for (uint i = 0; i < uNumActors; ++i) {
1437  // v7 = (char *)&pActors[0].pMonsterInfo;
1438  // do
1439  //{
1440  for (v8 = 0; v8 < v6; ++v8) {
1441  if (v21[v8] == pActors[i].pMonsterInfo.uID - 1) break;
1442  }
1443 
1444  if (v8 == v6) {
1445  v21[v6++] = pActors[i].pMonsterInfo.uID - 1;
1446  v20 = v6;
1447  if (v6 == 16) break;
1448  }
1449  // ++v16;
1450  // v7 += 836;
1451  //}
1452  // while ( v16 < (signed int)v5 );
1453  }
1454 
1456 
1457  if (engine->config->NoActors())
1458  uNumActors = 0;
1459  if (engine->config->NoDecorations())
1462 
1464 
1467  pIndoorCameraD3D->vPartyPos.z = 100;
1470  viewparams->bRedrawGameUI = true;
1472  pSprites_LOD->_461397();
1474  if (pParty->pPickedItem.uItemID != 0)
1476 }
1477 
1478 //----- (0042F3D6) --------------------------------------------------------
1480  for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i) {
1481  char icon_name[32];
1482  sprintf(icon_name, "turn%u", i);
1483  pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name);
1485  }
1486 
1492 
1497 }
1498 
1499 //----- (0046BDA8) --------------------------------------------------------
1500 unsigned int GetGravityStrength() {
1501  int v0 = ~(unsigned char)engine->config->flags2 & GAME_FLAGS_2_ALTER_GRAVITY;
1502  v0 |= 2;
1503  return (unsigned int)v0 >> 1;
1504 }
1505 
1506 //----- (00448B45) --------------------------------------------------------
1507 void GameUI_StatusBar_Update(bool force_hide) {
1508  if (force_hide ||
1512  }
1513 }
1514 
1515 void sub_44861E_set_texture_indoor(unsigned int uFaceCog,
1516  const String &filename) {
1517  for (uint i = 1; i < pIndoor->uNumFaceExtras; ++i) {
1518  auto extra = &pIndoor->pFaceExtras[i];
1519  if (extra->sCogNumber == uFaceCog) {
1520  auto face = &pIndoor->pFaces[extra->face_id];
1521  face->SetTexture(filename);
1522  }
1523  }
1524 }
1525 
1526 void sub_44861E_set_texture_outdoor(unsigned int uFaceCog,
1527  const String &filename) {
1528  for (BSPModel &model : pOutdoor->pBModels) {
1529  for (ODMFace &face : model.pFaces) {
1530  if (face.sCogNumber == uFaceCog) {
1531  face.SetTexture(filename);
1532  }
1533  }
1534  }
1535 }
1536 
1537 //----- (0044861E) --------------------------------------------------------
1538 void sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename) {
1539  if (uFaceCog) {
1540  // unsigned int texture = pBitmaps_LOD->LoadTexture(pFilename);
1541  // if (texture != -1)
1542  {
1543  // pBitmaps_LOD->pTextures[texture].palette_id2 =
1544  // pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[texture].palette_id1);
1545 
1547  sub_44861E_set_texture_indoor(uFaceCog, pFilename);
1548  } else {
1549  sub_44861E_set_texture_outdoor(uFaceCog, pFilename);
1550  }
1551 
1552  pParty->uFlags |= 2;
1553  }
1554  }
1555 }
1556 
1557 //----- (0044892E) --------------------------------------------------------
1558 void sub_44892E_set_faces_bit(int sCogNumber, int bit, int on) {
1559  if (sCogNumber) {
1561  for (uint i = 1; i < (unsigned int)pIndoor->uNumFaceExtras; ++i) {
1562  if (pIndoor->pFaceExtras[i].sCogNumber == sCogNumber) {
1563  if (on)
1565  .uAttributes |= bit;
1566  else
1568  .uAttributes &= ~bit;
1569  }
1570  }
1571  pParty->uFlags |= 2;
1572  } else {
1573  for (BSPModel &model : pOutdoor->pBModels) {
1574  for (ODMFace &face : model.pFaces) {
1575  if (face.sCogNumber == sCogNumber) {
1576  if (on) {
1577  face.uAttributes |= bit;
1578  } else {
1579  face.uAttributes &= ~bit;
1580  }
1581  }
1582  }
1583  }
1584  }
1585  pParty->uFlags |= 2;
1586  }
1587 }
1588 
1589 //----- (0044882F) --------------------------------------------------------
1590 void SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName) {
1591  for (size_t i = 0; i < uNumLevelDecorations; i++) {
1592  if (pLevelDecorations[i].uCog == uCog) {
1593  if (pFileName && strcmp(pFileName, "0")) {
1594  pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pFileName);
1596  }
1597 
1598  if (bHide)
1600  else
1602 
1603  pParty->uFlags |= 2;
1604  }
1605  }
1606 }
1607 
1608 //----- (004356FF) --------------------------------------------------------
1611  dword_4E455C = 1;
1612 
1613  extern int no_rightlick_in_inventory;
1614  no_rightlick_in_inventory = false;
1615 
1618  pEventTimer->Resume();
1620 }
1621 
1622 //----- (00494035) --------------------------------------------------------
1624  // unsigned int v4; // edi@1
1625  int v24; // ecx@60
1626  int v26; // ecx@64
1627  int v28; // ecx@68
1628  int v30; // ecx@72
1629  int v32; // ecx@76
1630  int v34; // ecx@80
1631  int v36; // ecx@84
1632  int v38; // ecx@88
1633  int v40; // ecx@92
1634  int v42; // ecx@96
1635  signed int a2a; // [sp+18h] [bp-18h]@47
1636  signed int old_day; // [sp+1Ch] [bp-14h]@47
1637  signed int old_hour;
1638 
1639  old_day = pParty->uCurrentDayOfMonth;
1640  old_hour = pParty->uCurrentHour;
1641 
1643 
1650  pParty->uCurrentYear =
1652  if (pParty->uCurrentHour >= 3 &&
1653  (old_hour < 3 ||
1654  pParty->uCurrentDayOfMonth > old_day)) { // new day dawns
1655  pParty->pHirelings[0].bHasUsedTheAbility = false;
1656  pParty->pHirelings[1].bHasUsedTheAbility = false;
1657 
1658  for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
1660 
1662  if (pParty->days_played_without_rest > 1) {
1663  for (uint i = 0; i < 4; ++i)
1664  pParty->pPlayers[i].SetCondWeakWithBlockCheck(0);
1665 
1666  if (pParty->GetFood() > 0) {
1667  Party::TakeFood(1);
1668  } else {
1669  for (uint i = 0; i < 4; ++i) {
1670  pParty->pPlayers[i].sHealth =
1671  pParty->pPlayers[i].sHealth /
1673  1;
1674  }
1675  }
1676 
1677  if (pParty->days_played_without_rest > 3) {
1678  for (uint i = 0; i < 4; ++i) {
1679  pParty->pPlayers[i].Zero();
1680  if (!pParty->pPlayers[i].IsPertified() &&
1681  !pParty->pPlayers[i].IsEradicated() &&
1682  !pParty->pPlayers[i].IsDead()) {
1683  if (rand() % 100 < 5 * pParty->days_played_without_rest)
1684  pParty->pPlayers[i].SetCondDeadWithBlockCheck(0);
1685  if (rand() % 100 <
1687  pParty->pPlayers[i].SetCondInsaneWithBlockCheck(0);
1688  }
1689  }
1690  }
1691  }
1693 
1694  for (uint i = 0; i < 4; ++i)
1695  pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
1696  }
1697 
1698  // water damage
1699  if (pParty->uFlags & 4 &&
1702  viewparams->bRedrawGameUI = true;
1703  for (uint pl = 1; pl <= 4; ++pl) {
1704  if (pPlayers[pl]->WearsItem(ITEM_RELIC_HARECS_LEATHER,
1705  EQUIP_ARMOUR) ||
1706  pPlayers[pl]->HasEnchantedItemEquipped(71) ||
1707  pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].expire_time) {
1708  pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
1709  } else {
1710  if (!pPlayers[pl]->HasUnderwaterSuitEquipped()) {
1711  pPlayers[pl]->ReceiveDamage(
1712  (int64_t)pPlayers[pl]->GetMaxHealth() * 0.1,
1713  DMGT_FIRE);
1714  if (pParty->uFlags & 4) {
1716  localization->GetString(660)); // You're drowning!
1717  }
1718  } else {
1719  pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
1720  }
1721  }
1722  }
1723  }
1724 
1725  // lava damage
1726  if (pParty->uFlags & 0x200 &&
1728  viewparams->bRedrawGameUI = true;
1730 
1731  for (uint pl = 1; pl <= 4; pl++) {
1732  pPlayers[pl]->ReceiveDamage(
1733  (signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
1734  if (pParty->uFlags & 0x200) {
1736  localization->GetString(661)); // On fire!
1737  }
1738  }
1739  }
1741  uint party_condition_flag = 4;
1742  a2a = pEventTimer->uTimeElapsed;
1743  if (pParty->uFlags2 &
1744  PARTY_FLAGS_2_RUNNING) { //замедление восстановления при беге
1745  a2a *= 0.5f;
1746  if (a2a < 1) a2a = 1;
1747  }
1748 
1749  for (uint pl = 1; pl <= 4; pl++) {
1750  if (pPlayers[pl]->uTimeToRecovery)
1751  pPlayers[pl]->Recover(a2a); //восстановление активности
1752  if (pPlayers[pl]->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) +
1753  pPlayers[pl]->sHealth + pPlayers[pl]->uEndurance >=
1754  1 ||
1755  pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Active()) {
1756  if (pPlayers[pl]->sHealth < 1)
1757  pPlayers[pl]->SetCondition(Condition_Unconcious, 0);
1758  } else {
1759  pPlayers[pl]->SetCondition(Condition_Dead, 0);
1760  }
1761  if (pPlayers[pl]->field_E0) {
1762  v24 = pPlayers[pl]->field_E0 - pEventTimer->uTimeElapsed;
1763  if (v24 > 0) {
1764  pPlayers[pl]->field_E0 = v24;
1765  } else {
1766  pPlayers[pl]->field_E0 = 0;
1767  viewparams->bRedrawGameUI = true;
1768  }
1769  }
1770  if (pPlayers[pl]->field_E4) {
1771  v26 = pPlayers[pl]->field_E4 - pEventTimer->uTimeElapsed;
1772  if (v26 > 0) {
1773  pPlayers[pl]->field_E4 = v26;
1774  } else {
1775  pPlayers[pl]->field_E4 = 0;
1776  viewparams->bRedrawGameUI = true;
1777  }
1778  }
1779  if (pPlayers[pl]->field_E8) {
1780  v28 = pPlayers[pl]->field_E8 - pEventTimer->uTimeElapsed;
1781  if (v28 > 0) {
1782  pPlayers[pl]->field_E8 = v28;
1783  } else {
1784  pPlayers[pl]->field_E8 = 0;
1785  viewparams->bRedrawGameUI = true;
1786  }
1787  }
1788  if (pPlayers[pl]->field_EC) {
1789  v30 = pPlayers[pl]->field_EC - pEventTimer->uTimeElapsed;
1790  if (v30 > 0) {
1791  pPlayers[pl]->field_EC = v30;
1792  } else {
1793  pPlayers[pl]->field_EC = 0;
1794  viewparams->bRedrawGameUI = true;
1795  }
1796  }
1797  if (pPlayers[pl]->field_F0) {
1798  v32 = pPlayers[pl]->field_F0 - pEventTimer->uTimeElapsed;
1799  if (v32 > 0) {
1800  pPlayers[pl]->field_F0 = v32;
1801  } else {
1802  pPlayers[pl]->field_F0 = 0;
1803  viewparams->bRedrawGameUI = true;
1804  }
1805  }
1806  if (pPlayers[pl]->field_F4) {
1807  v34 = pPlayers[pl]->field_F4 - pEventTimer->uTimeElapsed;
1808  if (v34 > 0) {
1809  pPlayers[pl]->field_F4 = v34;
1810  } else {
1811  pPlayers[pl]->field_F4 = 0;
1812  viewparams->bRedrawGameUI = true;
1813  }
1814  }
1815  if (pPlayers[pl]->field_F8) {
1816  v36 = pPlayers[pl]->field_F8 - pEventTimer->uTimeElapsed;
1817  if (v36 > 0) {
1818  pPlayers[pl]->field_F8 = v36;
1819  } else {
1820  pPlayers[pl]->field_F8 = 0;
1821  viewparams->bRedrawGameUI = true;
1822  }
1823  }
1824  if (pPlayers[pl]->field_FC) {
1825  v38 = pPlayers[pl]->field_FC - pEventTimer->uTimeElapsed;
1826  if (v38 > 0) {
1827  pPlayers[pl]->field_FC = v38;
1828  } else {
1829  pPlayers[pl]->field_FC = 0;
1830  viewparams->bRedrawGameUI = true;
1831  }
1832  }
1833  if (pPlayers[pl]->field_100) {
1834  v40 = pPlayers[pl]->field_100 - pEventTimer->uTimeElapsed;
1835  if (v40 > 0) {
1836  pPlayers[pl]->field_100 = v40;
1837  } else {
1838  pPlayers[pl]->field_100 = 0;
1839  viewparams->bRedrawGameUI = true;
1840  }
1841  }
1842  if (pPlayers[pl]->field_104) {
1843  v42 = pPlayers[pl]->field_104 - pEventTimer->uTimeElapsed;
1844  if (v42 > 0) {
1845  pPlayers[pl]->field_104 = v42;
1846  } else {
1847  pPlayers[pl]->field_104 = 0;
1848  viewparams->bRedrawGameUI = true;
1849  }
1850  }
1851  if (pPlayers[pl]->conditions_times[Condition_Sleep].Valid() ||
1852  pPlayers[pl]->conditions_times[Condition_Paralyzed].Valid() ||
1853  pPlayers[pl]->conditions_times[Condition_Unconcious].Valid() ||
1854  pPlayers[pl]->conditions_times[Condition_Dead].Valid() ||
1855  pPlayers[pl]->conditions_times[Condition_Pertified].Valid() ||
1856  pPlayers[pl]->conditions_times[Condition_Eradicated].Valid()) {
1857  --party_condition_flag;
1858  }
1859 
1860  for (uint k = 0; k < 24; ++k) {
1861  pPlayers[pl]->pPlayerBuffs[k].IsBuffExpiredToTime(
1862  pParty->GetPlayingTime());
1863  }
1864 
1865  if (pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_HASTE].Expired()) {
1866  pPlayers[pl]->SetCondition(Condition_Weak, 0);
1867  }
1868  }
1869 
1870  for (uint i = 0; i < 20; ++i) {
1871  if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(
1872  pParty->GetPlayingTime()) == 1)
1873  viewparams->bRedrawGameUI = true;
1874  }
1875 
1876  if (pParty->pPartyBuffs[PARTY_BUFF_HASTE].Expired()) {
1877  for (uint i = 0; i < 4; ++i)
1878  pParty->pPlayers[i].SetCondition(Condition_Weak, 0);
1879  }
1880 
1881  for (uint i = 0; i < 2; ++i) { // Проверка в сознании ли перс сделавший закл
1882  // на полёт и хождение по воде
1884  if (!pBuf->expire_time) continue;
1885 
1886  if (!(pBuf->uFlags & 1)) {
1887  if (!pPlayers[pBuf->uCaster]->CanAct()) {
1888  pBuf->Reset();
1890  pParty->bFlying = false;
1891  }
1892  }
1893  }
1894 
1895  if (!party_condition_flag) {
1897  for (uint pl = 1; pl <= 4; pl++) {
1898  if (pPlayers[pl]->conditions_times[Condition_Sleep].Valid()) {
1899  pPlayers[pl]->conditions_times[Condition_Sleep].Reset();
1900  party_condition_flag = 1;
1901  break;
1902  }
1903  }
1904  if (!party_condition_flag || _5C35C0_force_party_death)
1906  }
1907  }
1908 
1909  if (uActiveCharacter) { // выбор следующего после пропускающего ход
1911  if (pPlayers[uActiveCharacter]->conditions_times[Condition_Sleep] ||
1913  ->conditions_times[Condition_Paralyzed] ||
1915  ->conditions_times[Condition_Unconcious] ||
1916  pPlayers[uActiveCharacter]->conditions_times[Condition_Dead] ||
1918  ->conditions_times[Condition_Pertified] ||
1920  ->conditions_times[Condition_Eradicated]) {
1921  viewparams->bRedrawGameUI = true;
1923  }
1924  }
1925  }
1926 }
1927 
1928 //----- (00493938) --------------------------------------------------------
1929 void _493938_regenerate() { // immolation
1930  int current_time; // edi@1
1931  int last_reg_time; // qax@1
1932  int v4; // eax@2
1933  int v5; // edi@5
1934  int v9; // edi@15
1935  signed int v10; // eax@15
1936  int numberOfActorsAffected; // ebx@20
1937  unsigned int v14; // esi@21
1938  signed int v19; // eax@21
1939  bool recovery_HP; // ebx@25
1940  signed int v25; // eax@33
1941  signed int v31; // ecx@53
1942  int actorsAffectedByImmolation[100]; // [sp+4h] [bp-22Ch]@20
1943  SpriteObject a1; // [sp+194h] [bp-9Ch]@15
1944  Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15
1945  bool has_dragon_flag; // [sp+210h] [bp-20h]@22
1946  bool lich_jar_flag; // [sp+214h] [bp-1Ch]@25
1947  bool zombie_flag; // [sp+218h] [bp-18h]@25
1948  bool decrease_HP; // [sp+21Ch] [bp-14h]@25
1949  bool lich_flag; // [sp+220h] [bp-10h]@25
1950  int v49; // [sp+224h] [bp-Ch]@24
1951  bool recovery_SP; // [sp+228h] [bp-8h]@25
1952  bool redraw_flag; // [sp+22Ch] [bp-4h]@2
1953 
1954  current_time = pParty->GetPlayingTime().GetMinutesFraction();
1955  last_reg_time = pParty->last_regenerated.GetMinutesFraction();
1956 
1957  if (current_time == last_reg_time) return;
1958 
1959  int testmin = last_reg_time + 5;
1960  if (testmin >= 60) { // hour tickover boundaries
1961  testmin -= 60;
1962  if (current_time >= 55) current_time -= 60;
1963  }
1964 
1965  if (current_time >= testmin) {
1966  redraw_flag = false;
1967  v4 = (current_time - last_reg_time) / 5;
1968 
1969  // chance to flight break due to a curse
1970  if (pParty->FlyActive()) {
1971  if (pParty->bFlying) {
1972  if (!(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1)) {
1973  v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
1974 
1975  auto v6 =
1976  &pParty
1978  .uCaster -
1979  1]
1980  .conditions_times[Condition_Cursed];
1981  if (v6->value < v5) {
1982  v6 = 0;
1983  pParty->uFlags &= 0xFFFFFFBF;
1984  pParty->bFlying = false;
1985  redraw_flag = true;
1986  }
1987  }
1988  }
1989  }
1990 
1991  // chance to waterwalk drowning due to a curse
1992  if (pParty->WaterWalkActive()) {
1994  if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags &
1995  1)) { // taking on water
1996  auto v8 =
1997  &pParty
1998  ->pPlayers[pParty
2000  .uCaster -
2001  1]
2002  .conditions_times[Condition_Cursed];
2003  v8->value -= v4;
2004  if (v8->value <= 0) {
2005  v8->value = 0;
2007  redraw_flag = true;
2008  }
2009  }
2010  }
2011  }
2012 
2013  if (pParty->ImmolationActive()) { // Жертва
2014  a3.z = 0;
2015  a3.y = 0;
2016  a3.x = 0;
2017  a1.containing_item.Reset();
2024  a1.uAttributes = 0;
2025  a1.uSectorID = 0;
2026  a1.uSpriteFrameID = 0;
2028  a1.uFacing = 0;
2029  a1.uSoundID = 0;
2030  numberOfActorsAffected = pParty->_46A89E_immolation_effect(actorsAffectedByImmolation, 100, 307);
2031  for (v9 = 0; v9 < numberOfActorsAffected; ++v9) {
2032  v14 = actorsAffectedByImmolation[v9];
2033  a1.vPosition.x = pActors[v14].vPosition.x;
2034  a1.vPosition.y = pActors[v14].vPosition.y;
2035  a1.vPosition.z = pActors[v14].vPosition.z;
2036  a1.spell_target_pid = PID(OBJECT_Actor, v14);
2037  v19 = a1.Create(0, 0, 0, 0);
2038  Actor::DamageMonsterFromParty(PID(OBJECT_Item, v19), v14, &a3);
2039  }
2040  }
2041 
2042  has_dragon_flag = false;
2043  if (PartyHasDragon()) has_dragon_flag = true;
2044 
2045  for (v49 = 0; v49 < 4; v49++) {
2046  recovery_HP = false;
2047  recovery_SP = false;
2048  decrease_HP = false;
2049  lich_flag = false;
2050  lich_jar_flag = false;
2051  zombie_flag = false;
2052 
2053  for (int v22 = 0; (signed int)v22 < 16; v22++) {
2054  if (pParty->pPlayers[v49].HasItemEquipped(
2055  (ITEM_EQUIP_TYPE)v22)) {
2056  uint _idx = pParty->pPlayers[v49].pEquipment.pIndices[v22];
2057  if (pParty->pPlayers[v49]
2058  .pInventoryItemList[_idx - 1]
2059  .uItemID > 134) {
2060  if (pParty->pPlayers[v49]
2061  .pInventoryItemList[_idx - 1]
2062  .uItemID == ITEM_RELIC_ETHRICS_STAFF)
2063  decrease_HP = true;
2064  if (pParty->pPlayers[v49]
2065  .pInventoryItemList[_idx - 1]
2066  .uItemID == ITEM_ARTIFACT_HERMES_SANDALS) {
2067  recovery_HP = true;
2068  recovery_SP = true;
2069  }
2070  if (pParty->pPlayers[v49]
2071  .pInventoryItemList[_idx - 1]
2072  .uItemID == ITEM_ARTIFACT_MINDS_EYE)
2073  recovery_SP = true;
2074  if (pParty->pPlayers[v49]
2075  .pInventoryItemList[_idx - 1]
2076  .uItemID == ITEM_ARTIFACT_HEROS_BELT)
2077  recovery_HP = true;
2078  } else {
2079  v25 = pParty->pPlayers[v49]
2080  .pInventoryItemList[_idx - 1]
2081  .special_enchantment;
2082  if (v25 == 37 // of Regeneration("Regenerate 1hp/x
2083  // while walking, etc")
2084  || v25 == 44 // of Life("HP (+10), Regen hpts")
2085  || v25 == 50 // of The Phoenix("Fire Res (+30),
2086  // Regen hpts") &&
2087  ||
2088  v25 == 54) // of The Troll("End (+15), Regen hpts")
2089  recovery_HP = true;
2090  if (v25 == 38 // of Mana("Regenerate 1sp/x while
2091  // walking, etc")
2092  ||
2093  v25 == 47 // of The Eclipse("SP (+10), Regen spts")
2094  ||
2095  v25 ==
2096  55) // of The Unicorn("Luck (+15), Regen spts")
2097  recovery_SP = true;
2098  if (v25 == 66) { // of Plenty("Regenerate 1 hp/x and 1
2099  // sp/x while walking, etc.")
2100  recovery_HP = true;
2101  recovery_SP = true;
2102  }
2103  }
2104 
2105  if (recovery_HP &&
2106  !pParty->pPlayers[v49]
2107  .conditions_times[Condition_Dead] &&
2108  !pParty->pPlayers[v49]
2109  .conditions_times[Condition_Eradicated]) {
2110  if (pParty->pPlayers[v49].sHealth <
2111  pParty->pPlayers[v49].GetMaxHealth()) {
2112  ++pParty->pPlayers[v49].sHealth;
2113  }
2114  if (pParty->pPlayers[v49]
2115  .conditions_times[Condition_Unconcious] &&
2116  pParty->pPlayers[v49].sHealth > 0) {
2117  pParty->pPlayers[v49]
2118  .conditions_times[Condition_Unconcious]
2119  .Reset();
2120  }
2121  redraw_flag = true;
2122  }
2123 
2124  if (recovery_SP &&
2125  !pParty->pPlayers[v49]
2126  .conditions_times[Condition_Dead] &&
2127  !pParty->pPlayers[v49]
2128  .conditions_times[Condition_Eradicated]) {
2129  if (pParty->pPlayers[v49].sMana <
2130  pParty->pPlayers[v49].GetMaxMana())
2131  ++pParty->pPlayers[v49].sMana;
2132  redraw_flag = true;
2133  }
2134 
2135  if (decrease_HP &&
2136  !pParty->pPlayers[v49]
2137  .conditions_times[Condition_Dead] &&
2138  !pParty->pPlayers[v49]
2139  .conditions_times[Condition_Eradicated]) {
2140  --pParty->pPlayers[v49].sHealth;
2141  if (!(pParty->pPlayers[v49]
2142  .conditions_times[Condition_Unconcious]) &&
2143  pParty->pPlayers[v49].sHealth < 0) {
2144  pParty->pPlayers[v49]
2145  .conditions_times[Condition_Unconcious] =
2147  }
2148  if (pParty->pPlayers[v49].sHealth < 1) {
2149  if (pParty->pPlayers[v49].sHealth +
2150  pParty->pPlayers[v49].uEndurance +
2151  pParty->pPlayers[v49].GetItemsBonus(
2153  1 ||
2154  pParty->pPlayers[v49]
2155  .pPlayerBuffs[PLAYER_BUFF_PRESERVATION]
2156  .expire_time) {
2157  pParty->pPlayers[v49]
2158  .conditions_times[Condition_Unconcious] =
2160  } else if (!pParty->pPlayers[v49]
2161  .conditions_times[Condition_Dead]) {
2162  pParty->pPlayers[v49]
2163  .conditions_times[Condition_Dead] =
2165  }
2166  }
2167  redraw_flag = true;
2168  }
2169  }
2170  }
2171 
2172  // regeneration
2173  if (pParty->pPlayers[v49]
2174  .pPlayerBuffs[PLAYER_BUFF_REGENERATION]
2175  .expire_time &&
2176  !pParty->pPlayers[v49].conditions_times[Condition_Dead] &&
2177  !pParty->pPlayers[v49].conditions_times[Condition_Eradicated]) {
2178  pParty->pPlayers[v49].sHealth +=
2179  5 * pParty->pPlayers[v49]
2180  .pPlayerBuffs[PLAYER_BUFF_REGENERATION]
2181  .uPower;
2182  if (pParty->pPlayers[v49].sHealth >
2183  pParty->pPlayers[v49].GetMaxHealth()) {
2184  pParty->pPlayers[v49].sHealth =
2185  pParty->pPlayers[v49].GetMaxHealth();
2186  }
2187  if (pParty->pPlayers[v49]
2188  .conditions_times[Condition_Unconcious] &&
2189  pParty->pPlayers[v49].sHealth > 0) {
2190  pParty->pPlayers[v49]
2191  .conditions_times[Condition_Unconcious]
2192  .Reset();
2193  }
2194  redraw_flag = true;
2195  }
2196 
2197  // for warlock
2198  if (has_dragon_flag &&
2199  pParty->pPlayers[v49].classType == PLAYER_CLASS_WARLOCK) {
2200  if (pParty->pPlayers[v49].sMana <
2201  pParty->pPlayers[v49].GetMaxMana()) {
2202  ++pParty->pPlayers[v49].sMana;
2203  }
2204  redraw_flag = true;
2205  }
2206 
2207  // for lich
2208  if (pParty->pPlayers[v49].classType == PLAYER_CLASS_LICH) {
2209  for (v31 = 0; v31 < 126; ++v31) {
2210  if (pParty->pPlayers[v49].pInventoryItemList[v31].uItemID ==
2212  lich_jar_flag = true;
2213  }
2214  lich_flag = true;
2215  }
2216 
2217  if (lich_flag &&
2218  !pParty->pPlayers[v49].conditions_times[Condition_Dead] &&
2219  !pParty->pPlayers[v49].conditions_times[Condition_Eradicated]) {
2220  if (pParty->pPlayers[v49].sHealth >
2221  pParty->pPlayers[v49].GetMaxHealth() / 2) {
2222  pParty->pPlayers[v49].sHealth =
2223  pParty->pPlayers[v49].sHealth - 2;
2224  }
2225  if (pParty->pPlayers[v49].sMana >
2226  pParty->pPlayers[v49].GetMaxMana() / 2) {
2227  pParty->pPlayers[v49].sMana =
2228  pParty->pPlayers[v49].sMana - 2;
2229  }
2230  }
2231 
2232  if (lich_jar_flag) {
2233  if (pParty->pPlayers[v49].sMana <
2234  pParty->pPlayers[v49].GetMaxMana()) {
2235  ++pParty->pPlayers[v49].sMana;
2236  }
2237  }
2238 
2239  // for zombie
2240  if (pParty->pPlayers[v49].conditions_times[Condition_Zombie]) {
2241  zombie_flag = true;
2242  }
2243  if (zombie_flag &&
2244  !pParty->pPlayers[v49].conditions_times[Condition_Dead] &&
2245  !pParty->pPlayers[v49].conditions_times[Condition_Eradicated]) {
2246  if (pParty->pPlayers[v49].sHealth >
2247  pParty->pPlayers[v49].GetMaxHealth() / 2) {
2248  pParty->pPlayers[v49].sHealth =
2249  pParty->pPlayers[v49].sHealth - 1;
2250  }
2251  if (pParty->pPlayers[v49].sMana > 0) {
2252  pParty->pPlayers[v49].sMana =
2253  pParty->pPlayers[v49].sMana - 1;
2254  }
2255  }
2256  }
2258  if (!viewparams->bRedrawGameUI) viewparams->bRedrawGameUI = redraw_flag;
2259  }
2260 }
2261 
2262 //----- (00494820) --------------------------------------------------------
2263 unsigned int _494820_training_time(unsigned int a1) {
2264  signed int v1; // eax@1
2265 
2266  v1 = 5;
2267  if (a1 % 24 >= 5) v1 = 29;
2268  return v1 - a1 % 24;
2269 }
2270 
2271 //----- (00443E31) --------------------------------------------------------
2273  // char Args[100];
2274  int string_num;
2275  int max_string_length;
2276  // int current_string_length;
2277  int prev_string_offset;
2278 
2279  if (sizeof(pLevelStrOffsets) != 2000)
2280  logger->Warning(L"pLevelStrOffsets: deserialization warning");
2281  memset(pLevelStrOffsets.data(), 0, 2000);
2282 
2283  max_string_length = 0;
2284  string_num = 1;
2285  prev_string_offset = 0;
2286  pLevelStrOffsets[0] = 0;
2287  for (uint i = 0; i < uLevelStrFileSize; ++i) {
2288  if (!pLevelStr[i]) {
2289  pLevelStrOffsets[string_num] = i + 1;
2290  ++string_num;
2291  if (i - prev_string_offset > max_string_length)
2292  max_string_length = i - prev_string_offset;
2293  prev_string_offset = i;
2294  }
2295  }
2296 
2297  uLevelStrNumStrings = string_num - 1;
2298  if (max_string_length > 800)
2299  Error("MAX_EVENT_TEXT_LENGTH needs to be increased to %lu",
2300  max_string_length + 1);
2301 
2302  if (uLevelStrNumStrings > 0) {
2303  for (uint i = 0; i < uLevelStrNumStrings; ++i) {
2306  ++pLevelStrOffsets[i];
2307  }
2308  }
2309 }
2310 
2311 //----- (00443F95) --------------------------------------------------------
2312 void OnMapLeave() {
2313  _evt_raw *test_event;
2314  if (uLevelEVT_NumEvents > 0) {
2315  for (uint i = 0; i < uLevelEVT_NumEvents; ++i) {
2316  test_event =
2317  (_evt_raw *)&pLevelEVT[pLevelEVT_Index[i].uEventOffsetInEVT];
2318  if (test_event->_e_type == EVENT_OnMapLeave) {
2319  EventProcessor(pLevelEVT_Index[i].uEventID, 0, 1,
2320  pLevelEVT_Index[i].event_sequence_num);
2321  }
2322  }
2323  }
2324 }
2325 
2326 //----- (00443FDC) --------------------------------------------------------
2327 void OnMapLoad() {
2328  int v6; // eax@9
2329  int hours; // ebx@26
2330  GameTime v18; // [sp+Ch] [bp-44h]@12
2331  unsigned int seconds; // [sp+14h] [bp-3Ch]@26
2332  GameTime v20; // [sp+1Ch] [bp-34h]@7
2333  unsigned int minutes; // [sp+2Ch] [bp-24h]@26
2334  unsigned int years; // [sp+34h] [bp-1Ch]@26
2335  unsigned int weeks; // [sp+38h] [bp-18h]@26
2336  unsigned int days; // [sp+3Ch] [bp-14h]@26
2337  unsigned int months; // [sp+40h] [bp-10h]@26
2338 
2339  for (uint i = 0; i < uLevelEVT_NumEvents; ++i) {
2340  EventIndex pEvent = pLevelEVT_Index[i];
2341 
2342  _evt_raw *_evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
2343 
2344  // if (_evt->_e_type == EVENT_PlaySound)
2345  // pSoundList->LoadSound(EVT_DWORD(_evt->v5), 0);
2346  // else
2347  if (_evt->_e_type == EVENT_OnMapReload) {
2348  EventProcessor(pEvent.uEventID, 0, 0, pEvent.event_sequence_num);
2349  } else if (_evt->_e_type == EVENT_OnTimer ||
2350  _evt->_e_type == EVENT_OnLongTimer) {
2351  // v3 = &MapsLongTimersList[MapsLongTimers_count];
2352  v20 = pOutdoor->loc_time.last_visit;
2354  v20 = pIndoor->stru1.last_visit;
2355 
2357  _evt->_e_type;
2359  pEvent.uEventID;
2361  pEvent.event_sequence_num;
2362 
2369  _evt->v10;
2370 
2371  v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
2372 
2374  ((unsigned short)_evt->v12 << 8) + _evt->v11;
2376  ((unsigned short)_evt->v12 << 8) + _evt->v11;
2377  if (MapsLongTimersList[MapsLongTimers_count].timer_evt_type ==
2379  !(short)v6) {
2380  if (v20)
2381  v18 = pParty->GetPlayingTime() - v20;
2382  else
2383  v18 = GameTime(0);
2384 
2385  if (v18.GetYears() != 0 &&
2387  .YearsInterval ||
2388  v18.GetMonths() != 0 &&
2390  .MonthsInterval != 0 ||
2391  v18.GetWeeks() != 0 &&
2393  .WeeksInterval != 0 ||
2394  v18.GetDays() != 0 || !v20) {
2397  continue;
2398  }
2399  } else {
2400  seconds = pParty->GetPlayingTime().GetSecondsFraction();
2401  minutes = pParty->GetPlayingTime().GetMinutesFraction();
2402  hours = pParty->GetPlayingTime().GetHoursOfDay();
2403  days = pParty->GetPlayingTime().GetDaysOfWeek();
2404  weeks = pParty->GetPlayingTime().GetWeeksOfMonth();
2405  months = pParty->GetPlayingTime().GetMonthsOfYear();
2406  years = pParty->GetPlayingTime().GetYears();
2407 
2408  if (MapsLongTimersList[MapsLongTimers_count].YearsInterval) {
2409  ++years;
2411  .MonthsInterval) {
2412  ++months;
2413  } else if (MapsLongTimersList[MapsLongTimers_count].WeeksInterval) {
2414  ++weeks;
2415  } else {
2416  ++days;
2417  hours =
2420  .MinutesInterval;
2422  .SecondsInterval;
2423  }
2425  GameTime(seconds, minutes, hours, days, weeks, months,
2426  years);
2428  }
2429  }
2430  }
2431 }
2432 
2433 void Level_LoadEvtAndStr(const char *pLevelName) {
2434  char pContainerName[120]; // [sp+8h] [bp-98h]@1
2435 
2436  sprintf(pContainerName, "%s.evt", pLevelName);
2437  uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT.data(), 9216);
2438 
2439  sprintf(pContainerName, "%s.str", pLevelName);
2441  LoadEventsToBuffer(pContainerName, pLevelStr.data(), 9216);
2443 }
2444 
2445 void sub_4452BB() {
2446  pGUIWindow2->Release();
2447  pGUIWindow2 = 0;
2450  activeLevelDecoration = nullptr;
2451  pEventTimer->Resume();
2452 }
2453 
2462 }
2463 
2464 void Transition_StopSound_Autosave(const char *pMapName,
2465  MapStartPoint start_point) {
2466  pAudioPlayer->StopChannels(-1, -1);
2467 
2468  // pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_None);
2469 
2470  if (pCurrentMapName != pMapName) {
2471  SaveGame(1, 0);
2472  }
2473 
2475  pCurrentMapName = pMapName;
2476  uLevel_StartingPointType = start_point;
2477 }
2478 
2479 void OnTimer(int) {
2480  if (pEventTimer->bPaused) {
2481  return;
2482  }
2483 
2484  __int64 v13 = (pParty->GetPlayingTime() - _5773B8_event_timer).value / 128;
2485  if (!v13) return;
2486 
2488 
2489  for (uint i = 0; i < MapsLongTimers_count; ++i) {
2490  MapsLongTimer *timer = &MapsLongTimersList[i];
2491  if (timer->time_left_to_fire) {
2492  if (v13 < timer->time_left_to_fire) {
2493  timer->time_left_to_fire -= v13;
2494  } else {
2495  timer->time_left_to_fire = timer->IntervalHalfMins;
2496  EventProcessor(timer->timer_evt_ID, 0, 1,
2497  timer->timer_evt_seq_num);
2498  }
2499  } else {
2500  if (timer->NextStartTime < pParty->GetPlayingTime()) {
2501  uint next_trigger_time = 1 * 60 * 60 * 24; // 1 day
2502  if (timer->YearsInterval)
2503  next_trigger_time = 336 * 60 * 60 * 24; // 1 year
2504  else if (timer->MonthsInterval)
2505  next_trigger_time = 28 * 60 * 60 * 24; // 1 month
2506  else if (timer->WeeksInterval)
2507  next_trigger_time = 7 * 60 * 60 * 24; // 1 week
2508 
2509  timer->NextStartTime.value += (next_trigger_time * 128) / 3.0f;
2510  if (timer->NextStartTime <
2511  pParty->GetPlayingTime()) // make sure in wont fire several
2512  // times in a row if big time
2513  // interval has lapsed
2514  timer->NextStartTime = pParty->GetPlayingTime();
2515 
2516  EventProcessor(timer->timer_evt_ID, 0, 1,
2517  timer->timer_evt_seq_num);
2518  }
2519  }
2520  }
2521 }
2522 
2523 //----- (0044C28F) --------------------------------------------------------
2525  // return if we are already in the NWC dungeon
2526  if ("nwc.blv" == pCurrentMapName) {
2527  return;
2528  }
2529 
2530  // reset party teleport
2538 
2539  // start tranistion to dungeon
2543  return;
2544 }
UIGame.h
Party::pPickedItem
ItemGen pPickedItem
Definition: Party.h:312
uint16_t
unsigned __int16 uint16_t
Definition: SDL_config.h:37
SpriteObject
Definition: SpriteObject.h:189
SetDecorationSprite
void SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName)
Definition: Engine.cpp:1590
spell_sprite_mapping
std::array< stru324_spell_id_to_sprite_mapping, 103 > spell_sprite_mapping
Definition: Spells.cpp:35
LightsStack_StationaryLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition: Lights.h:65
CloseWindowBackground
void CloseWindowBackground()
Definition: Engine.cpp:761
IconFrameTable.h
Party::uCurrentTimeSecond
unsigned int uCurrentTimeSecond
Definition: Party.h:277
GameUI_DrawRightPanel
void GameUI_DrawRightPanel()
Definition: UIGame.cpp:1248
ParticleEngine.h
PlayerFrameTable
Definition: PlayerFrameTable.h:18
GUIWindow::DrawText
void DrawText(GUIFont *font, int x, int y, unsigned short uFontColor, const char *str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
Definition: GUIWindow.cpp:694
ViewingParams::field_48
int field_48
Definition: Viewport.h:75
uNumActors
size_t uNumActors
Definition: Actor.cpp:39
Party::vPosition
Vec3_int_ vPosition
Definition: Party.h:250
Engine_::IocContainer
Definition: IocContainer.h:15
IndoorLocation::uNumFaceExtras
unsigned int uNumFaceExtras
Definition: Indoor.h:631
IndoorLocation::uNumSectors
int uNumSectors
Definition: Indoor.h:633
face
GLenum GLuint GLint GLenum face
Definition: SDL_opengl_glext.h:3022
pNew_LOD
LOD::WriteableFile * pNew_LOD
Definition: LOD.cpp:24
ParticleEngine::Draw
void Draw()
Definition: ParticleEngine.cpp:113
GameUI_DrawRightPanelItems
void GameUI_DrawRightPanelItems()
Definition: UIGame.cpp:1154
pChestList
ChestList * pChestList
Definition: Chest.cpp:38
dword_4E455C
int dword_4E455C
Definition: mm7_data.cpp:246
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
stru10
Definition: stru10.h:5
uSpriteID_Spell11
int uSpriteID_Spell11
Definition: mm7_data.cpp:577
UIDialogue.h
pLevelDecorations
std::array< LevelDecoration, 3000 > pLevelDecorations
Definition: Decoration.cpp:8
Party::y_rotation_granularity
int y_rotation_granularity
Definition: Party.h:242
RemoveQuotes
char * RemoveQuotes(char *str)
Definition: Strings.h:17
Party::TakeFood
static void TakeFood(int amount)
Definition: Party.cpp:245
pIconIDs_Turn
std::array< unsigned int, 5 > pIconIDs_Turn
Definition: mm7_data.cpp:570
SetDataPath
void SetDataPath(const char *data_path)
Definition: Engine.cpp:124
Viewport.h
Timer::uTimeElapsed
unsigned int uTimeElapsed
Definition: Time.h:133
SpriteObject::uFacing
unsigned __int16 uFacing
Definition: SpriteObject.h:220
IndoorCameraD3D::sRotationY
int sRotationY
Definition: IndoorCameraD3D.h:247
Party::uCurrentMonth
unsigned int uCurrentMonth
Definition: Party.h:272
ODMRenderParams::outdoor_no_wavy_water
int outdoor_no_wavy_water
Definition: IRender.h:100
LOD.h
GameUI_DrawLifeManaBars
void GameUI_DrawLifeManaBars()
Definition: UIGame.cpp:1197
Party::GetPlayingTime
GameTime & GetPlayingTime()
Definition: Party.h:230
DecorationList::GetDecoration
DecorationDesc * GetDecoration(unsigned int index)
Definition: DecorationList.h:65
FinalInitialization
void FinalInitialization()
Definition: Engine.cpp:852
GameTime::GetDays
int GetDays() const
Definition: Time.h:32
PartyHasDragon
bool PartyHasDragon()
Definition: NPC.cpp:750
MapStartPoint
MapStartPoint
Definition: MapInfo.h:27
Timer::Initialize
void Initialize()
Definition: Time.cpp:72
ITEM_RELIC_HARECS_LEATHER
@ ITEM_RELIC_HARECS_LEATHER
Definition: Items.h:169
PrepareToLoadBLV
void PrepareToLoadBLV(unsigned int bLoading)
Definition: Indoor.cpp:2310
Vec2::x
T x
Definition: VectorTypes.h:12
Game.h
Game__StationaryLight::flt_18
float flt_18
Definition: Engine.h:50
TeleportToStartingPoint
void TeleportToStartingPoint(MapStartPoint point)
Definition: MapInfo.cpp:308
Mouse::GetCursorPos
Point GetCursorPos()
Definition: Mouse.cpp:108
GenerateItemsInChest
void GenerateItemsInChest()
Definition: Chest.cpp:631
GUIProgressBar::TYPE_Fullscreen
@ TYPE_Fullscreen
Definition: GUIProgressBar.h:11
sub_44861E_set_texture
void sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
Definition: Engine.cpp:1538
BLVFaceExtra::sCogNumber
int16_t sCogNumber
Definition: Indoor.h:511
OnMapLoad
void OnMapLoad()
Definition: Engine.cpp:2327
DecorationList.h
Engine::draw_debug_outlines
bool draw_debug_outlines()
Definition: Engine.cpp:500
Party::uCurrentMinute
unsigned int uCurrentMinute
Definition: Party.h:276
pTextureFrameTable
struct TextureFrameTable * pTextureFrameTable
Definition: Image.cpp:20
Timer::Resume
void Resume()
Definition: Time.cpp:27
IconFrameTable::InitializeAnimation
void InitializeAnimation(unsigned int uIconID)
Definition: IconFrameTable.cpp:59
sub_4452BB
void sub_4452BB()
Definition: Engine.cpp:2445
pSpriteFrameTable
struct SpriteFrameTable * pSpriteFrameTable
Definition: Sprites.cpp:22
MapsLongTimer::MinutesInterval
int16_t MinutesInterval
Definition: MapsLongTimer.h:17
PaletteManager::SetColorChannelInfo
void SetColorChannelInfo(int uNumRBits, int uNumGBits, int uNumBBits)
Definition: PaletteManager.cpp:167
OutdoorLocation::pBModels
BSPModelList pBModels
Definition: Outdoor.h:119
pSpriteObjects
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
Definition: SpriteObject.cpp:34
pSprites_LOD
LODFile_Sprites * pSprites_LOD
Definition: LOD.cpp:20
Party
Definition: Party.h:151
Start_Party_Teleport_Flag
int Start_Party_Teleport_Flag
Definition: mm7_data.cpp:628
vis_sprite_filter_1
Vis_SelectionFilter vis_sprite_filter_1
Definition: Vis.cpp:22
TeleportToNWCDungeon
void TeleportToNWCDungeon()
Definition: Engine.cpp:2524
Viewport::uViewportTL_Y
int uViewportTL_Y
Definition: Viewport.h:23
SpriteObject::field_60_distance_related_prolly_lod
char field_60_distance_related_prolly_lod
Definition: SpriteObject.h:234
DecorationList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: DecorationList.cpp:14
Polygon
Definition: Polygon.h:14
Party_Teleport_Y_Pos
int Party_Teleport_Y_Pos
Definition: mm7_data.cpp:623
Engine::Deinitialize
void Deinitialize()
Definition: Engine.cpp:478
OBJECT_Item
@ OBJECT_Item
Definition: Actor.h:66
Vec3_float_::x
float x
Definition: VectorTypes.h:89
OverlayList::InitializeSprites
void InitializeSprites()
Definition: Overlays.cpp:100
Engine::AlterGamma_BLV
bool AlterGamma_BLV(struct BLVFace *pFace, unsigned int *pColor)
Definition: Engine.cpp:459
Party::GetNextActiveCharacter
int GetNextActiveCharacter()
Definition: Party.cpp:166
PARTY_BUFF_IMMOLATION
@ PARTY_BUFF_IMMOLATION
Definition: Party.h:81
IconFrameTable::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: IconFrameTable.cpp:87
uGameState
unsigned int uGameState
Definition: mm7_data.cpp:695
Engine::keyboard
Keyboard * keyboard
Definition: Engine.h:470
_evt_raw::v7
unsigned char v7
Definition: Events.h:29
Mouse::Deactivate
void Deactivate()
Definition: Mouse.cpp:137
Party::sPrevRotationX
int sPrevRotationX
Definition: Party.h:255
UIPartyCreation.h
Party::sRotationX
int sRotationX
Definition: Party.h:252
NPCStats::InitializeAdditionalNPCs
void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId)
Definition: NPC.cpp:582
_44100D_should_alter_right_panel
bool _44100D_should_alter_right_panel()
Definition: Engine.cpp:2454
EVENT_OnMapReload
@ EVENT_OnMapReload
Definition: Events.h:93
dword_5C6DF8
int dword_5C6DF8
Definition: mm7_data.cpp:651
Engine_::IocContainer::ResolveBloodsplatContainer
static BloodsplatContainer * ResolveBloodsplatContainer()
Definition: IocContainer.cpp:67
SpellBuff
Definition: Spells.h:147
GameUI_DrawMinimap
void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap)
Definition: UIGame.cpp:1916
Party::ImmolationActive
bool ImmolationActive()
Definition: Party.h:208
Engine_::IocContainer::ResolveLogger
static Log * ResolveLogger()
Definition: IocContainer.cpp:51
access
GLuint GLint GLboolean GLint GLenum access
Definition: SDL_opengl_glext.h:2165
LOD::File::LoadCompressedTexture
void * LoadCompressedTexture(const String &pContainer, size_t *data_size=nullptr)
Definition: LOD.cpp:921
DMGT_FIRE
@ DMGT_FIRE
Definition: Items.h:11
pIconsFrameTable
struct IconFrameTable * pIconsFrameTable
Definition: mm7_data.cpp:168
ODMRenderParams::bDoNotRenderDecorations
unsigned int bDoNotRenderDecorations
Definition: IRender.h:97
ODMRenderParams::building_gamme
int building_gamme
Definition: IRender.h:102
ParticleEngine::UpdateParticles
void UpdateParticles()
Definition: ParticleEngine.cpp:134
MapsLongTimer::WeeksInterval
int16_t WeeksInterval
Definition: MapsLongTimer.h:15
LightmapBuilder::DrawLightmapsType
void DrawLightmapsType(int type)
Definition: LightmapBuilder.cpp:796
MapStats::GetMapInfo
MAP_TYPE GetMapInfo(const String &Str2)
Definition: MapInfo.cpp:225
OtherOverlayList::bRedraw
int bRedraw
Definition: Overlays.h:38
Party::sEyelevel
int sEyelevel
Definition: Party.h:239
SpriteObject::uSectorID
__int16 uSectorID
Definition: SpriteObject.h:223
ODMRenderParams::terrain_gamma
int terrain_gamma
Definition: IRender.h:103
AudioPlayer::PlaySound
void PlaySound(SoundID eSoundID, int pid, unsigned int uNumRepeats, int x, int y, int a7)
Definition: AudioPlayer.cpp:195
IndoorLocation::stru1
LocationTime_stru1 stru1
Definition: Indoor.h:649
Party::field_7B5_in_arena_quest
char field_7B5_in_arena_quest
Definition: Party.h:293
SpriteObject.h
EventIndex::uEventOffsetInEVT
unsigned int uEventOffsetInEVT
Definition: Events.h:9
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
MapsLongTimer::SecondsInterval
int16_t SecondsInterval
Definition: MapsLongTimer.h:18
IndoorLocation::pFaceExtras
struct BLVFaceExtra * pFaceExtras
Definition: Indoor.h:632
pSoundList
SoundList * pSoundList
Definition: AudioPlayer.cpp:21
init_event_triggers
void init_event_triggers()
Definition: Events.cpp:1205
vis_face_filter
Vis_SelectionFilter vis_face_filter
Definition: Vis.cpp:26
Graphics::IRenderFactory::Create
std::shared_ptr< IRender > Create(const std::string &renderer_name, bool is_fullscreen)
Definition: IRenderFactory.cpp:14
CURRENT_SCREEN::SCREEN_CASTING
@ SCREEN_CASTING
game_viewport_width
unsigned int game_viewport_width
Definition: mm7_data.cpp:194
GameTime::GetDaysOfWeek
int GetDaysOfWeek() const
Definition: Time.h:40
Engine::lightmap_builder
LightmapBuilder * lightmap_builder
Definition: Engine.h:468
windowManager
WindowManager windowManager
Definition: GUIWindow.cpp:2501
MapsLongTimer::MonthsInterval
int16_t MonthsInterval
Definition: MapsLongTimer.h:14
ObjectList::InitializeColors
void InitializeColors()
Definition: ObjectList.cpp:26
Party::uDefaultPartyHeight
unsigned int uDefaultPartyHeight
Definition: Party.h:238
Timer::Create
static Timer * Create()
Definition: Time.h:105
FactionTable.h
Polygon::field_59
char field_59
Definition: Polygon.h:49
IndoorCameraD3D::GetPickDepth
float GetPickDepth()
Definition: IndoorCameraD3D.cpp:61
game_starting_year
int game_starting_year
Definition: mm7_data.cpp:193
_591094_decoration
struct LevelDecoration * _591094_decoration
Definition: mm7_data.cpp:606
PauseGameDrawing
bool PauseGameDrawing()
Definition: GUIWindow.cpp:137
MapsLongTimer::YearsInterval
int16_t YearsInterval
Definition: MapsLongTimer.h:13
localization
Localization * localization
Definition: Localization.cpp:11
GameUI_DrawTorchlightAndWizardEye
void GameUI_DrawTorchlightAndWizardEye()
Definition: UIGame.cpp:2205
Party::FlyActive
bool FlyActive()
Definition: Party.h:202
MapsLongTimer.h
LEVEL_null
@ LEVEL_null
Definition: Indoor.h:285
DoPrepareWorld
void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box)
Definition: Engine.cpp:796
game_viewport_x
int game_viewport_x
Definition: mm7_data.cpp:196
Overlays.h
Point::x
unsigned int x
Definition: Point.h:7
PARTY_BUFF_WATER_WALK
@ PARTY_BUFF_WATER_WALK
Definition: Party.h:89
SpriteFrameTable
Definition: Sprites.h:57
PLAYER_BUFF_WATER_WALK
@ PLAYER_BUFF_WATER_WALK
Definition: Player.h:37
IndoorCameraD3D::sRotationX
int sRotationX
Definition: IndoorCameraD3D.h:248
Viewport::uScreen_TL_X
int uScreen_TL_X
Definition: Viewport.h:18
Timer::bPaused
unsigned int bPaused
Definition: Time.h:127
OverlayList
Definition: Overlays.h:53
pMediaPlayer
MPlayer * pMediaPlayer
Definition: MediaPlayer.cpp:43
Party::uCurrentHour
unsigned int uCurrentHour
Definition: Party.h:275
pStartingMapName
char pStartingMapName[32]
Definition: mm7_data.cpp:589
ObjectList::ObjectIDByItemID
unsigned int ObjectIDByItemID(unsigned int uItemID)
Definition: ObjectList.cpp:7
PaletteManager.h
LightmapBuilder.h
Color32
uint32_t Color32(uint16_t color16)
Definition: Engine.cpp:135
PlayerFrameTable.h
_evt_raw::_e_type
unsigned char _e_type
Definition: Events.h:26
int64_t
__int64 int64_t
Definition: alext.h:31
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
PaletteManager::LockAll
int LockAll()
Definition: PaletteManager.cpp:137
MM6_Initialize
void MM6_Initialize()
Definition: Engine.cpp:1228
GameUI_DrawHiredNPCs
void GameUI_DrawHiredNPCs()
Definition: UIGame.cpp:2236
GUIWindow::Release
virtual void Release()
Definition: GUIWindow.cpp:292
ITEM_EQUIP_TYPE
ITEM_EQUIP_TYPE
Definition: Items.h:226
uIconID_TurnStop
unsigned int uIconID_TurnStop
Definition: mm7_data.cpp:571
GUIFont.h
TextureFrameTable::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: Image.cpp:83
IconFrameTable
Definition: IconFrameTable.h:51
Party::UpdatePlayersAndHirelingsEmotions
void UpdatePlayersAndHirelingsEmotions()
Definition: Party.cpp:657
NPCStats::Release
void Release()
Definition: NPC.cpp:556
bDialogueUI_InitializeActor_NPC_ID
int bDialogueUI_InitializeActor_NPC_ID
Definition: mm7_data.cpp:642
dword_5C3418
int dword_5C3418
Definition: mm7_data.cpp:634
stru9.h
SpriteObject::uType
SPRITE_OBJECT_TYPE uType
Definition: SpriteObject.h:215
LODFile_IconsBitmaps::_011BA4_debug_paletted_pixels_uncompressed
int _011BA4_debug_paletted_pixels_uncompressed
Definition: LOD.h:169
_576E2C_current_minimap_zoom
int _576E2C_current_minimap_zoom
Definition: mm7_data.cpp:600
Party::uDefaultEyelevel
unsigned int uDefaultEyelevel
Definition: Party.h:240
pMovie_Track
PMovie pMovie_Track
Definition: MediaPlayer.cpp:44
Mouse::DrawCursorToTarget
void DrawCursorToTarget()
Definition: Mouse.cpp:197
SpellFxRenderer.h
Party::uCurrentMonthWeek
unsigned int uCurrentMonthWeek
Definition: Party.h:273
Game__StationaryLight::vPosition
Vec3_float_ vPosition
Definition: Engine.h:48
_494035_timed_effects__water_walking_damage__etc
void _494035_timed_effects__water_walking_damage__etc()
Definition: Engine.cpp:1623
ODMRenderParams::shading_dist_shademist
int shading_dist_shademist
Definition: IRender.h:75
Engine::decal_builder
DecalBuilder * decal_builder
Definition: Engine.h:466
Engine::_44ED0A_saturate_face_blv
int _44ED0A_saturate_face_blv(struct BLVFace *a2, int *a3, signed int a4)
Definition: Engine.cpp:561
OBJECT_Decoration
@ OBJECT_Decoration
Definition: Actor.h:69
stru10.h
Game__StationaryLight
Definition: Engine.h:47
AudioPlayer::Initialize
void Initialize()
Definition: AudioPlayer.cpp:364
qword_5C6DF0
int64_t qword_5C6DF0
Definition: mm7_data.cpp:650
path
GLsizei const GLchar *const * path
Definition: SDL_opengl_glext.h:3733
GameTime::GetYears
int GetYears() const
Definition: Time.h:35
ItemGen::Reset
void Reset()
Definition: Items.cpp:133
ITEM_ARTIFACT_MINDS_EYE
@ ITEM_ARTIFACT_MINDS_EYE
Definition: Items.h:185
SpellFxRenderer::LoadAnimations
void LoadAnimations()
Definition: SpellFxRenderer.cpp:1339
Vec3_float_::y
float y
Definition: VectorTypes.h:90
_evt_raw::v9
unsigned char v9
Definition: Events.h:31
Vec3_float_::z
float z
Definition: VectorTypes.h:91
Condition_Paralyzed
@ Condition_Paralyzed
Definition: Conditions.h:20
LightmapBuilder::MobileLightsCount
unsigned int MobileLightsCount
Definition: LightmapBuilder.h:85
GameTime::value
int64_t value
Definition: Time.h:99
pPlayers
NZIArray< struct Player *, 5 > pPlayers
Definition: Player.cpp:46
Initialize_GlobalEVT
void Initialize_GlobalEVT()
Definition: Events.cpp:73
DecorationList::GetDecorIdByName
uint16_t GetDecorIdByName(const char *pName)
Definition: DecorationList.cpp:60
TurnEngine.h
SpriteObject::uSpriteFrameID
unsigned __int16 uSpriteFrameID
Definition: SpriteObject.h:224
game_viewport_height
unsigned int game_viewport_height
Definition: mm7_data.cpp:195
EventIndex::event_sequence_num
int event_sequence_num
Definition: Events.h:8
Mouse::bRedraw
unsigned int bRedraw
Definition: Mouse.h:320
FileExists
bool FileExists(const char *fname)
Definition: Engine.cpp:153
Engine::Engine
Engine()
Definition: Engine.cpp:610
pIndoor
IndoorLocation * pIndoor
Definition: Indoor.cpp:49
Party::last_regenerated
GameTime last_regenerated
Definition: Party.h:248
Chest.h
sub_44861E_set_texture_indoor
void sub_44861E_set_texture_indoor(unsigned int uFaceCog, const String &filename)
Definition: Engine.cpp:1515
Mouse::Activate
void Activate()
Definition: Mouse.cpp:193
Level_LoadEvtAndStr
void Level_LoadEvtAndStr(const char *pLevelName)
Definition: Engine.cpp:2433
Engine.h
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
LightmapBuilder::DrawDebugOutlines
void DrawDebugOutlines(char bit_one_for_list1__bit_two_for_list2)
Definition: LightmapBuilder.cpp:1077
Lights.h
_5C35C0_force_party_death
int _5C35C0_force_party_death
Definition: mm7_data.cpp:641
_494820_training_time
unsigned int _494820_training_time(unsigned int a1)
Definition: Engine.cpp:2263
sub_44861E_set_texture_outdoor
void sub_44861E_set_texture_outdoor(unsigned int uFaceCog, const String &filename)
Definition: Engine.cpp:1526
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
EventIndex
Definition: Events.h:6
IndoorCameraD3D
Definition: IndoorCameraD3D.h:104
pMapStats
struct MapStats * pMapStats
Definition: mm7_data.cpp:20
SpriteObject::uObjectDescID
unsigned __int16 uObjectDescID
Definition: SpriteObject.h:217
Party::pPartyBuffs
std::array< SpellBuff, 20 > pPartyBuffs
Definition: Party.h:309
EVENT_OnTimer
@ EVENT_OnTimer
Definition: Events.h:87
OBJECT_Actor
@ OBJECT_Actor
Definition: Actor.h:67
Engine::MM7_Initialize
bool MM7_Initialize(const std::string &mm7_path)
Definition: Engine.cpp:903
uLevelMapStatsID
unsigned int uLevelMapStatsID
Definition: mm7_data.cpp:713
GameTime::GetMinutesFraction
int GetMinutesFraction() const
Definition: Time.h:38
Events.h
ViewingParams::uScreen_topL_Y
unsigned int uScreen_topL_Y
Definition: Viewport.h:61
area_of_effect__damage_evaluate
void area_of_effect__damage_evaluate()
Definition: Actor.cpp:5320
SpellBuff::Reset
void Reset()
Definition: Spells.cpp:337
Party::uPartyHeight
unsigned int uPartyHeight
Definition: Party.h:237
WindowManager::DeleteAllVisibleWindows
void DeleteAllVisibleWindows()
Definition: GUIWindow.cpp:2503
Actor.h
ViewingParams::uScreen_BttmR_X
unsigned int uScreen_BttmR_X
Definition: Viewport.h:62
game_viewport_y
int game_viewport_y
Definition: mm7_data.cpp:197
_evt_raw::v8
unsigned char v8
Definition: Events.h:30
UIHouses.h
PARTY_FLAGS_1_STANDING_ON_WATER
@ PARTY_FLAGS_1_STANDING_ON_WATER
Definition: Party.h:61
_4E94D0_light_type
char _4E94D0_light_type
Definition: mm7_data.cpp:305
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
CURRENT_SCREEN::SCREEN_E
@ SCREEN_E
Viewport::uScreen_TL_Y
int uScreen_TL_Y
Definition: Viewport.h:19
TextureFrameTable
Definition: Image.h:131
Vis_ObjectInfo::object
void * object
Definition: Vis.h:29
ODMRenderParams
Definition: IRender.h:55
Localization.h
GameTime::GetSecondsFraction
int GetSecondsFraction() const
Definition: Time.h:37
pWeather
Weather * pWeather
Definition: Weather.cpp:8
_evt_raw::v6
unsigned char v6
Definition: Events.h:28
SoundList::Initialize
void Initialize()
Definition: AudioPlayer.cpp:72
Engine::~Engine
virtual ~Engine()
Definition: Engine.cpp:644
LoadLevel_InitializeLevelStr
void LoadLevel_InitializeLevelStr()
Definition: Engine.cpp:2272
IndoorCameraD3D::CalculateRotations
void CalculateRotations(int camera_rot_x, int camera_rot_y)
Definition: IndoorCameraD3D.cpp:1184
GameUI_StatusBar_Update
void GameUI_StatusBar_Update(bool force_hide)
Definition: Engine.cpp:1507
IconFrameTable::GetIcon
Icon * GetIcon(unsigned int idx)
Definition: IconFrameTable.cpp:17
DecalBuilder::DrawDecalDebugOutlines
void DrawDecalDebugOutlines()
Definition: DecalBuilder.cpp:528
Viewport::uScreen_BR_Y
int uScreen_BR_Y
Definition: Viewport.h:21
Party_Spec_Motion_status_ids
std::array< int, 2 > Party_Spec_Motion_status_ids
Definition: mm7_data.cpp:473
pGUIWindow2
GUIWindow * pGUIWindow2
Definition: GUIWindow.cpp:60
NPCStats::uNumNewNPCs
unsigned int uNumNewNPCs
Definition: NPC.h:179
IndoorCameraD3D::vPartyPos
Vec3< int > vPartyPos
Definition: IndoorCameraD3D.h:253
BLV_UpdateUserInputAndOther
void BLV_UpdateUserInputAndOther()
Definition: Indoor.cpp:3779
Vec2::y
T y
Definition: VectorTypes.h:13
uIconID_TurnStart
unsigned int uIconID_TurnStart
Definition: mm7_data.cpp:574
Engine::pStationaryLights
Game__StationaryLight pStationaryLights[25]
Definition: Engine.h:420
OSWindowFactory
Definition: OSWindowFactory.h:4
GUIButton.h
GUIProgressBar::Initialize
bool Initialize(Type type)
Definition: GUIProgressBar.cpp:22
SpriteFrameTable::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: Sprites.cpp:378
SpriteObject::vPosition
struct Vec3_int_ vPosition
Definition: SpriteObject.h:218
Mouse::Initialize
void Initialize(OSWindow *window)
Definition: Mouse.cpp:112
activeLevelDecoration
LevelDecoration * activeLevelDecoration
Definition: Decoration.cpp:10
ViewingParams::uScreen_topL_X
unsigned int uScreen_topL_X
Definition: Viewport.h:60
pParty
Party * pParty
Definition: Party.cpp:30
Engine_::IocContainer::ResolveVis
static Vis * ResolveVis()
Definition: IocContainer.cpp:110
ODMRenderParams::shading_dist_shade
int shading_dist_shade
Definition: IRender.h:74
LODFile_IconsBitmaps::_inlined_sub0
void _inlined_sub0()
Definition: LOD.cpp:50
Engine_::IocContainer::ResolveParticleEngine
static ParticleEngine * ResolveParticleEngine()
Definition: IocContainer.cpp:103
LOD::WriteableFile::FreeSubIndexAndIO
void FreeSubIndexAndIO()
Definition: LOD.cpp:732
Party::_497FC5_check_party_perception_against_level
bool _497FC5_check_party_perception_against_level()
Definition: Party.cpp:130
MapsLongTimer::time_left_to_fire
int16_t time_left_to_fire
Definition: MapsLongTimer.h:11
pUIAnims
std::array< class UIAnimation *, 4 > pUIAnims
Definition: Party.cpp:52
Engine::mouse
Mouse * mouse
Definition: Engine.h:469
Party_Teleport_Cam_Pitch
int Party_Teleport_Cam_Pitch
Definition: mm7_data.cpp:626
MapsLongTimer::IntervalHalfMins
int16_t IntervalHalfMins
Definition: MapsLongTimer.h:12
GameUI_DrawRightPanelFrames
void GameUI_DrawRightPanelFrames()
Definition: UIGame.cpp:1254
flt_6BE3AC_debug_recmod1_x_1_6
float flt_6BE3AC_debug_recmod1_x_1_6
Definition: mm7_data.cpp:718
pIcons_LOD_mm6
LODFile_IconsBitmaps * pIcons_LOD_mm6
Definition: LOD.cpp:13
ViewingParams::uMinimapZoom
unsigned int uMinimapZoom
Definition: Viewport.h:65
pFontArrus
GUIFont * pFontArrus
Definition: GUIFont.cpp:18
MapsLongTimer::timer_evt_type
int16_t timer_evt_type
Definition: MapsLongTimer.h:19
Party::vPrevPosition
Vec3_int_ vPrevPosition
Definition: Party.h:253
IRender.h
LEVEL_DECORATION_INVISIBLE
@ LEVEL_DECORATION_INVISIBLE
Definition: Decoration.h:14
GameTime::GetWeeks
int GetWeeks() const
Definition: Time.h:33
NPCStats::pNewNPCData
NPCData pNewNPCData[501]
Definition: NPC.h:165
Party::days_played_without_rest
unsigned char days_played_without_rest
Definition: Party.h:290
Party::bFlying
unsigned int bFlying
Definition: Party.h:266
LocationTime_stru1::last_visit
GameTime last_visit
Definition: Indoor.h:274
EQUIP_ARMOUR
@ EQUIP_ARMOUR
Definition: Items.h:230
Engine::_44F07B
bool _44F07B()
Definition: Keyboard.cpp:38
GetGravityStrength
unsigned int GetGravityStrength()
Definition: Engine.cpp:1500
Vis
Definition: Vis.h:69
ViewingParams::uSomeY
int uSomeY
Definition: Viewport.h:56
ITEM_ARTIFACT_HERMES_SANDALS
@ ITEM_ARTIFACT_HERMES_SANDALS
Definition: Items.h:182
BLVFace::SetTexture
void SetTexture(const String &filename)
Definition: Indoor.cpp:746
OutdoorLocation::loc_time
LocationTime_stru1 loc_time
Definition: Outdoor.h:132
vis_sprite_filter_2
Vis_SelectionFilter vis_sprite_filter_2
Definition: Vis.cpp:24
Party::_6FC_water_lava_timer
int _6FC_water_lava_timer
Definition: Party.h:264
pDefaultSkyTexture
std::array< char, 777 > pDefaultSkyTexture
Definition: mm7_data.cpp:701
LODFile_IconsBitmaps::Load
bool Load(const String &pFilename, const String &pFolderName)
Definition: LOD.cpp:349
Vis_SelectionFilter
Definition: Vis.h:12
ODMRenderParams::bNoSky
unsigned int bNoSky
Definition: IRender.h:96
PaletteManager::LockTestAll
int LockTestAll()
Definition: PaletteManager.cpp:152
Engine::_44EEA7
bool _44EEA7()
Definition: Engine.cpp:399
Log::Info
void Info(const wchar_t *pFormat,...)
Definition: Log.cpp:11
pGameLoadingUI_ProgressBar
GUIProgressBar * pGameLoadingUI_ProgressBar
Definition: GUIProgressBar.cpp:14
NPCStats::pNPCData
NPCData pNPCData[501]
Definition: NPC.h:164
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
vis_sprite_filter_4
Vis_SelectionFilter vis_sprite_filter_4
Definition: Vis.cpp:32
OS_GetTime
unsigned int OS_GetTime()
Definition: Lin.cpp:12
ViewingParams
Definition: Viewport.h:38
Engine::bloodsplat_container
BloodsplatContainer * bloodsplat_container
Definition: Engine.h:465
no_rightlick_in_inventory
int no_rightlick_in_inventory
Definition: UIPopup.cpp:1815
Viewport::SetFOV
void SetFOV(float fov)
Definition: Viewport.cpp:62
SPRITE_SPELL_FIRE_IMMOLATION
@ SPRITE_SPELL_FIRE_IMMOLATION
Definition: SpriteObject.h:52
Engine::log
Log * log
Definition: Engine.h:464
LODFile_IconsBitmaps::SetupPalettes
void SetupPalettes(unsigned int uTargetRBits, unsigned int uTargetGBits, unsigned int uTargetBBits)
Definition: LOD.cpp:872
EngineConfig.h
PlayLevelMusic
void PlayLevelMusic()
Definition: AudioPlayer.cpp:377
Condition_Dead
@ Condition_Dead
Definition: Conditions.h:22
CURRENT_SCREEN::SCREEN_HOUSE
@ SCREEN_HOUSE
SpriteFrameTable::ResetSomeSpriteFlags
void ResetSomeSpriteFlags()
Definition: Sprites.cpp:32
MM7Initialization
void MM7Initialization()
Definition: Engine.cpp:1287
pLevelEVT
std::array< char, 9216 > pLevelEVT
Definition: Events.cpp:54
_5773B8_event_timer
GameTime _5773B8_event_timer
Definition: mm7_data.cpp:601
stru123.h
SaveLoad.h
Engine::DrawParticles
void DrawParticles()
Definition: Engine.cpp:381
SPELL_FIRE_IMMOLATION
@ SPELL_FIRE_IMMOLATION
Definition: Spells.h:20
ITEM_ARTIFACT_HEROS_BELT
@ ITEM_ARTIFACT_HEROS_BELT
Definition: Items.h:188
Party::_46A89E_immolation_effect
int _46A89E_immolation_effect(int *affected, int affectedArrSize, int effectRange)
Definition: Party.cpp:1144
Party_Teleport_X_Pos
int Party_Teleport_X_Pos
Definition: mm7_data.cpp:622
Viewport::uScreen_BR_X
int uScreen_BR_X
Definition: Viewport.h:20
BLVFace
Definition: Indoor.h:424
VisObjectType_Sprite
@ VisObjectType_Sprite
Definition: Vis.h:6
PARTY_BUFF_HASTE
@ PARTY_BUFF_HASTE
Definition: Party.h:79
ItemGen::uItemID
int uItemID
Definition: Items.h:326
GUIProgressBar::TYPE_Box
@ TYPE_Box
Definition: GUIProgressBar.h:12
IndoorLocation::Draw
void Draw()
Definition: Indoor.cpp:322
Engine_::IocContainer::ResolveDecalBuilder
static DecalBuilder * ResolveDecalBuilder()
Definition: IocContainer.cpp:60
OtherOverlayList::DrawTurnBasedIcon
void DrawTurnBasedIcon(int a2)
Definition: Overlays.cpp:67
NPCStats::uNewlNPCBufPos
unsigned int uNewlNPCBufPos
Definition: NPC.h:178
LODFile_Sprites::_inlined_sub0
void _inlined_sub0()
Definition: LOD.cpp:55
Localization
Definition: Localization.h:8
Weather::Draw
void Draw()
Definition: Weather.cpp:50
uIconID_CharacterFrame
int uIconID_CharacterFrame
Definition: mm7_data.cpp:573
Vis::_4C1A02
void _4C1A02()
Definition: Vis.cpp:427
Initialize_GamesLOD_NewLOD
bool Initialize_GamesLOD_NewLOD()
Definition: LOD.cpp:1218
sub_4637E0_is_there_popup_onscreen
char sub_4637E0_is_there_popup_onscreen()
Definition: GUIWindow.cpp:1361
PLAYER_CLASS_LICH
@ PLAYER_CLASS_LICH
Definition: Player.h:251
v1
GLfloat GLfloat v1
Definition: SDL_opengl_glext.h:694
LODFile_IconsBitmaps::ReleaseAll2
void ReleaseAll2()
Definition: LOD.cpp:223
UI_Create
void UI_Create()
Definition: GUIWindow.cpp:2539
GameUI_StatusBar_DrawForced
void GameUI_StatusBar_DrawForced()
Definition: UIStatusBar.cpp:63
GameUI_StatusBar_Draw
void GameUI_StatusBar_Draw()
Definition: UIStatusBar.cpp:71
SoundList
Definition: AudioPlayer.h:157
SpriteObject::spell_id
int spell_id
Definition: SpriteObject.h:228
Engine_::IocContainer::ResolveMouse
static Mouse * ResolveMouse()
Definition: IocContainer.cpp:88
MonsterList
Definition: Monsters.h:226
Log::Warning
void Warning(const wchar_t *pFormat,...)
Definition: Log.cpp:28
CURRENT_SCREEN::SCREEN_CHARACTERS
@ SCREEN_CHARACTERS
pIcons_LOD
LODFile_IconsBitmaps * pIcons_LOD
Definition: LOD.cpp:12
LODFile_IconsBitmaps::LoadTexture
unsigned int LoadTexture(const char *pContainer, enum TEXTURE_TYPE uTextureType=TEXTURE_DEFAULT)
Definition: LOD.cpp:1185
Engine::PushStationaryLights
void PushStationaryLights(int a2)
Definition: Engine.cpp:386
Engine::uNumStationaryLights
unsigned int uNumStationaryLights
Definition: Engine.h:422
AudioPlayer::StopChannels
void StopChannels(int uStartChannel, int uEndChannel)
Definition: AudioPlayer.cpp:331
IndoorCameraD3D::CreateWorldMatrixAndSomeStuff
void CreateWorldMatrixAndSomeStuff()
Definition: IndoorCameraD3D.cpp:489
Engine::OutlineSelection
void OutlineSelection()
Definition: Engine.cpp:718
pActors
std::array< Actor, 500 > pActors
Definition: Actor.cpp:38
MediaPlayer.h
Condition_Zombie
@ Condition_Zombie
Definition: Conditions.h:25
Party_Teleport_Cam_Yaw
int Party_Teleport_Cam_Yaw
Definition: mm7_data.cpp:625
Arcomage.h
Party::ImmolationSkillLevel
int ImmolationSkillLevel()
Definition: Party.h:211
Engine::Draw
void Draw()
Definition: Engine.cpp:166
Party.h
ODM_LoadAndInitialize
void ODM_LoadAndInitialize(const String &pFilename, ODMRenderParams *thisa)
Definition: Outdoor.cpp:3788
pPlayerFrameTable
struct PlayerFrameTable * pPlayerFrameTable
Definition: mm7_data.cpp:171
GUIProgressBar::Reset
void Reset(uint8_t uMaxProgress)
Definition: GUIProgressBar.cpp:78
FindMm7Directory
const char * FindMm7Directory(char *mm7_path)
Definition: Engine.cpp:1152
back_to_game
void back_to_game()
Definition: Engine.cpp:1609
InitializeTurnBasedAnimations
void InitializeTurnBasedAnimations(void *_this)
Definition: Engine.cpp:1479
Viewport::uViewportBR_X
int uViewportBR_X
Definition: Viewport.h:24
uNumLevelDecorations
size_t uNumLevelDecorations
Definition: Decoration.cpp:9
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
Party::uFlags
unsigned int uFlags
Definition: Party.h:313
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
SpellFxRenderer::DrawPlayerBuffAnims
void DrawPlayerBuffAnims()
Definition: SpellFxRenderer.cpp:1317
GameTime::GetHoursOfDay
int GetHoursOfDay() const
Definition: Time.h:39
GUI_UpdateWindows
void GUI_UpdateWindows()
Definition: GUIWindow.cpp:956
_strrev
char * _strrev(char *str)
Definition: PlatformLinux.h:16
Engine::spell_fx_renedrer
SpellFxRenderer * spell_fx_renedrer
Definition: Engine.h:467
Weather.h
MapsLongTimers_count
int MapsLongTimers_count
Definition: mm7_data.cpp:630
pTileTable
struct TileTable * pTileTable
Definition: mm7_data.cpp:700
_evt_raw::v10
unsigned char v10
Definition: Events.h:32
Transition_StopSound_Autosave
void Transition_StopSound_Autosave(const char *pMapName, MapStartPoint start_point)
Definition: Engine.cpp:2464
NPCStats::pAdditionalNPC
NPCData pAdditionalNPC[100]
Definition: NPC.h:168
stru_50C198
stru319 stru_50C198
Definition: Actor.cpp:41
OSWindowFactory::Create
OSWindow * Create(const char *title, int window_width, int window_height)
Definition: OSWindowFactory.cpp:13
IRenderFactory.h
Party::uWalkSpeed
unsigned int uWalkSpeed
Definition: Party.h:243
Engine::vis
Vis * vis
Definition: Engine.h:472
Engine::_44EC23_saturate_face_odm
int _44EC23_saturate_face_odm(struct Polygon *a2, int *a3, signed int a4)
Definition: Engine.cpp:509
UIMainMenu.h
LEVEL_Outdoor
@ LEVEL_Outdoor
Definition: Indoor.h:287
KeyboardActionMapping
Definition: Keyboard.h:45
Timer::Pause
void Pause()
Definition: Time.cpp:19
Mouse::DrawCursor
void DrawCursor()
Definition: Mouse.cpp:143
GAME_STATE_PARTY_DIED
@ GAME_STATE_PARTY_DIED
Definition: Engine.h:40
ODMRenderParams::outdoor_no_mist
int outdoor_no_mist
Definition: IRender.h:101
PlayerFrameTable::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: PlayerFrameTable.cpp:79
LoadEventsToBuffer
unsigned int LoadEventsToBuffer(const char *pContainerName, char *pBuffer, unsigned int uBufferSize)
Definition: Events.cpp:59
ObjectList
Definition: ObjectList.h:41
ItemsTable::Release
void Release()
Definition: Items.cpp:157
EVENT_OnLongTimer
@ EVENT_OnLongTimer
Definition: Events.h:94
AssetsManager::GetBitmap
Texture * GetBitmap(const String &name)
Definition: AssetsManager.cpp:126
value
EGLSyncKHR EGLint EGLint * value
Definition: SDL_egl.h:899
TileTable
Definition: TileFrameTable.h:74
ViewingParams::uSomeZ
int uSomeZ
Definition: Viewport.h:57
uLevelStrFileSize
unsigned int uLevelStrFileSize
Definition: Events.cpp:50
Vis_ObjectInfo
Definition: Vis.h:28
pGUIWindow_ScrollWindow
GUIWindow * pGUIWindow_ScrollWindow
Definition: GUIWindow.cpp:52
SpellBuff::expire_time
GameTime expire_time
Definition: Spells.h:165
MPlayer
Definition: MediaPlayer.h:17
depth
GLint GLint GLsizei GLsizei GLsizei depth
Definition: SDL_opengl.h:1572
ObjectList::InitializeSprites
void InitializeSprites()
Definition: ObjectList.cpp:20
Party::GetFood
int GetFood() const
Definition: Party.cpp:272
Engine::uNumStationaryLights_in_pStationaryLightsStack
int uNumStationaryLights_in_pStationaryLightsStack
Definition: Engine.h:443
LevelDecoration
Definition: Decoration.h:20
DecalBuilder::curent_decal_id
int curent_decal_id
Definition: DecalBuilder.h:161
pCurrentMapName
String pCurrentMapName
Definition: mm7_data.cpp:712
MPlayer::Initialize
void Initialize()
Definition: MediaPlayer.cpp:623
LoadLevel_InitializeLevelEvt
void LoadLevel_InitializeLevelEvt()
Definition: Events.cpp:108
pPaletteManager
PaletteManager * pPaletteManager
Definition: PaletteManager.cpp:7
uLevelEVT_Size
unsigned int uLevelEVT_Size
Definition: Events.cpp:52
Party::sPrevRotationY
int sPrevRotationY
Definition: Party.h:254
IconFrameTable::FindIcon
unsigned int FindIcon(const char *pIconName)
Definition: IconFrameTable.cpp:31
pLevelEVT_Index
std::array< EventIndex, 4400 > pLevelEVT_Index
Definition: Events.cpp:55
flt_6BE3A8_debug_recmod2
float flt_6BE3A8_debug_recmod2
Definition: mm7_data.cpp:717
ViewingParams::uSomeX
int uSomeX
Definition: Viewport.h:55
LODFile_Sprites
Definition: LOD.h:210
GameTime::GetWeeksOfMonth
int GetWeeksOfMonth() const
Definition: Time.h:42
ViewingParams::_443365
void _443365()
Definition: Viewport.cpp:177
Viewport::uViewportBR_Y
int uViewportBR_Y
Definition: Viewport.h:25
pMiscTimer
Timer * pMiscTimer
Definition: Time.cpp:7
pEvents_LOD
LODFile_IconsBitmaps * pEvents_LOD
Definition: LOD.cpp:10
game_viewport_w
int game_viewport_w
Definition: mm7_data.cpp:199
BLVFaceExtra::face_id
int16_t face_id
Definition: Indoor.h:505
CURRENT_SCREEN::SCREEN_INPUT_BLV
@ SCREEN_INPUT_BLV
Engine_DeinitializeAndTerminate
void Engine_DeinitializeAndTerminate(int exitCode)
Definition: Engine.cpp:157
Outdoor.h
LevelDecoration::uDecorationDescID
uint16_t uDecorationDescID
Definition: Decoration.h:26
Condition_Cursed
@ Condition_Cursed
Definition: Conditions.h:8
pLevelStr
std::array< char, 9216 > pLevelStr
Definition: Events.cpp:53
Engine::SetSaturateFaces
void SetSaturateFaces(bool saturate)
Definition: Engine.h:143
LEVEL_Indoor
@ LEVEL_Indoor
Definition: Indoor.h:286
PARTY_FLAGS_2_RUNNING
@ PARTY_FLAGS_2_RUNNING
Definition: Party.h:66
_6807E0_num_decorations_with_sounds_6807B8
int _6807E0_num_decorations_with_sounds_6807B8
Definition: mm7_data.cpp:686
SpriteObject::Create
int Create(int yaw, int pitch, int a4, int a5)
Definition: SpriteObject.cpp:56
SpriteObject::containing_item
struct ItemGen containing_item
Definition: SpriteObject.h:227
CHARACTER_ATTRIBUTE_ENDURANCE
@ CHARACTER_ATTRIBUTE_ENDURANCE
Definition: Engine.h:524
OutdoorLocation::SetFog
void SetFog()
Definition: Outdoor.cpp:483
dword_576E28
int dword_576E28
Definition: mm7_data.cpp:599
EventIndex::uEventID
int uEventID
Definition: Events.h:7
Party::pHirelings
std::array< NPCData, 2 > pHirelings
Definition: Party.h:311
AudioPlayer.h
OBJECT_Player
@ OBJECT_Player
Definition: Actor.h:68
DecorationList
Definition: DecorationList.h:57
game_ui_status_bar_event_string_time_left
unsigned int game_ui_status_bar_event_string_time_left
Definition: mm7_data.cpp:639
PLAYER_CLASS_WARLOCK
@ PLAYER_CLASS_WARLOCK
Definition: Player.h:247
uIconID_TurnHour
unsigned int uIconID_TurnHour
Definition: mm7_data.cpp:572
pViewport
struct Viewport * pViewport
Definition: mm7_data.cpp:21
LODFile_IconsBitmaps
Definition: LOD.h:125
ODMRenderParams::uPickDepth
int uPickDepth
Definition: IRender.h:73
GameTime::GetMonthsOfYear
int GetMonthsOfYear() const
Definition: Time.h:43
PaletteManager::ResetNonLocked
int ResetNonLocked()
Definition: PaletteManager.cpp:588
CURRENT_SCREEN::SCREEN_CHANGE_LOCATION
@ SCREEN_CHANGE_LOCATION
CURRENT_SCREEN::SCREEN_GAME
@ SCREEN_GAME
SpriteObject::uSoundID
unsigned __int16 uSoundID
Definition: SpriteObject.h:221
PaletteManager::RecalculateAll
void RecalculateAll()
Definition: PaletteManager.cpp:784
_evt_raw::v11
unsigned char v11
Definition: Events.h:33
OnMapLeave
void OnMapLeave()
Definition: Engine.cpp:2312
SpriteFrameTable::FastFindSprite
int FastFindSprite(const char *pSpriteName)
Definition: Sprites.cpp:243
dword_507BF0_is_there_popup_onscreen
int dword_507BF0_is_there_popup_onscreen
Definition: mm7_data.cpp:556
VisObjectType_Face
@ VisObjectType_Face
Definition: Vis.h:7
Party::armageddon_timer
int armageddon_timer
Definition: Party.h:320
Party::uCurrentDayOfMonth
unsigned int uCurrentDayOfMonth
Definition: Party.h:274
FrameTableInc.h
GAME_STATE_CHANGE_LOCATION
@ GAME_STATE_CHANGE_LOCATION
Definition: Engine.h:34
GetLevelFogColor
unsigned int GetLevelFogColor()
Definition: Outdoor.cpp:3871
pODMRenderParams
ODMRenderParams * pODMRenderParams
Definition: Outdoor.cpp:49
stru9
Definition: stru9.h:35
Point::y
unsigned int y
Definition: Point.h:8
GUIProgressBar::Release
void Release()
Definition: GUIProgressBar.cpp:88
CURRENT_SCREEN::SCREEN_NPC_DIALOGUE
@ SCREEN_NPC_DIALOGUE
EVENT_OnMapLeave
@ EVENT_OnMapLeave
Definition: Events.h:109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
Localization::Initialize
bool Initialize()
Definition: Localization.cpp:34
Engine::particle_engine
ParticleEngine * particle_engine
Definition: Engine.h:471
pOtherOverlayList
struct OtherOverlayList * pOtherOverlayList
Definition: Overlays.cpp:19
Party_Teleport_Z_Speed
int Party_Teleport_Z_Speed
Definition: mm7_data.cpp:627
ChestList
Definition: Chest.h:23
Engine::AlterGamma_ODM
bool AlterGamma_ODM(struct ODMFace *pFace, unsigned int *pColor)
Definition: Engine.cpp:468
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
OutdoorLocation::Release
void Release()
Definition: Outdoor.cpp:952
NPCData::bHasUsedTheAbility
int bHasUsedTheAbility
Definition: NPC.h:100
SpriteObject::spell_level
int spell_level
Definition: SpriteObject.h:229
SpellBuff::uCaster
unsigned __int8 uCaster
Definition: Spells.h:169
ItemsTable::Initialize
void Initialize()
Definition: Items.cpp:181
Condition_Weak
@ Condition_Weak
Definition: Conditions.h:9
Engine::pStru10Instance
stru10 * pStru10Instance
Definition: Engine.h:456
NPCStats::Initialize
void Initialize()
Definition: NPC.cpp:445
ItemsTable
Definition: Items.h:448
ReplaceHSV
int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace)
Definition: PaletteManager.cpp:843
Engine::Initialize
void Initialize()
Definition: Engine.cpp:1209
sub_44892E_set_faces_bit
void sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
Definition: Engine.cpp:1558
PaletteManager::SetMistColor
void SetMistColor(unsigned char r, unsigned char g, unsigned char b)
Definition: PaletteManager.cpp:776
free_book_subwindow
void free_book_subwindow()
Definition: GUIWindow.cpp:1025
Engine::PickKeyboard
bool PickKeyboard(bool bOutline, struct Vis_SelectionFilter *sprite_filter, struct Vis_SelectionFilter *face_filter)
Definition: Engine.cpp:691
pMonsterList
struct MonsterList * pMonsterList
Definition: Monsters.cpp:9
IndoorLocation::Release
void Release()
Definition: Indoor.cpp:761
UIStatusBar.h
pKeyActionMap
struct KeyboardActionMapping * pKeyActionMap
Definition: Keyboard.cpp:35
SpriteObject::spell_target_pid
int spell_target_pid
Definition: SpriteObject.h:233
MakeDataPath
std::string MakeDataPath(const char *file_rel_path)
Definition: Engine.cpp:126
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11096
DecorationDesc_mm6::uSoundID
int16_t uSoundID
Definition: DecorationList.h:45
MapsLongTimer
Definition: MapsLongTimer.h:6
v2
GLfloat GLfloat GLfloat v2
Definition: SDL_opengl_glext.h:695
Vis::PickMouse
bool PickMouse(float fDepth, float fMouseX, float fMouseY, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
Definition: Vis.cpp:1268
flt_6BE3A4_debug_recmod1
float flt_6BE3A4_debug_recmod1
Definition: mm7_data.cpp:716
pLevelStrOffsets
std::array< unsigned int, 500 > pLevelStrOffsets
Definition: Events.cpp:48
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
Polygon::pODMFace
ODMFace * pODMFace
Definition: Polygon.h:47
uint
unsigned int uint
Definition: MM7.h:4
GameTime::GetMonths
int GetMonths() const
Definition: Time.h:34
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
Engine::_461103_load_level_sub
void _461103_load_level_sub()
Definition: Engine.cpp:1365
v3
GLfloat GLfloat GLfloat GLfloat v3
Definition: SDL_opengl_glext.h:696
pStationaryLightsStack
LightsStack_StationaryLight_ * pStationaryLightsStack
Definition: LightmapBuilder.cpp:11
__debugbreak
void __cdecl __debugbreak(void)
_evt_raw
Definition: Events.h:20
stru10::bDoNotDrawPortalFrustum
int bDoNotDrawPortalFrustum
Definition: stru10.h:32
uLevelEVT_NumEvents
signed int uLevelEVT_NumEvents
Definition: Events.cpp:51
CURRENT_SCREEN::SCREEN_REST
@ SCREEN_REST
LODFile_Sprites::DeleteSomeOtherSprites
void DeleteSomeOtherSprites()
Definition: LOD.cpp:232
pNPCStats
struct NPCStats * pNPCStats
Definition: NPC.cpp:29
BSPModel::pFaces
std::vector< ODMFace > pFaces
Definition: BSPModel.h:190
CHARACTER_EXPRESSION_37
@ CHARACTER_EXPRESSION_37
Definition: Player.h:379
_6BE3A0_fov
float _6BE3A0_fov
Definition: mm7_data.cpp:715
ODMFace
Definition: BSPModel.h:93
PLAYER_BUFF_REGENERATION
@ PLAYER_BUFF_REGENERATION
Definition: Player.h:26
pOverlayList
struct OverlayList * pOverlayList
Definition: Overlays.cpp:20
ODMRenderParams::outdoor_grid_band_3
int outdoor_grid_band_3
Definition: IRender.h:93
PARTY_BUFF_FLY
@ PARTY_BUFF_FLY
Definition: Party.h:78
pBitmaps_LOD
LODFile_IconsBitmaps * pBitmaps_LOD
Definition: LOD.cpp:16
DecorationList::InitializeDecorationSprite
void InitializeDecorationSprite(unsigned int uDecID)
Definition: DecorationList.cpp:45
SpriteObject::spell_skill
int spell_skill
Definition: SpriteObject.h:230
Engine::fSaturation
float fSaturation
Definition: Engine.h:445
Mouse::SetCursorBitmapFromItemID
void SetCursorBitmapFromItemID(unsigned int uItemID)
Definition: Mouse.cpp:32
Condition_Unconcious
@ Condition_Unconcious
Definition: Conditions.h:21
AudioPlayer
Definition: AudioPlayer.h:111
Decoration.h
ODMFace::uAttributes
uint32_t uAttributes
Definition: BSPModel.h:135
MapsLongTimersList
MapsLongTimer MapsLongTimersList[100]
Definition: mm7_data.cpp:165
_evt_raw::v5
unsigned char v5
Definition: Events.h:27
ODM_GetFloorLevel
int ODM_GetFloorLevel(int X, signed int Y, int Z, int __unused, bool *pIsOnWater, int *bmodel_pid, int bWaterWalk)
Definition: Outdoor.cpp:1877
Viewport::SetScreen
void SetScreen(int uX, int uY, int uZ, int uW)
Definition: Viewport.cpp:26
LODFile_Sprites::_461397
int _461397()
Definition: LOD.cpp:843
ViewingParams::bRedrawGameUI
int bRedrawGameUI
Definition: Viewport.h:74
OSWindowFactory.h
ODM_UpdateUserInputAndOther
void ODM_UpdateUserInputAndOther()
Definition: Outdoor.cpp:2115
DecalBuilder::DecalsCount
unsigned int DecalsCount
Definition: DecalBuilder.h:160
dword_6BE364_game_settings_1
int dword_6BE364_game_settings_1
Definition: mm7_data.cpp:714
DecorationDesc
Definition: DecorationList.h:49
Engine::CanSaturateFaces
bool CanSaturateFaces() const
Definition: Engine.h:134
SoundID
SoundID
Definition: AudioPlayer.h:10
OurMath.h
GameUI_DrawCharacterSelectionFrame
void GameUI_DrawCharacterSelectionFrame()
Definition: UIGame.cpp:1688
EventProcessor
void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
Definition: Events.cpp:260
Vis::PickKeyboard
bool PickKeyboard(Vis_SelectionList *list, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
Definition: Vis.cpp:1247
Mouse::SetCursorImage
void SetCursorImage(const String &name)
Definition: Mouse.cpp:38
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
MonsterList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: Monsters.cpp:394
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112
OS_SetAppInt
void OS_SetAppInt(const char *pKey, int val)
Definition: Lin.cpp:98
Is_out15odm_underwater
char Is_out15odm_underwater()
Definition: Outdoor.cpp:3377
pPrimaryWindow
GUIWindow * pPrimaryWindow
Definition: GUIWindow.cpp:48
TileTable::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: TileTable.cpp:90
IndoorLocation::GetSector
int GetSector(int sX, int sY, int sZ)
Definition: Indoor.cpp:1279
IndoorLocation::pFaces
struct BLVFace * pFaces
Definition: Indoor.h:630
Vis_SelectionList::uNumPointers
unsigned int uNumPointers
Definition: Vis.h:63
ChestList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: Chest.cpp:457
s_data_path
static std::string s_data_path
Definition: Engine.cpp:122
Graphics::IRenderFactory
Definition: IRenderFactory.h:9
uLevel_StartingPointType
MapStartPoint uLevel_StartingPointType
Definition: Outdoor.cpp:46
GameUI_DrawPartySpells
void GameUI_DrawPartySpells()
Definition: UIGame.cpp:1699
LightsStack_StationaryLight_::AddLight
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t a5, unsigned char r, unsigned char g, unsigned char b, char uLightType)
Definition: LightsStack.cpp:30
LODFile_IconsBitmaps::_inlined_sub1
void _inlined_sub1()
Definition: LOD.cpp:42
MapsLongTimer::timer_evt_ID
int16_t timer_evt_ID
Definition: MapsLongTimer.h:9
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
v0
GLfloat v0
Definition: SDL_opengl_glext.h:693
Condition_Eradicated
@ Condition_Eradicated
Definition: Conditions.h:24
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
MapsLongTimer::HoursInterval
int16_t HoursInterval
Definition: MapsLongTimer.h:16
BSPModel
Definition: BSPModel.h:163
UISaveLoad.h
SOUND_StartMainChoice02
@ SOUND_StartMainChoice02
Definition: AudioPlayer.h:37
GameUI_DrawPortraits
void GameUI_DrawPortraits(unsigned int _this)
Definition: UIGame.cpp:1766
OnTimer
void OnTimer(int)
Definition: Engine.cpp:2479
GUIWindow.h
Engine::ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows
void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
Definition: Engine.cpp:1342
MM7_LoadLods
bool MM7_LoadLods(const char *mm7_path)
Definition: Engine.cpp:869
Point
Definition: Point.h:3
PrepareToLoadODM
void PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2)
Definition: Engine.cpp:1319
ITEM_LICH_JAR_FULL
@ ITEM_LICH_JAR_FULL
Definition: Items.h:206
Party::floor_face_pid
int floor_face_pid
Definition: Party.h:262
ITEM_RELIC_ETHRICS_STAFF
@ ITEM_RELIC_ETHRICS_STAFF
Definition: Items.h:168
ObjectList.h
logger
Log * logger
Definition: IocContainer.cpp:47
CastSpellInfoHelpers::Cancel_Spell_Cast_In_Progress
void Cancel_Spell_Cast_In_Progress()
Definition: CastSpellInfo.cpp:4350
Vis_ObjectInfo::object_type
VisObjectType object_type
Definition: Vis.h:37
ODMRenderParams::Initialize
void Initialize()
Definition: Outdoor.cpp:2196
Condition_Pertified
@ Condition_Pertified
Definition: Conditions.h:23
Engine_::IocContainer::ResolveSpellFxRenderer
static SpellFxRenderer * ResolveSpellFxRenderer()
Definition: IocContainer.cpp:74
Party::uFlags2
int uFlags2
Definition: Party.h:307
Color16
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
Definition: Engine.cpp:148
LightmapBuilder::StationaryLightsCount
unsigned int StationaryLightsCount
Definition: LightmapBuilder.h:83
pOutdoor
OutdoorLocation * pOutdoor
Definition: Outdoor.cpp:48
ViewingParams::uScreen_BttmR_Y
unsigned int uScreen_BttmR_Y
Definition: Viewport.h:63
UpdateUserInput_and_MapSpecificStuff
void UpdateUserInput_and_MapSpecificStuff()
Definition: Engine.cpp:766
GUIProgressBar::Progress
void Progress()
Definition: GUIProgressBar.cpp:83
Engine_::IocContainer::ResolveLightmapBuilder
static LightmapBuilder * ResolveLightmapBuilder()
Definition: IocContainer.cpp:81
UICredits.h
GameUI_StatusBar_OnEvent_128ms
void GameUI_StatusBar_OnEvent_128ms(const String &str)
Definition: UIStatusBar.cpp:37
SpriteObject::uAttributes
unsigned __int16 uAttributes
Definition: SpriteObject.h:222
IndoorCameraD3D::_4374E8_ProllyBuildFrustrum
void _4374E8_ProllyBuildFrustrum()
Definition: IndoorCameraD3D.cpp:581
Party::uCurrentYear
unsigned int uCurrentYear
Definition: Party.h:271
DecalBuilder::DrawBloodsplats
void DrawBloodsplats()
Definition: DecalBuilder.cpp:517
Actor::DamageMonsterFromParty
static void DamageMonsterFromParty(int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity)
Definition: Actor.cpp:3379
pIndoorCameraD3D
IndoorCameraD3D * pIndoorCameraD3D
Definition: IndoorCameraD3D.cpp:21
PLAYER_BUFF_HASTE
@ PLAYER_BUFF_HASTE
Definition: Player.h:21
Engine::DrawGUI
void DrawGUI()
Definition: Engine.cpp:252
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
pGUIWindow_CastTargetedSpell
GUIWindow * pGUIWindow_CastTargetedSpell
Definition: GUIWindow.cpp:56
_6807B8_level_decorations_ids
std::array< int, 777 > _6807B8_level_decorations_ids
Definition: mm7_data.cpp:685
Engine::pStru9Instance
stru9 * pStru9Instance
Definition: Engine.h:455
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
GUIProgressBar.h
Viewport::uViewportTL_X
int uViewportTL_X
Definition: Viewport.h:22
game_viewport_z
int game_viewport_z
Definition: mm7_data.cpp:198
OS_GetAppString
bool OS_GetAppString(const char *path, char *out_string, int out_string_size)
Definition: Launcher.cpp:62
dword_5C341C
int dword_5C341C
Definition: mm7_data.cpp:635
uint32_t
unsigned __int32 uint32_t
Definition: SDL_config.h:39
Party::sPrevEyelevel
int sPrevEyelevel
Definition: Party.h:256
Party_Teleport_Z_Pos
int Party_Teleport_Z_Pos
Definition: mm7_data.cpp:624
OutdoorLocation::Draw
void Draw()
Definition: Outdoor.cpp:160
uLevelStrNumStrings
unsigned int uLevelStrNumStrings
Definition: Events.cpp:49
BLV_GetFloorLevel
int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID)
Definition: Indoor.cpp:2530
Party::sRotationY
int sRotationY
Definition: Party.h:251
ViewingParams::uSomeW
int uSomeW
Definition: Viewport.h:58
PLAYER_BUFF_PRESERVATION
@ PLAYER_BUFF_PRESERVATION
Definition: Player.h:25
MapsLongTimer::timer_evt_seq_num
int16_t timer_evt_seq_num
Definition: MapsLongTimer.h:10
Timer::uTotalGameTimeElapsed
unsigned int uTotalGameTimeElapsed
Definition: Time.h:135
DecalBuilder.h
StorylineTextTable.h
Vis_SelectionList::object_pointers
Vis_ObjectInfo * object_pointers[512]
Definition: Vis.h:62
String
std::string String
Definition: Strings.h:10
Keyboard.h
Engine_::IocContainer::ResolveKeyboard
static Keyboard * ResolveKeyboard()
Definition: IocContainer.cpp:96
PrepareWorld
void PrepareWorld(unsigned int _0_box_loading_1_fullscreen)
Definition: Engine.cpp:781
LODFile_Sprites::LoadSprites
bool LoadSprites(const String &pFilename)
Definition: LOD.cpp:141
_unused_5B5924_is_travel_ui_drawn
int _unused_5B5924_is_travel_ui_drawn
Definition: mm7_data.cpp:621
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
BLVFace::uAttributes
unsigned int uAttributes
Definition: Indoor.h:475
Sprites.h
GameTime
Definition: Time.h:14
MapStartPoint_Party
@ MapStartPoint_Party
Definition: MapInfo.h:28
config
EGLConfig config
Definition: SDL_egl.h:1149
OverlayList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: Overlays.cpp:119
LODFile_Sprites::_inlined_sub1
void _inlined_sub1()
Definition: LOD.cpp:46
Vec3::z
T z
Definition: VectorTypes.h:27
pObjectList
struct ObjectList * pObjectList
Definition: ObjectList.cpp:5
Party::WaterWalkActive
bool WaterWalkActive()
Definition: Party.h:205
_493938_regenerate
void _493938_regenerate()
Definition: Engine.cpp:1929
ViewingParams::field_20
int field_20
Definition: Viewport.h:64
Mouse::ReadCursorWithItem
void ReadCursorWithItem()
Definition: Mouse.cpp:206
SpellBuff::uFlags
unsigned __int8 uFlags
Definition: Spells.h:170
Mouse.h
SaveGame
void SaveGame(bool IsAutoSAve, bool NotSaveWorld)
Definition: SaveLoad.cpp:238
ObjectList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: ObjectList.cpp:55
IRenderConfig.h
CastSpellInfo.h
Api.h
Engine::SecondaryInitialization
void SecondaryInitialization()
Definition: Engine.cpp:1082
pDecorationList
struct DecorationList * pDecorationList
Definition: DecorationList.cpp:11
SoundList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: AudioPlayer.cpp:74
SpriteObject::spell_caster_pid
int spell_caster_pid
Definition: SpriteObject.h:232
Engine::PickMouse
bool PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, struct Vis_SelectionFilter *sprite_filter, struct Vis_SelectionFilter *face_filter)
Definition: Engine.cpp:662
_evt_raw::v12
unsigned char v12
Definition: Events.h:34
GUIWindow::InitializeGUI
static void InitializeGUI()
Definition: GUIWindow.cpp:754
Game__StationaryLight::vRGBColor
Vec3_float_ vRGBColor
Definition: Engine.h:49
MapsLongTimer::NextStartTime
GameTime NextStartTime
Definition: MapsLongTimer.h:7
Vis.h
Time.h
Condition_Sleep
@ Condition_Sleep
Definition: Conditions.h:10
NPCStats
Definition: NPC.h:146
Vis::default_list
Vis_SelectionList default_list
Definition: Vis.h:149
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52