World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл Game.cpp

См. исходные тексты.

Функции

void ShowMM7IntroVideo_and_LoadingScreen ()
 
void IntegrityTest ()
 
int MM_Main (const char *pCmdLine)
 
void Game_StartDialogue (unsigned int actor_id)
 
void Game_StartHirelingDialogue (unsigned int hireling_id)
 

Переменные

Imagegamma_preview_image = nullptr
 

Функции

◆ ShowMM7IntroVideo_and_LoadingScreen()

void ShowMM7IntroVideo_and_LoadingScreen ( )

См. определение в файле Game.cpp строка 221

221  {
222  bGameoverLoop = true;
223 
224  render->PresentBlackScreen();
225  if (!engine->config->NoVideo()) {
226  if (!engine->config->no_logo) {
227  pMediaPlayer->PlayFullscreenMovie("3dologo");
228  pMediaPlayer->PlayFullscreenMovie("new world logo");
230  }
231  if (!engine->config->no_intro) {
233  }
234  }
235 
236  bGameoverLoop = false;
237 }

Перекрестные ссылки bGameoverLoop, engine, MPlayer::PlayFullscreenMovie(), pMediaPlayer и render.

Используется в Application::Game::Run().

+ Граф вызовов:
+ Граф вызова функции:

◆ IntegrityTest()

void IntegrityTest ( )

См. определение в файле IocContainer.cpp строка 127

127  {
128  // ToDo(_): make platform independent
129  static_assert(sizeof(BLVSector) == 0x74, "Wrong type size");
130  static_assert(sizeof(BLVDoor) == 0x50, "Wrong type size");
131  static_assert(sizeof(Particle_sw) == 0x68, "Wrong type size");
132  static_assert(sizeof(Particle) == 0x68, "Wrong type size");
133  static_assert(sizeof(ParticleEngine) == 0xE430, "Wrong type size");
134  static_assert(sizeof(Lightmap) == 0xC1C, "Wrong type size");
135  static_assert(sizeof(Vis_SelectionList) == 0x2008, "Wrong type size");
136  // static_assert(sizeof(Vis) == 0x20D0, "Wrong type size");
137  static_assert(sizeof(ProjectileAnim) == 0x1C, "Wrong type size");
138  static_assert(sizeof(IndoorCameraD3D_Vec3) == 0x10, "Wrong type size");
139  static_assert(sizeof(IndoorCameraD3D_Vec4) == 0x18, "Wrong type size"); // should be 14 (10 vec3 + 4 vdtor) but 18 coz of
140  // his +4 from own vdtor, but it is odd since vdtor
141  // already present from vec3
142  static_assert(sizeof(NPCData) == 0x4C, "Wrong type size");
143  static_assert(sizeof(NPCStats) == 0x17FFC, "Wrong type size");
144  static_assert(sizeof(BspRenderer) == 0x53740, "Wrong type size");
145  static_assert(sizeof(ViewingParams) == 0x26C, "Wrong type size");
146  static_assert(sizeof(Bloodsplat) == 0x28, "Wrong type size");
147  static_assert(sizeof(BloodsplatContainer) == 0xA0C, "Wrong type size");
148  static_assert(sizeof(_2devent) == 0x34, "Wrong type size");
149  static_assert(sizeof(StorylineText) == 0x160, "Wrong type size");
150  static_assert(sizeof(Decal) == 0xC20, "Wrong type size");
151  static_assert(sizeof(MonsterInfo) == 0x58, "Wrong type size");
152  static_assert(sizeof(MonsterStats) == 0x5BA0, "Wrong type size");
153  static_assert(sizeof(BLVSector) == 116, "Wrong type size");
154  static_assert(sizeof(Actor) == 836, "Wrong type size");
155 
156  // ToDo(_): move to usage place
157  static_assert(sizeof(OverlayDesc) == 8, "Wrong type size");
158  static_assert(sizeof(DecorationDesc) == 84, "Wrong type size");
159  static_assert(sizeof(PlayerFrame) == 10, "Wrong type size");
160  static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size");
161  static_assert(sizeof(MonsterDesc_mm6) == 148, "Wrong type size");
162  static_assert(sizeof(MonsterDesc) == 152, "Wrong type size");
163  static_assert(sizeof(Timer) == 0x28, "Wrong type size");
164  static_assert(sizeof(OtherOverlay) == 0x14, "Wrong type size");
165  static_assert(sizeof(ItemGen) == 0x24, "Wrong type size");
166  static_assert(sizeof(SpriteObject) == 0x70, "Wrong type size");
167  static_assert(sizeof(Chest) == 0x14CC, "Wrong type size");
168  static_assert(sizeof(SpellData) == 0x14, "Wrong type size");
169  static_assert(sizeof(SpellBuff) == 0x10, "Wrong type size");
170  static_assert(sizeof(AIDirection) == 0x1C, "Wrong type size");
171  static_assert(sizeof(ActorJob) == 0xC, "Wrong type size");
172  static_assert(sizeof(LevelDecoration) == 0x20, "Wrong type size");
173  static_assert(sizeof(BLVFaceExtra) == 0x24, "Wrong type size");
174  static_assert(sizeof(BLVLightMM7) == 0x10, "Wrong type size");
175  static_assert(sizeof(PlayerBuffAnim) == 0x10, "Wrong type size");
176  static_assert(sizeof(StationaryLight) == 0xC, "Wrong type size");
177  static_assert(sizeof(MobileLight) == 0x12, "Wrong type size");
178  static_assert(sizeof(stru141_actor_collision_object) == 0xA8, "Wrong type size");
179  static_assert(sizeof(ActionQueue) == 0x7C, "Wrong type size");
180  static_assert(sizeof(PaletteManager) == 0x267AF0, "Wrong type size");
181  static_assert(sizeof(TrailParticle) == 0x18, "Wrong type size");
182  static_assert(sizeof(EventIndex) == 0xC, "Wrong type size");
183  static_assert(sizeof(MapsLongTimer) == 0x20, "Wrong type size");
184  static_assert(sizeof(SavegameHeader) == 0x64, "Wrong type size");
185  static_assert(sizeof(FactionTable) == 0x1EF1, "Wrong type size");
186  static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size");
187  static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size");
188  static_assert(sizeof(ArcomageCard) == 0x6C, "Wrong type size");
189  static_assert(sizeof(LightsData) == 0x3FC, "Wrong type size");
190  static_assert(sizeof(TravelInfo) == 0x20, "Wrong type size");
191  static_assert(sizeof(stru336) == 0x798, "Wrong type size");
192  static_assert(sizeof(Vec3_short_) == 6, "Wrong type size");
193  static_assert(sizeof(BLVFaceExtra) == 36, "Wrong type size");
194  static_assert(sizeof(LevelDecoration) == 32, "Wrong type size");
195  static_assert(sizeof(BLVLightMM7) == 16, "Wrong type size");
196  static_assert(sizeof(BSPNode) == 8, "Wrong type size");
197  static_assert(sizeof(DDM_DLV_Header) == 40, "Wrong type size");
198  static_assert(sizeof(SpriteObject) == 112, "Wrong type size");
199  static_assert(sizeof(Chest) == 5324, "Wrong type size");
200  static_assert(sizeof(stru123) == 0xC8, "Wrong type size");
201  static_assert(sizeof(BLVMapOutline) == 12, "Wrong type size");
202 }

Используется в Application::Game::Run().

+ Граф вызова функции:

◆ MM_Main()

int MM_Main ( const char *  pCmdLine)

См. определение в файле Game.cpp строка 83

83  {
84  GameFactory gameFactory;
85 
86  auto game = gameFactory.CreateGame(std::string(pCmdLine));
87  game->Run();
88 
89  return 0;
90 }

Перекрестные ссылки Application::GameFactory::CreateGame().

Используется в main() и SDL_main().

+ Граф вызовов:
+ Граф вызова функции:

◆ Game_StartDialogue()

void Game_StartDialogue ( unsigned int  actor_id)

См. определение в файле Game.cpp строка 244

244  {
245  if (uActiveCharacter) {
246  viewparams->field_48 = 1;
247 
249 
250  dword_5B65D0_dialogue_actor_npc_id = pActors[actor_id].sNPC_ID;
251  GameUI_InitializeDialogue(&pActors[actor_id], true);
252  }
253 }

Перекрестные ссылки dword_5B65D0_dialogue_actor_npc_id, ViewingParams::field_48, GUIMessageQueue::Flush(), GameUI_InitializeDialogue(), pActors, pMessageQueue_50CBD0, uActiveCharacter и viewparams.

Используется в Application::Game::EventLoop().

+ Граф вызовов:
+ Граф вызова функции:

◆ Game_StartHirelingDialogue()

void Game_StartHirelingDialogue ( unsigned int  hireling_id)

См. определение в файле Game.cpp строка 255

255  {
257 
259 
260  uint hireling_slot = 0;
261  char buf[1024];
262  for (uint i = 0; i < 2; ++i) {
263  if (pParty->pHirelings[i].pName) buf[hireling_slot++] = i;
264  }
265 
266  for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) {
267  NPCData *npc = &pNPCStats->pNewNPCData[i];
268  if (npc->Hired() &&
269  (!pParty->pHirelings[0].pName ||
270  strcmp(npc->pName, pParty->pHirelings[0].pName)) &&
271  (!pParty->pHirelings[1].pName ||
272  strcmp(npc->pName, pParty->pHirelings[1].pName))) {
273  buf[hireling_slot++] = i + 2;
274  }
275  }
276 
277  if ((signed int)hireling_id + (signed int)pParty->hirelingScrollPosition < hireling_slot) {
278  Actor actor;
279  memset(&actor, 0, sizeof(actor));
280  actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_id;
281  GameUI_InitializeDialogue(&actor, true);
282  }
283 }

Перекрестные ссылки bNoNPCHiring, current_screen_type, GUIMessageQueue::Flush(), GameUI_InitializeDialogue(), NPCData::Hired(), Party::hirelingScrollPosition, Party::pHirelings, pMessageQueue_50CBD0, NPCData::pName, NPCStats::pNewNPCData, pNPCStats, pParty, SCREEN_GAME, Actor::sNPC_ID и NPCStats::uNumNewNPCs.

Используется в Application::Game::EventLoop().

+ Граф вызовов:
+ Граф вызова функции:

Переменные

◆ gamma_preview_image

Image* gamma_preview_image = nullptr

См. определение в файле Game.cpp строка 242

Используется в Application::Game::EventLoop(), Application::Menu::MenuLoop() и GUIWindow_GameVideoOptions::Update().

BspRenderer
Definition: Indoor.h:800
SpriteObject
Definition: SpriteObject.h:189
ViewingParams::field_48
int field_48
Definition: Viewport.h:75
MobileLight
Definition: Lights.h:21
PlayerFrame
Definition: PlayerFrameTable.h:7
stru141_actor_collision_object
Definition: Indoor.h:148
BLVFaceExtra
Definition: Indoor.h:496
MPlayer::PlayFullscreenMovie
void PlayFullscreenMovie(const std::string &pMovieName)
Definition: MediaPlayer.cpp:705
OverlayDesc
Definition: Overlays.h:44
PaletteManager
Definition: PaletteManager.h:7
CastSpellInfo
Definition: CastSpellInfo.h:17
_2devent
Definition: Events2D.h:40
NPCData::Hired
bool Hired()
Definition: NPC.h:80
SpellBuff
Definition: Spells.h:147
GUIMessageQueue::Flush
void Flush()
Definition: GUIWindow.cpp:159
Party::hirelingScrollPosition
unsigned __int8 hirelingScrollPosition
Definition: Party.h:268
Actor
Definition: Actor.h:151
Decal
Definition: DecalBuilder.h:98
ArcomageCard
Definition: Arcomage.h:9
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
TravelInfo
Definition: MM7.h:264
bNoNPCHiring
char bNoNPCHiring
Definition: mm7_data.cpp:720
ProjectileAnim
Definition: SpellFxRenderer.h:73
pMediaPlayer
MPlayer * pMediaPlayer
Definition: MediaPlayer.cpp:43
IndoorCameraD3D_Vec4
Definition: IndoorCameraD3D.h:32
SpellData
Definition: Spells.h:206
MonsterDesc_mm6
Definition: Monsters.h:203
Lightmap
Definition: LightmapBuilder.h:12
BSPNode
Definition: BSPModel.h:42
StorylineText
Definition: StorylineTextTable.h:18
BLVMapOutline
Definition: Indoor.h:412
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
stru336
Definition: MM7.h:290
EventIndex
Definition: Events.h:6
AIDirection
Definition: Actor.h:126
ParticleEngine
Definition: ParticleEngine.h:93
StationaryLight
Definition: Lights.h:10
Particle
Definition: ParticleEngine.h:40
NPCStats::uNumNewNPCs
unsigned int uNumNewNPCs
Definition: NPC.h:179
pParty
Party * pParty
Definition: Party.cpp:30
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: SDL_opengl_glext.h:2483
NPCData::pName
char * pName
Definition: NPC.h:82
NPCStats::pNewNPCData
NPCData pNewNPCData[501]
Definition: NPC.h:165
OtherOverlay
Definition: Overlays.h:7
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
ViewingParams
Definition: Viewport.h:38
IndoorCameraD3D_Vec3
Definition: IndoorCameraD3D.h:9
BLVDoor
Definition: Indoor.h:378
MonsterStats
Definition: Monsters.h:186
stru123
Definition: stru123.h:6
dword_5B65D0_dialogue_actor_npc_id
signed int dword_5B65D0_dialogue_actor_npc_id
Definition: mm7_data.cpp:633
pActors
std::array< Actor, 500 > pActors
Definition: Actor.cpp:38
Particle_sw
Definition: ParticleEngine.h:18
Actor::sNPC_ID
int16_t sNPC_ID
Definition: Actor.h:287
FactionTable
Definition: FactionTable.h:5
Bloodsplat
Definition: DecalBuilder.h:13
DDM_DLV_Header
Definition: Indoor.h:82
NPCData
Definition: NPC.h:79
Application::GameFactory
Definition: GameFactory.h:10
LevelDecoration
Definition: Decoration.h:20
MonsterDesc
Definition: Monsters.h:213
PlayerBuffAnim
Definition: SpellFxRenderer.h:59
Party::pHirelings
std::array< NPCData, 2 > pHirelings
Definition: Party.h:311
CURRENT_SCREEN::SCREEN_GAME
@ SCREEN_GAME
BloodsplatContainer
Definition: DecalBuilder.h:50
LightsData
Definition: Indoor.h:16
Timer
Definition: Time.h:104
MapsLongTimer
Definition: MapsLongTimer.h:6
uint
unsigned int uint
Definition: MM7.h:4
bGameoverLoop
int bGameoverLoop
Definition: mm7_data.cpp:785
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
pNPCStats
struct NPCStats * pNPCStats
Definition: NPC.cpp:29
TrailParticle
Definition: ParticleEngine.h:116
BLVLightMM7
Definition: Indoor.h:357
DecorationDesc
Definition: DecorationList.h:49
ActionQueue
Definition: Party.h:121
SavegameHeader
Definition: SaveLoad.h:18
PartyTimeStruct
Definition: Party.h:141
Application::GameFactory::CreateGame
std::shared_ptr< Game > CreateGame(const std::string &command_line)
Definition: GameFactory.cpp:17
Chest
Definition: Chest.h:35
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
BLVSector
Definition: Indoor.h:522
ItemGen
Definition: Items.h:263
RenderVertexSoft
Definition: IRender.h:113
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
Vis_SelectionList
Definition: Vis.h:42
MonsterInfo
Definition: Monsters.h:109
GameUI_InitializeDialogue
void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello)
Definition: UIDialogue.cpp:25
ActorJob
Definition: Actor.h:137
NPCStats
Definition: NPC.h:146
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52