annotate IndoorCameraD3D.cpp @ 1:ac0fb48cd27a

Texture, hwl loading, video player
author Nomad
date Tue, 09 Oct 2012 13:09:08 +0200
parents 8b8875f5b359
children 2ca04ccb612a
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "IndoorCameraD3D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "VectorTypes.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "Indoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "OutdoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "Render.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 //----- (004364C5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 void IndoorCameraD3D::_4364C5(RenderVertexSoft *pVertices, unsigned int uNumVertices, RenderVertexSoft *a1, stru320 *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 unsigned int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 char *v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 char *v7; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 v5 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 v6 = (char *)&a1->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 v7 = (char *)&pVertices->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 *((int *)v6 - 2) = *((int *)v7 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 *((int *)v6 - 1) = *((int *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 *(int *)v6 = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 *((float *)v6 - 5) = (double)a5->pDeltaUV[0] + *((float *)v7 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 *((float *)v6 - 4) = (double)a5->pDeltaUV[1] + *((float *)v7 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 ViewTransform(a1, uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 //----- (0043669D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 char IndoorCameraD3D::ApplyViewTransform_TrueIfStillVisible(int x, int y, int z, signed int *pOutX, int *pOutZ, int *pOutY, char bDoNotShow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 int to_z; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 int v9; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 signed int *v10; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 int pOutY_; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 signed int v12; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 int v14; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 int to_x; // [sp+14h] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 int to_y; // [sp+18h] [bp+Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 int a2b; // [sp+18h] [bp+Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 int a3a; // [sp+1Ch] [bp+10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 to_x = (x - pBLVRenderParams->vPartyPos.x) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 to_y = (y - pBLVRenderParams->vPartyPos.y) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 to_z = (z - pBLVRenderParams->vPartyPos.z) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 v14 = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 + ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 v9 = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 - ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 v14 = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 - ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 v9 = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 + ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 a3a = (z - pBLVRenderParams->vPartyPos.z) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 a2b = (unsigned __int64)(to_z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 v10 = pOutX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 *pOutX = ((unsigned __int64)(v14 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 *pOutZ = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 pOutY_ = ((unsigned __int64)(v14 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 + ((unsigned __int64)(a3a * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 pOutY_ = (z - pBLVRenderParams->vPartyPos.z) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 v10 = pOutX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 *pOutX = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 + ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 *pOutZ = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 - ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 v10 = pOutX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 *pOutX = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 - ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 *pOutZ = ((unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 + ((unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 *pOutY = pOutY_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 return !bDoNotShow || (v12 = *v10, v12 >= (signed int)0x40000u) && v12 <= (signed int)0x1F400000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 //----- (00436455) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 bool IndoorCameraD3D::IsFaceFacedTowardsCamera(BLVFace *pFace)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 IndoorCameraD3D *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 RenderVertexSoft v; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 Vec3_short__to_RenderVertexSoft(&v, &pIndoor->pVertices[*pFace->pVertexIDs]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 LOBYTE(result) = is_vertex_with_normal_from_face_towards_camera(pFace, &v);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 //----- (00436523) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 void IndoorCameraD3D::ViewTransform(RenderVertexSoft *a1a, unsigned int uNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 unsigned int v3; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 unsigned int v4; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 float v7; // [sp+4h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 if ( byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 fld pIndoorCamera->fRotationYCosine
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 fld pIndoorCamera->fRotationYSine
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 fld pIndoorCamera->fRotationXCosine
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 v4 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 v7 = pIndoorCamera->fRotationXSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 _EAX = a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 fsubr dword ptr [eax]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 fstp [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 fsubr dword ptr [eax+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 fstp [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 fsubr dword ptr [eax+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 fld st(1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 fld st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 fmul [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 ++_EAX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 fstp dword ptr [eax-24h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 fstp dword ptr [eax-20h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 fmul [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 fld st(1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 fstp dword ptr [eax-1Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 __asm { fstp st }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 __asm { fstp st }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 _EAX = a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 fsubr dword ptr [eax]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 fstp [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 fsubr dword ptr [eax+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 fstp [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 fsubr dword ptr [eax+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 fmul st, st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 fstp dword ptr [eax+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 fmul st, st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 fstp dword ptr [eax+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 fld [ebp+a1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 fmul st, st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 fld [ebp+uNumVertices]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 fmul st, st(4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 fstp dword ptr [eax+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 fstp dword ptr [eax+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 ++_EAX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 v3 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 :ViewTransform(a1a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 ++a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 --v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 //----- (00436932) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 char IndoorCameraD3D::GetFacetOrientation(char a1, Vec3_float_ *a2, Vec3_float_ *a3, Vec3_float_ *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 Vec3_float_ *v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 double v6; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 if ( a1 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 a4->x = -a2->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 a4->y = a2->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 a4->z = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 v5 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 a3->x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 a3->y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 v6 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 v5->z = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 if ( a1 == 3 || a1 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 a4->x = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 a4->y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 a4->z = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 v5 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 a3->x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 a3->y = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 v6 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 if ( a1 == 4 || a1 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 if ( fabs(a2->z) < 0.70811361 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 a4->x = -a2->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 a4->y = a2->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 a4->z = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 a4->Normalize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 //----- (00438258) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 bool IndoorCameraD3D::is_vertex_with_normal_from_face_towards_camera(BLVFace *pFace, RenderVertexSoft *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 if ( (a2->vWorldPosition.z - (double)pIndoorCamera->pos.z) * (double)pFace->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 + (a2->vWorldPosition.y - (double)pIndoorCamera->pos.y) * (double)pFace->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 + (a2->vWorldPosition.x - (double)pIndoorCamera->pos.x) * (double)pFace->pFacePlane_old.vNormal.x < 0.0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 || (result = 1, pFace->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 //----- (00438250) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 void IndoorCameraD3D::Reset_list_0037C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 this->list_0037C_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 //----- (00438240) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 void IndoorCameraD3D::_438240_draw_lits()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 IndoorCameraD3D *v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 int v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 int v3; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 int v4; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 double v5; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 float v6; // ST00_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 IndoorCameraD3D *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 float v8; // [sp+4h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 float v9; // [sp+8h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 unsigned int v10; // [sp+Ch] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 char v11; // [sp+10h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 float v12; // [sp+14h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 int v13; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 _438141_draw_list_0037C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 v1 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 if ( v7->list_E0380_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 v2 = (int)&v7->list_E0380[0].field_C04;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 if ( *(int *)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 v4 = v2 - 3048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 if ( *(char *)(v2 - 3076) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 LODWORD(v12) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 v10 = *(int *)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 v9 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v8 = *(float *)(v4 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 v5 = *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 LODWORD(v12) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 v10 = *(int *)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 v9 = *(float *)(v4 - 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 v8 = *(float *)(v4 - 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 v5 = *(float *)(v4 - 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 _437D4A_draw_some_vertices(v6, v8, v9, v10, v11, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 v4 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 while ( v3 < *(int *)v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 v2 += 3088;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 while ( v13 < v1->list_E0380_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 //----- (00438141) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 void IndoorCameraD3D::_438141_draw_list_0037C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 IndoorCameraD3D *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 char *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 float v5; // ST00_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 float v6; // [sp+4h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 float v7; // [sp+8h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 unsigned int v8; // [sp+Ch] [bp-18h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 char v9; // [sp+10h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 float v10; // [sp+14h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 if ( (signed int)this->list_0037C_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 v3 = (char *)&this->list_0037C[0].field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 if ( *(v3 - 32) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 LODWORD(v10) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 v8 = *((int *)v3 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 v7 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 v6 = *(float *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 v4 = *((float *)v3 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 LODWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 v8 = *((int *)v3 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 v7 = *((float *)v3 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 v6 = *((float *)v3 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 v4 = *((float *)v3 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 _437D4A_draw_some_vertices(v5, v6, v7, v8, v9, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 v3 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 while ( v2 < (signed int)v1->list_0037C_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 //----- (00437D4A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 void IndoorCameraD3D::_437D4A_draw_some_vertices(float x, float y, float z, unsigned int a5, char a6, float a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 IndoorCameraD3D *v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 char *v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 signed int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 signed int v10; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 char *v11; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 signed int uNumD3DVertices; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 char *v13; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 unsigned int v14; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 unsigned int v15; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 int v16; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 int v17; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 int v18; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 IDirect3DDevice3 *v19; // ST24_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 HRESULT v20; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 RenderVertexSoft vert[20]; // [sp+0h] [bp-680h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 RenderVertexD3D3 pD3DVertices[5]; // [sp+3C0h] [bp-2C0h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 RenderVertexSoft a1; // [sp+640h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 double v24; // [sp+670h] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 double v25; // [sp+678h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 a1.flt_2C = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 HIDWORD(v25) = (int)this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 v8 = (char *)&vert[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 v9 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 *(float *)v8 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 v8 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 while ( v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 if ( LOBYTE(a7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 vert[0].vWorldViewProjX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 vert[0].vWorldViewProjY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 a1.vWorldPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 a1.vWorldPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 a1.vWorldPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 LODWORD(a7) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 if ( v7->_437285_prolly_colide_vertices_against_frustrum(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 &a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 (unsigned int *)&a7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 vert,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 v7->std__vector_000034_prolly_frustrum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 0) == 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 && SLODWORD(a7) < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 vert[0].vWorldPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 vert[0].vWorldPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 vert[0].vWorldPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 ViewTransform(vert, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 v11 = (char *)&vert[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 if ( *(float *)v11 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 v11 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 while ( v10 < 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 if ( v10 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 _436BB7_project_and_stuff(vert, 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 pD3DVertices[0].pos.x = vert[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 pD3DVertices[0].pos.y = vert[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 pD3DVertices[0].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 pD3DVertices[0].diffuse = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 if ( a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 pD3DVertices[0].pos.z = 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 pD3DVertices[1].pos.x = vert[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 pD3DVertices[2].pos.x = vert[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 pD3DVertices[0].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 uNumD3DVertices = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 pD3DVertices[0].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 pD3DVertices[1].diffuse = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 pD3DVertices[1].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 pD3DVertices[0].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 pD3DVertices[2].diffuse = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 pD3DVertices[2].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 pD3DVertices[3].pos.y = vert[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 pD3DVertices[3].diffuse = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 pD3DVertices[3].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 pD3DVertices[4].pos.y = vert[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 pD3DVertices[1].pos.y = vert[0].vWorldViewProjY - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 pD3DVertices[4].diffuse = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 pD3DVertices[4].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 pD3DVertices[1].pos.z = 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 pD3DVertices[1].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 pD3DVertices[1].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 pD3DVertices[1].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 pD3DVertices[2].pos.y = vert[0].vWorldViewProjY + 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 pD3DVertices[2].pos.z = 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 pD3DVertices[2].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 pD3DVertices[2].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 pD3DVertices[2].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 pD3DVertices[3].pos.x = vert[0].vWorldViewProjX - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 pD3DVertices[3].pos.z = 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 pD3DVertices[3].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 pD3DVertices[3].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 pD3DVertices[3].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 pD3DVertices[4].pos.x = vert[0].vWorldViewProjX + 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 pD3DVertices[4].pos.z = 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 pD3DVertices[4].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 pD3DVertices[4].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 pD3DVertices[4].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 uNumD3DVertices = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 __debugbreak(); // make things right
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 *(unsigned int *)(&pD3DVertices[0].pos.z) = 0x38D1B717u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 pD3DVertices[0].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 *(unsigned int *)(&pD3DVertices[0].rhw) = 0x3A83126Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 pD3DVertices[0].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 __debugbreak(); // decompilation bug
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 //v19 = pRenderer->pRenderD3D->pDevice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, nullptr));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_POINTLIST,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 452,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 pD3DVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 uNumD3DVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 if ( (double)(signed int)pViewport->uViewportX <= vert[0].vWorldViewProjX - 1.0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 && (double)(signed int)pViewport->uViewportZ > vert[0].vWorldViewProjX + 2.0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 && (double)(signed int)pViewport->uViewportY <= vert[0].vWorldViewProjY - 1.0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 && (double)(signed int)pViewport->uViewportW > vert[0].vWorldViewProjY + 2.0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 && uNumD3DVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 v13 = (char *)&pD3DVertices[0].diffuse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 LODWORD(a7) = *((int *)v13 - 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 v25 = a7 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 v24 = *((float *)v13 - 4) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 v14 = *(int *)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 v15 = *(int *)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 v16 = (*(int *)v13 >> 3) & 0x1F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 if ( pRenderer->uTargetGBits == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 v17 = (v15 >> 6) & 0x3E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 v18 = (v14 >> 9) & 0x7C00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 v17 = (v15 >> 5) & 0x7E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 v18 = (v14 >> 8) & 0xF800;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 v13 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 --uNumD3DVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 pRenderer->pTargetSurface[LODWORD(v24) + pRenderer->uTargetSurfacePitch * LODWORD(v25)] = v18 | v16 | (unsigned __int16)v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 while ( uNumD3DVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 //----- (00437C96) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 void IndoorCameraD3D::do_draw_debug_line_d3d(const RenderVertexD3D3 *pLineBegin, unsigned int uDiffuseBegin, const RenderVertexD3D3 *pLineEnd, unsigned int uDiffuseEnd, float z_stuff)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 IDirect3DDevice3 *v7; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 HRESULT v8; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 std::string v9; // [sp-18h] [bp-60h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 const char *v10; // [sp-Ch] [bp-54h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 const char *v11; // [sp-8h] [bp-50h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 int v12; // [sp-4h] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 RenderVertexD3D3 v13[2]; // [sp+8h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 v6 = 0.001 - z_stuff;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 memcpy(v13, pLineBegin, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 memcpy(&v13[1], pLineEnd, sizeof(v13[1]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 v13[0].pos.z = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 v13[1].pos.z = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 v13[0].diffuse = uDiffuseBegin;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 v13[1].diffuse = uDiffuseEnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 v7 = pRenderer->pRenderD3D->pDevice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 //v10 = (const char *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, nullptr));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 D3DPT_LINELIST,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 452,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 v13,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 MessageBoxW(nullptr, L"draw_debug_line() not implemented for SW rendering", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Core3D.cpp:1415", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 //----- (00437AB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 void IndoorCameraD3D::do_draw_debug_line_sw(RenderVertexSoft *pLineBegin, unsigned int uStartDiffuse, RenderVertexSoft *pLineEnd, unsigned int uEndDiffuse, unsigned int uOutNumVertices, float z_stuff)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 char *v7; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 signed int v8; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 float v9; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 float v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 char *v11; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 signed int v12; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 float v13; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 float v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 float v15; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 double v16; // st7@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 HRESULT v17; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 std::string v18; // [sp-18h] [bp-7E4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 IDirect3DDevice3 *v19; // [sp-Ch] [bp-7D8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 const char *v20; // [sp-8h] [bp-7D4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 int v21; // [sp-4h] [bp-7D0h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 RenderVertexSoft a1[20]; // [sp+8h] [bp-7C4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 RenderVertexSoft pVertices[20]; // [sp+3C8h] [bp-404h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 RenderVertexD3D3 v24[2]; // [sp+788h] [bp-44h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 IndoorCameraD3D *v25; // [sp+7C8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 v25 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 v7 = (char *)&pVertices[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 v8 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 *(float *)v7 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 --v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 while ( v8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 if ( (char)uOutNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 v9 = pLineBegin->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 pVertices[0].vWorldViewProjY = pLineBegin->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 pVertices[0].vWorldViewProjX = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 v10 = pLineEnd->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 pVertices[1].vWorldViewProjX = pLineEnd->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 pVertices[1].vWorldViewProjY = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 v16 = 0.001 - z_stuff;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 v24[0].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 v24[0].pos.x = pVertices[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 v24[0].pos.y = pVertices[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 v24[0].pos.z = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 v24[0].diffuse = uStartDiffuse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 v24[0].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 v24[1].pos.x = pVertices[1].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 v24[0].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 v24[1].pos.y = pVertices[1].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 v24[0].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 v24[1].diffuse = uEndDiffuse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 v24[1].pos.z = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 v24[1].specular = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 v24[1].rhw = 0.001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 v24[1].texcoord.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 v24[1].texcoord.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 //v19 = pRenderer->pRenderD3D->pDevice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, nullptr));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 D3DPT_LINELIST,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 452,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 v24,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 v11 = (char *)&a1[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 v12 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 *(float *)v11 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 v11 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 --v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 while ( v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 v20 = (const char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 v19 = (IDirect3DDevice3 *)4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 v13 = pLineBegin->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 uOutNumVertices = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 a1[0].vWorldPosition.x = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 v14 = pLineBegin->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 a1[0].vWorldPosition.y = pLineBegin->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 a1[0].vWorldPosition.z = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 a1[1].vWorldPosition.x = pLineEnd->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 v15 = pLineEnd->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 a1[1].vWorldPosition.y = pLineEnd->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 a1[1].vWorldPosition.z = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 if ( _437285_prolly_colide_vertices_against_frustrum(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 &uOutNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 pVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 this->std__vector_000034_prolly_frustrum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 0) != 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 || (signed int)uOutNumVertices >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 ViewTransform(pVertices, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 _436BB7_project_and_stuff(pVertices, 2u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 MessageBoxW(nullptr, L"draw_debug_line() not implemented for SW rendering", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Core3D.cpp:1383", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 //----- (00437A55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 void IndoorCameraD3D::debug_outline_d3d(const RenderVertexD3D3 *pLineVertices, unsigned int uNumLines, int uDiffuse, float z_stuff)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 unsigned int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 const RenderVertexD3D3 *v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 unsigned int v7; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 const RenderVertexD3D3 *v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 IndoorCameraD3D *thisa; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 thisa = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 if ( (signed int)(uNumLines - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v6 = pLineVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 v7 = uNumLines - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 v5 = uNumLines - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 v8 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 do_draw_debug_line_d3d(v6, uDiffuse, v6 + 1, uDiffuse, z_stuff);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v6 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 do_draw_debug_line_d3d(&pLineVertices[v5], uDiffuse, pLineVertices, uDiffuse, z_stuff);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 //----- (004379EE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 void IndoorCameraD3D::debug_outline_sw(RenderVertexSoft *a2, unsigned int uNumVertices, unsigned int uDiffuse, float a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 unsigned int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 RenderVertexSoft *v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 RenderVertexSoft *v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 char v8; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 IndoorCameraD3D *v9; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 unsigned int uNumVerticesa; // [sp+20h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 v9 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 if ( (signed int)(uNumVertices - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 v5 = uNumVertices - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 uNumVerticesa = uNumVertices - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 v7 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 do_draw_debug_line_sw(v6, uDiffuse, v6 + 1, uDiffuse, 0, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 v8 = uNumVerticesa-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 while ( !v8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 do_draw_debug_line_sw(&a2[v5], uDiffuse, a2, uDiffuse, 0, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 //----- (00437906) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 void IndoorCameraD3D::PrepareAndDrawDebugOutline(BLVFace *pFace, unsigned int uDiffuse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 char *v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 signed int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 signed int v5; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 Vec3_short_ *v6; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 char *v7; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 signed int v8; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 IndoorCameraD3D *thisa; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 thisa = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 static RenderVertexSoft static_sub_437906_array_50CDD0[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 static_sub_437906_array_50CDD0[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 if ( pFace->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v6 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 v7 = (char *)&static_sub_437906_array_50CDD0[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 v8 = v5++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 *((float *)v7 - 1) = (double)v6[pFace->pVertexIDs[v8]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 *(float *)v7 = (double)v6[pFace->pVertexIDs[v8]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 *((float *)v7 - 11) = (double)v6[pFace->pVertexIDs[v8]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 *((float *)v7 - 4) = (double)pFace->pVertexUIDs[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 *((float *)v7 - 3) = (double)pFace->pVertexVIDs[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 while ( v5 < pFace->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 debug_outline_sw(static_sub_437906_array_50CDD0, pFace->uNumVertices, uDiffuse, 0.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 // 50D9D0: using guessed type char static_sub_437906_byte_50D9D0_init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 //----- (004378BA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 void IndoorCameraD3D::MatrixMultiply(Matrix3x3_float_ *a1, Matrix3x3_float_ *a2, Matrix3x3_float_ *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 float *v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 float *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 signed int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 float *v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 float *v8; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 signed int v9; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 double v10; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 double v11; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 v4 = (float *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 v5 = &a1->_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 v6 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 v7 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 v8 = &a2->_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 v9 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 v10 = v8[3] * v5[1] + *(v8 - 3) * *(v5 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 v11 = *v8 * *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 *v7 = v10 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 while ( v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 v5 += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 v4 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 //----- (004376E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 void IndoorCameraD3D::CreateWorldMatrixAndSomeStuff()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 IndoorCameraD3D *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 double v5; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 Matrix3x3_float_ a3; // [sp+10h] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 Matrix3x3_float_ v8; // [sp+34h] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 Matrix3x3_float_ a2; // [sp+58h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 Matrix3x3_float_ v10; // [sp+7Ch] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 Matrix3x3_float_ a1; // [sp+A0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 float v12; // [sp+C4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 a1._13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 a1._23 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 a1._31 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 a1._32 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 a1._33 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 v10._11 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 v10._12 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v10._13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 v10._21 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v10._31 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 a2._12 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 a2._21 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 a2._22 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 a2._23 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 a2._32 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 v12 = cos(0.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 v2 = sin(0.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 a1._11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 a1._12 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 a1._21 = -v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 a1._22 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 v10._22 = pIndoorCamera->fRotationXCosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 v10._32 = -pIndoorCamera->fRotationXSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 v10._23 = pIndoorCamera->fRotationXSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 v10._33 = pIndoorCamera->fRotationXCosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 a2._11 = pIndoorCamera->fRotationYCosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 a2._13 = -pIndoorCamera->fRotationYSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 a2._31 = pIndoorCamera->fRotationYSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 a2._33 = pIndoorCamera->fRotationYCosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 MatrixMultiply(&a1, &a2, &a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 MatrixMultiply(&v10, &a3, &v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 v4 = (int)&v1->field_4.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 v5 = *(&v8._11 + v3++);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 *(float *)(v4 + 16) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 *(float *)v4 = *(float *)((char *)&v8._12 - (char *)v1 + v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 *(float *)(v4 + 32) = *(float *)((char *)&v8._22 - (char *)v1 + v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 v4 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 while ( v3 < 3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 LODWORD(v1->field_D8) = 0x3F91361Du;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 v1->flt_D0 = (double)pViewport->uScreenWidth * 0.8814736;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 v6 = 0.8814736 * (double)pViewport->uScreenHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 v1->flt_D4 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 if ( v1->flt_D0 > v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 v6 = v1->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 v1->flt_fov = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 v1->field_C8 = (double)pViewport->uScreenCenterX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 v1->field_CC = (double)(pViewport->uScreenCenterY - pViewport->uScreenY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 //----- (00437691) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 IndoorCameraD3D_Vec3 *IndoorCameraD3D::Vec3Transform(const IndoorCameraD3D_Vec3 *pVector, IndoorCameraD3D_Vec3 *pOut)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 IndoorCameraD3D_Vec3 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 result = (IndoorCameraD3D_Vec3 *)pVector;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 pOut->y = this->field_14.x * pVector->x + this->field_4.x * pVector->y + this->field_24.x * pVector->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 pOut->z = this->field_14.y * result->x + this->field_4.y * result->y + this->field_24.y * result->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 pOut->x = this->field_14.z * result->x + this->field_4.z * result->y + this->field_24.z * pVector->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 //----- (00437607) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 void IndoorCameraD3D::_437607(IndoorCameraD3D_Vec3 *a1, IndoorCameraD3D_Vec4 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 IndoorCameraD3D *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 double v4; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 signed int v5; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 char *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 double v7; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 IndoorCameraD3D_Vec3 v8; // [sp+8h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 Vec3_float_ v9; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 int v10; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 v9.x = (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 v9.y = (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 v9.z = (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 Vec3Transform(a1, a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 v4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 v6 = (char *)&a2->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 v7 = *(&v9.x + v5++) * *(float *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 v6 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 v4 = v4 + v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 while ( v5 < 3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 v10 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 a2->dot = v4 + 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 //IndoorCameraD3D_Vec3::dtor(&v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 //----- (004374E8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 void IndoorCameraD3D::_4374E8_ProllyBuildFrustrum()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 IndoorCameraD3D *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 double v4; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 double v5; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 double v6; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 IndoorCameraD3D_Vec3 v7; // [sp+Ch] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 float v8; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 float v9; // [sp+14h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 float v10; // [sp+18h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 float v11; // [sp+1Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 float v12; // [sp+20h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 int v13; // [sp+2Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 v2 = 2.0 / v1->field_D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 v3 = atan(v2 * v1->flt_fov / v1->flt_D0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 v12 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 v11 = sin(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 v4 = cos(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 v8 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 v9 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 v10 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 _437607(&v7, v1->std__vector_000034_prolly_frustrum);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 v8 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 _437607(&v7, &v1->std__vector_000034_prolly_frustrum[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 v5 = atan(2.0 / v1->field_D8 * v1->flt_fov / (v1->flt_D4 + 0.5));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v12 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 v11 = sin(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 v6 = cos(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v9 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 v8 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 v10 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 _437607(&v7, &v1->std__vector_000034_prolly_frustrum[2]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 v9 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 _437607(&v7, &v1->std__vector_000034_prolly_frustrum[3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 v13 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 //IndoorCameraD3D_Vec3::dtor(&v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 //----- (00437376) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 char IndoorCameraD3D::_437376(stru154 *thisa, RenderVertexSoft *a2, unsigned int *pOutNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 RenderVertexSoft *v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 unsigned int v7; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 signed int v8; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 int v9; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 int v10; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 int v11; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 int v12; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 int v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 signed int v14; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 RenderVertexSoft *v15; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 unsigned int *v16; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 char result; // al@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 RenderVertexSoft v18; // [sp+Ch] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 int v19; // [sp+3Ch] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 signed int thisb; // [sp+48h] [bp+8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 char a2_3; // [sp+4Fh] [bp+Fh]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 v4 = *pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 if ( (signed int)*pOutNumVertices <= 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 || ((v5 = a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 memcpy(&v18, a2, sizeof(v18)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 (v18.vWorldPosition.z - (double)pBLVRenderParams->vPartyPos.z) * thisa->vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 + (v18.vWorldPosition.y - (double)pBLVRenderParams->vPartyPos.y) * thisa->vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 + (v18.vWorldPosition.x - (double)pBLVRenderParams->vPartyPos.x) * thisa->vNormal.x < 0.0) ? (v6 = 1.0) : (v6 = -1.0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 a2_3 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 memcpy(&v5[v4], v5, sizeof(v5[v4])),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 memcpy(&v5[*pOutNumVertices + 1], &v5[1], sizeof(v5[*pOutNumVertices + 1])),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 v7 = *pOutNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 (signed int)*pOutNumVertices <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 for ( thisb = 1; ; v8 = thisb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 v9 = v8 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 v10 = v8 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 v19 = v8 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 if ( v8 - 1 >= (signed int)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 v9 -= v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 if ( v8 >= (signed int)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 v8 -= v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 if ( v19 >= (signed int)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 v10 = v19 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 v11 = (int)&v5[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 v12 = (int)&v5[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 if ( -0.009999999776482582 > ((v5[v8].vWorldViewProjX - *(float *)(v12 + 24))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 * (*(float *)(v11 + 28) - *(float *)(v12 + 28))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 - (v5[v8].vWorldViewProjY - *(float *)(v12 + 28))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 * (*(float *)(v11 + 24) - *(float *)(v12 + 24)))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 * v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 thisb = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 v16 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 v13 = thisb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 if ( thisb >= (signed int)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 v13 = thisb - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 if ( v13 < (signed int)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 v15 = &v5[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 memcpy(v15, &v15[1], 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 while ( v14 < (signed int)*pOutNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 v16 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 a2_3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 --*v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 v7 = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 if ( thisb - 1 >= (signed int)*v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 if ( a2_3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 //----- (00437285) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 bool IndoorCameraD3D::_437285_prolly_colide_vertices_against_frustrum(RenderVertexSoft *a1, unsigned int *pOutNumVertices, RenderVertexSoft *pVertices, IndoorCameraD3D_Vec4 *a4, signed int uNumVertices, char a6, int _unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 char *v8; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 signed int v9; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 bool result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 int v11; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 signed int v12; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 char *v13; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 RenderVertexSoft *v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 RenderVertexSoft *v15; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 Vec3_float_ a5; // [sp+18h] [bp-3Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 float v17; // [sp+44h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 int v18; // [sp+48h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 stru9 *thisa; // [sp+4Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 int a7a; // [sp+53h] [bp-1h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 bool a6a; // [sp+70h] [bp+1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 v17 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 thisa = pGame->pStru9Instance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 static RenderVertexSoft sr_vertices_50D9D8[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 sr_vertices_50D9D8[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 LOBYTE(a7a) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 v11 = 2 * (a6 == 0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 a6a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 v18 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 if ( uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 LOBYTE(result) = a7a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 v12 = *pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v13 = (char *)&a4->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 if ( result % 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 v15 = sr_vertices_50D9D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 v15 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 v14 = sr_vertices_50D9D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 ++a6a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 if ( a6a == uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 v14 = pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 a5.x = *((float *)v13 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 a5.y = *(float *)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 a5.z = *((float *)v13 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 result = thisa->_4985FB(v15, v12, v14, pOutNumVertices, &a5, *((float *)v13 + 2), (char *)&a7a, _unused);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 v12 = *pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 if ( (signed int)*pOutNumVertices < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 result = a6a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 v13 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 if ( a6a >= uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 *pOutNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 // 50E5D8: using guessed type char static_50D9D8_init_flag_bit1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 //----- (004371C3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 bool IndoorCameraD3D::_4371C3(RenderVertexSoft *pVertices, unsigned int *pOutNumVertices, int _unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 char *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 signed int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 RenderVertexSoft *v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 unsigned int *v7; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 char *v8; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 int v9; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 IndoorCameraD3D *thisa; // [sp+0h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 signed int v12; // [sp+4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 unsigned int pVerticesa; // [sp+14h] [bp+8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 unsigned int pOutNumVerticesa; // [sp+18h] [bp+Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 thisa = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 static RenderVertexSoft static_4371C3_array_50E5E0[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 static_4371C3_array_50E5E0[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 v6 = pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 v7 = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 if ( (signed int)*pOutNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 pOutNumVerticesa = (char *)static_4371C3_array_50E5E0 - (char *)pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 pVerticesa = (char *)&static_4371C3_array_50E5E0[0].vWorldViewProjY - (char *)pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 v8 = (char *)&static_4371C3_array_50E5E0[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 v9 = (int)&v6->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 *((int *)v8 - 1) = *(int *)(v9 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 *(int *)v8 = *(int *)(v9 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 v8 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 *(float *)(pOutNumVerticesa + v9) = *(float *)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 *(float *)(pVerticesa + v9) = *(float *)(v9 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 *(float *)((char *)&static_4371C3_array_50E5E0[0].flt_20 - (char *)v6 + v9) = *(float *)(v9 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 while ( v12 < (signed int)*v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 return _437285_prolly_colide_vertices_against_frustrum(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 static_4371C3_array_50E5E0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 v6,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 thisa->std__vector_000034_prolly_frustrum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 _unused);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 // 50F1E0: using guessed type char static_sub_4371C3_byte_50F1E0_init_flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 //----- (00437143) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 int IndoorCameraD3D::_437143(unsigned int uNumInVertices, RenderVertexSoft *pOutVertices, RenderVertexSoft *pInVertices, unsigned int *pOutNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 unsigned int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 char *pOutVertices_; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 char *v7; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 unsigned int v8; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 double v9; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 double v10; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 unsigned int a2a; // [sp+10h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 v5 = uNumInVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 if ( (signed int)uNumInVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 pOutVertices_ = (char *)&pOutVertices->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 v7 = (char *)&pInVertices->flt_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 v8 = (char *)pOutVertices - (char *)pInVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 a2a = uNumInVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 *(float *)v7 = 1.0 / (*((float *)v7 - 5) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 memcpy(pOutVertices_ - 28, v7 - 32, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 v9 = (double)pOutdoorCamera->int_fov_rad * *(float *)&v7[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 v10 = (double)pViewport->uScreenCenterX - v9 * *((float *)v7 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 *((float *)pOutVertices_ - 1) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 *(float *)pOutVertices_ = (double)pViewport->uScreenCenterY - v9 * *((float *)v7 - 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 pOutVertices_ += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 --a2a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 while ( a2a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 v5 = uNumInVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 result = (int)pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 *pOutNumVertices = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 //----- (00436F09) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 void IndoorCameraD3D::_436F09(RenderVertexSoft *pInVertices, int uNumInVertices, RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 unsigned int *pOutNumVertices_; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 signed int v7; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 char *v8; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 unsigned int v9; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 RenderVertexSoft *v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 double v11; // st6@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 double v12; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 unsigned int v13; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 unsigned __int8 v14; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 unsigned __int8 v15; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 unsigned int v16; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 bool a1a; // [sp+Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 int a4a; // [sp+18h] [bp+14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 pOutNumVertices_ = pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 *pOutNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 if ( uNumInVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 memcpy(&pInVertices[uNumInVertices], pInVertices, sizeof(pInVertices[uNumInVertices]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 v6 = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 if ( v6 >= pInVertices->vWorldViewPosition.x )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 if ( uNumInVertices + 1 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 a4a = uNumInVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 v8 = (char *)&pInVertices[1].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 a1a = v6 >= *((float *)v8 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 if ( v7 == a1a )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 v10 = pOutVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 v9 = *pOutNumVertices_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 if ( a1a )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 v10 = pOutVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 v11 = (v6 - *((float *)v8 - 18)) / (*((float *)v8 - 6) - *((float *)v8 - 18));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 pOutVertices[v9].vWorldViewPosition.y = (*((float *)v8 - 5) - *((float *)v8 - 17)) * v11 + *((float *)v8 - 17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 pOutVertices[*pOutNumVertices_].vWorldViewPosition.z = (*((float *)v8 - 4) - *((float *)v8 - 16)) * v11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 + *((float *)v8 - 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 pOutVertices[*pOutNumVertices_].u = (*(float *)v8 - *((float *)v8 - 12)) * v11 + *((float *)v8 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 pOutVertices[*pOutNumVertices_].v = (*((float *)v8 + 1) - *((float *)v8 - 11)) * v11 + *((float *)v8 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 v12 = (v6 - *((float *)v8 - 6)) / (*((float *)v8 - 18) - *((float *)v8 - 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 pOutVertices[v9].vWorldViewPosition.y = (*((float *)v8 - 17) - *((float *)v8 - 5)) * v12 + *((float *)v8 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 pOutVertices[*pOutNumVertices_].vWorldViewPosition.z = (*((float *)v8 - 16) - *((float *)v8 - 4)) * v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 + *((float *)v8 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 pOutVertices[*pOutNumVertices_].u = (*((float *)v8 - 12) - *(float *)v8) * v12 + *(float *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 pOutVertices[*pOutNumVertices_].v = (*((float *)v8 - 11) - *((float *)v8 + 1)) * v12 + *((float *)v8 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 v10 = pOutVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 v10[*pOutNumVertices_].vWorldViewPosition.x = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 v10[*pOutNumVertices_].flt_20 = 1.0 / v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v13 = (unsigned int)&v10[*pOutNumVertices_];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 if ( *(float *)(v13 + 12) != *((float *)v8 - 18) || *(float *)(v13 + 16) != *((float *)v8 - 17) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 v15 = *(float *)(v13 + 20) == *((float *)v8 - 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v16 = (unsigned int)&v10[*pOutNumVertices_];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 if ( *(float *)(v16 + 12) != *((float *)v8 - 6) || *(float *)(v16 + 16) != *((float *)v8 - 5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 ++*pOutNumVertices_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 v15 = *(float *)(v16 + 20) == *((float *)v8 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 if ( !(v15 | v14) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 if ( a1a )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 memcpy(&v10[*pOutNumVertices_], v8 - 36, sizeof(v10[*pOutNumVertices_]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 pOutVertices[*pOutNumVertices_].flt_20 = 1.0 / (*((float *)v8 - 6) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 pOutVertices[(*pOutNumVertices_)++].flt_2C = *((float *)v8 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 v7 = a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 v8 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 --a4a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 while ( a4a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 if ( (signed int)*pOutNumVertices_ < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 *pOutNumVertices_ = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 //----- (00436CDC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 void IndoorCameraD3D::_436CDC(RenderVertexSoft *pInVertices, int uNumInVertices, RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 signed int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 char *v6; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 unsigned int v7; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 RenderVertexSoft *v8; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 double v9; // st6@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 double v10; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 unsigned int v11; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 unsigned __int8 v12; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 unsigned __int8 v13; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 unsigned int v14; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 bool a1a; // [sp+Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 if ( uNumInVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 *pOutNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 memcpy(&pInVertices[uNumInVertices], pInVertices, sizeof(pInVertices[uNumInVertices]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 if ( pInVertices->vWorldViewPosition.x >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 if ( uNumInVertices + 1 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 v6 = (char *)&pInVertices[1].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 a1a = *((float *)v6 - 6) >= 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 if ( v5 == a1a )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v8 = pOutVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 v7 = *pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 if ( a1a )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 v8 = pOutVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 v9 = (8.0 - *((float *)v6 - 18)) / (*((float *)v6 - 6) - *((float *)v6 - 18));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 pOutVertices[v7].vWorldViewPosition.y = (*((float *)v6 - 5) - *((float *)v6 - 17)) * v9 + *((float *)v6 - 17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 pOutVertices[*pOutNumVertices].vWorldViewPosition.z = (*((float *)v6 - 4) - *((float *)v6 - 16)) * v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 + *((float *)v6 - 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 pOutVertices[*pOutNumVertices].u = (*(float *)v6 - *((float *)v6 - 12)) * v9 + *((float *)v6 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 pOutVertices[*pOutNumVertices].v = (*((float *)v6 + 1) - *((float *)v6 - 11)) * v9 + *((float *)v6 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 v10 = (8.0 - *((float *)v6 - 6)) / (*((float *)v6 - 18) - *((float *)v6 - 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 pOutVertices[v7].vWorldViewPosition.y = (*((float *)v6 - 17) - *((float *)v6 - 5)) * v10 + *((float *)v6 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 pOutVertices[*pOutNumVertices].vWorldViewPosition.z = (*((float *)v6 - 16) - *((float *)v6 - 4)) * v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 + *((float *)v6 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 pOutVertices[*pOutNumVertices].u = (*((float *)v6 - 12) - *(float *)v6) * v10 + *(float *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 pOutVertices[*pOutNumVertices].v = (*((float *)v6 - 11) - *((float *)v6 + 1)) * v10 + *((float *)v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 v8 = pOutVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 v8[*pOutNumVertices].vWorldViewPosition.x = 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 v8[*pOutNumVertices].flt_20 = 0.125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 v11 = (unsigned int)&v8[*pOutNumVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 if ( *(float *)(v11 + 12) != *((float *)v6 - 18) || *(float *)(v11 + 16) != *((float *)v6 - 17) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 v13 = *(float *)(v11 + 20) == *((float *)v6 - 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 v14 = (unsigned int)&v8[*pOutNumVertices];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 if ( *(float *)(v14 + 12) != *((float *)v6 - 6) || *(float *)(v14 + 16) != *((float *)v6 - 5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 ++*pOutNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 v13 = *(float *)(v14 + 20) == *((float *)v6 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 if ( !(v13 | v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 if ( a1a )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 memcpy(&v8[*pOutNumVertices], v6 - 36, sizeof(v8[*pOutNumVertices]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 pOutVertices[(*pOutNumVertices)++].flt_20 = 1.0 / (*((float *)v6 - 6) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v5 = a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 --uNumInVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 while ( uNumInVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 if ( (signed int)*pOutNumVertices < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 *pOutNumVertices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 //----- (00436BB7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 void IndoorCameraD3D::_436BB7_project_and_stuff(RenderVertexSoft *pVertices, unsigned int uNumVertices, char a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 IndoorCameraD3D *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 float *v6; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 double v7; // st7@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 double v8; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 double v9; // st6@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 double v10; // st5@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 double v11; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 double v12; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 double v13; // st5@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 float uNumVerticesa; // [sp+14h] [bp+Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 float uNumVerticesb; // [sp+14h] [bp+Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 v4 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 v5 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 v6 = &pVertices->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 if ( byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 v7 = 1.0 / *(v6 - 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 *v6 = *(v6 - 2) * v5->flt_fov * v7 + v5->field_C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 v6[1] = (double)(signed int)pViewport->uViewportW - (*(v6 - 1) * v5->flt_fov * v7 + v5->field_CC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 extern void _outdoor_project(RenderVertexSoft *v);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 _outdoor_project((RenderVertexSoft *)(v6 - 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 v8 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 if ( v8 >= *v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 v9 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 v10 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 if ( v10 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 if ( v8 >= *v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 v8 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 uNumVerticesa = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v8 = uNumVerticesa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 *v6 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 v11 = (double)(signed int)pViewport->uViewportW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 if ( v11 >= v6[1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 v12 = v6[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 v13 = (double)(signed int)pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 if ( v13 <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 if ( v11 >= v6[1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 v11 = v6[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 uNumVerticesb = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 v11 = uNumVerticesb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 v6[1] = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 v6 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 //----- (00436A9A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 void IndoorCameraD3D::Project(signed int x, signed int y, signed int z, int *a5, int *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 double v6; // ST00_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 double v7; // ST08_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 double v8; // ST00_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 signed __int64 v9; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 int v10; // ST04_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 float a2a; // [sp+18h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 float a2b; // [sp+18h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 v6 = 1.0 / (double)x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 a2a = (double)y * this->flt_fov * v6 + this->field_C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 v7 = a2a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 *a5 = LODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 a2b = (double)z * this->flt_fov * v6 + this->field_CC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 v8 = a2b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 *a6 = pViewport->uViewportW - LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 LODWORD(v9) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 HIDWORD(v9) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 v10 = v9 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 LODWORD(v9) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 HIDWORD(v9) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 *a5 = pBLVRenderParams->uViewportCenterX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 - ((signed int)(((unsigned __int64)(v10 * (signed __int64)y) >> 16) + 32768) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 *a6 = pBLVRenderParams->uViewportCenterY - ((signed int)(((unsigned __int64)(v9 / x * z) >> 16) + 32768) >> 16);
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 //----- (00436A6D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 double IndoorCameraD3D::GetPolygonMinZ(RenderVertexSoft *pVertices, unsigned int uStripType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 unsigned int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 double result; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 float *v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 v3 = uStripType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 result = 3.4028235e38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 if ( (signed int)uStripType > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 v5 = &pVertices->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 if ( *v5 < result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 result = *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 v5 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 --v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 //----- (00436A24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 struct IDirect3DTexture2 *IndoorCameraD3D::LoadTextureAndGetHardwarePtr(char *Str1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 return pBitmaps_LOD->pHardwareTextures[pBitmaps_LOD->LoadTexture(Str1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 //----- (00436A40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 double IndoorCameraD3D::GetPolygonMaxZ(RenderVertexSoft *pVertex, unsigned int uStripType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 unsigned int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 double result; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 float *v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 v3 = uStripType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 result = 1.1754944e-38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 if ( (signed int)uStripType > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 v5 = &pVertex->vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 if ( *v5 > result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 result = *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 v5 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 --v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 }