annotate Game.cpp @ 202:b78cf60aaa8e

3.01.13
author Ritor1
date Thu, 03 Jan 2013 16:03:46 +0600
parents 6109a4e23903
children 22730e77fa32
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "LightmapBuilder.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "stru279.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "OSInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "stru157.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "VideoPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 #include "Bink_Smacker.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #include "Arcomage.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 //#include "MM7.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 Game *pGame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 //----- (00435694) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 void Game::ToggleFlags2(unsigned int uFlag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 unsigned int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 v2 = this->uFlags2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 if ( v2 & uFlag )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 this->uFlags2 = v2 & ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 this->uFlags2 = uFlag | v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 //----- (0044103C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 void Game::Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 float v2; // ST24_4@11
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
52 //double v3; // ST28_8@11
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 int v4; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 int v5; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 uFlags2 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 if ( pParty->_497FC5_check_party_perception_against_level() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 uFlags2 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 pIndoorCamera->sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 pIndoorCamera->sRotationY = pParty->sRotationY;
197
6109a4e23903 run new game (29.12.12)
Ritor1
parents: 101
diff changeset
61 pIndoorCamera->pos.x = pParty->vPosition.x - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 * (signed __int64)pParty->field_18) >> 16);
197
6109a4e23903 run new game (29.12.12)
Ritor1
parents: 101
diff changeset
63 pIndoorCamera->pos.y = pParty->vPosition.y - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 * (signed __int64)pParty->field_18) >> 16);
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
65 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 pIndoorCamera->Initialize2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
69
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 if ( pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 goto LABEL_22;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
74 pRenderer->BeginSceneD3D();
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
75 pMouse->DrawCursorToTarget();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 {
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
79 if ( pParty->vPosition.x != pParty->vPrevPosition.x | pParty->sRotationY != pParty->sPrevRotationY | pParty->vPosition.y != pParty->vPrevPosition.z | pParty->sRotationX != pParty->sPrevRotationX | pParty->vPosition.z != pParty->vPrevPosition.y | pParty->sEyelevel != pParty->sPrevEyelevel )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 pParty->vPrevPosition.x = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
82 pParty->vPrevPosition.y = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 //v0 = &pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 pParty->sPrevRotationY = pParty->sRotationY;
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
85 pParty->vPrevPosition.z = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 pParty->sPrevRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 pParty->sPrevEyelevel = pParty->sEyelevel;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
88 pRenderer->BeginSceneD3D();
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
89
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 if ( !pRenderer->pRenderD3D )
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
91 pMouse->DrawCursorToTarget();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 if ( !sub_4226C2() || viewparams->field_48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
97 //v3 = v2 + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
98 //pRenderer->field_1036A8_bitmapid = LODWORD(v3);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
99 pRenderer->field_1036A8_bitmapid = floorf(v2 + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
102 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 pIndoor->Draw();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
104 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
105 pOutdoor->Draw();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
107 if (pRenderer->pRenderD3D)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 pDecalBuilder->DrawBloodsplats();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
110 if (pRenderer->pRenderD3D)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 pGame->pLightmapBuilder->DrawLightmaps(2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 pRenderer->BeginScene();
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
118 if (pRenderer->pRenderD3D)
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
119 pMouse->DrawCursorToTarget();
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
120 if (pOtherOverlayList->field_3EC)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 v4 = viewparams->bRedrawGameUI;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 GameUI_DrawStatusBar();
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
124 if (!viewparams->bRedrawGameUI)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 GameUI_DrawRightPanelItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 GameUI_DrawRightPanelFrames();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 GameUI_DrawStatusBar_2();
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
132 viewparams->bRedrawGameUI = false;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 }
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
134 if (!pVideoPlayer->pSmackerMovie)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
136 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, pParty->uFlags & 2);
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
137 if (v4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 {
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
139 if ( !sub_4226C2() && pRenderer->pRenderD3D)
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
140 pRenderer->FillRectFast(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 pViewport->uViewportZ - pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 pViewport->uViewportW - pViewport->uViewportY + 1,
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
145 pRenderer->uTargetGMask | pRenderer->uTargetBMask);
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
146 viewparams->field_48 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 v5 = pOtherOverlayList->field_3EC;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
150 pOtherOverlayList->field_3EC = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 viewparams->bRedrawGameUI = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 GameUI_DrawPartySpells();
197
6109a4e23903 run new game (29.12.12)
Ritor1
parents: 101
diff changeset
153 //if (v4 || pParty->pHirelings[0].evtc || pParty->pHirelings[1].evtc ) Ritor1: it's temporarily
6109a4e23903 run new game (29.12.12)
Ritor1
parents: 101
diff changeset
154 //DrawHiredNPCs();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 GameUI_DrawPortraits(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 GameUI_DrawLifeManaBars();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 GameUI_DrawCharacterSelectionFrame();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 if ( sub_44100D() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 draw_right_panel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 if ( !pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 pStru6Instance->DrawPlayerBuffAnims();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 pOtherOverlayList->_441964(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 GameUI_DrawTorchlightAndWizardEye();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 pParty->_4909F4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 ++stru_51076C.field_8;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
169 dword_5B5924 = 0;
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
170 if (v4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 pMouse->field_14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 pMouse->_469EA4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 pMouse->DrawCursor();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 pMouse->_469E1C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 //----- (0047A815) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 void Game::DrawParticles()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 pParticleEngine->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 //----- (00463149) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 void Game::Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 {
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
190 //signed int v0; // ebp@3
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
191 //signed int v1; // esi@4
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
192 //Render *v2; // edi@7
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
193 //signed int v3; // esi@7
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 signed int v4; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 char *v5; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 Player *v6; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 OtherOverlay *v7; // esi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 signed int v8; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 int v9; // edi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 int *pHealth; // esi@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 signed int v11; // esi@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 int v12; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 const char *v13; // [sp-4h] [bp-68h]@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 bool bLoading; // [sp+10h] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 signed int bLoadinga; // [sp+10h] [bp-54h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 signed int v16; // [sp+14h] [bp-50h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 int v17[4]; // [sp+18h] [bp-4Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 MSG Msg; // [sp+28h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 char Source[64]; // [sp+44h] [bp-20h]@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 bLoading = uCurrentMenuID == MENU_LOAD;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
212 SetCurrentMenuID((MENU_STATE)-1);
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
213 if (bLoading)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 dword_6BE340 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 LoadGame(uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 }
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
220
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
221 for (uint i = 1; i < 5; ++i)
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
222 for (uint j = 1; j < 6; ++j)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 {
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
224 sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 }
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
227
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 LoadPlayerPortraintsAndVoices();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
230 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0);
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
231
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
234 v16 = 1;
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
235 if (pMessageQueue_50CBD0->uNumMessages)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
237
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 pPartyActionQueue->uNumActions = 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
239 if (pParty->bTurnBasedModeOn)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
241 pTurnEngine->End(false);
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
242 pParty->bTurnBasedModeOn = false;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
244 DoPrepareWorld(bLoading, 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 pEventTimer->Resume();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
246 dword_6BE364_game_settings_1 |= 0x80;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 dword_6BE340 = 2;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
248 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
249 pCurrentScreen = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
250 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 pAsyncMouse->Resume();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
252 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 pGame->pVisInstance->_4C1A02();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 bLoadinga = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
259 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 if ( Msg.message == WM_QUIT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
266 if (dword_6BE364_game_settings_1 & 0x0100 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 pGame->_44EEA7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 GameUI_WritePointedObjectStatusString();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 ProcessInputActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 GameUI_MsgProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 ArcomageGame::Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 LABEL_89:
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
279 pRenderer->Present();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
282 if (pAsyncMouse)
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
283 pAsyncMouse->_46B736_consume_click_lists(1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 if ( pVideoPlayer->pSmackerMovie && !SmackWait(pVideoPlayer->pSmackerMovie) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
286 pRenderer->BeginScene();
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
287 pMouse->DrawCursorToTarget();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 pVideoPlayer->SmackUpdatePalette(pVideoPlayer->hWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 pMouse->_469EA4();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
290 pRenderer->EndScene();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 if ( pVideoPlayer->pBinkMovie && !BinkWait(pVideoPlayer->pBinkMovie) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
294 pRenderer->BeginScene();
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
295 pMouse->DrawCursorToTarget();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 pVideoPlayer->BinkUpdatePalette(pVideoPlayer->hWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 pMouse->_469EA4();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
298 pRenderer->EndScene();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 pEventTimer->Update();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 pMiscTimer->Update();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 OnTimer(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 GameUI_StatusBar_UpdateTimedString(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 if ( pMiscTimer->bPaused && !pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 if ( pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 pEventTimer->bTackGameTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 if ( !pEventTimer->bPaused && !uGameState )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 if ( !pEventTimer->bTackGameTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 _494035_timed_effects__water_walking_damage__etc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 if ( dword_6BE364_game_settings_1 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 dword_6BE364_game_settings_1 &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 sub_401A91_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 sub_46BDC0_UpdateUserInput_and_MapSpecificStuff();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 v16 = 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
325 viewparams->bRedrawGameUI = true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 }
197
6109a4e23903 run new game (29.12.12)
Ritor1
parents: 101
diff changeset
327 //pAudioPlayer->_4AAFCF();Ritor1: it's temporarily
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
328 if (uGameState == 1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 goto LABEL_96;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
330 if (uGameState == 2)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 PrepareWorld(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 if ( (signed int)uGameState <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 if ( (signed int)uGameState <= 5 || uGameState == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 LABEL_96:
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
342 bLoadinga = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 if ( uGameState != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 if ( uGameState != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 memset(pParty->pHirelings, 0, 0x4Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 memset(&pParty->pHirelings[1], 0, 0x4Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 v5 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 if ( *((int *)v5 + 6) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 *v5 &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 v5 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 while ( v4 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 pVideoPlayer->PlayDeathMovie();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 if ( pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 SaveGame(0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 ++pParty->uNumDeaths;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 v6 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 v6->SetVariable(VAR_Award, 85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 while ( (signed int)v6 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 pParty->field_764 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 pParty->uTimePlayed += 0x276000ui64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 pParty->SetGold(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 v7 = pOtherOverlayList->pOverlays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 v8 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 v7->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 --v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 while ( v8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 memset(pParty->pPartyBuffs, 0, 0x140u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 pTurnEngine->End(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 pParty->bTurnBasedModeOn = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 pHealth = &pParty->pPlayers[0].sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 memset(pHealth - 0x64F, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 memset(pHealth - 0x67, 0, 0x180u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 *pHealth = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 pHealth += 1743;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 uActiveCharacter = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 while ( (signed int)pHealth < (signed int)&pParty->field_871C[567] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 136) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 pParty->vPosition.x = -17331; // respawn in harmondale
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
419 pParty->vPosition.y = 12547;
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
420 pParty->vPosition.z = 465;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 pParty->sRotationY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 v13 = "out02.odm";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 pParty->vPosition.x = 12552; // respawn on emerald isle
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
427 pParty->vPosition.y = 1816;
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
428 pParty->vPosition.z = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 v13 = "out01.odm";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 strcpy(Source, v13);
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
433 pParty->uFallStartY = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 pParty->field_6E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 pParty->field_6E0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 if ( _strcmpi(Source, pCurrentMapName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 strcpy(pCurrentMapName, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
442 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 52
diff changeset
443 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 dword_5B65C0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 PrepareWorld(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 }
101
8be5293b6b33 odm loading
Nomad
parents: 68
diff changeset
449 InitializeActors();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 if ( pPlayers[v9]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 v17[v11++] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 while ( v9 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 v12 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 pPlayers[v17[v12 % v11]]->PlaySound(99, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2u);// "Once again you've cheated death!.."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 while ( !bLoadinga );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 dword_6BE340 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 if ( uGameState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 sub_491E3A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 LoadPlayerPortraintsAndVoices();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
476 bLoading = true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
481 pCurrentScreen = 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 sub_491E3A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
484
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 //----- (0044F192) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
488 void Game::PrepareBloodsplats()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
490 for (uint i = 0; i < uNumBloodsplats; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
492 pBloodsplatContainer->AddBloodsplat(
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
493 pBloodsplats[i].x,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
494 pBloodsplats[i].y,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
495 pBloodsplats[i].z,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
496 pBloodsplats[i].radius,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
497 pBloodsplats[i].r,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
498 pBloodsplats[i].g,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
499 pBloodsplats[i].b);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
500 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 //----- (0044F120) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 void Game::PushStationaryLights(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 signed int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 auto v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 if ( (signed int)this->uNumStationaryLights > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 v4 = (char *)&this->pStationaryLights[0].vRGBColor.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 pStationaryLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 (signed __int64)*((float *)v4 - 4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 (signed __int64)*((float *)v4 - 3),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 (signed __int64)*((float *)v4 - 2),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 (signed __int64)*((float *)v4 + 2),
29
e62134245ab0 On BLV loading.
Nomad
parents: 27
diff changeset
522 (signed __int64)*((float *)v4 - 1),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 (signed __int64)*(float *)v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 (signed __int64)*((float *)v4 + 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 byte_4E94D0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 v4 += 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 while ( v3 < (signed int)v2->uNumStationaryLights );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 // 4E94D0: using guessed type char byte_4E94D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 //----- (0044F0FD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 void Game::_44F0FD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 ToggleFlags(0x40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 if ( !(uFlags & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
541 uNumBloodsplats = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 field_E0C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 //----- (0044F0D8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 void Game::ToggleFlags(uint uMask)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 if (uFlags & uMask)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 uFlags &= ~uMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 uFlags |= uMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 //----- (0044F07B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 bool Game::_44F07B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 pKeyboardInstance->WasKeyPressed(VK_F11)))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 //----- (0044EEA7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 bool Game::_44EEA7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
572 //Game *v1; // esi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 double v2; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 float depth; // ST00_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 bool result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 unsigned int v5; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 __int64 v6; // kr00_8@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 unsigned int y; // [sp+4h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 unsigned int x; // [sp+8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 bool v9; // [sp+Ch] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 stru157 *v10; // [sp+10h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 stru157 *v11; // [sp+14h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 POINT a2; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
585 //v1 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 ++qword_5C6DF0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 pParticleEngine->UpdateParticles();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 pMouseInstance->GetCursorPos(&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 if ( sub_4637E0_is_there_popup_onscreen() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 v11 = &a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 v10 = &stru_F93E30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 x = a2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 y = a2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 v2 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
600 if ( uFlags2 & 0x10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v11 = &a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 v10 = &stru_F93E1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 static stru157 static_sub_44EEA7_stru157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 static_sub_44EEA7_stru157.field_8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 static_sub_44EEA7_stru157.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 static_sub_44EEA7_stru157.field_4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 static_sub_44EEA7_stru157.field_C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 static_sub_44EEA7_stru157.field_10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 v11 = &a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 v10 = &static_sub_44EEA7_stru157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 v2 = 5120.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 x = a2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 y = a2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 depth = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 PickMouse(depth, y, x, v9, v10, v11);
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
629 pLightmapBuilder->std__vector_000004_size = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
630 pLightmapBuilder->std__vector_183808_size = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 pDecalBuilder->std__vector_pDecals_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 pDecalBuilder->field_308008 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 result = _44F07B();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 if ( uFlags & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 LOBYTE(pStru10Instance->field_4) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 v5 = GetLevelFogColor();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
641 pRenderer->uFogColor = v5 & 0xFFFFFF;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 if (uFlags & 0x0400)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 uFlags2 |= 0x01;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
645 if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 uFlags2 |= 0x01;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 field_E10 = qword_5C6DF0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
650 v6 = qword_5C6DF0 - field_E10;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
651 if ( qword_5C6DF0 - field_E10 == 1 )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
652 uFlags2 |= v6;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
653 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
655 uFlags2 |= 1u;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
656 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 _44E904();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
663
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 //----- (0044EDE4) --------------------------------------------------------
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
666 bool Game::AlterGamma(BLVFace *pFace, unsigned int *pColor)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
668 if (pGame->uFlags2 & 2 && pFace->uAttributes & 2)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
670 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
671 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 else
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
674 return false;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 //----- (0044EE30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 bool Game::_44EE30(ODMFace *a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
680 if (uFlags2 & 0x2 && a2->uAttributes & 0x02)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
682 *(int *)a3 = ReplaceHSV(*(int *)a3, 1.0, fSaturation, -1.0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 //----- (004645FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 void Game::Deinitialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 struct tagRECT Rect; // [sp+0h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
695 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 pAsyncMouse->Suspend();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
697 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 WriteWindowsRegistryInt("startinwindow", pRenderer->bWindowMode);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 if ( GetWindowRect(hWnd, &Rect) && pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 WriteWindowsRegistryInt("window X", Rect.left);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 WriteWindowsRegistryInt("window Y", Rect.top);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 WriteWindowsRegistryInt("debug flags", stru_51076C.registry_debug_flags);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 pItemsTable->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 pNPCStats->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
709 if (pAsyncKeyboard)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
710 pAsyncKeyboard->Release();
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
711 if (pAsyncMouse)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
712 pAsyncMouse->Release();
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
713 if (pMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 pMouse->Deactivate();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
715
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 pAudioPlayer->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 pNew_LOD->FreeSubIndexAndIO();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 pGames_LOD->FreeSubIndexAndIO();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 Game::Destroy();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 //----- (0044EE7C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 bool Game::draw_debug_outlines()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 if (uFlags & 0x04)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 pLightmapBuilder->DrawDebugOutlines(-1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 pDecalBuilder->DrawDecalDebugOutlines();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 //----- (0044EC23) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 int Game::_44EC23(stru148 *a2, int *a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 double v4; // st7@4
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
738 //double v5; // ST00_8@4
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 signed int v6; // eax@5
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
740 //double v7; // ST00_8@6
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 signed int result; // eax@8
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
742 //double v9; // ST00_8@9
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
743 //double v10; // ST00_8@11
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 float a2a; // [sp+14h] [bp+8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 float a3a; // [sp+18h] [bp+Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 float a3b; // [sp+18h] [bp+Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 float a4a; // [sp+1Ch] [bp+10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 float a4b; // [sp+1Ch] [bp+10h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
750 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 v4 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 a2a = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 *a3 |= 2u;
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
755 a3a = (1.0 - this->fSaturation) * v4;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
756 //v5 = a3a + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
757 //if ( SLODWORD(v5) >= 0 )
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
758 if (floorf(a3a + 0.5f) >= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
760 a3b = (1.0 - this->fSaturation) * a2a;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
761 //v7 = a3b + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
762 //v6 = LODWORD(v7);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
763 v6 = floorf(a3b + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 if ( a4 >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
771 a4a = (1.0 - fSaturation) * a2a;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
772 //v9 = a4a + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
773 //if ( SLODWORD(v9) >= 0 )
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
774 if (floorf(a4a + 0.5f) >= 0)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
776 a4b = (1.0 - fSaturation) * a2a;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
777 //v10 = a4b + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
778 //result = LODWORD(v10);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
779 result = floorf(a4b + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 //----- (00465C8B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 Game *Game::Create()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 return new Game;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 //----- (00465CF3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 void Game::Destroy()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 if (pGame)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 delete pGame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 pGame = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 //----- (0044ED0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 signed int Game::_44ED0A(BLVFace *a2, int *a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 double v4; // st7@3
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
818 //double v5; // ST00_8@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 signed int v6; // eax@4
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
820 //double v7; // ST00_8@5
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 signed int result; // eax@7
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
822 //double v9; // ST00_8@8
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
823 //double v10; // ST00_8@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 float v11; // [sp+14h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 float v12; // [sp+18h] [bp+Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 float v13; // [sp+18h] [bp+Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 float v14; // [sp+1Ch] [bp+10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 float v15; // [sp+1Ch] [bp+10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 if ( this->uFlags2 & 2 && a2->uAttributes & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 v4 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 *a3 |= 2u;
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
835 v12 = (1.0 - this->fSaturation) * v4;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
836 //v5 = v12 + 6.7553994e15;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
837 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
839 v13 = (1.0 - this->fSaturation) * v11;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
840 //v7 = v13 + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
841 //v6 = LODWORD(v7);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
842 v6 = floorf(v13 + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 if ( a4 >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
850 v14 = (1.0 - fSaturation) * v11;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
851 //v9 = v14 + 6.7553994e15;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 47
diff changeset
852 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 {
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
854 v15 = (1.0 - fSaturation) * v11;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
855 //v10 = v15 + 6.7553994e15;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
856 //result = LODWORD(v10);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
857 result = floorf(v15 + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 //----- (0044E4B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 Game::Game()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 uNumStationaryLights = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
881 uNumBloodsplats = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 field_E0C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 field_E10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 uNumStationaryLights_in_pStationaryLightsStack = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 bGammaControlInitialized = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 uFlags2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 uSomeGammaStartTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 uSomeGammaDeltaTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 pThreadWardInstance = new ThreadWard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 pParticleEngine = new ParticleEngine;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
893 pMouse = pMouseInstance = new Mouse(pThreadWardInstance);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 pLightmapBuilder = new LightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 pVisInstance = new Vis;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 pStru6Instance = new stru6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 pIndoorCameraD3D = new IndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 pStru9Instance = new stru9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 pStru10Instance = new stru10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 pStru11Instance = new stru11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 pStru12Instance = new stru12(pStru11Instance);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 pCShow = new CShow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 pKeyboardInstance = new Keyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 pGammaController = new GammaController;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 uFlags |= 0x0800;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 uFlags2 |= 0x24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 _44F0FD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 bWinNT4_0 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 if (pVersion->pVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 pVersion->pVersionInfo.dwMajorVersion == 4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 bWinNT4_0 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 //----- (0044E7F3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 Game::~Game()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 if (pGammaController)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 delete pGammaController;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 if (pKeyboardInstance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 delete pKeyboardInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 if (pCShow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 delete pCShow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 if (pStru12Instance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 delete pStru12Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 if (pStru11Instance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 delete pStru11Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 if (pStru10Instance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 delete pStru10Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 if (pStru9Instance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 delete pStru9Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 if (pIndoorCameraD3D)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 delete pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 if (pStru6Instance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 delete pStru6Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 if (pVisInstance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 delete pVisInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 if (pLightmapBuilder)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 delete pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 if (pMouseInstance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 delete pMouseInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 if (pParticleEngine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 delete pParticleEngine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 if (pThreadWardInstance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 delete pThreadWardInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 //----- (0044E904) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 void Game::_44E904()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
953 //Game *v1; // esi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 unsigned __int64 v2; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 unsigned int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 unsigned __int8 v5; // cf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 double v6; // st7@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 double v7; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 signed __int64 v8; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
962 //v1 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 v2 = pEventTimer->Time();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
964 v4 = (v2 - uSomeGammaStartTime) >> 32;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
965 v3 = v2 - LODWORD(uSomeGammaStartTime);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
966 v8 = v2 - uSomeGammaStartTime;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 if ( v4 < 0
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
968 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 && v3 <= 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 if ( v4 > 0 || v4 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
978 if ( uSomeGammaDeltaTime )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
980 LODWORD(uSomeGammaDeltaTime) = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
981 HIDWORD(uSomeGammaDeltaTime) = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
985 LODWORD(uSomeGammaDeltaTime) = v3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
986 HIDWORD(uSomeGammaDeltaTime) = v4;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 v5 = __CFADD__(v3, -128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 v3 -= 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v4 = v5 + v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
992 uSomeGammaStartTime = v2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v8 = __PAIR__(v4, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 LABEL_12:
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
995 if ( uSomeGammaDeltaTime )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
996 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 v6 = (double)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 v7 = v6 * 0.0078125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 if ( v7 < 0.0 || v7 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 if ( v7 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 v7 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 v7 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 if ( pRenderer->pRenderD3D )
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
1010 fSaturation = v7;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 else
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
1012 fSaturation = (1.0 - 0.5) * v7 + 0.5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 //----- (0044EA17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 bool Game::InitializeGammaController()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 pVersion->pVersionInfo.dwMajorVersion != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 pGammaController->InitializeFromSurface(pRenderer->pFrontBuffer4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 bGammaControlInitialized = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 uSomeGammaStartTime = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 //----- (0044EA5E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 char Game::PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, stru157 *a5, stru157 *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 std::string v10; // [sp-4h] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 float v11; // [sp+4h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 float v12; // [sp+8h] [bp-18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 const char *v13; // [sp+Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 int v14; // [sp+10h] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 std::string *v15; // [sp+18h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 int a3; // [sp+1Fh] [bp-1h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 auto v7 = this;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
1040 if (!pCurrentScreen && pRenderer->pRenderD3D)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 if (!pVisInstance)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 MessageBoxW(nullptr, L"The 'Vis' object pointer has not been instatiated, but CGame::Pick() is trying to call through it.", nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 if ( (signed int)uMouseX >= (signed int)pViewport->uScreenX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 && (signed int)uMouseX <= (signed int)pViewport->uScreenZ
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 && (signed int)uMouseY >= (signed int)pViewport->uScreenY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 && (signed int)uMouseY <= (signed int)pViewport->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 v14 = (int)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 v12 = (double)(signed int)uMouseY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 v11 = (double)(signed int)uMouseX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 pVisInstance->PickMouse(fPickDepth, v11, v12, a5, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 if (bOutline)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 OutlineSelection();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
1065 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 //----- (0044EB12) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 bool Game::_44EB12(bool bOutline, stru157 *a3, stru157 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
1070 if ( !pCurrentScreen && pVisInstance && pRenderer->pRenderD3D )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 bool r = pVisInstance->_4C05CC(&pVisInstance->stru1, a3, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 if (bOutline)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 OutlineSelection();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 return r;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
1080 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 //----- (0044EB5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 void Game::OutlineSelection()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 Vis *v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 Vis_stru1_stru0 *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 void *v3; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 int v4; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 int v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 int v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 int v7; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 const char *v9; // [sp-8h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 int v10; // [sp-4h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 char v11; // [sp+0h] [bp-Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 int a3; // [sp+Ah] [bp-2h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 v1 = this->pVisInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 v2 = (Vis_stru1_stru0 *)((signed int)v1->stru1.uNumPointers <= 0 ? 0 : v1->stru1.array_1804[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 if ( v2->uObjectType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 MessageBoxW(nullptr, L"Sprite outline currently Unsupported", nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 if ( v2->uObjectType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 v3 = v2->pObjectInfo; // TODO 2 objects for indoor/outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 // some clues in header for Vis_stru1_stru0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v4 = *((int *)v3 + 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 if ( v4 & 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 v5 = v4 & 0xFFFEFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 v5 = v4 | 0x10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 *((int *)v3 + 11) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 v6 = *((int *)v3 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 if ( v6 & 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 v7 = v6 & 0xFFFEFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 v7 = v6 | 0x10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 *((int *)v3 + 7) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 MessageBoxW(nullptr, L"Undefined CObjectInfo type requested in CGame::outline_selection()", nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 }