annotate Indoor.cpp @ 5:ca90d9e499b3

.
author Серик@ПончиК
date Tue, 09 Oct 2012 20:00:01 +0600
parents 8b8875f5b359
children ac0fb48cd27a
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "Render.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "LayingItem.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Game.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 "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "DecorationList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "ObjectList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "Actor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Chest.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "GUIProgressBar.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "stru123.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
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 IndoorLocation *pIndoor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 BLVRenderParams *pBLVRenderParams;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 struct DecorationList *pDecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 LevelDecoration pLevelDecorations[3000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 size_t uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 LevelDecoration *_5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 LEVEL_TYPE uCurrentlyLoadedLevelType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 stru320 stru_F8AD28; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 stru337 stru_F81018;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 stru167_wrap array_5118E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 stru170_stru2 stru_F8A590;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 stru170 *pStru170; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 stru141 stru_721530;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 stru352 stru_F83B80[480];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 //----- (0043F39E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 void __fastcall sub_43F39E(IndoorLocation_drawstru *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 int *v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 double v2; // ST30_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 double v3; // ST30_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 double v4; // ST28_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 int v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 unsigned int v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 BLVSector *v8; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 unsigned __int16 *v9; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 int i; // [sp+18h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 unsigned __int8 v11; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 signed int v12; // [sp+1Ch] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 pBLVRenderParams->Set(_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 uNumMobileLightsApplied = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 uNumDecorationsDrawnThisFrame = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 _unused000 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 uNumSpritesDrawnThisFrame = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 uNumBillboardsToDraw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 if ( !byte_4D864C || !(BYTE1(pGame->uFlags) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 v2 = pParty->flt_TorchlightColorB + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 v11 = LOBYTE(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 v5 = 800;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 v5 = 800 * pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 LOBYTE(v1) = byte_4E94D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 v4 = pParty->flt_TorchlightColorR + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 v3 = pParty->flt_TorchlightColorG + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 SLOWORD(pBLVRenderParams->vPartyPos.x),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 SLOWORD(pBLVRenderParams->vPartyPos.y),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 SLOWORD(pBLVRenderParams->vPartyPos.z),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 SLOWORD(pBLVRenderParams->uRadius),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 LOBYTE(v4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 LOBYTE(v3),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 PrepareWallsRenderList_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 PrepareItemsRenderList_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 PrepareActorRenderList_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 for ( i = 0; i < pStru170->field_53730; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 v7 = pStru170->pSectorIDs_toDrawDecorationsFrom[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 v8 = &pIndoor->pSectors[pStru170->pSectorIDs_toDrawDecorationsFrom[v6]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 v9 = v8->pDecorationIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 if ( v8->uNumDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 PrepareDecorationsRenderList_BLV((signed __int16)v9[v12++], v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 while ( v12 < v8->uNumDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 v6 = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 MessWithBillboards_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 pGame->PushStru165s();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 //----- (004407D9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 int BLVRenderParams::Set(IndoorLocation_drawstru *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 IndoorLocation_drawstru *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 BLVRenderParams *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 int v4; // ST08_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 int v5; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 int v6; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 int v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 int v8; // ST08_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 int v9; // ST04_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 int v10; // ST00_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 unsigned int v11; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 unsigned int v12; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 int v13; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 signed int v14; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 unsigned int v15; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 unsigned int v16; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 double v17; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 int v18; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 double v19; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 int v20; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 double v21; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 int v22; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 unsigned int v23; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 unsigned int v24; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 int v25; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 int v26; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 signed int v27; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 int result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 int v29; // [sp+24h] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 v2 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 this->field_0_timer_ = a2->field_0_timer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 this->uFlags = a2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 this->vPartyPos.x = a2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 this->vPartyPos.y = a2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 this->vPartyPos.z = a2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 v4 = this->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 v5 = this->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 this->sPartyRotY = a2->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 v6 = this->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 this->sPartyRotX = a2->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 v7 = pIndoor->GetSector(v6, v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 v3->uRadius = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 v8 = v3->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 v3->vPartyPos.x = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 v9 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 v10 = v3->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 v3->vPartyPos.y = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 v3->uRadius = pIndoor->GetSector(v10, v9, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v3->sCosineY = stru_5C6E00->SinCos(v3->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 v3->sSineY = stru_5C6E00->SinCos(v3->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 v3->sCosineNegX = stru_5C6E00->SinCos(-v3->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 v3->sSineNegX = stru_5C6E00->SinCos(-v3->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v3->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)v3->sPartyRotY * 0.00048828125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 v3->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)v3->sPartyRotY * 0.00048828125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v3->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-v3->sPartyRotX * 0.00048828125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 v3->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-v3->sPartyRotX * 0.00048828125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 v3->field_64 = a2->field_3C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 v11 = v3->uViewportW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 v12 = v3->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 v13 = v3->uViewportZ - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 v14 = v3->uViewportZ + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 v3->field_70 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 v15 = v3->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 v3->uViewportHeight = v11 - v15 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 v16 = v3->uViewportW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 v3->uViewportCenterX = v14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 v3->uViewportCenterY = (signed int)(v16 + v15) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 v3->sCosineY = stru_5C6E00->SinCos(-v3->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 v3->sSineY = stru_5C6E00->SinCos(-v3->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 v3->sCosineNegX = stru_5C6E00->SinCos(-v3->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 v3->sSineNegX = stru_5C6E00->SinCos(-v3->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 v17 = cos((double)-v3->sPartyRotY * 0.0030664064);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 v18 = v3->sPartyRotY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 v3->fCosineY = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 v19 = sin((double)-v18 * 0.0030664064);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 v20 = v3->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 v3->fSineY = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 v21 = cos((double)-v20 * 0.0030664064);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 v22 = v3->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 v3->fCosineNegX = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 v3->fSineNegX = sin((double)-v22 * 0.0030664064);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v23 = v3->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 v3->field_64 = a2->field_3C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 v24 = v3->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 v3->field_70 = v3->uViewportZ - v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 v25 = v3->uViewportW - v3->uViewportY + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 v3->uViewportHeight = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 v29 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 v26 = v3->field_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 v3->uViewportCenterX = (signed int)(v24 + v23) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 v3->uViewportCenterY = v3->uViewportW - ((unsigned __int64)(v26 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 v27 = (unsigned int)(signed __int64)((double)v3->field_70 * 0.5 / tan((double)(v2->field_1C_mb_fov >> 1) * 0.01745329)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 + 0.5) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 v3->field_40 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 LODWORD(v3->field_44) = 4294967296i64 / v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 v3->pRenderTarget = v2->pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 v3->uTargetWidth = v2->uTargetWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 v3->uTargetHeight = v2->uTargetHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 v3->uViewportX = v2->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 v3->uViewportY = v2->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 v3->uViewportZ = v2->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 v3->uViewportW = v2->uViewportW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 v3->pTargetZBuffer = v2->pTargetZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 v3->field_8C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 v3->field_84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 v3->field_80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 v3->field_88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 pBLVRenderParams->field_90 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 pBLVRenderParams->field_94 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 //----- (00440B44) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 void IndoorLocation::ExecDraw(char a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 signed int i; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 IndoorCameraD3D_Vec4 *v3; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 signed int j; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 unsigned int v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 RenderVertexSoft *v6; // [sp-4h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 for ( i = 0; i < (signed int)pStru170->uNumFaceIDs; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 v2 = pStru170->pFaceIDs[2 * i + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 if ( pStru170->field_FA8[v2].std__vector_0007A8 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 v3 = pStru170->field_FA8[v2].std__vector_0007AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 v6 = pStru170->field_FA8[v2].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 IndoorLocation::ExecDraw_sub0(pStru170->pFaceIDs[2 * i], v3, 4u, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 for ( j = 0; j < (signed int)pStru170->uNumFaceIDs; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 v5 = pStru170->pFaceIDs[2 * j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 pBLVRenderParams->field_7C = &pStru170->field_FA8[pStru170->pFaceIDs[2 * j + 1]].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 IndoorLocation::ExecDraw_sub1(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 //----- (00440BED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 void __fastcall sub_440BED(IndoorLocation_drawstru *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 unsigned __int16 *v1; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 char *v2; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 int v3; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 unsigned int v4; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 char *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 signed int v6; // [sp+8h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 int v7; // [sp+Ch] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 sub_43F39E(_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 if ( pBLVRenderParams->uRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 IndoorLocation::ExecDraw(pRenderer->pRenderD3D != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 pRenderer->DrawBillboardList_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 if ( pBLVRenderParams->uFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 stru170_sub_4B0967();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 if ( pBLVRenderParams->uFlags & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 v1 = pBLVRenderParams->pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 if ( (signed int)pStru170->std__vector_000FA8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 v2 = (char *)&pStru170->field_FA8[0].field_C.field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 v3 = *((int *)v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 v4 = pRenderer->uTargetSurfacePitch * *((int *)v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 if ( v3 <= *(int *)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 v5 = (char *)&pStru170->field_FA8[0].field_C.array_3D8[v3 + v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 v1[v4 + *((short *)v5 - 480)] = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 v1[v4 + *(short *)v5] = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 v4 += pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v5 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 while ( v3 <= *(int *)v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 v7 += 1126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 v2 += 2252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 while ( v6 < (signed int)pStru170->std__vector_000FA8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 //----- (00441BD4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 void IndoorLocation::Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 IndoorLocation_drawstru _this; // [sp+0h] [bp-4Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 int v2; // [sp+44h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 float v3; // [sp+48h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 if ( viewparams->field_50_draw_debug_outlines )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 if ( viewparams->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 LOBYTE(v0) = v0 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 _this.field_0_timer = pEventTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 _this.uFlags = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 _this.vPosition.x = pParty->vPosition.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 * (signed __int64)pParty->field_18) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v2 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 LODWORD(v3) = (unsigned __int64)(v2 * (signed __int64)pParty->field_18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 _this.field_1C_mb_fov = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 _this.vPosition.y = pParty->vPosition.z - LODWORD(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 _this.sRotationY = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 _this.sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 _this.pRenderTarget = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 _this.uViewportX = pViewport->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 _this.uViewportY = pViewport->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 _this.uViewportZ = pViewport->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 _this.uViewportW = pViewport->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 _this.field_3C = pViewport->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 _this.vPosition.z = pParty->vPosition.y + pParty->sEyelevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 _this.uTargetWidth = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 _this.uTargetHeight = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 _this.pTargetZ = pRenderer->pActiveZBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 sub_440BED(&_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 pGame->DrawParticles();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 array_5118E8._440F07();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 //----- (004C0EF2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 void BLVFace::FromODM(ODMFace *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 this->pFacePlane_old.vNormal.x = a2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 this->pFacePlane_old.vNormal.y = a2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 this->pFacePlane_old.vNormal.z = a2->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 this->pFacePlane_old.dist = a2->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 this->pFacePlane.vNormal.x = (double)(a2->pFacePlane.vNormal.x & 0xFFFF) * 0.000015259022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 + (double)(a2->pFacePlane.vNormal.x >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 this->pFacePlane.vNormal.y = (double)(a2->pFacePlane.vNormal.y & 0xFFFF) * 0.000015259022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 + (double)(a2->pFacePlane.vNormal.y >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 this->pFacePlane.vNormal.z = (double)(a2->pFacePlane.vNormal.z & 0xFFFF) * 0.000015259022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 + (double)(a2->pFacePlane.vNormal.z >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 this->pFacePlane.dist = (double)(a2->pFacePlane.dist & 0xFFFF) * 0.000015259022 + (double)(a2->pFacePlane.dist >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 this->uAttributes = a2->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 this->pBounding.x1 = a2->pBoundingBox.x1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 this->pBounding.y1 = a2->pBoundingBox.y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 this->pBounding.z1 = a2->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 this->pBounding.x2 = a2->pBoundingBox.x2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 this->pBounding.y2 = a2->pBoundingBox.y2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 this->pBounding.z2 = a2->pBoundingBox.z2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 this->zCalc1 = a2->zCalc1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 this->zCalc2 = a2->zCalc2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 this->zCalc3 = a2->zCalc3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 this->pXInterceptDisplacements = a2->pXInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 this->pYInterceptDisplacements = a2->pYInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 this->pZInterceptDisplacements = a2->pZInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 this->uPolygonType = (PolygonType)a2->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 this->uNumVertices = a2->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 this->uBitmapID = a2->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 this->pVertexIDs = a2->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 //----- (004B0A25) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 void IndoorLocation::ExecDraw_sub0(unsigned int uFaceID, IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, RenderVertexSoft *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 unsigned int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 char *v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 signed int v6; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 char *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 signed int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 BLVFace *v9; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 IndoorCameraD3D *v10; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 int v11; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 Vec3_short_ *v12; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 char *v13; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 int v14; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 unsigned __int8 v15; // sf@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 unsigned __int8 v16; // of@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 int v17; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 double v18; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 double v19; // st6@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 double v20; // st5@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 char v21; // dl@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 unsigned int v22; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 unsigned int v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 DWORD v24; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 int v25; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 char *v26; // edi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 IDirect3DTexture2 *v27; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 Texture *v28; // [sp+Ch] [bp-1Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 int i; // [sp+10h] [bp-18h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 LightmapBuilder *pStru4; // [sp+14h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 IndoorCameraD3D *v31; // [sp+18h] [bp-10h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 IndoorCameraD3D_Vec4 *a7; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 unsigned int uFaceID_; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 unsigned int uNumVerticesa; // [sp+24h] [bp-4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 int a4a; // [sp+34h] [bp+Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 unsigned int a4b; // [sp+34h] [bp+Ch]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 v4 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 a7 = pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 uFaceID_ = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 if ( (uFaceID & 0x80000000u) == 0 && (signed int)uFaceID < (signed int)pIndoor->uNumFaces )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 static RenderVertexSoft static_vertices_F7C228[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 static_vertices_F7C228[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 static RenderVertexSoft static_vertices_F7B628[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 static bool __init_flag2 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 if (!__init_flag2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 __init_flag2 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 static_vertices_F7B628[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 static stru154 stru_F7B60C; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 /*static bool __init_flag3 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 if (!__init_flag3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 __init_flag3 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 stru154::stru154(&stru_F7B60C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 v9 = &pIndoor->pFaces[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 if ( v9->uNumVertices >= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 if ( !(BYTE1(v9->uAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 ++pBLVRenderParams->field_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 LOBYTE(v9->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 v28 = v9->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 v10 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 v31 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 pStru4 = pGame->pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 if ( !pGame->pIndoorCameraD3D->IsFaceFacedTowardsCamera(v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 uNumVerticesa = v9->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 if ( (signed int)uNumVerticesa > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 v12 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 v13 = (char *)&static_vertices_F7C228[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 v14 = v11++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 *((float *)v13 - 2) = (double)v12[v9->pVertexIDs[v14]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 *((float *)v13 - 1) = (double)v12[v9->pVertexIDs[v14]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 *(float *)v13 = (double)v12[v9->pVertexIDs[v14]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 v13 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 v16 = __OFSUB__(v11, uNumVerticesa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 v15 = ((v11 - uNumVerticesa) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 *((float *)v13 - 5) = (double)v9->pVertexUIDs[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 *((float *)v13 - 4) = (double)v9->pVertexVIDs[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 while ( v15 ^ v16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 v10 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 if ( !a7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 || (pGame->pStru9Instance->_498377(a4, 4u, a7, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 if ( v10->_437285_prolly_colide_vertices_against_frustrum(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 static_vertices_F7C228,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 &uNumVerticesa,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 static_vertices_F7B628,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 v10->std__vector_000034_prolly_frustrum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 0) != 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 || uNumVerticesa )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 a4a = SHIWORD(stru_F8AD28.field_2C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 v17 = (248 - 8 * SHIWORD(stru_F8AD28.field_2C)) | (((248 - 8 * SHIWORD(stru_F8AD28.field_2C)) | ((248 - 8 * SHIWORD(stru_F8AD28.field_2C)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 sub_4B0E07(uFaceID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 pStru4->ApplyLights_IndoorFace(uFaceID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 pDecalBuilder->ApplyBloodsplatDecals_IndoorFace(uFaceID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 v31->_4364C5(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 v31->_436BB7_project_and_stuff(array_507D30, uNumVerticesa, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 pStru4->std__vector_000004_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 if ( stru_F8AD28.field_AC > 0 || pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 v18 = v9->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 v19 = v9->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 v20 = v9->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 v21 = v9->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 stru_F7B60C.vNormal.x = v9->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 stru_F7B60C.field_14 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 stru_F7B60C.vNormal.y = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 stru_F7B60C.vNormal.z = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 stru_F7B60C.field_10 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 if ( stru_F8AD28.field_AC > 0 && !(BYTE2(v9->uAttributes) & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 pStru4->ApplyLights(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 &stru_F8AD28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 &stru_F7B60C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 uNumVerticesa,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 array_507D30,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 *(float *)&a7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 if ( pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 pDecalBuilder->ApplyDecals(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 a4a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 &stru_F7B60C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 uNumVerticesa,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 array_507D30,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 (int)a7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 v9->uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 if ( v9->uAttributes & 0x10 && v9->uBitmapID == pRenderer->field_1036AC_bitmapid )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 v23 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 if ( v9->uAttributes & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 v24 = GetTickCount() >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 if ( (signed int)uNumVerticesa > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 v25 = v24 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 v26 = (char *)&array_507D30[0].v;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 a4b = uNumVerticesa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 for ( i = v25; ; v25 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 *(float *)v26 = (double)(pBitmaps_LOD->pTextures[v9->uBitmapID].uHeightMinus1 & (unsigned int)(stru_5C6E00->SinCos(v25) >> 8))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 + *(float *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v26 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 --a4b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 if ( !a4b )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v22 = v9->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 if ( BYTE1(v22) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 v23 = pTextureFrameTable->GetFrameTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 v9->uBitmapID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 pBLVRenderParams->field_0_timer_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 v27 = pBitmaps_LOD->pHardwareTextures[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 if ( BYTE2(v9->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 sub_479A53(uNumVerticesa, uFaceID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 pRenderer->DrawIndoorPolygon(uNumVerticesa, v9, v27, v28, 8 * uFaceID_ | 6, v17, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 v23 = v9->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 // F7CE28: using guessed type char static_init_flag__F7C228_bit1__F7B628_bit2__F7B60C_bit3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 //----- (004AFF79) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 void IndoorLocation::ExecDraw_sub1(unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 BLVFace *v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 Texture *v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 Texture *v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 int v8; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 int v9; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 int v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 int v11; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 unsigned int v12; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 int j; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 int v14; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 int v15; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 int v16; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 int i; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 int v18; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 int v19; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 int v20; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 int v21; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 unsigned __int8 *v22; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 int v23; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 int v24; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 int v25; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 unsigned __int16 *v26; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 unsigned int v27; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 int v28; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 char *v29; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 int v30; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 int v31; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 int v32; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 int v33; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 signed int v34; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 int v35; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 int v36; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 signed int v37; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 signed int v38; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 unsigned int v39; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 int v40; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 int v41; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 signed int v42; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 int v43; // edx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 int v44; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 unsigned __int16 *v45; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 int *v46; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 unsigned __int16 *v47; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 unsigned int v48; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 int v49; // ebx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 char v50; // cl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 char v51; // ch@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 unsigned int v52; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 int v53; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 unsigned int v54; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 int v55; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 unsigned int v56; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 int v57; // edx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 int v58; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 int v59; // edx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 unsigned __int16 *v60; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 int *v61; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 unsigned __int16 *v62; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 unsigned int v63; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 int v64; // ebx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 char v65; // cl@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 char v66; // ch@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 unsigned int v67; // ebx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 int v68; // edx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 unsigned int v69; // ebx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 int v70; // edx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 unsigned int v71; // ebx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 int v72; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 int v73; // ebx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 int v74; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 unsigned __int16 *v75; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 int *v76; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 int v77; // edi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 unsigned int v78; // edx@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 int v79; // ebx@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 char v80; // cl@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 char v81; // ch@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 int v82; // ebx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 int v83; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 unsigned int v84; // ebx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 int v85; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 unsigned __int16 *v86; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 int *v87; // esi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 int v88; // edi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 unsigned int v89; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 int v90; // ebx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 char v91; // cl@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 char v92; // ch@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 int v93; // ebx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 int v94; // edx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 unsigned __int16 v95; // bx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 int v96; // edx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 unsigned __int8 *v97; // [sp+Ch] [bp-9Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 unsigned __int8 *v98; // [sp+10h] [bp-98h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 unsigned __int8 *v99; // [sp+14h] [bp-94h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 unsigned __int8 *v100; // [sp+18h] [bp-90h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 int v101; // [sp+1Ch] [bp-8Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 int v102; // [sp+20h] [bp-88h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 BLVFace *v103; // [sp+24h] [bp-84h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 unsigned __int16 *v104; // [sp+28h] [bp-80h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 int v105; // [sp+2Ch] [bp-7Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 int v106; // [sp+30h] [bp-78h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 int v107; // [sp+34h] [bp-74h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 Texture *v108; // [sp+38h] [bp-70h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 int v109; // [sp+3Ch] [bp-6Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 unsigned int v110; // [sp+40h] [bp-68h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 unsigned int v111; // [sp+44h] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 int *k; // [sp+48h] [bp-60h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 int v113; // [sp+4Ch] [bp-5Ch]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 int v114; // [sp+50h] [bp-58h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 int v115; // [sp+54h] [bp-54h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 unsigned __int8 *v116; // [sp+58h] [bp-50h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 int v117; // [sp+5Ch] [bp-4Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 int a1; // [sp+60h] [bp-48h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 int v119; // [sp+64h] [bp-44h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 int v120; // [sp+68h] [bp-40h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 unsigned int v121; // [sp+6Ch] [bp-3Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 unsigned int v122; // [sp+70h] [bp-38h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 int v123; // [sp+74h] [bp-34h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 int v124; // [sp+78h] [bp-30h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 int v125; // [sp+7Ch] [bp-2Ch]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 unsigned int v126; // [sp+80h] [bp-28h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 int v127; // [sp+84h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 int v128; // [sp+88h] [bp-20h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 int *pZPixel; // [sp+8Ch] [bp-1Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 int a2; // [sp+90h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 unsigned int v131; // [sp+94h] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 unsigned __int16 *pColorPixel; // [sp+98h] [bp-10h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 int v133; // [sp+9Ch] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 int v134; // [sp+A0h] [bp-8h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 int v135; // [sp+A4h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 v1 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 v111 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 if ( (uFaceID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 if ( (signed int)uFaceID < (signed int)pIndoor->uNumFaces )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 v2 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 v103 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 v3 = v2->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 if ( !(BYTE1(v3) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 if ( v3 & 0x400000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 sub_4ADD1D(uFaceID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 if ( !(v3 & 0x10) || (sub_4AD504(uFaceID), pRenderer->pRenderD3D) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 v4 = v2->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 ++pBLVRenderParams->field_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 v108 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 v6 = HIWORD(v4->palette);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 LOBYTE(v2->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 v109 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 sub_4AE5F1(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 v126 = stru_F8AD28.pDeltaUV[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 v128 = stru_F8AD28.pDeltaUV[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 v107 = bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 v7 = sub_423B5D(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 if ( sub_424829(v7, &stru_F8A590, pBLVRenderParams->field_7C, v1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 if ( v2->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 for ( i = 0; i < stru_F8AD28.field_AC; stru_F8AD28._blv_lights_ys[v18] = v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 v18 = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 v120 = stru_F8AD28._blv_lights_xs[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 v134 = (unsigned __int64)(v120 * (signed __int64)-stru_F8AD28.plane_4.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 v133 = stru_F8AD28.plane_4.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 v120 = stru_F8AD28._blv_lights_ys[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 v133 = (unsigned __int64)(v120 * (signed __int64)stru_F8AD28.plane_4.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 v19 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 stru_F8AD28._blv_lights_xs[i] = v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 + v134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 + ((unsigned __int64)(v120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 * (signed __int64)stru_F8AD28.plane_4.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 v20 = v19 - stru_F8AD28._blv_lights_zs[i++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 if ( v2->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 if ( v2->uPolygonType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 if ( stru_F8AD28.field_AC > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v8 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 v9 = stru_F8AD28._blv_lights_xs[a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 v131 = stru_F8AD28._blv_lights_ys[a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 v10 = stru_F8AD28._blv_lights_zs[a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 v11 = (signed int)(v10 * stru_F8AD28.plane_4.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 + stru_F8AD28.plane_4.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 + v9 * stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 + v131 * stru_F8AD28.plane_4.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v119 = v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 * (signed __int64)((signed int)(v10 * stru_F8AD28.plane_4.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 + stru_F8AD28.plane_4.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 + v9 * stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 + v131 * stru_F8AD28.plane_4.vNormal.y) >> 16)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 v131 -= (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)v11) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 v127 = v10 - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z * (signed __int64)v11) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 stru_F8AD28._blv_lights_xs[a2] = ((unsigned __int64)(v119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 * (signed __int64)stru_F8AD28.vec_14.x) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 + ((unsigned __int64)((signed int)v131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 * (signed __int64)stru_F8AD28.vec_14.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 v124 = (unsigned __int64)(v119 * (signed __int64)stru_F8AD28.vec_20.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 v134 = (unsigned __int64)((signed int)v131 * (signed __int64)stru_F8AD28.vec_20.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 v133 = (unsigned __int64)(v127 * (signed __int64)stru_F8AD28.vec_20.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 v12 = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 stru_F8AD28._blv_lights_ys[v8] = v124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 + ((unsigned __int64)((signed int)v131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 * (signed __int64)stru_F8AD28.vec_20.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 + ((unsigned __int64)(v127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 * (signed __int64)stru_F8AD28.vec_20.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 stru_F8AD28._blv_lights_xs[v8] += v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 stru_F8AD28._blv_lights_ys[v8] += v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 ++a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 while ( a2 < stru_F8AD28.field_AC );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 v2 = v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 if ( v2->uPolygonType != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 if ( v2->uPolygonType != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 for ( j = 0; j < stru_F8AD28.field_AC; *(int *)v15 = v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 v14 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 stru_F8AD28._blv_lights_xs[j] += v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 v15 = 4 * j + 16297672;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 v16 = v14 - stru_F8AD28._blv_lights_ys[j++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 v135 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 pGame->_44ED0A(v2, &v135, 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 v104 = sr_sub_47C24C_get_palette(v2, v109, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 v134 = stru_F8AD28.field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 v106 = stru_F8AD28.field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 v21 = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 a2 = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 v110 = v111 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 v97 = v5->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 v98 = v5->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 v99 = v5->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 v22 = v5->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 v23 = 640 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 v119 = 640 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 v100 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 if ( stru_F8A590._viewport_space_y <= stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 v24 = 2 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 v120 = 2 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 a1 = *(__int16 *)((char *)stru_F8A590.array_18 + v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 sub_4AE313(a1, v21, &stru_F81018.field_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 v27 = v111 * (v24 - pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 pZPixel = &pBLVRenderParams->pTargetZBuffer[2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 * (*(__int16 *)((char *)stru_F8A590.array_18 + v24)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 + 320 * (v24 - pBLVRenderParams->uViewportY))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 pColorPixel = &pBLVRenderParams->pRenderTarget[v27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 + 2 * *(__int16 *)((char *)stru_F8A590.array_18 + v24)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 v26 = &pBLVRenderParams->pRenderTarget[v27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 + 2 * *(__int16 *)((char *)stru_F8A590.array_3D8 + v24)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 v23 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 v25 = *(__int16 *)((char *)stru_F8A590.array_18 + v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 pZPixel = &pBLVRenderParams->pTargetZBuffer[v25 + v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 pColorPixel = &pBLVRenderParams->pRenderTarget[v25 + v110];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 v26 = &pBLVRenderParams->pRenderTarget[v110 + *(__int16 *)((char *)stru_F8A590.array_3D8 + v24)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 v131 = (unsigned int)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 HIWORD(v28) = HIWORD(stru_F81018.field_0.field_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 LOWORD(v28) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 v105 = stru_F8AD28.field_0 | v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 v123 = sub_4AE491(SHIWORD(stru_F81018.field_0.field_4), SHIWORD(stru_F81018.field_0.field_8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 if ( (unsigned int)pColorPixel < v131 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 v102 = v107 + v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 v29 = (char *)&stru_F81018.field_34.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 a1 += v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 for ( k = &stru_F81018.field_34.field_8; ; v29 = (char *)k )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 sub_4AE313(a1, a2, (stru337_stru0 *)(v29 - 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 v30 = *((int *)v29 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 LOWORD(v30) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 v117 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 v31 = stru_F8AD28.field_0 | v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 if ( v105 <= (unsigned int)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 v117 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v105 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 v32 = *((int *)v29 - 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 v122 = *((int *)v29 - 14) >> v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 v33 = *((int *)v29 - 13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 v125 = *((int *)v29 - 13) >> v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 v34 = *((int *)v29 - 1) - v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 v113 = (*(int *)v29 - v33) >> v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 v35 = *((int *)v29 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 v114 = v34 >> v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 v116 = (&v97)[4 * v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 v36 = v35 + 16 - v5->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 v133 = v35 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 v127 = v35 + v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 v37 = v5->uWidthMinus1 >> v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 v38 = v5->uHeightMinus1 >> v35 << (v35 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 v128 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 v126 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 v39 = (unsigned int)(LOBYTE(viewparams->field_20) ? &pColorPixel[2 * v134] : &pColorPixel[v134]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 if ( v39 > v131 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 v39 = v131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 v40 = *((short *)v29 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 v41 = *((short *)v29 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 v121 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 v42 = sub_4AE491(v41, v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 v101 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 v124 = (signed int)(v39 - (int)pColorPixel) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 if ( v123 >> 16 == v42 >> 16 || v135 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 v123 = (int)sr_sub_47C24C_get_palette(v103, v109, v123 >> 16, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 v86 = pColorPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 if ( (unsigned int)pColorPixel < v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 v87 = pZPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 v88 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v89 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 v90 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v91 = v133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v92 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 if ( v124 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 *pZPixel = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 v87 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 v86 = pColorPixel + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 v86 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 v93 = *(&v116[v128 & (v89 >> v91)] + ((v126 & v90) >> v92));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 v94 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 LOWORD(v93) = *(short *)(v88 + 2 * v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 *v87 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 v87[1] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 v87[640] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 v87[641] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 *(v86 - 4) = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 *(v86 - 3) = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 v86[636] = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 v86[637] = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 v87[2] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 v87[3] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 v87[642] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 v87[643] = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 v122 += v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 v89 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 v90 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 LABEL_69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 v87 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 v95 = *(short *)(v88 + 2 * *(&v116[v128 & (v89 >> v91)] + ((v126 & v90) >> v92)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 v96 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 *(v86 - 2) = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 *(v86 - 1) = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 v86[638] = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 v86[639] = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 v122 += v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 v89 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 v90 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 while ( (unsigned int)v86 < v121 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 pColorPixel = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 pZPixel = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 v75 = pColorPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 if ( (unsigned int)pColorPixel < v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 v76 = pZPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 v77 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 v78 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 v79 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 v80 = v133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 v81 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 if ( v124 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 *pZPixel = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 --v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 v75 = pColorPixel + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 v75 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 v82 = *(&v116[v128 & (v78 >> v80)] + ((v126 & v79) >> v81));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 v83 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 LOWORD(v82) = *(short *)(v77 + 2 * v82);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 *v76 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 *(v75 - 2) = v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 v76[1] = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 v122 += v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 v78 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 v79 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 LABEL_62:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 v84 = (unsigned int)(&v116[v128 & (v78 >> v80)] + ((v126 & v79) >> v81));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 v76 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 v85 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 *(v75 - 1) = *(short *)(v77 + 2 * *(char *)v84);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 v122 += v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 v78 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 v79 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 while ( (unsigned int)v75 < v121 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 pColorPixel = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 pZPixel = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 v43 = (v42 - v123) >> v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 v44 = v123 - v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 v123 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 v115 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 v60 = pColorPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 if ( (unsigned int)pColorPixel < v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 v61 = pZPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 v62 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 v63 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 v64 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v65 = v133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 v66 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 if ( v124 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 *pZPixel = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 v61 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 v60 = pColorPixel + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 v67 = (v128 & (v63 >> v65)) + ((v126 & v64) >> v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v68 = v123 + v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 v60 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 v115 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v69 = ((v68 & 0xFFFF0000u) >> 8) + v116[v67];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 v70 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 LOWORD(v69) = v62[v69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 *v61 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 v61[1] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 v61[640] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 v61[641] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 *(v60 - 4) = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 *(v60 - 3) = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 v60[636] = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 v60[637] = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 v61[2] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 v61[3] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 v61[642] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 v61[643] = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 v122 += v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 v63 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 v64 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 v61 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 v71 = (v128 & (v63 >> v65)) + ((v126 & v64) >> v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 v72 = v123 + v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 v73 = v116[v71];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 v115 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 LOWORD(v73) = v62[((v72 & 0xFFFF0000u) >> 8) + v73];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 v74 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 *(v60 - 2) = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 *(v60 - 1) = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 v60[638] = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 v60[639] = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v122 += v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 v63 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 v64 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 while ( (unsigned int)v60 < v121 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 pColorPixel = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 pZPixel = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 v45 = pColorPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 if ( (unsigned int)pColorPixel < v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 v46 = pZPixel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v47 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 v48 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 v49 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 v50 = v133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 v51 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 if ( v124 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 *pZPixel = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 ++v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 v45 = pColorPixel + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 v52 = (v128 & (v48 >> v50)) + ((v126 & v49) >> v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 v53 = v123 + v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 v45 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 v115 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 v54 = ((v53 & 0xFFFF0000u) >> 8) + v116[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 v55 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 LOWORD(v54) = v47[v54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 *v46 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 *(v45 - 2) = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 v46[1] = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 v122 += v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 v48 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v49 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 v46 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 LABEL_47:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 v56 = (v128 & (v48 >> v50)) + ((v126 & v49) >> v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 v57 = v123 + v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 v58 = v116[v56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 v115 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 LOWORD(v58) = v47[((v57 & 0xFFFF0000u) >> 8) + v58];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 v59 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 *(v45 - 1) = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 v122 += v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 v125 += v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 v48 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 v49 = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 while ( (unsigned int)v45 < v121 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 pColorPixel = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 pZPixel = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 k += 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 v5 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 v123 = v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 a1 += v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 if ( (unsigned int)pColorPixel >= v131 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 v23 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 v24 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 ++a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 v110 += v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 v23 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 v24 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 v120 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 v119 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 if ( a2 > stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 v21 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 // 4AE491: using guessed type int __fastcall sub_4AE491(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 //----- (004B0E07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 unsigned int __fastcall sub_4B0E07(unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 BLVFace *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 BLVFaceExtra *v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 Texture *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 unsigned int v5; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 unsigned int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v1 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 v2 = &pIndoor->pFaceExtras[v1->uFaceExtraID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v3 = (Texture *)(v1->uBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[v1->uBitmapID] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 stru_F8AD28.pDeltaUV[0] = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 stru_F8AD28.pDeltaUV[1] = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v4 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 v5 = v1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 result = v4 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 if ( v5 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 stru_F8AD28.pDeltaUV[1] -= result & v3->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 if ( v5 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 stru_F8AD28.pDeltaUV[1] += result & v3->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 v7 = v1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 if ( BYTE1(v7) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 stru_F8AD28.pDeltaUV[0] -= result & v3->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 if ( v7 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 stru_F8AD28.pDeltaUV[0] += result & v3->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 //----- (004B0EA8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 void stru170::_4B0EA8(signed int a2, unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 unsigned int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 stru170 *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 BLVFace *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 unsigned __int16 v7; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 Vec3_short_ *v8; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 int v9; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 signed int v10; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 signed int v11; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 signed int v12; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 signed int v13; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 signed int v14; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 int v15; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 int v16; // esi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 BLVFace *v17; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 unsigned __int16 v18; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 char *v19; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 signed int v20; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 char *v21; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 signed int v22; // ecx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 signed int v23; // edx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 char *v24; // ecx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 int v25; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 Vec3_short_ *v26; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 double v27; // st7@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 signed int v28; // ST28_4@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 char v29; // al@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 signed int v30; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 int v31; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 unsigned int v32; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 __int16 v33; // cx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 signed int v34; // [sp+Ch] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 int a0; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 IndoorCameraD3D *a0a; // [sp+14h] [bp-Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 signed int v37; // [sp+18h] [bp-8h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 stru10 *v38; // [sp+18h] [bp-8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 BLVFace *v39; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 v3 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 v5 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 this->field_FA8[this->std__vector_000FA8].std__vector_0007A8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v39 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 if ( v5->uAttributes & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 v6 = (int)((char *)this + 2252 * a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 a0 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 if ( v3 == *(short *)(v6 + 5964) ) // stru170_stru0[a2]::uFaceID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 if ( !a2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 && pBLVRenderParams->vPartyPos.x >= v5->pBounding.x1 - 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 && pBLVRenderParams->vPartyPos.x <= v5->pBounding.x2 + 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 && pBLVRenderParams->vPartyPos.y >= v5->pBounding.y1 - 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 && pBLVRenderParams->vPartyPos.y <= v5->pBounding.y2 + 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 && pBLVRenderParams->vPartyPos.z >= v5->pBounding.z1 - 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 && pBLVRenderParams->vPartyPos.z <= v5->pBounding.z2 + 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 if ( abs(v5->pFacePlane_old.dist + pBLVRenderParams->vPartyPos.x * v5->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 + pBLVRenderParams->vPartyPos.y * v5->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 + pBLVRenderParams->vPartyPos.z * v5->pFacePlane_old.vNormal.z) <= 589824 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 v7 = v39->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 if ( v4->field_FA8[0].uSectorID == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 v7 = v39->uBackSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 v4->field_FA8[v4->std__vector_000FA8].uSectorID = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 v4->field_FA8[v4->std__vector_000FA8].uFaceID = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 v4->field_FA8[v4->std__vector_000FA8].uViewportX = LOWORD(pBLVRenderParams->uViewportX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 v4->field_FA8[v4->std__vector_000FA8].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 v4->field_FA8[v4->std__vector_000FA8].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v4->field_FA8[v4->std__vector_000FA8].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v4->field_FA8[v4->std__vector_000FA8++].field_C._43F9E1(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 SLOWORD(pBLVRenderParams->uViewportX),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 pBLVRenderParams->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 SLOWORD(pBLVRenderParams->uViewportZ),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 sub_440639(v4->std__vector_000FA8 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 v5 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 v6 = a0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 v8 = &pIndoor->pVertices[*v5->pVertexIDs];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 v9 = v5->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v8->x - pBLVRenderParams->vPartyPos.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 + v5->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v8->x >> 16) - pBLVRenderParams->vPartyPos.y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 + v5->pFacePlane_old.vNormal.z * (v8->z - pBLVRenderParams->vPartyPos.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 if ( *(short *)(v6 + 4008) != v5->uSectorID )// stru170_stru0[a2]::uSectorID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 v9 = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 v10 = sub_423B5D(uFaceID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 v34 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 v11 = dword_50BAC8[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 v12 = dword_50B9D8_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 a2 = dword_50BAC8[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 v13 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 v37 = dword_50B9D8_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 if ( v10 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 v14 = dword_50BAC8[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 if ( v14 < a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 a2 = dword_50BAC8[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 if ( v14 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 v11 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 v15 = dword_50B9D8_ys[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 if ( v15 < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 v37 = dword_50B9D8_ys[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 if ( v15 > v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 v12 = dword_50B9D8_ys[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 v10 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 while ( v13 < v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 v16 = a0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 if ( v11 >= *(short *)(a0 + 4010) // stru170_stru0[a2]::uViewportX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 && a2 <= *(short *)(a0 + 4014) // stru170_stru0[a2]::uViewportZ
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 && v12 >= *(short *)(a0 + 4012) // stru170_stru0[a2]::uViewportY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 && v37 <= *(short *)(a0 + 4016) // stru170_stru0[a2]::uViewportW
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 && sub_424829(v10, &v4->field_FA8[v4->std__vector_000FA8].field_C, (stru170_stru2 *)(a0 + 4020), uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 v17 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 v18 = v39->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 if ( *(short *)(a0 + 4008) == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 v18 = v39->uBackSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 v4->field_FA8[v4->std__vector_000FA8].uSectorID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 v4->field_FA8[v4->std__vector_000FA8].uFaceID = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 v4->field_FA8[v4->std__vector_000FA8].uViewportX = LOWORD(pBLVRenderParams->uViewportX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 v4->field_FA8[v4->std__vector_000FA8].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 v4->field_FA8[v4->std__vector_000FA8].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 v4->field_FA8[v4->std__vector_000FA8].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 v38 = pGame->pStru10Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 a0a = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 if ( *(int *)(v16 + 5968) == -1 ) // [a2]::std__vector_0007A8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 v29 = pGame->pStru10Instance->_49C681(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 v39,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 v4->field_FA8[v4->std__vector_000FA8].std__vector_0007AC,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 v4->field_FA8[v4->std__vector_000FA8].pVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 static RenderVertexSoft static_sub_4B0EA8_stru_F7AA08[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 static_sub_4B0EA8_stru_F7AA08[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 static RenderVertexSoft static_sub_4B0EA8_stru_F79E08[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 static bool __init_flag2 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 if (!__init_flag2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 __init_flag2 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 static_sub_4B0EA8_stru_F79E08[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 a2 = v39->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 if ( a2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 v24 = (char *)&static_sub_4B0EA8_stru_F7AA08[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 v25 = v17->pVertexIDs[v23++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 v26 = &pIndoor->pVertices[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v27 = (double)v26->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 v28 = v26->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 v17 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 *((float *)v24 - 2) = (double)v26->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 *((float *)v24 - 1) = (double)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 *(float *)v24 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 v24 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 while ( v23 < a2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 a0a->_437285_prolly_colide_vertices_against_frustrum(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 static_sub_4B0EA8_stru_F7AA08,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 (unsigned int *)&a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 static_sub_4B0EA8_stru_F79E08,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 (IndoorCameraD3D_Vec4 *)(v16 + 5972),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 v29 = v38->_49C5DA(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 v17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 static_sub_4B0EA8_stru_F79E08,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 v4->field_FA8[v4->std__vector_000FA8].std__vector_0007AC,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 v4->field_FA8[v4->std__vector_000FA8].pVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 v4->field_FA8[v4->std__vector_000FA8].std__vector_0007A8 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 v30 = v4->std__vector_000FA8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 if ( v30 < 150 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 v31 = v30 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 v4->std__vector_000FA8 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 sub_440639(v31 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 if ( pBLVRenderParams->uFlags & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 a0a->PrepareAndDrawDebugOutline(v17, 0x1E1EFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 v32 = this->uNumFaceIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 if ( (signed int)this->uNumFaceIDs < 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 v33 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 v4->pFaceIDs[2 * v32] = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v4->pFaceIDs[2 * v4->uNumFaceIDs++ + 1] = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 // F7B608: using guessed type char static_sub_4B0EA8_byte_F7B608_init_flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 //----- (004AFB86) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 void stru170::_4AFB86(int a2, unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 stru170 *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 BLVFace *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 char *v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 unsigned __int16 v6; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 int v7; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 Vec3_short_ *v8; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 int v9; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 signed int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 signed int v11; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 signed int v12; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 signed int v13; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 int v14; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 int v15; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 unsigned __int16 v16; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 signed int v17; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 int v18; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 signed int v19; // [sp+Ch] [bp-14h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 char *v20; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 BLVFace *v21; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 signed int v22; // [sp+1Ch] [bp-4h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 signed int v23; // [sp+28h] [bp+8h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 v4 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 v21 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 if ( v4->uAttributes & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 v5 = (char *)this + 2252 * a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 v20 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 if ( uFaceID == *((short *)v5 + 2982) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 if ( !a2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 && pBLVRenderParams->vPartyPos.x >= v4->pBounding.x1 - 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 && pBLVRenderParams->vPartyPos.x <= v4->pBounding.x2 + 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 && pBLVRenderParams->vPartyPos.y >= v4->pBounding.y1 - 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 && pBLVRenderParams->vPartyPos.y <= v4->pBounding.y2 + 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 && pBLVRenderParams->vPartyPos.z >= v4->pBounding.z1 - 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 && pBLVRenderParams->vPartyPos.z <= v4->pBounding.z2 + 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 if ( abs(v4->pFacePlane_old.dist + pBLVRenderParams->vPartyPos.x * v4->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 + pBLVRenderParams->vPartyPos.y * v4->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 + pBLVRenderParams->vPartyPos.z * v4->pFacePlane_old.vNormal.z) <= 589824 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 v6 = v21->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 if ( v3->field_FA8[0].uSectorID == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 v6 = v21->uBackSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 v3->field_FA8[v3->std__vector_000FA8].uSectorID = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 v3->field_FA8[v3->std__vector_000FA8].uFaceID = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 v3->field_FA8[v3->std__vector_000FA8].uViewportX = LOWORD(pBLVRenderParams->uViewportX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 v3->field_FA8[v3->std__vector_000FA8].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 v3->field_FA8[v3->std__vector_000FA8].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 v3->field_FA8[v3->std__vector_000FA8].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 v3->field_FA8[v3->std__vector_000FA8++].field_C._43F9E1(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 SLOWORD(pBLVRenderParams->uViewportX),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 pBLVRenderParams->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 SLOWORD(pBLVRenderParams->uViewportZ),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v7 = v3->std__vector_000FA8 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 v4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 v5 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v8 = &pIndoor->pVertices[*v4->pVertexIDs];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 v9 = v4->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v8->x - pBLVRenderParams->vPartyPos.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 + v4->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v8->x >> 16) - pBLVRenderParams->vPartyPos.y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 + v4->pFacePlane_old.vNormal.z * (v8->z - pBLVRenderParams->vPartyPos.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 if ( *((short *)v5 + 2004) != v4->uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 v9 = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 v10 = sub_423B5D(uFaceID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v19 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 v11 = dword_50BAC8[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v12 = dword_50B9D8_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 v23 = dword_50BAC8[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 v13 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 v22 = dword_50B9D8_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 if ( v10 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 v14 = dword_50BAC8[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 if ( v14 < v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 v23 = dword_50BAC8[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 if ( v14 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 v11 = dword_50BAC8[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 v15 = dword_50B9D8_ys[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 if ( v15 < v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v22 = dword_50B9D8_ys[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 if ( v15 > v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 v12 = dword_50B9D8_ys[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 v10 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 while ( v13 < v19 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 if ( v11 >= *((short *)v20 + 2005)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 && v23 <= *((short *)v20 + 2007)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 && v12 >= *((short *)v20 + 2006)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 && v22 <= *((short *)v20 + 2008)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 && sub_424829(v10, &v3->field_FA8[v3->std__vector_000FA8].field_C, (stru170_stru2 *)(v20 + 4020), uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 v16 = v21->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 if ( *((short *)v20 + 2004) == v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 v16 = v21->uBackSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 v3->field_FA8[v3->std__vector_000FA8].uSectorID = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 v3->field_FA8[v3->std__vector_000FA8].uFaceID = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 v3->field_FA8[v3->std__vector_000FA8].uViewportX = LOWORD(pBLVRenderParams->uViewportX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 v3->field_FA8[v3->std__vector_000FA8].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 v3->field_FA8[v3->std__vector_000FA8].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 v3->field_FA8[v3->std__vector_000FA8].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 v17 = v3->std__vector_000FA8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 if ( v17 < 150 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 v18 = v17 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v3->std__vector_000FA8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 v7 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 sub_440639(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 if ( (signed int)this->uNumFaceIDs < 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 this->pFaceIDs[2 * this->uNumFaceIDs] = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 this->pFaceIDs[2 * this->uNumFaceIDs++ + 1] = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 //----- (004B0967) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 void __cdecl stru170_sub_4B0967()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 signed int i; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 int v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 unsigned int v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 unsigned __int16 *v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 int v6; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 int v7; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 for ( i = 0; i < (signed int)pStru170->uNumFaceIDs; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 v1 = pStru170->pFaceIDs[2 * i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 if ( v1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 if ( v1 < (signed int)pIndoor->uNumFaces )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 v2 = pStru170->pFaceIDs[2 * i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 pBLVRenderParams->field_7C = &pStru170->field_FA8[pStru170->pFaceIDs[2 * i + 1]].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 v3 = sub_423B5D(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 if ( sub_424829(v3, &stru_F8A590, pBLVRenderParams->field_7C, v1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 v4 = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 v5 = pBLVRenderParams->pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 if ( stru_F8A590._viewport_space_y <= stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 v6 = 640 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 v5[v6 + stru_F8A590.array_18[v4]] = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 v7 = v6 + stru_F8A590.array_3D8[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 v6 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 v5[v7] = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 while ( v4 <= stru_F8A590.field_4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 //----- (004AE5BA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 Texture *BLVFace::GetTexture()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 if ( uAttributes & 0x4000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 v1 = pTextureFrameTable->GetFrameTexture(this->uBitmapID, pBLVRenderParams->field_0_timer_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 v1 = uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 return (Texture *)(v1 != -1 ? (int)&pBitmaps_LOD->pTextures[v1] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 //----- (00498B15) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 void IndoorLocation::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 IndoorLocation *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 char *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 void *v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 v2 = (char *)&this->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 pAllocator->FreeChunk(this->ptr_0002B4_doors_ddata);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 *(int *)v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 pAllocator->FreeChunk(v1->ptr_0002B0_sector_rdata);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v1->ptr_0002B0_sector_rdata = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 pAllocator->FreeChunk(v1->ptr_0002B8_sector_lrdata);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 v1->ptr_0002B8_sector_lrdata = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 pAllocator->FreeChunk(v1->ptr_2AC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v1->ptr_2AC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 pAllocator->FreeChunk(v1->pSpawnPoints);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v3 = v1->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 v1->pSpawnPoints = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 v1->uNumSectors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 v1->uNumFaces = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 v1->uNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 v1->uNumNodes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 v1->uNumDoors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 v1->uNumLights = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 pAllocator->FreeChunk(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 pAllocator->FreeChunk(v1->pFaces);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 pAllocator->FreeChunk(v1->pFaceExtras);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 pAllocator->FreeChunk(v1->pSectors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 pAllocator->FreeChunk(v1->pLights);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 pAllocator->FreeChunk(v1->pDoors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 pAllocator->FreeChunk(v1->pNodes);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 pAllocator->FreeChunk(v1->pMapVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 v1->pVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 v1->pFaces = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 v1->pFaceExtras = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 v1->pSectors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 v1->pLights = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 v1->pDoors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 v1->pNodes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 v1->pMapVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 v1->bLoaded = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 //----- (00498C45) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 int IndoorLocation::Alloc()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 IndoorLocation *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 void *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 const void *v3; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 void *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 const void *v5; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 void *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 const void *v7; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 void *v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 const void *v9; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 void *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 const void *v11; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 void *v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 const void *v13; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 void *v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 const void *v15; // ST3C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 void *v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 void *v17; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 signed int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 v2 = pAllocator->AllocNamedChunk(this->pVertices, 0x15F90u, "L.V");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 v3 = v1->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 v1->pVertices = (Vec3_short_ *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 v4 = pAllocator->AllocNamedChunk(v3, 0xEA600u, "L.F");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 v5 = v1->pFaceExtras;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 v1->pFaces = (BLVFace *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 v6 = pAllocator->AllocNamedChunk(v5, 0x2BF20u, "L.FX");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 v7 = v1->pSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 v1->pFaceExtras = (BLVFaceExtra *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 v8 = pAllocator->AllocNamedChunk(v7, 0xE800u, "L.R");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 v9 = v1->pLights;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 v1->pSectors = (BLVSector *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 v10 = pAllocator->AllocNamedChunk(v9, 0x1900u, "L.L");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 v11 = v1->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 v1->pLights = (BLVLightMM7 *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 v12 = pAllocator->AllocNamedChunk(v11, 0x3E80u, "L.D");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 v13 = v1->pNodes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 v1->pDoors = (BLVDoor *)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 v14 = pAllocator->AllocNamedChunk(v13, 0x9C40u, "L.BSP");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 v15 = v1->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 v1->pNodes = (BSPNode *)v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 v16 = pAllocator->AllocNamedChunk(v15, 0x14824u, "L.Map");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 v17 = v1->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 v1->pMapVertices = (unsigned int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 if ( v17 && v1->pFaces && v1->pFaceExtras && v1->pSectors && v1->pLights && v1->pDoors && v1->pNodes && v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 memset(v17, 90000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 memset(v1->pFaces, 960000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 memset(v1->pFaceExtras, 180000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 memset(v1->pSectors, 59392, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 memset(v1->pLights, 6400, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 memset(v1->pDoors, 16000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 memset(v1->pNodes, 40000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 memset(v1->pMapVertices, 84004, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 //----- (00444810) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 unsigned int IndoorLocation::GetLocationIndex(const char *Str1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 v1 = Str1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 while ( _strcmpi(v1, _4E6BDC_loc_names[v2]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 if ( v2 >= 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 return v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 //----- (004488F7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 void IndoorLocation::ToggleLight(unsigned int uLightID, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 char *v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && (signed int)uLightID <= pIndoor->uNumLights - 1 && (uLightID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v2 = (char *)&pIndoor->pLights[uLightID].uAtributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 *v2 &= 0xF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 *v2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 //----- (00498E0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 bool IndoorLocation::Load(char *pFilename, int a3, size_t i, char *pDest)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 unsigned int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 IndoorLocation *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 FILE *v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 bool result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 char *v9; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 void *v10; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 unsigned __int8 v11; // zf@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 unsigned __int8 v12; // sf@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 int v13; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 size_t v14; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 char *v15; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 int v16; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 size_t v17; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 char *v18; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 int v19; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 unsigned __int16 *v20; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 unsigned __int16 *v21; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 unsigned __int16 *v22; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 __int16 v23; // ax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 char *v24; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 __int16 v25; // cx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 __int16 v26; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 char *v27; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 unsigned __int16 v28; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 BLVFaceExtra *v29; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 char *v30; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 int v31; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 void *v32; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 int v33; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 unsigned __int16 *v34; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 size_t v35; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 char *v36; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 int v37; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 size_t v38; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 char *v39; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 int v40; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 unsigned __int16 *v41; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 unsigned __int16 *v42; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 unsigned __int16 *v43; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 unsigned __int16 *v44; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 size_t v45; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 unsigned __int16 *v46; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 void *v47; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 BLVSector *v48; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 size_t v49; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 unsigned __int16 *v50; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 void *v51; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 int v52; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 unsigned __int16 *v53; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 size_t v54; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 char *v55; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 int v56; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 size_t v57; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 char *v58; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 int v59; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 unsigned __int16 *v60; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 unsigned __int16 *v61; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 unsigned __int16 *v62; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 unsigned __int16 *v63; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 int v64; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 BLVDoor *v65; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 char *v66; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 int v67; // edx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 int v68; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 BLVFace *v69; // edx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 int v70; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 int v71; // edx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 int v72; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 unsigned __int16 v73; // ax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 char *v74; // ecx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 LayingItem *v75; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 size_t v76; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 int j; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 unsigned __int16 v78; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 void *v79; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 void **v80; // esi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 size_t v81; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 FILE *v82; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 unsigned int v83; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 void *v84; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 void *v85; // ebx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 const void *v86; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 const void *v87; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 const void *v88; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 void *v89; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 size_t v90; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 const void *v91; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 int v92; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 BLVFace *v93; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 BLVSector *v94; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 unsigned __int16 *v95; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 int v96; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 BLVSector *v97; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 unsigned __int16 *v98; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 unsigned __int16 *v99; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 unsigned __int16 *v100; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 unsigned __int16 *v101; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 __int16 v102; // ax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 BLVSector *v103; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 __int16 v104; // ax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 __int16 v105; // ax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 BLVSector *v106; // ecx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 const void *v107; // ebx@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 const void *v108; // ebx@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 unsigned __int16 v109; // ax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 BLVFaceExtra *v110; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 int v111; // edx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 BLVFaceExtra *v112; // ecx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 const void *v113; // ebx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 const void *v114; // ebx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 void *v115; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 size_t v116; // ecx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 const void *v117; // ebx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 int v118; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 unsigned __int16 *v119; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 int v120; // ecx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 BLVFace *v121; // ecx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 unsigned __int16 *v122; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 int v123; // ecx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 BLVFace *v124; // ecx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 unsigned __int16 *v125; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 unsigned __int16 *v126; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 unsigned __int16 *v127; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 unsigned __int16 *v128; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 unsigned __int16 *v129; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 int v130; // ecx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 unsigned __int16 *v131; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 void *v132; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 size_t v133; // ecx@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 const void *v134; // ebx@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 BLVSector *v135; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 FILE *v136; // ecx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 unsigned __int16 *v137; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 const void *v138; // ebx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 const void *v139; // ebx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 unsigned __int16 v140; // ax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 FILE *v141; // ecx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 const void *v142; // ebx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 const void *v143; // ebx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 const void *v144; // ebx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 unsigned int v145; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 void *v146; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 unsigned int v147; // ecx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 int v148; // ebx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 unsigned int *v149; // ecx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 size_t v150; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 unsigned int v151; // ebx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 unsigned int v152; // ecx@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 unsigned int v153; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 size_t v154; // ebx@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 unsigned int v155; // ebx@134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 size_t v156; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 signed int v157; // ebx@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 int v158; // ebx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 BLVFace *v159; // eax@149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 BLVFaceExtra *v160; // ecx@149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 BLVFaceExtra *v161; // ecx@149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 signed int v162; // ebx@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 unsigned int v163; // ebx@157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 unsigned int v164; // ebx@157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 unsigned int v165; // edx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 char *v166; // ecx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 unsigned __int16 v167; // ax@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 __int16 v168; // ax@165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 unsigned int v169; // ebx@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 void *v170; // eax@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 size_t v171; // ebx@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 int v172; // edx@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 BLVDoor *v173; // ecx@169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 int k; // eax@169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 BLVDoor *v175; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 int v176; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 BLVDoor *v177; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 int v178; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 BLVDoor *v179; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 int v180; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 BLVDoor *v181; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 int v182; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 BLVDoor *v183; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 int v184; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 BLVDoor *v185; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 int v186; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 BLVDoor *v187; // ecx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 int v188; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 unsigned __int16 *v189; // ebx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 char *v190; // edx@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 BLVDoor *v191; // ecx@174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 BLVDoor *l; // eax@175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 signed int v193; // ebx@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 int v194; // ecx@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 BLVFaceExtra *v195; // ecx@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 BLVFace *v196; // ebx@178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 std::string v197; // [sp-18h] [bp-680h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 void *v198; // [sp-14h] [bp-67Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 size_t v199; // [sp-10h] [bp-678h]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 size_t v200; // [sp-Ch] [bp-674h]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 const char *v201; // [sp-8h] [bp-670h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 int v202; // [sp-4h] [bp-66Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 char v203[875]; // [sp+Ch] [bp-65Ch]@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 char FileName[260]; // [sp+378h] [bp-2F0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 char DstBuf; // [sp+47Ch] [bp-1ECh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 __int32 Offset; // [sp+480h] [bp-1E8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 __int32 v207; // [sp+48Ch] [bp-1DCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 __int32 v208; // [sp+498h] [bp-1D0h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 __int32 v209; // [sp+4A4h] [bp-1C4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 __int32 v210; // [sp+4B0h] [bp-1B8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 __int32 v211; // [sp+4BCh] [bp-1ACh]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 __int32 v212; // [sp+4C8h] [bp-1A0h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 __int32 v213; // [sp+4D4h] [bp-194h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 __int32 v214; // [sp+4E0h] [bp-188h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 __int32 v215; // [sp+4ECh] [bp-17Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 __int32 v216; // [sp+4F8h] [bp-170h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 __int32 v217; // [sp+504h] [bp-164h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 __int32 v218; // [sp+510h] [bp-158h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 __int32 v219; // [sp+51Ch] [bp-14Ch]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 __int32 v220; // [sp+528h] [bp-140h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 __int32 v221; // [sp+534h] [bp-134h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 __int32 v222; // [sp+540h] [bp-128h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 __int32 v223; // [sp+54Ch] [bp-11Ch]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 __int32 v224; // [sp+558h] [bp-110h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 __int32 v225; // [sp+564h] [bp-104h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 __int32 v226; // [sp+570h] [bp-F8h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 __int32 v227; // [sp+57Ch] [bp-ECh]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 __int32 v228; // [sp+588h] [bp-E0h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 __int32 v229; // [sp+594h] [bp-D4h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 __int32 v230; // [sp+5A0h] [bp-C8h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 __int32 v231; // [sp+5ACh] [bp-BCh]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 __int32 v232; // [sp+5B8h] [bp-B0h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 __int32 v233; // [sp+5C4h] [bp-A4h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 __int32 v234; // [sp+5D0h] [bp-98h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 char pName[40]; // [sp+5FCh] [bp-6Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 size_t pSource; // [sp+624h] [bp-44h]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 char Dst[12]; // [sp+628h] [bp-40h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 char *v238; // [sp+634h] [bp-34h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 ODMHeader header; // [sp+638h] [bp-30h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 void *ptr; // [sp+648h] [bp-20h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 size_t Count; // [sp+64Ch] [bp-1Ch]@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 int uSourceLen; // [sp+653h] [bp-15h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 FILE *File; // [sp+658h] [bp-10h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 BLVSector *v244; // [sp+65Ch] [bp-Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 int v245; // [sp+660h] [bp-8h]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 BLVFace *Src; // [sp+664h] [bp-4h]@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 signed int Argsa; // [sp+670h] [bp+8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 signed int Argsb; // [sp+670h] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 signed int Argsc; // [sp+670h] [bp+8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 signed int Argsd; // [sp+670h] [bp+8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 int Argse; // [sp+670h] [bp+8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 int Argsf; // [sp+670h] [bp+8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 int Argsg; // [sp+670h] [bp+8h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 int Argsh; // [sp+670h] [bp+8h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 signed int Argsi; // [sp+670h] [bp+8h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 signed int Argsj; // [sp+670h] [bp+8h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 int Argsk; // [sp+670h] [bp+8h]@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 void *Argsl; // [sp+670h] [bp+8h]@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 signed int Argsm; // [sp+670h] [bp+8h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 signed int Argsn; // [sp+670h] [bp+8h]@175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 _6807E0_num_decorations_6807B8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 sprintfex(FileName, "levels\\%s", pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 if ( GetFileAttributesA(FileName) != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 v6->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 if ( v6->Alloc() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 v7 = fopen(FileName, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 v9 = pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 v6->bLoaded = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v202 = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v201 = (const char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 *(int *)v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 fread(&DstBuf, 0x180u, (size_t)v201, (FILE *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 fseek(v7, Offset, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 fread(&v6->blv, 0x88u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 fseek(v7, v207, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 fread(&v6->uNumVertices, 1u, 4u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 fseek(v7, v208, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 fread(v6->pVertices, 6u, v6->uNumVertices, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 fseek(v7, v209, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 fread(&v6->uNumFaces, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 fseek(v7, v210, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 fread(v6->pFaces, 0x60u, v6->uNumFaces, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 v10 = pAllocator->AllocNamedChunk(v6->ptr_2AC, v6->blv.uFaces_fdata_Size, "L.FData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 v202 = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 v6->ptr_2AC = (unsigned __int16 *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 fread(v10, 1u, v6->blv.uFaces_fdata_Size, (FILE *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 v11 = v6->uNumFaces == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 v12 = (v6->uNumFaces & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 v6->pFaces[v13].pVertexIDs = (unsigned __int16 *)&pDest[(unsigned int)v6->ptr_2AC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 v14 = (size_t)&v6->pFaces[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 i = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 v15 = &pDest[2 * *(char *)(v14 + 93) + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 v16 = (int)&v15[(unsigned int)v6->ptr_2AC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 pDest = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 *(int *)(i + 52) = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 v17 = (size_t)&v6->pFaces[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 i = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 v18 = &pDest[2 * *(char *)(v17 + 93) + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 v19 = (int)&v18[(unsigned int)v6->ptr_2AC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 pDest = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 *(int *)(i + 56) = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 i = (size_t)&v6->pFaces[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 v20 = v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 pDest += 2 * *(char *)(i + 93) + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 *(int *)(i + 60) = (int)(char *)v20 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 i = (size_t)&v6->pFaces[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 v21 = v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 pDest += 2 * *(char *)(i + 93) + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 *(int *)(i + 64) = (int)(char *)v21 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 i = (size_t)&v6->pFaces[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 v22 = v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 pDest += 2 * *(char *)(i + 93) + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 *(int *)(i + 68) = (int)(char *)v22 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 pDest += 2 * *((char *)&v6->pFaces[v13] - 3) + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 while ( Argsa < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 Argsb = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 if ( (signed int)v6->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 fread(Dst, 1u, 0xAu, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 if ( pDest[(unsigned int)v6->pFaces + 45] & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 v23 = pTextureFrameTable->FindTextureByName(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 v24 = pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 *(short *)&pDest[(unsigned int)v6->pFaces + 74] = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 v25 = *(short *)&v24[(unsigned int)v6->pFaces + 74];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 pTextureFrameTable->LoadAnimationSequenceAndPalettes(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 v26 = pBitmaps_LOD->LoadTexture(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 v27 = pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 *(short *)&pDest[(unsigned int)v6->pFaces + 74] = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 v27[(unsigned int)v6->pFaces + 45] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 *(short *)&pDest[(unsigned int)v6->pFaces + 74] = pBitmaps_LOD->LoadTexture(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 ++Argsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 pDest += 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 while ( Argsb < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 fseek(v7, v211, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 fread(&v6->uNumFaceExtras, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 fseek(v7, v212, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 fread(v6->pFaceExtras, 0x24u, v6->uNumFaceExtras, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 Argsc = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 if ( (signed int)v6->uNumFaceExtras > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 fread(Dst, 1u, 0xAu, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 v28 = pBitmaps_LOD->LoadTexture(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 v29 = v6->pFaceExtras;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 v30 = pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 ++Argsc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 pDest += 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 *(unsigned __int16 *)((char *)&v29->uAdditionalBitmapID + (int)v30) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 while ( Argsc < (signed int)v6->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 Argsd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 if ( (signed int)v6->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 v31 = (int)&v6->pFaceExtras[*(short *)&pDest[(unsigned int)v6->pFaces + 72]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 if ( *(short *)(v31 + 26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 if ( ((BLVFaceExtra *)v31)->HasEventint() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 pDest[(unsigned int)v6->pFaces + 46] |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 pDest[(unsigned int)v6->pFaces + 46] &= 0xEFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 ++Argsd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 pDest += 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 while ( Argsd < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 fseek(v7, v213, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 fread(&v6->uNumSectors, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 fseek(v7, v214, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 fread(v6->pSectors, 0x74u, v6->uNumSectors, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 v32 = pAllocator->AllocNamedChunk(v6->ptr_0002B0_sector_rdata, v6->blv.uSector_rdata_Size, "L.RData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 v202 = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 v6->ptr_0002B0_sector_rdata = (unsigned __int16 *)v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 fread(v32, 1u, v6->blv.uSector_rdata_Size, (FILE *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 v11 = v6->uNumSectors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 v12 = v6->uNumSectors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 Argse = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 v6->pSectors[v33].pFloors = (unsigned __int16 *)&pDest[(unsigned int)v6->ptr_0002B0_sector_rdata];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 i = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 v34 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 pDest += 2 * *(short *)(i + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 *(int *)(i + 16) = (int)(char *)v34 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 v35 = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 i = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 v36 = &pDest[2 * *(short *)(v35 + 12)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 v37 = (int)&v36[(unsigned int)v6->ptr_0002B0_sector_rdata];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 pDest = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 *(int *)(i + 24) = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 v38 = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 i = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 v39 = &pDest[2 * *(short *)(v38 + 20)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 v40 = (int)&v39[(unsigned int)v6->ptr_0002B0_sector_rdata];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 pDest = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 *(int *)(i + 32) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 i = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 v41 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 pDest += 2 * *(short *)(i + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 *(int *)(i + 40) = (int)(char *)v41 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 i = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 v42 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 pDest += 2 * *(short *)(i + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 *(int *)(i + 48) = (int)(char *)v42 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 i = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 v43 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 pDest += 2 * *(short *)(i + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 *(int *)(i + 64) = (int)(char *)v43 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 i = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 v44 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 pDest += 2 * *(short *)(i + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 *(int *)(i + 72) = (int)(char *)v44 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 v45 = (size_t)&v6->pSectors[v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 i = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 v46 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 pDest += 2 * *(short *)(v45 + 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 ++Argse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 *(int *)(v45 + 80) = (int)(char *)v46 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 pDest += 2 * *((short *)&v6->pSectors[v33] - 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 while ( Argse < v6->uNumSectors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 v47 = pAllocator->AllocNamedChunk(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 v6->ptr_0002B8_sector_lrdata,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 v6->blv.uSector_lrdata_Size,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 "L.RLData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 v202 = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 v6->ptr_0002B8_sector_lrdata = (unsigned __int16 *)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 fread(v47, 1u, v6->blv.uSector_lrdata_Size, (FILE *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 v11 = v6->uNumSectors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 v12 = v6->uNumSectors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 Argsf = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 v48 = v6->pSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 for ( i = 0; ; v49 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 v50 = v6->ptr_0002B8_sector_lrdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 i += 116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 ++Argsf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 *(BLVLightMM7 **)((char *)&v48->pLights + v49) = (BLVLightMM7 *)((char *)v50 + (int)pDest);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 v48 = v6->pSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 pDest += 2 * *(__int16 *)((char *)&v48->uNumLights + v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 if ( Argsf >= v6->uNumSectors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 fseek(v7, v215, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 fread(&v6->uNumDoors, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 fseek(v7, v216, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 fread(v6->pDoors, 0x50u, 0xC8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 v51 = pAllocator->AllocNamedChunk(v6->ptr_0002B4_doors_ddata, v6->blv.uDoors_ddata_Size, "L.DData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 v202 = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 v6->ptr_0002B4_doors_ddata = (unsigned __int16 *)v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 fread(v51, 1u, v6->blv.uDoors_ddata_Size, (FILE *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 v11 = v6->uNumDoors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 v12 = v6->uNumDoors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 Argsg = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 v6->pDoors[v52].pVertexIDs = (unsigned __int16 *)&pDest[(unsigned int)v6->ptr_0002B4_doors_ddata];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 i = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 v53 = v6->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 pDest += 2 * *(short *)(i + 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 *(int *)(i + 40) = (int)(char *)v53 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 v54 = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 i = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 v55 = &pDest[2 * *(short *)(v54 + 70)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 v56 = (int)&v55[(unsigned int)v6->ptr_0002B4_doors_ddata];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 pDest = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 *(int *)(i + 44) = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 v57 = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 i = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 v58 = &pDest[2 * *(short *)(v57 + 72)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 v59 = (int)&v58[(unsigned int)v6->ptr_0002B4_doors_ddata];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 pDest = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 *(int *)(i + 48) = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 i = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 v60 = v6->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 pDest += 2 * *(short *)(i + 70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 *(int *)(i + 52) = (int)(char *)v60 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 i = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 v61 = v6->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 pDest += 2 * *(short *)(i + 70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 *(int *)(i + 56) = (int)(char *)v61 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 i = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 v62 = v6->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 pDest += 2 * *(short *)(i + 74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 *(int *)(i + 60) = (int)(char *)v62 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 i = (size_t)&v6->pDoors[v52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 v63 = v6->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 pDest += 2 * *(short *)(i + 74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 *(int *)(i + 64) = (int)(char *)v63 + (int)pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 ++Argsg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 v64 = v6->pDoors[v52].uNumOffsets;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 pDest += 2 * v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 while ( Argsg < v6->uNumDoors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 Argsh = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 if ( v6->uNumDoors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 v65 = v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v66 = &pDest[(int)v65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 if ( *(short *)&pDest[(int)v65 + 70] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 v67 = *((int *)v66 + 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 a3 = 2 * i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 v68 = *(short *)(v67 + 2 * i);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 v69 = v6->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 v70 = (int)&v6->pFaceExtras[v69[v68].uFaceExtraID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 v71 = *((int *)v66 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 v72 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 v238 = (char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 *(short *)(a3 + v71) = *(short *)(v70 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 *(__int16 *)(*(char **)((char *)&v6->pDoors->pDeltaVs + (unsigned int)pDest) + v72) = *((short *)v238 + 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 v65 = v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 v66 = &pDest[(int)v65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 while ( (signed int)i < *(short *)&pDest[(int)v65 + 70] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 ++Argsh;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 pDest += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 while ( Argsh < v6->uNumDoors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 fseek(v7, v217, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 fread(&uNumLevelDecorations, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 fseek(v7, v218, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 fread(pLevelDecorations, 0x20u, uNumLevelDecorations, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 Argsi = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 pDest = (char *)pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 fread(pName, 1u, 0x20u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 v73 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 v74 = pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 ++Argsi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 pDest += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 *(short *)v74 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 while ( Argsi < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 fseek(v7, v219, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 fread(&uNumLayingItems, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 fseek(v7, v220, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 fread(pLayingItems, 0x70u, uNumLayingItems, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v75 = pLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 pDest = (char *)uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 Argsj = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2492 v76 = 48 * v75->stru_24.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2493 v11 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 v12 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 LOWORD(v76) = *(unsigned __int16 *)((char *)&pItemsTable->pItems[0].uSpriteID + v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 i = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 v75->uItemType = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 if ( v12 | v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 for ( j = (int)&pObjectList->pObjects->uObjectID; (short)v76 != *(short *)j; j = a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 ++Argsj;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 a3 = j + 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 if ( Argsj >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 LOWORD(v76) = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 v78 = Argsj;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 v75->uObjectDescID = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 --pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 while ( pDest );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 fseek(v7, v221, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 fread(&uNumActors, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 fseek(v7, v222, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 fread(pActors, 0x344u, uNumActors, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 fseek(v7, v228, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 fread(&uNumChests, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 fseek(v7, v229, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 fread(pChests, 0x14CCu, uNumChests, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 fseek(v7, v224, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 fread(&v6->uNumLights, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 fseek(v7, v225, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 fread(v6->pLights, 0x10u, v6->uNumLights, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 fseek(v7, v226, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 fread(&v6->uNumNodes, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 fseek(v7, v227, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 fread(v6->pNodes, 8u, v6->uNumNodes, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 fseek(v7, v230, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 fread(&v6->uNumSpawnPoints, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 v79 = pAllocator->AllocNamedChunk(v6->pSpawnPoints, 24 * v6->uNumSpawnPoints, "Spawn");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 v202 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 v6->pSpawnPoints = (SpawnPointMM7 *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 fseek(v7, v231, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 fread(v6->pSpawnPoints, 0x18u, v6->uNumSpawnPoints, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 fseek(v7, v232, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 fread(&v6->dlv, 0x28u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 fseek(v7, v233, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 fread(&stru_5E4C90, 1u, 0xC8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 fseek(v7, v234, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 fread(&v6->uLastVisitDay, 1u, 0x38u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 fseek(v7, v223, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 v80 = (void **)&v6->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 fread(*v80, 4u, 1u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 fread((char *)*v80 + 4, 0xCu, *(int *)*v80, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 fclose(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 goto LABEL_179;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 return 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 if ( !pGames_LOD->DoesContainerExist(pFilename) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 Abortf("Unable to find %s in Games.LOD", pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 v238 = pFilename - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 v81 = strlen(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 strcpy(&v238[v81], ".blv");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 v82 = pGames_LOD->FindContainer(pFilename, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 v11 = v6->bLoaded == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 File = v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 return 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 if ( !Alloc() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 return 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 header.pMagic[0] = 'm';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 header.uVersion = 91969;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 header.pMagic[1] = 'v';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 header.pMagic[2] = 'i';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 header.pMagic[3] = 'i';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 header.uCompressedSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 header.uDecompressedSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 fread(&header, 0x10u, 1u, File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 if ( header.uVersion != 91969
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 || header.pMagic[0] != 'm'
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 || header.pMagic[1] != 'v'
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 || header.pMagic[2] != 'i'
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 || header.pMagic[3] != 'i' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:792", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 v83 = header.uCompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 pSource = header.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 v84 = malloc(header.uDecompressedSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 v85 = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 ptr = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 if ( v83 <= pSource )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 if ( v83 == pSource )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 fread(v84, pSource, 1u, File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 *(int *)((char *)&uSourceLen + 1) = (int)malloc(v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 fread(*(void **)((char *)&uSourceLen + 1), v83, 1u, File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 zlib::MemUnzip(v85, &pSource, *(const void **)((char *)&uSourceLen + 1), v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 free(*(void **)((char *)&uSourceLen + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:803", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 strcpy(v6->pFilename, pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 v200 = 136;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 v199 = (size_t)v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 v198 = &v6->blv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 v6->bLoaded = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 memcpy(v198, (const void *)v199, v200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 v86 = (char *)v85 + 136;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 memcpy(&v6->uNumVertices, v86, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 v86 = (char *)v86 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 v202 = 6 * v6->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 v201 = (const char *)v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 v200 = (size_t)v6->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 v245 = v202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 memcpy((void *)v200, v86, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 v87 = (char *)v86 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 memcpy(&v6->uNumFaces, v87, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 v87 = (char *)v87 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 v202 = 96 * v6->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 v201 = (const char *)v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 v200 = (size_t)v6->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 v245 = v202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 memcpy((void *)v200, v87, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v88 = (char *)v87 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v202 = (int)"L.FData";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 v201 = (const char *)v6->blv.uFaces_fdata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 v200 = (size_t)v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v89 = pAllocator->AllocNamedChunk((const void *)v200, (unsigned int)v201, "L.FData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 v90 = v6->blv.uFaces_fdata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v6->ptr_2AC = (unsigned __int16 *)v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 v245 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 memcpy(v89, v88, v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 v91 = (char *)v88 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 v11 = v6->uNumFaces == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 v12 = (v6->uNumFaces & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 v244 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 v6->pFaces[v92].pVertexIDs = (unsigned __int16 *)((char *)v244 + (unsigned int)v6->ptr_2AC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 v93 = &v6->pFaces[v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 Src = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 v94 = (BLVSector *)((char *)v244 + 2 * v93->uNumVertices + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 v95 = (unsigned __int16 *)((char *)v94 + (unsigned int)v6->ptr_2AC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 v244 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 Src->pXInterceptDisplacements = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 v96 = (int)&v6->pFaces[v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 Src = (BLVFace *)v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 v97 = (BLVSector *)((char *)v244 + 2 * *(char *)(v96 + 93) + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 v98 = (unsigned __int16 *)((char *)v97 + (unsigned int)v6->ptr_2AC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 v244 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 Src->pYInterceptDisplacements = v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 Src = &v6->pFaces[v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 v99 = v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 v244 = (BLVSector *)((char *)v244 + 2 * Src->uNumVertices + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 Src->pZInterceptDisplacements = (unsigned __int16 *)((char *)v99 + (int)v244);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 Src = &v6->pFaces[v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 v100 = v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v244 = (BLVSector *)((char *)v244 + 2 * Src->uNumVertices + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 Src->pVertexUIDs = (unsigned __int16 *)((char *)v100 + (int)v244);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 Src = &v6->pFaces[v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 ++v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 v101 = v6->ptr_2AC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 v244 = (BLVSector *)((char *)v244 + 2 * Src->uNumVertices + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 Src->pVertexVIDs = (unsigned __int16 *)((char *)v101 + (int)v244);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 v244 = (BLVSector *)((char *)v244 + 2 * *((char *)&v6->pFaces[v92] - 3) + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 while ( v245 < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 v11 = v6->uNumFaces == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 v12 = (v6->uNumFaces & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 v244 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 memcpy(Dst, v91, 0xAu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 v91 = (char *)v91 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 if ( *((char *)&v244->field_2C + (unsigned int)v6->pFaces + 1) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 v102 = pTextureFrameTable->FindTextureByName(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 v103 = v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 *(short *)((char *)&v244->pDecorationIDs + (unsigned int)v6->pFaces + 2) = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 v104 = *(short *)((char *)&v103->pDecorationIDs + (unsigned int)v6->pFaces + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 if ( v104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 pTextureFrameTable->LoadAnimationSequenceAndPalettes(v104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 v105 = pBitmaps_LOD->LoadTexture(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v106 = v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 *(short *)((char *)&v244->pDecorationIDs + (unsigned int)v6->pFaces + 2) = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 *((char *)&v106->field_2C + (unsigned int)v6->pFaces + 1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 *(short *)((char *)&v244->pDecorationIDs + (unsigned int)v6->pFaces + 2) = pBitmaps_LOD->LoadTexture(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 v244 = (BLVSector *)((char *)v244 + 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 while ( v245 < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 memcpy(&v6->uNumFaceExtras, v91, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 v107 = (char *)v91 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 v202 = 36 * v6->uNumFaceExtras;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 v201 = (const char *)v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 v200 = (size_t)v6->pFaceExtras;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 v245 = v202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 memcpy((void *)v200, v107, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 v108 = (char *)v107 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 if ( (signed int)v6->uNumFaceExtras > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 *(int *)((char *)&uSourceLen + 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 memcpy(Dst, v108, 0xAu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 v108 = (char *)v108 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 if ( !_strcmpi(Dst, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 *(unsigned __int16 *)((char *)&v6->pFaceExtras->uAdditionalBitmapID + *(int *)((char *)&uSourceLen + 1)) = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 v109 = pBitmaps_LOD->LoadTexture(Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 v110 = v6->pFaceExtras;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 v111 = *(int *)((char *)&uSourceLen + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 *(int *)((char *)&uSourceLen + 1) += 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 *(unsigned __int16 *)((char *)&v110->uAdditionalBitmapID + v111) = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 while ( v245 < (signed int)v6->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 v11 = v6->uNumFaces == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 v12 = (v6->uNumFaces & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 v244 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 v112 = &v6->pFaceExtras[*(short *)((char *)&v244->pDecorationIDs + (unsigned int)v6->pFaces)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 if ( v112->uEventID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 if ( v112->HasEventint() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 *((char *)&v244->uNumNonBSPFaces + (unsigned int)v6->pFaces) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 *((char *)&v244->uNumNonBSPFaces + (unsigned int)v6->pFaces) &= 0xEFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 v244 = (BLVSector *)((char *)v244 + 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 while ( v245 < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 memcpy(&v6->uNumSectors, v108, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 v113 = (char *)v108 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 v202 = 116 * v6->uNumSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 v201 = (const char *)v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 v200 = (size_t)v6->pSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 v245 = v202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 memcpy((void *)v200, v113, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 v114 = (char *)v113 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 v202 = (int)"L.RData";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 v201 = (const char *)v6->blv.uSector_rdata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 v200 = (size_t)v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 v115 = pAllocator->AllocNamedChunk((const void *)v200, (unsigned int)v201, "L.RData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 v116 = v6->blv.uSector_rdata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 v6->ptr_0002B0_sector_rdata = (unsigned __int16 *)v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 v245 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 memcpy(v115, v114, v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2794 v117 = (char *)v114 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 v118 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 v11 = v6->uNumSectors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 v12 = v6->uNumSectors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 Src = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 v6->pSectors[v118].pFloors = (unsigned __int16 *)((char *)Src + (unsigned int)v6->ptr_0002B0_sector_rdata);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 v244 = &v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 v119 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 Src = (BLVFace *)((char *)Src + 2 * v244->field_4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 v244->pWalls = (unsigned __int16 *)((char *)v119 + (int)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 v120 = (int)&v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 v244 = (BLVSector *)v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 v121 = (BLVFace *)((char *)Src + 2 * *(short *)(v120 + 12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 v122 = (unsigned __int16 *)((char *)v121 + (unsigned int)v6->ptr_0002B0_sector_rdata);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 Src = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 v244->pCeilings = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 v123 = (int)&v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 v244 = (BLVSector *)v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 v124 = (BLVFace *)((char *)Src + 2 * *(short *)(v123 + 20));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 v125 = (unsigned __int16 *)((char *)v124 + (unsigned int)v6->ptr_0002B0_sector_rdata);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 Src = v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 v244->pFluids = v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 v244 = &v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 v126 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 Src = (BLVFace *)((char *)Src + 2 * v244->field_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 v244->pPortals = (unsigned __int16 *)((char *)v126 + (int)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 v244 = &v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 v127 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 Src = (BLVFace *)((char *)Src + 2 * v244->uNumPortals);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 v244->pFaceIDs = (unsigned __int16 *)((char *)v127 + (int)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 v244 = &v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 v128 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 Src = (BLVFace *)((char *)Src + 2 * v244->field_2C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v244->pCogs = (unsigned __int16 *)((char *)v128 + (int)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v244 = &v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v129 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 Src = (BLVFace *)((char *)Src + 2 * v244->field_3C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 v244->pDecorationIDs = (unsigned __int16 *)((char *)v129 + (int)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v130 = (int)&v6->pSectors[v118];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 ++v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 v244 = (BLVSector *)v130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 v131 = v6->ptr_0002B0_sector_rdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 Src = (BLVFace *)((char *)Src + 2 * *(short *)(v130 + 68));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 *(int *)(v130 + 80) = (int)(char *)v131 + (int)Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 Src = (BLVFace *)((char *)Src + 2 * *((short *)&v6->pSectors[v118] - 20));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 while ( v245 < v6->uNumSectors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 v202 = (int)"L.RLData";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 v201 = (const char *)v6->blv.uSector_lrdata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 v200 = (size_t)v6->ptr_0002B8_sector_lrdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 v132 = pAllocator->AllocNamedChunk((const void *)v200, (unsigned int)v201, "L.RLData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 v133 = v6->blv.uSector_lrdata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 v6->ptr_0002B8_sector_lrdata = (unsigned __int16 *)v132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 v245 = v133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 memcpy(v132, v117, v133);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 v134 = (char *)v117 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 v11 = v6->uNumSectors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 v12 = v6->uNumSectors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 Src = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 v135 = v6->pSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 v136 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 for ( File = 0; ; v136 = File )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 v137 = v6->ptr_0002B8_sector_lrdata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 File = (FILE *)((char *)File + 116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 *(int *)((char *)&v136[2]._bufsiz + (int)v135) = (int)((char *)v137 + (int)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v135 = v6->pSectors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 Src = (BLVFace *)((char *)Src + 2 * *(short *)((char *)&v136[2]._charbuf + (int)v135));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 if ( v245 >= v6->uNumSectors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 memcpy(&v6->uNumDoors, v134, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 v138 = (char *)v134 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 memcpy(&uNumLevelDecorations, v138, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 v138 = (char *)v138 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 v245 = 32 * uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 memcpy(pLevelDecorations, v138, 32 * uNumLevelDecorations);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 v139 = (char *)v138 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 File = (FILE *)pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 memcpy(pName, v139, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 v139 = (char *)v139 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v140 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 v141 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 ++File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 LOWORD(v141->_ptr) = v140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 while ( v245 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 memcpy(&v6->uNumLights, v139, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 v142 = (char *)v139 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 v202 = 16 * v6->uNumLights;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 v201 = (const char *)v142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 v200 = (size_t)v6->pLights;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 v245 = v202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 memcpy((void *)v200, v142, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 v143 = (char *)v142 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 memcpy(&v6->uNumNodes, v143, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 v143 = (char *)v143 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 v202 = 8 * v6->uNumNodes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 v201 = (const char *)v143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 v200 = (size_t)v6->pNodes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 v245 = v202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 memcpy((void *)v200, v143, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 v144 = (char *)v143 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 memcpy(&v6->uNumSpawnPoints, v144, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 v144 = (char *)v144 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 v145 = v6->uNumSpawnPoints;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 v202 = (int)"Spawn";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v201 = (const char *)(24 * v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 v200 = (size_t)v6->pSpawnPoints;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 v146 = pAllocator->AllocNamedChunk((const void *)v200, 24 * v145, "Spawn");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 v147 = v6->uNumSpawnPoints;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 v6->pSpawnPoints = (SpawnPointMM7 *)v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 v245 = 24 * v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 memcpy(v146, v144, 24 * v147);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 v148 = (int)((char *)v144 + v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 v202 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 v201 = (const char *)v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 v200 = (size_t)v6->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 memcpy((void *)v200, (const void *)v148, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 v149 = v6->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 v199 = 12 * *v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 memcpy(v149 + 1, (const void *)(v148 + 4), v199);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 free(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 v202 = (int)".dlv";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 v150 = strlen(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 strcpy(&v238[v150], (const char *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 v245 = (int)pNew_LOD->FindContainer(pFilename, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 fread(&header, 0x10u, 1u, (FILE *)v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 v244 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 if ( header.uVersion != 91969
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 || header.pMagic[0] != 'm'
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 || header.pMagic[1] != 'v'
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 || header.pMagic[2] != 'i'
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 || header.pMagic[3] != 'i' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:1090", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 v244 = (BLVSector *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 v151 = header.uCompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 Count = header.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 Src = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 File = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 if ( !v244 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 Src = (BLVFace *)malloc(header.uDecompressedSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 File = (FILE *)Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 if ( v151 <= Count )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 if ( v151 == Count )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 fread(Src, 1u, Count, (FILE *)v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 *(int *)((char *)&uSourceLen + 1) = (int)malloc(v151);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 fread(*(void **)((char *)&uSourceLen + 1), v151, 1u, (FILE *)v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 zlib::MemUnzip(Src, &Count, *(const void **)((char *)&uSourceLen + 1), v151);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 free(*(void **)((char *)&uSourceLen + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:1108", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 memcpy(&v6->dlv, Src, 0x28u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 Src = (BLVFace *)((char *)Src + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 v152 = v6->dlv.uNumFacesInBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 if ( v152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 v153 = v6->dlv.uNumDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 if ( v153 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 if ( v152 != pIndoor->uNumFaces || v153 != uNumLevelDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 v244 = (BLVSector *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 if ( BYTE1(dword_6BE364_game_settings_1) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 i = 29030400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 *(int *)((char *)&uSourceLen + 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 if ( a3 - v6->dlv.uLastRepawnDay >= i && _strcmpi(pCurrentMapName, "d29.dlv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 *(int *)((char *)&uSourceLen + 1) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 v154 = 875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 if ( v244 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 memset(v203, 0, 0x36Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 goto LABEL_132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 if ( *(int *)((char *)&uSourceLen + 1) || !v6->dlv.uLastRepawnDay )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 memcpy(v203, Src, 0x36Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 LABEL_132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 free(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 v11 = v244 == (BLVSector *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 v6->dlv.uLastRepawnDay = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 ++v6->dlv.uNumRespawns;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 v202 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 v201 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 *(int *)pDest = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 v245 = (int)pGames_LOD->FindContainer(v201, v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 fread(&header, 0x10u, 1u, (FILE *)v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 v155 = header.uCompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 Count = header.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 Src = (BLVFace *)malloc(header.uDecompressedSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 File = (FILE *)Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 if ( v155 <= Count )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 if ( v155 == Count )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 fread(Src, 1u, Count, (FILE *)v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 *(int *)((char *)&uSourceLen + 1) = (int)malloc(v155);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 fread(*(void **)((char *)&uSourceLen + 1), v155, 1u, (FILE *)v245);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 zlib::MemUnzip(Src, &Count, *(const void **)((char *)&uSourceLen + 1), v155);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 free(*(void **)((char *)&uSourceLen + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:1195", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 Src = (BLVFace *)((char *)Src + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 v154 = 875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 *(int *)pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 v202 = (int)".blv";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 v156 = strlen(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 strcpy(&v238[v156], (const char *)v202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 memcpy(v6->_visible_outlines, Src, v154);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 Src = (BLVFace *)((char *)Src + v154);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 if ( *(int *)pDest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 memcpy(v6->_visible_outlines, v203, v154);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 v157 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 if ( (signed int)*pIndoor->pMapVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 Argsk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 if ( (unsigned __int8)(1 << (7 - v157 % 8)) & v6->_visible_outlines[v157 / 8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 BYTE2(v6->pMapVertices[Argsk + 3]) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 Argsk += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 ++v157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 while ( v157 < (signed int)*pIndoor->pMapVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 if ( (signed int)v6->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 v158 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 v200 = (size_t)&v6->pFaces[v158].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 memcpy((void *)v200, Src, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 v159 = v6->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 v160 = v6->pFaceExtras;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 Src = (BLVFace *)((char *)Src + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 v161 = &v160[v159[v158].uFaceExtraID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 if ( v161->uEventID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 if ( v161->HasEventint() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 BYTE2(v6->pFaces[v158].uAttributes) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 BYTE2(v6->pFaces[v158].uAttributes) &= 0xEFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 ++v158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 while ( v245 < (signed int)v6->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 v162 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 Argsl = &pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 memcpy(Argsl, Src, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 Src = (BLVFace *)((char *)Src + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 Argsl = (char *)Argsl + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 ++v162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 while ( v162 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 memcpy(&uNumActors, Src, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 Src = (BLVFace *)((char *)Src + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 v163 = 836 * uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 memcpy(pActors, Src, 836 * uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 Src = (BLVFace *)((char *)Src + v163);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 memcpy(&uNumLayingItems, Src, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 Src = (BLVFace *)((char *)Src + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 v164 = 112 * uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 memcpy(pLayingItems, Src, 112 * uNumLayingItems);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 Src = (BLVFace *)((char *)Src + v164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 v165 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 v166 = (char *)&pLayingItems[0].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 i = uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 if ( *(int *)v166 && !(*(v166 - 9) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 Argsm = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 v167 = pItemsTable->pItems[*(int *)v166].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 *((short *)v166 - 18) = v167;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 if ( (signed int)v165 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 LABEL_165:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 v168 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 pDest = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 while ( v167 != *(short *)pDest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 ++Argsm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 pDest += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 if ( Argsm >= (signed int)v165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 v168 = Argsm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 *((short *)v166 - 17) = v168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 v166 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 --i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 while ( i );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 memcpy(&uNumChests, Src, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 Src = (BLVFace *)((char *)Src + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 v169 = 5324 * uNumChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 memcpy(pChests, Src, 5324 * uNumChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 Src = (BLVFace *)((char *)Src + v169);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 v202 = 16000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 v201 = (const char *)Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 v200 = (size_t)v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 memcpy((void *)v200, Src, 0x3E80u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 Src = (BLVFace *)((char *)Src + 16000);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 v202 = (int)"L.DData";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 v201 = (const char *)v6->blv.uDoors_ddata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 v200 = (size_t)v6->ptr_0002B4_doors_ddata;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 v170 = pAllocator->AllocNamedChunk((const void *)v200, (unsigned int)v201, "L.DData");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 v171 = v6->blv.uDoors_ddata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 v6->ptr_0002B4_doors_ddata = (unsigned __int16 *)v170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 memcpy(v170, Src, v171);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 Src = (BLVFace *)((char *)Src + v171);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 v172 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 v11 = v6->uNumDoors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 v12 = v6->uNumDoors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 v173 = v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 for ( k = 0; ; v172 = v188 + 2 * *((short *)&v173[k] - 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 v173[k].pVertexIDs = (unsigned __int16 *)((char *)v6->ptr_0002B4_doors_ddata + v172);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 v175 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 v176 = v172 + 2 * v175->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 v175->pFaceIDs = (unsigned __int16 *)((char *)v6->ptr_0002B4_doors_ddata + v176);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 v177 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 v178 = v176 + 2 * v177->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 v177->pSectorIDs = (unsigned __int16 *)((char *)v6->ptr_0002B4_doors_ddata + v178);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 v179 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 v180 = v178 + 2 * v179->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 v179->pDeltaUs = (__int16 *)((char *)v6->ptr_0002B4_doors_ddata + v180);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 v181 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 v182 = v180 + 2 * v181->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 v181->pDeltaVs = (__int16 *)((char *)v6->ptr_0002B4_doors_ddata + v182);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 v183 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 v184 = v182 + 2 * v183->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 v183->pXOffsets = (unsigned __int16 *)((char *)v6->ptr_0002B4_doors_ddata + v184);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 v185 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 v186 = v184 + 2 * v185->uNumOffsets;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 v185->pYOffsets = (unsigned __int16 *)((char *)v6->ptr_0002B4_doors_ddata + v186);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 v187 = &v6->pDoors[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 ++k;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 v188 = v186 + 2 * v187->uNumOffsets;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 v189 = (unsigned __int16 *)((char *)v6->ptr_0002B4_doors_ddata + v188);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 v187->pZOffsets = v189;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 v173 = v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 if ( v245 >= v6->uNumDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 v190 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 v11 = v6->uNumDoors == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 v12 = v6->uNumDoors < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 v245 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 if ( !(v12 | v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 v191 = v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 Argsn = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 for ( l = (BLVDoor *)&v190[(int)v191];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 Argsn < *(short *)&v190[(int)v191 + 70];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 l = (BLVDoor *)&v190[(int)v191] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 v193 = Argsn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 v194 = l->pFaceIDs[Argsn++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 v195 = &v6->pFaceExtras[v6->pFaces[v194].uFaceExtraID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 l->pDeltaUs[v193] = v195->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 v190 = pDest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 *(short *)(v193 * 2 + *(int *)&pDest[(unsigned int)v6->pDoors + 52]) = v195->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 v191 = v6->pDoors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 ++v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 v190 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 pDest = v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 while ( v245 < v6->uNumDoors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 v196 = Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 memcpy(&stru_5E4C90, Src, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 memcpy(&v6->uLastVisitDay, &v196[2].pFacePlane.vNormal.z, 0x38u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 free(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 LABEL_179:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 pSoundList->_4A9A67(64, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 pSoundList->_4A9A67(103, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 pSoundList->_4A9A67(63, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 pSoundList->_4A9A67(102, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 pSoundList->_4A9A67(50, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 pSoundList->_4A9A67(89, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 // 6807E0: using guessed type int _6807E0_num_decorations_6807B8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 //----- (0049AC17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 int IndoorLocation::GetSector(int sX, int sY, int sZ)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 unsigned __int8 v5; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 unsigned __int8 v6; // sf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 unsigned __int8 v7; // of@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 BLVSector *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 int v9; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 int v11; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 int v12; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 unsigned __int16 v13; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 int v14; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 BLVFace *v15; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 BLVFace *v16; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 PolygonType v17; // al@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 unsigned __int16 *pVertexIDs; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 Vec3_short_ *v19; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 int v20; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 unsigned __int16 *v21; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 int v22; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 int v23; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 Vec3_short_ *v24; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 signed int v25; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 int v26; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 int v27; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 signed __int64 v28; // qtt@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 Vec3_short_ *v29; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 Vec3_short_ *v30; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 int v31; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 signed int v32; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 signed __int64 v33; // qtt@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 Vec3_short_ *v34; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 int v35; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 int v37; // edi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 int v38; // ebx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 int v39; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 BLVFace *v40; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 PolygonType v41; // dl@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 int v42; // edx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 int v43[50]; // [sp+Ch] [bp-108h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 int v44; // [sp+D4h] [bp-40h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 int v45; // [sp+D8h] [bp-3Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 int v46; // [sp+DCh] [bp-38h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 int v47; // [sp+E0h] [bp-34h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 int v48; // [sp+E4h] [bp-30h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 Vec3_short_ *v49; // [sp+E8h] [bp-2Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 bool v50; // [sp+ECh] [bp-28h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 int v51; // [sp+F0h] [bp-24h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 unsigned int v52; // [sp+F4h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 int v53; // [sp+F8h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 int v54; // [sp+FCh] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 int v55; // [sp+100h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 int v56; // [sp+104h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 int v57; // [sp+108h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 Vec3_short_ *v58; // [sp+10Ch] [bp-8h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 int v59; // [sp+110h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 v7 = __OFSUB__(this->uNumSectors, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 v5 = this->uNumSectors == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 v6 = this->uNumSectors - 1 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 v43[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 v56 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 if ( (unsigned __int8)(v6 ^ v7) | v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 v52 = 116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 v8 = &this->pSectors[v52 / 0x74];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 if ( v8->pBounding.x1 <= sX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 if ( v8->pBounding.x2 >= sX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 if ( v8->pBounding.y1 <= sY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 if ( v8->pBounding.y2 >= sY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 if ( v8->pBounding.z1 - 64 <= sZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 if ( v8->pBounding.z2 + 64 >= sZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 v9 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 v10 = v9 + v8->uNumPortals;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v44 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 v51 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 if ( v10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 v12 = -2 * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 v53 = -2 * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 if ( v11 < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 v13 = this->pSectors[v52 / 0x74].pFloors[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 v13 = *(unsigned __int16 *)((char *)this->pSectors[v52 / 0x74].pPortals + v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v14 = (signed __int16)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 v15 = this->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v46 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 v14 *= 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 v45 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v16 = (BLVFace *)((char *)v15 + v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v17 = v16->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 if ( v17 == 3 || v17 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 pVertexIDs = v16->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v19 = this->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v20 = v19[*pVertexIDs].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 v5 = v16->uNumVertices == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v59 = v20 >= sY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v21 = pVertexIDs + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 if ( v54 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 v49 = &v19[*v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 v22 = v49->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v47 = v49->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 v50 = v22 >= sY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 if ( v59 ^ v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 v58 = &v19[*(v21 - 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v23 = v58->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 HIWORD(v24) = HIWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 LOWORD(v24) = v49->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 v49 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 v59 = (signed __int16)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 v25 = (signed __int16)v24 >= sX ? 0 : 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 v26 = v25 | v23 < sX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 if ( v26 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 if ( !v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 || (v58->x >= (signed __int16)v49 ? (v32 = v23 - v59,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 v58 = (Vec3_short_ *)(v58->y - v47),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 LODWORD(v33) = v32 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 HIDWORD(v33) = v32 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 v59 = v33 / (signed int)v58,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 v34 = this->pVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 v58 = (Vec3_short_ *)(v33 / (signed int)v58),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 v59 = sY - v34[*v21].y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 v59 = (unsigned __int64)((signed int)v58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 * (signed __int64)v59) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 v31 = *v21) : (v27 = v58->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 v59 -= v23,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 v58 = (Vec3_short_ *)(v47 - v27),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 LODWORD(v28) = v59 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 HIDWORD(v28) = v59 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 v59 = v28 / (v47 - v27),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 v29 = (Vec3_short_ *)(v28 / (v47 - v27)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 v30 = this->pVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 v58 = v29,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 v59 = sY - v30[*(v21 - 1)].y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 v59 = (unsigned __int64)((signed int)v29 * (signed __int64)v59) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 v31 = *(v21 - 1)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 v19 = this->pVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 v59 + v19[v31].x > sX) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 ++v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 v59 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 while ( v57 < *(&this->pFaces->uNumVertices + v45) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 if ( v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 v35 = v55++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 v43[v35] = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 v11 = v48 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 v12 = v53 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 v7 = __OFSUB__(v48 + 1, v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 v6 = v48++ + 1 - v51 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 v53 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 while ( v6 ^ v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 v4 = v43[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 v52 += 116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 while ( v56 < this->uNumSectors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 if ( v55 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 return this->pFaces[v4].uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 if ( !v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 v53 = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 if ( v55 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 v39 = sY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 v40 = &this->pFaces[v43[v37]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 v41 = v40->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 if ( v41 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 if ( v41 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 v51 = v40->zCalc1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 v57 = (unsigned __int64)(v51 * (signed __int64)(sX << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 v56 = sY << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v51 = v40->zCalc2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 v56 = (unsigned __int64)(v51 * (signed __int64)(sY << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 v42 = (v56 + v40->zCalc3 + v57 + 32768) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 LABEL_47:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 if ( v39 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 if ( v39 < v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 v38 = v40->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 v53 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 if ( v37 >= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 return v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 v42 = this->pVertices[*v40->pVertexIDs].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 v39 = sZ - v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 return v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 // 49AC17: using guessed type int var_108[50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 //----- (00498A41) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 char BLVFace::_get_normals(Vec3_int_ *a2, Vec3_int_ *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 BLVFace *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 signed __int64 v5; // qax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 double v6; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 Vec3_float_ a1; // [sp+Ch] [bp-Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 LOBYTE(v4) = this->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 if ( (char)v4 == POLYGON_VerticalWall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 a2->x = -this->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 LODWORD(v5) = this->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 a2->y = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 a2->z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 a3->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 a3->z = 0xFFFF0000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 a3->x = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 if ( (char)v4 == POLYGON_Floor || (char)v4 == POLYGON_Ceiling )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 a2->x = 0x10000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 a2->z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 a2->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 a3->y = 0xFFFF0000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 a3->z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 if ( (char)v4 == POLYGON_InBetweenFloorAndWall || (char)v4 == POLYGON_InBetweenCeilingAndWall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 if ( abs(this->pFacePlane_old.vNormal.z) < 46441 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 a1.x = (double)-v3->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 a1.y = (double)v3->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 a1.z = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 a1.Normalize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 v6 = a1.y * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 a2->x = (signed __int64)(a1.x * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 v5 = (signed __int64)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 if ( BYTE2(v3->uAttributes) & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 a2->x = -a2->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 a2->y = -a2->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 a2->z = -a2->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 if ( BYTE3(v3->uAttributes) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 a3->x = -a3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 a3->y = -a3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 a3->z = -a3->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 //----- (0044C23B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 int BLVFaceExtra::HasEventint()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 Event *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 signed int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 signed int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 if ( (signed int)(uLevelEVT_NumEvents - 1) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 v2 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 while ( v2->uEventID != this->uEventID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 if ( v1 >= (signed int)(uLevelEVT_NumEvents - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 if ( pLevelEVT[pLevelEVT_Events[v4 + 1].uEventOffsetInEVT + 4] != 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 || pLevelEVT[pLevelEVT_Events[v4].uEventOffsetInEVT + 4] != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 }