Mercurial > mm7
annotate IndoorCameraD3D.cpp @ 2427:94393b73d333
* Some initialization stuff
author | a.parshin |
---|---|
date | Wed, 23 Jul 2014 13:28:30 +0300 |
parents | f4af3b203f65 |
children | 0f17a30149ec |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2245
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
2336 | 6 #include "ErrorHandling.h" |
0 | 7 #include "IndoorCameraD3D.h" |
8 #include "VectorTypes.h" | |
9 #include "Game.h" | |
10 #include "Indoor.h" | |
11 #include "Viewport.h" | |
1637 | 12 #include "Outdoor_stuff.h" |
0 | 13 #include "Render.h" |
14 #include "LOD.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2006
diff
changeset
|
15 #include "OurMath.h" |
0 | 16 #include "mm7_data.h" |
17 | |
1016 | 18 #include "stru9.h" |
19 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
20 |
1641 | 21 // calculates FOV (Field of View) angle in radians for IndoorCamera::Initialize and BLVRenderParams::Reset |
22 float _calc_fov(int viewport_width, int angle_degree) | |
23 { | |
24 return viewport_width * 0.5 / tan(angle_degree / 2 * 0.01745329) + 0.5; | |
25 } | |
26 | |
27 | |
28 | |
781 | 29 //----- (004361EF) -------------------------------------------------------- |
30 IndoorCameraD3D::IndoorCameraD3D() | |
31 { | |
2245 | 32 this->field_108 = 0.0; |
33 this->field_138 = 0.0; | |
34 this->field_168 = 0.0; | |
35 this->field_198 = 0.0; | |
36 this->field_1C8 = 0.0; | |
37 this->field_1F8 = 0.0; | |
38 this->field_228 = 0.0; | |
39 this->field_258 = 0.0; | |
40 this->field_288 = 0.0; | |
41 this->field_2B8 = 0.0; | |
42 this->field_2E8 = 0.0; | |
43 this->field_2BC = 0.0; | |
44 this->field_2C0 = 0.0; | |
45 this->field_2C4 = 0.0; | |
46 this->field_318 = 0.0; | |
47 this->field_2EC = 0.0; | |
48 this->field_2F0 = 0.0; | |
49 this->field_2F4 = 0.0; | |
50 this->field_348 = 0.0; | |
51 this->field_31C = 0.0; | |
52 this->field_320 = 0.0; | |
53 this->field_324 = 0.0; | |
54 this->field_378 = 0.0; | |
55 this->field_34C = 0.0; | |
56 this->field_350 = 0.0; | |
57 this->field_354 = 0.0; | |
781 | 58 for (uint i = 0; i < 16384; ++i) |
59 { | |
60 list_0037C[i].field_0 = 0; | |
61 list_0037C[i].flt_30 = 0.0f; | |
62 } | |
63 list_0037C_size = 0; | |
64 for (uint i = 0; i < 256; ++i) | |
65 list_E0380[i].mm7__vector_000004_size = 0; | |
66 list_E0380_size = 0; | |
67 } | |
0 | 68 |
871 | 69 |
70 //----- (0043643E) -------------------------------------------------------- | |
71 float IndoorCameraD3D::GetPickDepth() | |
72 { | |
1637 | 73 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
74 return pODMRenderParams->uPickDepth; | |
871 | 75 else |
76 return 16192.0; | |
77 } | |
78 | |
1637 | 79 //----- (00436427) -------------------------------------------------------- |
80 float IndoorCameraD3D::GetShadingDistMist() | |
81 { | |
82 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
83 return (double)pODMRenderParams->shading_dist_mist; | |
84 else | |
85 return 16192.0; | |
86 } | |
871 | 87 |
0 | 88 //----- (004364C5) -------------------------------------------------------- |
89 void IndoorCameraD3D::ViewTransfrom_OffsetUV(RenderVertexSoft *pVertices, unsigned int uNumVertices, RenderVertexSoft *pOutVertices, stru320 *a5) | |
90 { | |
91 for (uint i = 0; i < uNumVertices; ++i) | |
92 { | |
93 pOutVertices[i].vWorldPosition.x = pVertices[i].vWorldPosition.x; | |
94 pOutVertices[i].vWorldPosition.y = pVertices[i].vWorldPosition.y; | |
95 pOutVertices[i].vWorldPosition.z = pVertices[i].vWorldPosition.z; | |
96 | |
97 pOutVertices[i].u = pVertices[i].u + a5->pDeltaUV[0]; | |
98 pOutVertices[i].v = pVertices[i].v + a5->pDeltaUV[1]; | |
99 } | |
100 ViewTransform(pOutVertices, uNumVertices); | |
101 } | |
102 | |
103 //----- (0043669D) -------------------------------------------------------- | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
104 bool IndoorCameraD3D::ApplyViewTransform_TrueIfStillVisible_BLV(int x, int y, int z, signed int *pOutX, int *pOutZ, int *pOutY, char bDoNotShow) |
0 | 105 { |
106 int to_z; // esi@2 | |
107 int v9; // ecx@3 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
108 //signed int *v10; // esi@5 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
109 //int pOutY_; // ecx@5 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
110 //signed int v12; // esi@7 |
0 | 111 int v14; // [sp+8h] [bp-4h]@3 |
112 int to_x; // [sp+14h] [bp+8h]@1 | |
113 int to_y; // [sp+18h] [bp+Ch]@1 | |
2334 | 114 // int a2b; // [sp+18h] [bp+Ch]@5 |
0 | 115 int a3a; // [sp+1Ch] [bp+10h]@5 |
116 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
117 to_x = x - pGame->pIndoorCameraD3D->vPartyPos.x; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
118 to_y = y - pGame->pIndoorCameraD3D->vPartyPos.y; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
119 if (pGame->pIndoorCameraD3D->sRotationX) |
0 | 120 { |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
121 to_z = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
122 //if ( pRenderer->pRenderD3D ) |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
123 //{ |
1642 | 124 v14 = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) |
125 + (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y); | |
126 v9 = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) | |
127 - (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y); | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
128 //} |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
129 a3a = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; |
2207 | 130 *pOutX = fixpoint_mul(v14, pGame->pIndoorCameraD3D->int_cosine_x) - fixpoint_mul(to_z, pGame->pIndoorCameraD3D->int_sine_x); |
0 | 131 *pOutZ = v9; |
2207 | 132 *pOutY = fixpoint_mul(v14, pGame->pIndoorCameraD3D->int_sine_x) + fixpoint_mul(a3a, pGame->pIndoorCameraD3D->int_cosine_x); |
0 | 133 } |
134 else | |
135 { | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
136 *pOutY = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
137 //if ( pRenderer->pRenderD3D ) |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
138 //{ |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
139 //v10 = pOutX; |
1642 | 140 *pOutX = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) |
141 + (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y); | |
142 *pOutZ = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) | |
143 - (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y); | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
144 //} |
0 | 145 } |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
146 if (!bDoNotShow) |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
147 return false; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
148 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
149 return *pOutX >= fixpoint_from_int(4, 0) && |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
150 *pOutX <= fixpoint_from_int(8000, 0); |
0 | 151 } |
152 | |
153 //----- (00436455) -------------------------------------------------------- | |
154 bool IndoorCameraD3D::IsCulled(BLVFace *pFace) | |
155 { | |
156 RenderVertexSoft v; // [sp+8h] [bp-30h]@1 | |
157 | |
2152 | 158 //----- (0043648F) -------------------------------------------------------- |
159 auto Vec3_short__to_RenderVertexSoft = [](RenderVertexSoft *_this, Vec3_short_ *a2) -> void | |
160 { | |
161 _this->flt_2C = 0.0; | |
162 | |
163 _this->vWorldPosition.x = a2->x; | |
164 _this->vWorldPosition.y = a2->y; | |
165 _this->vWorldPosition.z = a2->z; | |
166 }; | |
167 | |
168 | |
0 | 169 Vec3_short__to_RenderVertexSoft(&v, &pIndoor->pVertices[*pFace->pVertexIDs]); |
170 return is_face_faced_to_camera(pFace, &v); | |
171 } | |
172 | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
173 |
0 | 174 //----- (00436523) -------------------------------------------------------- |
175 void IndoorCameraD3D::ViewTransform(RenderVertexSoft *a1a, unsigned int uNumVertices) | |
176 { | |
177 if (byte_4D864C && pGame->uFlags & 0x80 || | |
178 uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
179 { | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
180 float sin_x = fRotationXSine, |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
181 cos_x = fRotationXCosine; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
182 float sin_y = fRotationYSine, |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
183 cos_y = fRotationYCosine; |
0 | 184 |
185 //v4 = uNumVertices; | |
186 //v7 = pIndoorCamera->fRotationXSine; | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
187 if (pGame->pIndoorCameraD3D->sRotationX) |
0 | 188 { |
189 | |
190 //_EAX = a1a; | |
191 for (uint i = 0; i < uNumVertices; ++i) | |
192 { | |
193 float st0, st1, st2; | |
2154 | 194 //if ( pRenderer->pRenderD3D ) |
0 | 195 { |
196 /*__asm | |
197 { | |
198 fld [ebp+uNumVertices] // [(a1a[i].y - pIndoorCamera->pos.y)] [(a1a[i].z - pIndoorCamera->pos.z)] [pIndoorCamera->fRotationXCosine] [pIndoorCamera->fRotationYSine] [pIndoorCamera->fRotationYCosine] | |
199 fmul st, st(3) // [pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] [(a1a[i].z - pIndoorCamera->pos.z)] [pIndoorCamera->fRotationXCosine] [pIndoorCamera->fRotationYSine] [pIndoorCamera->fRotationYCosine] | |
200 fld [ebp+a1] // [(a1a[i].x - pIndoorCamera->pos.x)] [pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] [(a1a[i].z - pIndoorCamera->pos.z)] [pIndoorCamera->fRotationXCosine] [pIndoorCamera->fRotationYSine] [pIndoorCamera->fRotationYCosine] | |
201 fmul st, st(5) // 0[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x)] | |
202 // 1[pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
203 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
204 // 3[pIndoorCamera->fRotationXCosine] | |
205 // 4[pIndoorCamera->fRotationYSine] | |
206 // 5[pIndoorCamera->fRotationYCosine] | |
207 faddp st(1), st // [pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) + pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] [(a1a[i].z - pIndoorCamera->pos.z)] [pIndoorCamera->fRotationXCosine] [pIndoorCamera->fRotationYSine] [pIndoorCamera->fRotationYCosine] | |
208 fld [ebp+a1] // [(a1a[i].x - pIndoorCamera->pos.x)] [pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) + pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] [(a1a[i].z - pIndoorCamera->pos.z)] [pIndoorCamera->fRotationXCosine] [pIndoorCamera->fRotationYSine] [pIndoorCamera->fRotationYCosine] | |
209 fmul st, st(4) // [pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] [pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) + pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] [(a1a[i].z - pIndoorCamera->pos.z)] [pIndoorCamera->fRotationXCosine] [pIndoorCamera->fRotationYSine] [pIndoorCamera->fRotationYCosine] | |
210 | |
211 fld [ebp+uNumVertices] // 0[a1a[i].y - pIndoorCamera->pos.y] | |
212 // 1[pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] | |
213 // 2[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) + pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
214 // 3[(a1a[i].z - pIndoorCamera->pos.z)] | |
215 // 4[pIndoorCamera->fRotationXCosine] | |
216 // 5[pIndoorCamera->fRotationYSine] | |
217 // 6[pIndoorCamera->fRotationYCosine] | |
218 | |
219 fmul st, st(6) // 0[pIndoorCamera->fRotationYCosine * (a1a[i].y - pIndoorCamera->pos.y)] | |
220 // 1[pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] | |
221 // 2[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) + pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
222 // 3[(a1a[i].z - pIndoorCamera->pos.z)] | |
223 // 4[pIndoorCamera->fRotationXCosine] | |
224 // 5[pIndoorCamera->fRotationYSine] | |
225 // 6[pIndoorCamera->fRotationYCosine] | |
226 | |
227 fsubp st(1), st // 0[pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYCosine * (a1a[i].y - pIndoorCamera->pos.y)] | |
228 // 1[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) + pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
229 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
230 // 3[pIndoorCamera->fRotationXCosine] | |
231 // 4[pIndoorCamera->fRotationYSine] | |
232 // 5[pIndoorCamera->fRotationYCosine] | |
233 }*/ | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
234 st0 = sin_y * (a1a[i].vWorldPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) - cos_y * (a1a[i].vWorldPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
235 st1 = cos_y * (a1a[i].vWorldPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) + sin_y * (a1a[i].vWorldPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
236 st2 = (a1a[i].vWorldPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z); |
0 | 237 } |
2154 | 238 if (false)//else |
0 | 239 { |
240 /*__asm | |
241 { | |
242 fld [ebp+a1] // 0[(a1a[i].x - pIndoorCamera->pos.x)] | |
243 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
244 // 2[pIndoorCamera->fRotationXCosine] | |
245 // 3[pIndoorCamera->fRotationYSine] | |
246 // 4[pIndoorCamera->fRotationYCosine] | |
247 fmul st, st(4) // 0[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x)] | |
248 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
249 // 2[pIndoorCamera->fRotationXCosine] | |
250 // 3[pIndoorCamera->fRotationYSine] | |
251 // 4[pIndoorCamera->fRotationYCosine] | |
252 fld [ebp+uNumVertices] // 0[(a1a[i].y - pIndoorCamera->pos.y)] | |
253 // 1[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x)] | |
254 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
255 // 3[pIndoorCamera->fRotationXCosine] | |
256 // 4[pIndoorCamera->fRotationYSine] | |
257 // 5[pIndoorCamera->fRotationYCosine] | |
258 fmul st, st(4) // 0[pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
259 // 1[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x)] | |
260 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
261 // 3[pIndoorCamera->fRotationXCosine] | |
262 // 4[pIndoorCamera->fRotationYSine] | |
263 // 5[pIndoorCamera->fRotationYCosine] | |
264 fsubp st(1), st // 0[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
265 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
266 // 2[pIndoorCamera->fRotationXCosine] | |
267 // 3[pIndoorCamera->fRotationYSine] | |
268 // 4[pIndoorCamera->fRotationYCosine] | |
269 fld [ebp+a1] // 0[(a1a[i].x - pIndoorCamera->pos.x)] | |
270 // 1[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
271 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
272 // 3[pIndoorCamera->fRotationXCosine] | |
273 // 4[pIndoorCamera->fRotationYSine] | |
274 // 5[pIndoorCamera->fRotationYCosine] | |
275 fmul st, st(4) // 0[pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] | |
276 // 1[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
277 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
278 // 3[pIndoorCamera->fRotationXCosine] | |
279 // 4[pIndoorCamera->fRotationYSine] | |
280 // 5[pIndoorCamera->fRotationYCosine] | |
281 fld [ebp+uNumVertices] // 0[(a1a[i].y - pIndoorCamera->pos.y)] | |
282 // 1[pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] | |
283 // 2[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
284 // 3[(a1a[i].z - pIndoorCamera->pos.z)] | |
285 // 4[pIndoorCamera->fRotationXCosine] | |
286 // 5[pIndoorCamera->fRotationYSine] | |
287 // 6[pIndoorCamera->fRotationYCosine] | |
288 fmul st, st(6) // 0[pIndoorCamera->fRotationYCosine * (a1a[i].y - pIndoorCamera->pos.y)] | |
289 // 1[pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] | |
290 // 2[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
291 // 3[(a1a[i].z - pIndoorCamera->pos.z)] | |
292 // 4[pIndoorCamera->fRotationXCosine] | |
293 // 5[pIndoorCamera->fRotationYSine] | |
294 // 6[pIndoorCamera->fRotationYCosine] | |
295 faddp st(1), st // 0[pIndoorCamera->fRotationYCosine * (a1a[i].y - pIndoorCamera->pos.y) + pIndoorCamera->fRotationYSine * (a1a[i].x - pIndoorCamera->pos.x)] | |
296 // 1[pIndoorCamera->fRotationYCosine * (a1a[i].x - pIndoorCamera->pos.x) - pIndoorCamera->fRotationYSine * (a1a[i].y - pIndoorCamera->pos.y)] | |
297 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
298 // 3[pIndoorCamera->fRotationXCosine] | |
299 // 4[pIndoorCamera->fRotationYSine] | |
300 // 5[pIndoorCamera->fRotationYCosine] | |
301 }*/ | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
302 st0 = cos_y * (a1a[i].vWorldPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) + sin_y * (a1a[i].vWorldPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
303 st1 = cos_y * (a1a[i].vWorldPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) - sin_y * (a1a[i].vWorldPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
304 st2 = (a1a[i].vWorldPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z); |
0 | 305 } |
306 | |
307 a1a[i].vWorldViewPosition.x = st1*cos_x - st2*sin_x; | |
308 a1a[i].vWorldViewPosition.y = st0; | |
309 a1a[i].vWorldViewPosition.z = st2*cos_x + st1*sin_x; | |
310 } | |
311 } | |
312 else | |
313 { | |
314 for (uint i = 0; i < uNumVertices; ++i) | |
315 { | |
2154 | 316 //if ( pRenderer->pRenderD3D ) |
0 | 317 { |
318 /*__asm | |
319 { | |
320 fld [ebp+uNumVertices] // 0[(a1a[i].y - pIndoorCamera->pos.y)] | |
321 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
322 // 2[sin_y] | |
323 // 3[cos_y] | |
324 fmul st, st(2) // 0[sin_y * (a1a[i].y - pIndoorCamera->pos.y)] | |
325 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
326 // 2[sin_y] | |
327 // 3[cos_y] | |
328 fld [ebp+a1] // 0[(a1a[i].x - pIndoorCamera->pos.x)] | |
329 // 1[sin_y * (a1a[i].y - pIndoorCamera->pos.y)] | |
330 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
331 // 3[sin_y] | |
332 // 4[cos_y] | |
333 fmul st, st(4) // 0[cos_y * (a1a[i].x - pIndoorCamera->pos.x)] | |
334 // 1[sin_y * (a1a[i].y - pIndoorCamera->pos.y)] | |
335 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
336 // 3[sin_y] | |
337 // 4[cos_y] | |
338 faddp st(1), st // 0[cos_y * (a1a[i].x - pIndoorCamera->pos.x) + sin_y * (a1a[i].y - pIndoorCamera->pos.y)] | |
339 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
340 // 2[sin_y] | |
341 // 3[cos_y] | |
342 fstp dword ptr [eax+0Ch] | |
343 fld [ebp+a1] // 0[(a1a[i].x - pIndoorCamera->pos.x)] | |
344 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
345 // 2[sin_y] | |
346 // 3[cos_y] | |
347 fmul st, st(2) // 0[sin_y * (a1a[i].x - pIndoorCamera->pos.x)] | |
348 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
349 // 2[sin_y] | |
350 // 3[cos_y] | |
351 fld [ebp+uNumVertices] // 0[(a1a[i].y - pIndoorCamera->pos.y)] | |
352 // 1[sin_y * (a1a[i].x - pIndoorCamera->pos.x)] | |
353 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
354 // 3[sin_y] | |
355 // 4[cos_y] | |
356 fmul st, st(4) // 0[cos_y * (a1a[i].y - pIndoorCamera->pos.y)] | |
357 // 1[sin_y * (a1a[i].x - pIndoorCamera->pos.x)] | |
358 // 2[(a1a[i].z - pIndoorCamera->pos.z)] | |
359 // 3[sin_y] | |
360 // 4[cos_y] | |
361 fsubp st(1), st // 0[sin_y * (a1a[i].x - pIndoorCamera->pos.x) - cos_y * (a1a[i].y - pIndoorCamera->pos.y)] | |
362 // 1[(a1a[i].z - pIndoorCamera->pos.z)] | |
363 // 2[sin_y] | |
364 // 3[cos_y] | |
365 fstp dword ptr [eax+10h] | |
366 fstp dword ptr [eax+14h] | |
367 }*/ | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
368 a1a[i].vWorldViewPosition.x = cos_y * (a1a[i].vWorldPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) + sin_y * (a1a[i].vWorldPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
369 a1a[i].vWorldViewPosition.y = sin_y * (a1a[i].vWorldPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) - cos_y * (a1a[i].vWorldPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
370 a1a[i].vWorldViewPosition.z = (a1a[i].vWorldPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z); |
0 | 371 } |
2154 | 372 if (false)//else |
0 | 373 { |
374 __debugbreak(); | |
375 /*__asm | |
376 { | |
377 fld [ebp+a1] | |
378 fmul st, st(3) | |
379 fld [ebp+uNumVertices] | |
380 fmul st, st(3) | |
381 fsubp st(1), st | |
382 fstp dword ptr [eax+0Ch] | |
383 fld [ebp+a1] | |
384 fmul st, st(2) | |
385 fld [ebp+uNumVertices] | |
386 fmul st, st(4) | |
387 faddp st(1), st | |
388 | |
389 fstp dword ptr [eax+10h] | |
390 fstp dword ptr [eax+14h] | |
391 }*/ | |
392 } | |
393 } | |
394 } | |
395 } | |
396 else for (uint i = 0; i < uNumVertices; ++i) | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
397 //pIndoorCamera->ViewTransform_ODM(a1a + i); |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
398 { |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
399 //ViewTransform_ODM(a1a + i); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
400 |
1980 | 401 RenderVertexSoft* a1 = &a1a[i]; |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
402 //----- (00481CCE) -------------------------------------------------------- |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
403 //void ViewTransform_ODM(RenderVertexSoft *a1) |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
404 { |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
405 float result; // eax@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
406 double vCamToVertexZ; // st7@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
407 double v3; // st6@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
408 double v4; // st5@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
409 double v5; // st4@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
410 float v6; // ST04_4@3 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
411 float v7; // [sp+0h] [bp-14h]@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
412 float v8; // [sp+8h] [bp-Ch]@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
413 float vCamToVertexX; // [sp+Ch] [bp-8h]@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
414 float vCamToVertexY; // [sp+10h] [bp-4h]@1 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
415 |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
416 v8 = fRotationXCosine; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
417 result = fRotationXSine; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
418 v7 = fRotationXSine; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
419 vCamToVertexX = a1->vWorldPosition.x - (double)pGame->pIndoorCameraD3D->vPartyPos.x; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
420 vCamToVertexY = a1->vWorldPosition.y - (double)pGame->pIndoorCameraD3D->vPartyPos.y; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
421 vCamToVertexZ = a1->vWorldPosition.z - (double)pGame->pIndoorCameraD3D->vPartyPos.z; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
422 v3 = fRotationYCosine; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
423 v4 = fRotationYSine; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
424 v5 = vCamToVertexY * fRotationYSine + fRotationYCosine * vCamToVertexX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
425 if (pGame->pIndoorCameraD3D->sRotationX) |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
426 { |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
427 v6 = vCamToVertexY * fRotationYSine + fRotationYCosine * vCamToVertexX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
428 a1->vWorldViewPosition.x = v5 * fRotationXCosine + fRotationXSine * vCamToVertexZ; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
429 a1->vWorldViewPosition.y = v3 * vCamToVertexY - v4 * vCamToVertexX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
430 a1->vWorldViewPosition.z = v8 * vCamToVertexZ - v6 * v7; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
431 } |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
432 else |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
433 { |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
434 a1->vWorldViewPosition.x = vCamToVertexY * fRotationYSine + fRotationYCosine * vCamToVertexX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
435 a1->vWorldViewPosition.y = v3 * vCamToVertexY - v4 * vCamToVertexX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
436 a1->vWorldViewPosition.z = vCamToVertexZ; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
437 } |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
438 } |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
439 } |
0 | 440 } |
441 | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
442 |
0 | 443 //----- (00436932) -------------------------------------------------------- |
444 bool IndoorCameraD3D::GetFacetOrientation(char polyType, Vec3_float_ *a2, Vec3_float_ *a3, Vec3_float_ *a4) | |
445 { | |
446 switch ((PolygonType)polyType) | |
447 { | |
448 case POLYGON_VerticalWall: | |
449 { | |
450 a4->x = -a2->y; | |
451 a4->y = a2->x; | |
452 a4->z = 0.0; | |
453 | |
454 a3->x = 0.0; | |
455 a3->y = 0.0; | |
456 a3->z = 1.0f; | |
457 } | |
458 return true; | |
459 | |
460 case POLYGON_Floor: | |
461 case POLYGON_Ceiling: | |
462 { | |
463 a4->x = 1.0; | |
464 a4->y = 0.0; | |
465 a4->z = 0.0; | |
466 | |
467 a3->x = 0.0; | |
468 a3->y = 1.0; | |
469 a3->z = 0.0; | |
470 } | |
471 return true; | |
472 | |
473 case POLYGON_InBetweenFloorAndWall: | |
474 case POLYGON_InBetweenCeilingAndWall: | |
475 { | |
476 if (fabs(a2->z) < 0.70811361) | |
477 { | |
478 a4->x = -a2->y; | |
479 a4->y = a2->x; | |
480 a4->z = 0.0; | |
481 a4->Normalize(); | |
482 | |
483 a3->x = 0.0; | |
484 a3->y = 0.0; | |
485 a3->z = 1.0; | |
486 } | |
487 else | |
488 { | |
489 a4->x = 1.0; | |
490 a4->y = 0.0; | |
491 a4->z = 0.0; | |
492 | |
493 a3->x = 0.0; | |
494 a3->y = 1.0; | |
495 a3->z = 0.0; | |
496 } | |
497 } | |
498 return true; | |
499 | |
500 default: | |
501 return false; | |
502 } | |
503 } | |
504 | |
505 //----- (00438258) -------------------------------------------------------- | |
506 bool IndoorCameraD3D::is_face_faced_to_camera(BLVFace *pFace, RenderVertexSoft *a2) | |
507 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
168
diff
changeset
|
508 if (pFace->Portal()) |
0 | 509 return false; |
510 | |
511 //really strange cull; dot(to_cam, normal) < 0 means we see the BACK face, not font %_% | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
512 if ( (a2->vWorldPosition.z - (double)pGame->pIndoorCameraD3D->vPartyPos.z) * (double)pFace->pFacePlane_old.vNormal.z |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
513 + (a2->vWorldPosition.y - (double)pGame->pIndoorCameraD3D->vPartyPos.y) * (double)pFace->pFacePlane_old.vNormal.y |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
514 + (a2->vWorldPosition.x - (double)pGame->pIndoorCameraD3D->vPartyPos.x) * (double)pFace->pFacePlane_old.vNormal.x < 0.0) |
0 | 515 return false; |
516 | |
517 return true; | |
518 } | |
519 | |
520 | |
521 //----- (00437AB5) -------------------------------------------------------- | |
2006 | 522 void IndoorCameraD3D::do_draw_debug_line_sw(RenderVertexSoft *pLineBegin, signed int sStartDiffuse, RenderVertexSoft *pLineEnd, signed int sEndDiffuse, unsigned int uOutNumVertices, float z_stuff) |
0 | 523 { |
524 RenderVertexSoft a1[20]; // [sp+8h] [bp-7C4h]@6 | |
525 RenderVertexSoft pVertices[20]; // [sp+3C8h] [bp-404h]@2 | |
526 RenderVertexD3D3 v24[2]; // [sp+788h] [bp-44h]@11 | |
527 | |
2154 | 528 //if ( pRenderer->pRenderD3D ) |
2277 | 529 //{ |
530 for ( uint i = 0; i < 20; i++ ) | |
531 pVertices[i].flt_2C = 0.0; | |
0 | 532 if ( (char)uOutNumVertices ) |
533 { | |
2277 | 534 pVertices[0].vWorldViewProjX = pLineBegin->vWorldViewProjX; |
0 | 535 pVertices[0].vWorldViewProjY = pLineBegin->vWorldViewProjY; |
2277 | 536 |
0 | 537 pVertices[1].vWorldViewProjX = pLineEnd->vWorldViewProjX; |
2277 | 538 pVertices[1].vWorldViewProjY = pLineEnd->vWorldViewProjY; |
0 | 539 v24[0].specular = 0; |
540 v24[0].pos.x = pVertices[0].vWorldViewProjX; | |
541 v24[0].pos.y = pVertices[0].vWorldViewProjY; | |
2277 | 542 v24[0].pos.z = 0.001 - z_stuff; |
2006 | 543 v24[0].diffuse = sStartDiffuse; |
0 | 544 v24[0].rhw = 0.001; |
2277 | 545 v24[0].texcoord.x = 0.0; |
546 v24[0].texcoord.y = 0.0; | |
547 | |
0 | 548 v24[1].pos.x = pVertices[1].vWorldViewProjX; |
549 v24[1].pos.y = pVertices[1].vWorldViewProjY; | |
2006 | 550 v24[1].diffuse = sEndDiffuse; |
2277 | 551 v24[1].pos.z = 0.001 - z_stuff; |
0 | 552 v24[1].specular = 0; |
553 v24[1].rhw = 0.001; | |
554 v24[1].texcoord.x = 0.0; | |
555 v24[1].texcoord.y = 0.0; | |
556 //v19 = pRenderer->pRenderD3D->pDevice; | |
2155 | 557 pRenderer->DrawLines(v24, 2); |
0 | 558 return; |
559 } | |
2277 | 560 for ( uint i = 0; i < 20; i++ ) |
561 a1[i].flt_2C = 0.0; | |
0 | 562 uOutNumVertices = 2; |
2277 | 563 a1[0].vWorldPosition.x = pLineBegin->vWorldPosition.x; |
0 | 564 a1[0].vWorldPosition.y = pLineBegin->vWorldPosition.y; |
2277 | 565 a1[0].vWorldPosition.z = pLineBegin->vWorldPosition.z; |
0 | 566 a1[1].vWorldPosition.x = pLineEnd->vWorldPosition.x; |
567 a1[1].vWorldPosition.y = pLineEnd->vWorldPosition.y; | |
2277 | 568 a1[1].vWorldPosition.z = pLineEnd->vWorldPosition.z; |
569 if ( CalcPortalShape(a1, &uOutNumVertices, pVertices, this->std__vector_000034_prolly_frustrum, 4, 1, 0) != 1 || (signed int)uOutNumVertices >= 2 ) | |
0 | 570 { |
2277 | 571 ViewTransform(pVertices, 2); |
572 Project(pVertices, 2, 0); | |
573 v24[0].specular = 0; | |
574 v24[0].pos.x = pVertices[0].vWorldViewProjX; | |
575 v24[0].pos.y = pVertices[0].vWorldViewProjY; | |
576 v24[0].pos.z = 0.001 - z_stuff; | |
577 v24[0].diffuse = sStartDiffuse; | |
578 v24[0].rhw = 0.001; | |
579 v24[0].texcoord.x = 0.0; | |
580 v24[0].texcoord.y = 0.0; | |
581 | |
582 v24[1].pos.x = pVertices[1].vWorldViewProjX; | |
583 v24[1].pos.y = pVertices[1].vWorldViewProjY; | |
584 v24[1].diffuse = sEndDiffuse; | |
585 v24[1].pos.z = 0.001 - z_stuff; | |
586 v24[1].specular = 0; | |
587 v24[1].rhw = 0.001; | |
588 v24[1].texcoord.x = 0.0; | |
589 v24[1].texcoord.y = 0.0; | |
590 //v19 = pRenderer->pRenderD3D->pDevice; | |
591 pRenderer->DrawLines(v24, 2); | |
592 return; | |
0 | 593 } |
2277 | 594 //} |
0 | 595 } |
596 | |
597 //----- (00437A55) -------------------------------------------------------- | |
598 void IndoorCameraD3D::debug_outline_d3d(const RenderVertexD3D3 *pLineVertices, unsigned int uNumLines, int uDiffuse, float z_stuff) | |
599 { | |
600 unsigned int v5; // esi@1 | |
601 const RenderVertexD3D3 *v6; // ecx@2 | |
602 unsigned int v7; // ebx@2 | |
603 const RenderVertexD3D3 *v8; // edi@3 | |
604 | |
605 v5 = 0; | |
606 if ( (signed int)(uNumLines - 1) > 0 ) | |
607 { | |
608 v6 = pLineVertices; | |
609 v5 = uNumLines - 1; | |
2277 | 610 for ( v7 = uNumLines - 1; v7; --v7 ) |
0 | 611 { |
612 v8 = v6 + 1; | |
2155 | 613 pRenderer->do_draw_debug_line_d3d(v6, uDiffuse, v6 + 1, uDiffuse, z_stuff); |
0 | 614 v6 = v8; |
615 } | |
616 } | |
2155 | 617 pRenderer->do_draw_debug_line_d3d(&pLineVertices[v5], uDiffuse, pLineVertices, uDiffuse, z_stuff); |
0 | 618 } |
619 | |
620 //----- (004379EE) -------------------------------------------------------- | |
621 void IndoorCameraD3D::debug_outline_sw(RenderVertexSoft *a2, unsigned int uNumVertices, unsigned int uDiffuse, float a5) | |
622 { | |
2281 | 623 if ( !uNumVertices ) |
624 return; | |
0 | 625 if ( (signed int)(uNumVertices - 1) > 0 ) |
626 { | |
2281 | 627 for ( uint i = 0; i < uNumVertices - 1; i++ ) |
628 do_draw_debug_line_sw(&a2[i], uDiffuse, &a2[i + 1], uDiffuse, 0, a5); | |
0 | 629 } |
2281 | 630 do_draw_debug_line_sw(&a2[uNumVertices - 1], uDiffuse, a2, uDiffuse, 0, a5); |
0 | 631 } |
632 | |
791 | 633 |
634 void IndoorCameraD3D::DebugDrawPortal(BLVFace *pFace) | |
635 { | |
1545 | 636 Assert(pFace->uNumVertices <= 32); |
791 | 637 |
638 RenderVertexSoft sw[32]; | |
639 for (uint i = 0; i < pFace->uNumVertices; ++i) | |
640 { | |
641 sw[i].vWorldPosition.x = pIndoor->pVertices[pFace->pVertexIDs[i]].x; | |
642 sw[i].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[i]].y; | |
643 sw[i].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[i]].z; | |
644 } | |
645 ViewTransform(sw, pFace->uNumVertices); | |
646 Project(sw, pFace->uNumVertices, 0); | |
647 | |
648 | |
649 | |
650 RenderVertexD3D3 v[32]; | |
651 for (uint i = 0; i < pFace->uNumVertices; ++i) | |
652 { | |
653 v[i].pos.x = sw[i].vWorldViewProjX; | |
654 v[i].pos.y = sw[i].vWorldViewProjY; | |
655 v[i].pos.z = 1.0 - 1.0 / (sw[i].vWorldViewPosition.x * 0.061758894); | |
656 v[i].rhw = 1.0 / sw[i].vWorldViewPosition.x; | |
657 v[i].diffuse = 0x80F020F0; | |
658 v[i].specular = 0; | |
659 //v[i].texcoord.x = pFace->pVertexUIDs[i] / (double)pTex->uTextureWidth; | |
660 //v[i].texcoord.y = pFace->pVertexUIDs[i] / (double)pTex->uTextureHeight; | |
661 v[i].texcoord.x = 0; | |
662 v[i].texcoord.y = 0; | |
663 } | |
664 | |
2155 | 665 pRenderer->DrawFansTransparent(v, pFace->uNumVertices); |
791 | 666 } |
667 | |
0 | 668 //----- (00437906) -------------------------------------------------------- |
669 void IndoorCameraD3D::PrepareAndDrawDebugOutline(BLVFace *pFace, unsigned int uDiffuse) | |
670 { | |
671 static RenderVertexSoft static_sub_437906_array_50CDD0[64]; | |
672 static bool __init_flag1 = false; | |
673 if (!__init_flag1) | |
674 { | |
675 __init_flag1 = true; | |
676 | |
677 for (uint i = 0; i < 64; ++i) | |
678 static_sub_437906_array_50CDD0[i].flt_2C = 0.0f; | |
679 } | |
680 if ( pFace->uNumVertices ) | |
681 { | |
1507 | 682 for ( uint i = 0; i < pFace->uNumVertices; i++ ) |
0 | 683 { |
1507 | 684 static_sub_437906_array_50CDD0[i].vWorldPosition.x = (double)pIndoor->pVertices[pFace->pVertexIDs[i]].x; |
685 static_sub_437906_array_50CDD0[i].vWorldPosition.y = (double)pIndoor->pVertices[pFace->pVertexIDs[i]].y; | |
686 static_sub_437906_array_50CDD0[i].vWorldPosition.z = (double)pIndoor->pVertices[pFace->pVertexIDs[i]].z; | |
687 static_sub_437906_array_50CDD0[i].u = (double)pFace->pVertexUIDs[i]; | |
688 static_sub_437906_array_50CDD0[i].v = (double)pFace->pVertexVIDs[i]; | |
0 | 689 } |
690 } | |
2277 | 691 if ( draw_portals_loops ) |
1507 | 692 debug_outline_sw(static_sub_437906_array_50CDD0, pFace->uNumVertices, uDiffuse, 0.0); |
0 | 693 } |
694 // 50D9D0: using guessed type char static_sub_437906_byte_50D9D0_init_flag; | |
695 | |
696 //----- (004378BA) -------------------------------------------------------- | |
697 void IndoorCameraD3D::MatrixMultiply(Matrix3x3_float_ *a1, Matrix3x3_float_ *a2, Matrix3x3_float_ *out) | |
698 { | |
699 float *v4; // ecx@1 | |
700 double v10; // st7@3 | |
701 double v11; // st6@3 | |
702 | |
703 v4 = (float *)out; | |
2245 | 704 for ( uint i = 0; i < 3; i++ ) |
0 | 705 { |
2245 | 706 for ( uint j = 0; j < 3; j++ ) |
0 | 707 { |
2245 | 708 v10 = a2->v[2][j] * a1->v[i][2] + a2->v[0][j] * a1->v[i][0]; |
709 v11 = a2->v[1][j] * a1->v[i][1]; | |
710 *v4 = v10 + v11; | |
711 ++v4; | |
0 | 712 } |
713 } | |
714 } | |
715 | |
716 //----- (004376E7) -------------------------------------------------------- | |
717 void IndoorCameraD3D::CreateWorldMatrixAndSomeStuff() | |
718 { | |
719 //IndoorCameraD3D *v1; // esi@1 | |
2334 | 720 // double v2; // st7@1 |
0 | 721 //signed int v3; // edi@1 |
722 //int v4; // eax@1 | |
723 //double v5; // st7@2 | |
724 //double v6; // st7@3 | |
725 Matrix3x3_float_ m1; // [sp+10h] [bp-B8h]@1 | |
726 Matrix3x3_float_ m2; // [sp+34h] [bp-94h]@1 | |
727 Matrix3x3_float_ m3; // [sp+58h] [bp-70h]@1 | |
728 Matrix3x3_float_ m4; // [sp+7Ch] [bp-4Ch]@1 | |
729 Matrix3x3_float_ m5; // [sp+A0h] [bp-28h]@1 | |
2334 | 730 // float v12; // [sp+C4h] [bp-4h]@1 |
0 | 731 |
732 //RotationZ(0) | |
733 m5._11 = cosf(0); m5._12 = sinf(0); m5._13 = 0; | |
734 m5._21 = -sinf(0); m5._22 = cosf(0); m5._23 = 0; | |
735 m5._31 = 0; m5._32 = 0; m5._33 = 1; | |
736 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
737 float cos_x1 = fRotationXCosine, |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
738 sin_x1 = fRotationXSine; |
0 | 739 //RotationX(x) |
740 m4._11 = 1; m4._12 = 0; m4._13 = 0; | |
741 m4._21 = 0; m4._22 = cos_x1; m4._23 = sin_x1; | |
742 m4._31 = 0; m4._32 = -sin_x1; m4._33 = cos_x1; | |
743 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
744 float cos_y1 = fRotationYCosine, |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
745 sin_y1 = fRotationYSine; |
0 | 746 //RotationY(some_angle) |
747 m3._11 = cos_y1; m3._12 = 0; m3._13 = -sin_y1; | |
748 m3._21 = 0; m3._22 = 1; m3._23 = 0; | |
749 m3._31 = sin_y1; m3._32 = 0; m3._33 = cos_y1; | |
750 | |
751 MatrixMultiply(&m5, &m3, &m1); | |
752 MatrixMultiply(&m4, &m1, &m2); | |
753 | |
754 for (uint i = 0; i < 3; ++i) | |
755 { | |
756 field_4[0].v[i] = m2.v[1][i]; | |
757 field_4[1].v[i] = m2.v[0][i]; | |
758 field_4[2].v[i] = m2.v[2][i]; | |
759 } | |
760 | |
761 inv_fov = 1.1344639; | |
762 fov_x = (double)pViewport->uScreenWidth * 0.8814736; | |
763 | |
764 fov_y = 0.8814736 * (double)pViewport->uScreenHeight; | |
765 fov = fov_y; | |
766 if ( fov_x > fov ) | |
767 fov = fov_x; | |
768 screenCenterX = (double)pViewport->uScreenCenterX; | |
692 | 769 screenCenterY = (double)(pViewport->uScreenCenterY - pViewport->uScreen_TL_Y); |
0 | 770 } |
771 | |
772 //----- (00437691) -------------------------------------------------------- | |
773 void IndoorCameraD3D::Vec3Transform(const IndoorCameraD3D_Vec3 *pVector, IndoorCameraD3D_Vec3 *pOut) | |
774 { | |
775 pOut->y = field_4[1].x * pVector->x + field_4[0].x * pVector->y + field_4[2].x * pVector->z; | |
776 pOut->z = field_4[1].y * pVector->x + field_4[0].y * pVector->y + field_4[2].y * pVector->z; | |
777 pOut->x = field_4[1].z * pVector->x + field_4[0].z * pVector->y + field_4[2].z * pVector->z; | |
778 } | |
779 | |
780 //----- (00437607) -------------------------------------------------------- | |
781 void IndoorCameraD3D::_437607(IndoorCameraD3D_Vec3 *a1, IndoorCameraD3D_Vec4 *a2) | |
782 { | |
783 double v4; // st7@1 | |
784 IndoorCameraD3D_Vec3 v8; // [sp+8h] [bp-1Ch]@1 | |
785 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
786 v8.x = (double)pGame->pIndoorCameraD3D->vPartyPos.x; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
787 v8.y = (double)pGame->pIndoorCameraD3D->vPartyPos.y; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
788 v8.z = (double)pGame->pIndoorCameraD3D->vPartyPos.z; |
0 | 789 Vec3Transform(a1, a2); |
790 | |
791 v4 = v8.x * a2->x + v8.y * a2->y + v8.z * a2->z; | |
792 a2->dot = v4 + 0.000099999997; | |
793 } | |
794 | |
795 //----- (004374E8) -------------------------------------------------------- | |
796 void IndoorCameraD3D::_4374E8_ProllyBuildFrustrum() | |
797 { | |
798 //IndoorCameraD3D *v1; // esi@1 | |
799 //double v2; // st7@1 | |
800 double v3; // st7@1 | |
801 //double v4; // st7@1 | |
802 double v5; // st7@1 | |
803 //double v6; // st7@1 | |
804 IndoorCameraD3D_Vec3 v7; // [sp+Ch] [bp-24h]@1 | |
805 //float v8; // [sp+10h] [bp-20h]@1 | |
806 //float v9; // [sp+14h] [bp-1Ch]@1 | |
807 //float v10; // [sp+18h] [bp-18h]@1 | |
808 //float v11; // [sp+1Ch] [bp-14h]@1 | |
809 //float v12; // [sp+20h] [bp-10h]@1 | |
810 //int v13; // [sp+2Ch] [bp-4h]@1 | |
811 | |
812 //v1 = this; | |
813 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v7); | |
814 //v2 = 2.0 / inv_fov; | |
815 //v13 = 0; | |
816 v3 = atan(2.0 / inv_fov * fov / fov_x); | |
817 //v12 = v3; | |
818 //v11 = sin(v3); | |
819 //v4 = cos(v3); | |
820 v7.x = -sin(v3); | |
821 v7.y = 0.0; | |
822 v7.z = cos(v3); | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
823 _437607(&v7, std__vector_000034_prolly_frustrum + 0); |
0 | 824 v7.x = sin(v3); |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
825 _437607(&v7, std__vector_000034_prolly_frustrum + 1); |
0 | 826 v5 = atan(2.0 / inv_fov * fov / (fov_y + 0.5)); |
827 //v12 = v5; | |
828 //v11 = sin(v5); | |
829 //v6 = cos(v5); | |
830 v7.y = sin(v5); | |
831 v7.x = 0.0; | |
832 v7.z = cos(v5); | |
833 _437607(&v7, &std__vector_000034_prolly_frustrum[2]); | |
834 v7.y = -sin(v5); | |
835 _437607(&v7, &std__vector_000034_prolly_frustrum[3]); | |
836 //v13 = -1; | |
837 //IndoorCameraD3D_Vec3::dtor(&v7); | |
838 } | |
839 | |
840 //----- (00437376) -------------------------------------------------------- | |
841 char IndoorCameraD3D::_437376(stru154 *thisa, RenderVertexSoft *a2, unsigned int *pOutNumVertices) | |
842 { | |
2245 | 843 //unsigned int v4; // ebx@1 |
844 //RenderVertexSoft *v5; // edx@2 | |
0 | 845 double v6; // st7@3 |
2245 | 846 //unsigned int v7; // edi@5 |
0 | 847 signed int v8; // esi@6 |
848 int v9; // ebx@8 | |
849 int v10; // eax@8 | |
2245 | 850 //int v11; // ecx@14 |
851 //int v12; // eax@14 | |
0 | 852 int v13; // eax@15 |
853 signed int v14; // ebx@17 | |
2245 | 854 //RenderVertexSoft *v15; // eax@18 |
0 | 855 unsigned int *v16; // eax@20 |
2334 | 856 // char result; // al@24 |
0 | 857 RenderVertexSoft v18; // [sp+Ch] [bp-34h]@2 |
858 int v19; // [sp+3Ch] [bp-4h]@8 | |
859 signed int thisb; // [sp+48h] [bp+8h]@6 | |
2245 | 860 bool a2_3; // [sp+4Fh] [bp+Fh]@5 |
0 | 861 |
2245 | 862 //v4 = *pOutNumVertices; |
863 //v5 = a2; | |
864 memcpy(&v18, a2, sizeof(v18)); | |
865 a2_3 = false; | |
866 memcpy(&a2[*pOutNumVertices], a2, sizeof(a2[*pOutNumVertices])); | |
867 memcpy(&a2[*pOutNumVertices + 1], &a2[1], sizeof(a2[*pOutNumVertices + 1])); | |
868 //v7 = *pOutNumVertices; | |
869 | |
0 | 870 if ( (signed int)*pOutNumVertices <= 3 |
2245 | 871 || (((v18.vWorldPosition.z - (double)pGame->pIndoorCameraD3D->vPartyPos.z) * thisa->face_plane.vNormal.z |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
872 + (v18.vWorldPosition.y - (double)pGame->pIndoorCameraD3D->vPartyPos.y) * thisa->face_plane.vNormal.y |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
873 + (v18.vWorldPosition.x - (double)pGame->pIndoorCameraD3D->vPartyPos.x) * thisa->face_plane.vNormal.x < 0.0) ? (v6 = 1.0) : (v6 = -1.0), |
0 | 874 (signed int)*pOutNumVertices <= 0) ) |
2245 | 875 return 0; |
0 | 876 v8 = 1; |
2245 | 877 for ( thisb = 1; thisb - 1 < (signed int)*pOutNumVertices; v8 = thisb ) |
0 | 878 { |
879 v9 = v8 - 1; | |
880 v10 = v8 + 1; | |
881 v19 = v8 + 1; | |
2245 | 882 if ( v8 - 1 >= (signed int)*pOutNumVertices ) |
883 v9 -= *pOutNumVertices; | |
884 if ( v8 >= (signed int)*pOutNumVertices ) | |
885 v8 -= *pOutNumVertices; | |
886 if ( v19 >= (signed int)*pOutNumVertices ) | |
887 v10 = v19 - *pOutNumVertices; | |
888 //v11 = (int)&a2[v10]; | |
889 //v12 = (int)&a2[v9]; | |
890 if ( -0.009999999776482582 > ((a2[v8].vWorldViewProjX - a2[v9].vWorldViewProjX) | |
891 * (a2[v10].vWorldViewProjY - a2[v9].vWorldViewProjY) | |
892 - (a2[v8].vWorldViewProjY - a2[v9].vWorldViewProjY) | |
893 * (a2[v10].vWorldViewProjX - a2[v9].vWorldViewProjX)) | |
0 | 894 * v6 ) |
895 { | |
896 thisb = v19; | |
897 v16 = pOutNumVertices; | |
898 } | |
899 else | |
900 { | |
901 v13 = thisb; | |
2245 | 902 if ( thisb >= (signed int)*pOutNumVertices ) |
903 v13 = thisb - *pOutNumVertices; | |
904 if ( v13 < (signed int)*pOutNumVertices ) | |
0 | 905 { |
2245 | 906 for ( v14 = v13; v14 < (signed int)*pOutNumVertices; ++v14 ) |
907 memcpy(&a2[v14], &a2[v14 + 1], sizeof(a2[v14])); | |
0 | 908 } |
909 v16 = pOutNumVertices; | |
2245 | 910 a2_3 = true; |
0 | 911 --*v16; |
912 } | |
2245 | 913 *pOutNumVertices = *v16; |
914 //if ( thisb - 1 >= (signed int)*v16 ) | |
915 //break; | |
0 | 916 } |
917 if ( a2_3 ) | |
2245 | 918 return true; |
0 | 919 else |
2245 | 920 return false; |
0 | 921 } |
922 | |
923 //----- (00437285) -------------------------------------------------------- | |
795 | 924 bool IndoorCameraD3D::CalcPortalShape(RenderVertexSoft *a1, unsigned int *pOutNumVertices, RenderVertexSoft *pVertices, IndoorCameraD3D_Vec4 *a4, signed int uNumVertices, char a6, int _unused) |
0 | 925 { |
2334 | 926 // char *v8; // eax@2 |
927 // signed int v9; // ecx@2 | |
0 | 928 //bool result; // eax@5 |
929 int v11; // ecx@5 | |
930 //signed int v12; // ecx@6 | |
931 //char *v13; // esi@6 | |
932 RenderVertexSoft *v14; // eax@8 | |
933 RenderVertexSoft *v15; // edx@8 | |
934 Vec3_float_ a5; // [sp+18h] [bp-3Ch]@12 | |
1317 | 935 //float v17; // [sp+44h] [bp-10h]@1 |
936 //int v18; // [sp+48h] [bp-Ch]@5 | |
0 | 937 //stru9 *thisa; // [sp+4Ch] [bp-8h]@1 |
938 int a7a; // [sp+53h] [bp-1h]@5 | |
939 //bool a6a; // [sp+70h] [bp+1Ch]@5 | |
940 | |
1317 | 941 //v17 = 0.0; |
0 | 942 //thisa = pGame->pStru9Instance; |
943 | |
944 static RenderVertexSoft sr_vertices_50D9D8[64]; | |
945 | |
946 //result = 0; | |
947 a7a = 0; | |
948 v11 = 2 * (a6 == 0) + 1; | |
949 //a6a = 0; | |
1317 | 950 //v18 = v11; |
0 | 951 if (uNumVertices <= 0) |
952 return false; | |
953 | |
954 //v12 = *pOutNumVertices; | |
955 //v13 = (char *)&a4->y; | |
1317 | 956 |
957 //while ( 1 ) | |
958 for ( uint i = 0; i < uNumVertices; ++i ) | |
959 { | |
960 if (i % 2) | |
961 { | |
962 v14 = a1; | |
963 v15 = sr_vertices_50D9D8; | |
964 } | |
965 else | |
0 | 966 { |
1317 | 967 v15 = a1; |
968 v14 = sr_vertices_50D9D8; | |
0 | 969 } |
1317 | 970 if (i == uNumVertices - 1) |
971 v14 = pVertices; | |
972 a5.x = a4[i].x; | |
973 a5.y = a4[i].y; | |
974 a5.z = a4[i].z; | |
975 pGame->pStru9Instance->CalcPortalShape(v15, *pOutNumVertices, v14, pOutNumVertices, &a5, a4[i].dot, (char *)&a7a, _unused); | |
976 //v12 = *pOutNumVertices; | |
977 if (*pOutNumVertices < v11) | |
978 { | |
979 *pOutNumVertices = 0; | |
980 return true; | |
981 } | |
982 //result = a6a; | |
983 //v13 += 24; | |
984 //if (++i >= uNumVertices) | |
985 // | |
986 } | |
987 return a7a; | |
0 | 988 } |
989 | |
990 //----- (004371C3) -------------------------------------------------------- | |
991 bool IndoorCameraD3D::_4371C3(RenderVertexSoft *pVertices, unsigned int *pOutNumVertices, int _unused) | |
992 { | |
2334 | 993 // char *v4; // eax@2 |
994 // signed int v5; // ecx@2 | |
0 | 995 RenderVertexSoft *v6; // esi@5 |
996 unsigned int *v7; // edi@5 | |
997 char *v8; // ecx@6 | |
998 int v9; // eax@6 | |
999 IndoorCameraD3D *thisa; // [sp+0h] [bp-Ch]@1 | |
1000 signed int v12; // [sp+4h] [bp-8h]@5 | |
1001 unsigned int pVerticesa; // [sp+14h] [bp+8h]@6 | |
1002 unsigned int pOutNumVerticesa; // [sp+18h] [bp+Ch]@6 | |
1003 | |
1004 thisa = this; | |
1005 | |
1006 | |
1007 static RenderVertexSoft static_4371C3_array_50E5E0[64]; | |
1008 static bool __init_flag1 = false; | |
1009 if (!__init_flag1) | |
1010 { | |
1011 __init_flag1 = true; | |
1012 | |
1013 for (uint i = 0; i < 64; ++i) | |
1014 static_4371C3_array_50E5E0[i].flt_2C = 0.0f; | |
1015 } | |
1016 | |
1017 v12 = 0; | |
1018 v6 = pVertices; | |
1019 v7 = pOutNumVertices; | |
1020 if ( (signed int)*pOutNumVertices > 0 ) | |
1021 { | |
1022 pOutNumVerticesa = (char *)static_4371C3_array_50E5E0 - (char *)pVertices; | |
1023 pVerticesa = (char *)&static_4371C3_array_50E5E0[0].vWorldViewProjY - (char *)pVertices; | |
1024 v8 = (char *)&static_4371C3_array_50E5E0[0].vWorldPosition.y; | |
1025 v9 = (int)&v6->vWorldPosition.z; | |
1026 do | |
1027 { | |
1028 ++v12; | |
1029 *((int *)v8 - 1) = *(int *)(v9 - 8); | |
1030 *(int *)v8 = *(int *)(v9 - 4); | |
1031 v8 += 48; | |
1032 *(float *)(pOutNumVerticesa + v9) = *(float *)v9; | |
1033 *(float *)(pVerticesa + v9) = *(float *)(v9 + 28); | |
168 | 1034 *(float *)((char *)&static_4371C3_array_50E5E0[0]._rhw - (char *)v6 + v9) = *(float *)(v9 + 32); |
0 | 1035 v9 += 48; |
1036 } | |
1037 while ( v12 < (signed int)*v7 ); | |
1038 } | |
795 | 1039 return CalcPortalShape( |
0 | 1040 static_4371C3_array_50E5E0, |
1041 v7, | |
1042 v6, | |
1043 thisa->std__vector_000034_prolly_frustrum, | |
1044 4, | |
1045 0, | |
1046 _unused); | |
1047 } | |
1048 // 50F1E0: using guessed type char static_sub_4371C3_byte_50F1E0_init_flags; | |
1049 | |
1050 //----- (00437143) -------------------------------------------------------- | |
2245 | 1051 void IndoorCameraD3D::_437143(unsigned int uNumInVertices, RenderVertexSoft *pOutVertices, RenderVertexSoft *pInVertices, unsigned int *pOutNumVertices) |
0 | 1052 { |
1053 double v9; // st7@3 | |
1054 | |
2245 | 1055 uint i = 0; |
1056 | |
1057 for ( i; i < uNumInVertices; ++i ) | |
0 | 1058 { |
2245 | 1059 pInVertices[i]._rhw = 1.0 / (pInVertices[i].vWorldViewPosition.x + 0.0000001); |
1060 memcpy(&pOutVertices[i], &pInVertices[i], sizeof(pOutVertices[i])); | |
1061 v9 = (double)pODMRenderParams->int_fov_rad * pInVertices[i]._rhw; | |
1062 pOutVertices[i].vWorldViewProjX = (double)pViewport->uScreenCenterX - v9 * pInVertices[i].vWorldViewPosition.y; | |
1063 pOutVertices[i].vWorldViewProjY = (double)pViewport->uScreenCenterY - v9 * pInVertices[i].vWorldViewPosition.z; | |
0 | 1064 } |
2245 | 1065 *pOutNumVertices = i; |
1066 return; | |
0 | 1067 } |
781 | 1068 |
0 | 1069 //----- (00436F09) -------------------------------------------------------- |
1070 void IndoorCameraD3D::_436F09_mess_with_lightmap__clipflag_4(RenderVertexSoft *pInVertices, int uNumInVertices, RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices) | |
1071 { | |
1072 unsigned int *pOutNumVertices_; // ebx@1 | |
1073 double v6; // st7@2 | |
1074 signed int v7; // esi@2 | |
1075 char *v8; // edx@5 | |
1076 unsigned int v9; // eax@10 | |
1077 RenderVertexSoft *v10; // ecx@11 | |
1078 double v11; // st6@11 | |
1079 double v12; // st6@12 | |
1080 unsigned int v13; // edi@14 | |
1081 unsigned __int8 v14; // c2@16 | |
1082 unsigned __int8 v15; // c3@16 | |
1083 unsigned int v16; // edi@17 | |
1084 bool a1a; // [sp+Ch] [bp+8h]@7 | |
1085 int a4a; // [sp+18h] [bp+14h]@5 | |
1086 | |
1087 pOutNumVertices_ = pOutNumVertices; | |
1088 *pOutNumVertices = 0; | |
1089 if ( uNumInVertices ) | |
1090 { | |
1091 memcpy(&pInVertices[uNumInVertices], pInVertices, sizeof(pInVertices[uNumInVertices])); | |
1637 | 1092 v6 = (double)pODMRenderParams->shading_dist_mist; |
0 | 1093 v7 = 0; |
1094 if ( v6 >= pInVertices->vWorldViewPosition.x ) | |
1095 v7 = 1; | |
1096 if ( uNumInVertices + 1 > 1 ) | |
1097 { | |
1098 a4a = uNumInVertices; | |
1099 v8 = (char *)&pInVertices[1].u; | |
1100 do | |
1101 { | |
1102 a1a = v6 >= *((float *)v8 - 6); | |
1103 if ( v7 == a1a ) | |
1104 { | |
1105 v10 = pOutVertices; | |
1106 goto LABEL_23; | |
1107 } | |
1108 v9 = *pOutNumVertices_; | |
1109 if ( a1a ) | |
1110 { | |
1111 v10 = pOutVertices; | |
1112 v11 = (v6 - *((float *)v8 - 18)) / (*((float *)v8 - 6) - *((float *)v8 - 18)); | |
1113 pOutVertices[v9].vWorldViewPosition.y = (*((float *)v8 - 5) - *((float *)v8 - 17)) * v11 + *((float *)v8 - 17); | |
1114 pOutVertices[*pOutNumVertices_].vWorldViewPosition.z = (*((float *)v8 - 4) - *((float *)v8 - 16)) * v11 | |
1115 + *((float *)v8 - 16); | |
1116 pOutVertices[*pOutNumVertices_].u = (*(float *)v8 - *((float *)v8 - 12)) * v11 + *((float *)v8 - 12); | |
1117 pOutVertices[*pOutNumVertices_].v = (*((float *)v8 + 1) - *((float *)v8 - 11)) * v11 + *((float *)v8 - 11); | |
1118 } | |
1119 else | |
1120 { | |
1121 v12 = (v6 - *((float *)v8 - 6)) / (*((float *)v8 - 18) - *((float *)v8 - 6)); | |
1122 pOutVertices[v9].vWorldViewPosition.y = (*((float *)v8 - 17) - *((float *)v8 - 5)) * v12 + *((float *)v8 - 5); | |
1123 pOutVertices[*pOutNumVertices_].vWorldViewPosition.z = (*((float *)v8 - 16) - *((float *)v8 - 4)) * v12 | |
1124 + *((float *)v8 - 4); | |
1125 pOutVertices[*pOutNumVertices_].u = (*((float *)v8 - 12) - *(float *)v8) * v12 + *(float *)v8; | |
1126 pOutVertices[*pOutNumVertices_].v = (*((float *)v8 - 11) - *((float *)v8 + 1)) * v12 + *((float *)v8 + 1); | |
1127 v10 = pOutVertices; | |
1128 } | |
1129 v10[*pOutNumVertices_].vWorldViewPosition.x = v6; | |
168 | 1130 v10[*pOutNumVertices_]._rhw = 1.0 / v6; |
0 | 1131 if ( v7 ) |
1132 { | |
1133 v13 = (unsigned int)&v10[*pOutNumVertices_]; | |
1134 if ( *(float *)(v13 + 12) != *((float *)v8 - 18) || *(float *)(v13 + 16) != *((float *)v8 - 17) ) | |
1135 goto LABEL_21; | |
1136 v14 = 0; | |
1137 v15 = *(float *)(v13 + 20) == *((float *)v8 - 16); | |
1138 } | |
1139 else | |
1140 { | |
1141 v16 = (unsigned int)&v10[*pOutNumVertices_]; | |
1142 if ( *(float *)(v16 + 12) != *((float *)v8 - 6) || *(float *)(v16 + 16) != *((float *)v8 - 5) ) | |
1143 { | |
1144 LABEL_21: | |
1145 ++*pOutNumVertices_; | |
1146 goto LABEL_23; | |
1147 } | |
1148 v14 = 0; | |
1149 v15 = *(float *)(v16 + 20) == *((float *)v8 - 4); | |
1150 } | |
1151 if ( !(v15 | v14) ) | |
1152 goto LABEL_21; | |
1153 LABEL_23: | |
1154 if ( a1a ) | |
1155 { | |
1156 memcpy(&v10[*pOutNumVertices_], v8 - 36, sizeof(v10[*pOutNumVertices_])); | |
168 | 1157 pOutVertices[*pOutNumVertices_]._rhw = 1.0 / (*((float *)v8 - 6) + 0.0000001); |
0 | 1158 pOutVertices[(*pOutNumVertices_)++].flt_2C = *((float *)v8 + 2); |
1159 } | |
1160 v7 = a1a; | |
1161 v8 += 48; | |
1162 --a4a; | |
1163 } | |
1164 while ( a4a ); | |
1165 } | |
1166 if ( (signed int)*pOutNumVertices_ < 3 ) | |
1167 *pOutNumVertices_ = 0; | |
1168 } | |
1169 } | |
1170 | |
1171 //----- (00436CDC) -------------------------------------------------------- | |
1172 void IndoorCameraD3D::_436CDC_mess_with_lightmap__clipflag_2(RenderVertexSoft *pInVertices, int uNumInVertices, RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices) | |
1173 { | |
1174 signed int v5; // esi@2 | |
1175 char *v6; // edx@5 | |
1176 unsigned int v7; // eax@10 | |
1177 RenderVertexSoft *v8; // ecx@11 | |
1178 double v9; // st6@11 | |
1179 double v10; // st6@12 | |
1180 unsigned int v11; // edi@14 | |
1181 unsigned __int8 v12; // c2@16 | |
1182 unsigned __int8 v13; // c3@16 | |
1183 unsigned int v14; // edi@17 | |
1184 bool a1a; // [sp+Ch] [bp+8h]@7 | |
1185 | |
1186 if ( uNumInVertices ) | |
1187 { | |
1188 *pOutNumVertices = 0; | |
1189 memcpy(&pInVertices[uNumInVertices], pInVertices, sizeof(pInVertices[uNumInVertices])); | |
1190 v5 = 0; | |
1191 if ( pInVertices->vWorldViewPosition.x >= 8.0 ) | |
1192 v5 = 1; | |
1193 if ( uNumInVertices + 1 > 1 ) | |
1194 { | |
1195 v6 = (char *)&pInVertices[1].u; | |
1196 do | |
1197 { | |
1198 a1a = *((float *)v6 - 6) >= 8.0; | |
1199 if ( v5 == a1a ) | |
1200 { | |
1201 v8 = pOutVertices; | |
1202 goto LABEL_23; | |
1203 } | |
1204 v7 = *pOutNumVertices; | |
1205 if ( a1a ) | |
1206 { | |
1207 v8 = pOutVertices; | |
1208 v9 = (8.0 - *((float *)v6 - 18)) / (*((float *)v6 - 6) - *((float *)v6 - 18)); | |
1209 pOutVertices[v7].vWorldViewPosition.y = (*((float *)v6 - 5) - *((float *)v6 - 17)) * v9 + *((float *)v6 - 17); | |
1210 pOutVertices[*pOutNumVertices].vWorldViewPosition.z = (*((float *)v6 - 4) - *((float *)v6 - 16)) * v9 | |
1211 + *((float *)v6 - 16); | |
1212 pOutVertices[*pOutNumVertices].u = (*(float *)v6 - *((float *)v6 - 12)) * v9 + *((float *)v6 - 12); | |
1213 pOutVertices[*pOutNumVertices].v = (*((float *)v6 + 1) - *((float *)v6 - 11)) * v9 + *((float *)v6 - 11); | |
1214 } | |
1215 else | |
1216 { | |
1217 v10 = (8.0 - *((float *)v6 - 6)) / (*((float *)v6 - 18) - *((float *)v6 - 6)); | |
1218 pOutVertices[v7].vWorldViewPosition.y = (*((float *)v6 - 17) - *((float *)v6 - 5)) * v10 + *((float *)v6 - 5); | |
1219 pOutVertices[*pOutNumVertices].vWorldViewPosition.z = (*((float *)v6 - 16) - *((float *)v6 - 4)) * v10 | |
1220 + *((float *)v6 - 4); | |
1221 pOutVertices[*pOutNumVertices].u = (*((float *)v6 - 12) - *(float *)v6) * v10 + *(float *)v6; | |
1222 pOutVertices[*pOutNumVertices].v = (*((float *)v6 - 11) - *((float *)v6 + 1)) * v10 + *((float *)v6 + 1); | |
1223 v8 = pOutVertices; | |
1224 } | |
1225 v8[*pOutNumVertices].vWorldViewPosition.x = 8.0; | |
168 | 1226 v8[*pOutNumVertices]._rhw = 0.125; |
0 | 1227 if ( v5 ) |
1228 { | |
1229 v11 = (unsigned int)&v8[*pOutNumVertices]; | |
1230 if ( *(float *)(v11 + 12) != *((float *)v6 - 18) || *(float *)(v11 + 16) != *((float *)v6 - 17) ) | |
1231 goto LABEL_21; | |
1232 v12 = 0; | |
1233 v13 = *(float *)(v11 + 20) == *((float *)v6 - 16); | |
1234 } | |
1235 else | |
1236 { | |
1237 v14 = (unsigned int)&v8[*pOutNumVertices]; | |
1238 if ( *(float *)(v14 + 12) != *((float *)v6 - 6) || *(float *)(v14 + 16) != *((float *)v6 - 5) ) | |
1239 { | |
1240 LABEL_21: | |
1241 ++*pOutNumVertices; | |
1242 goto LABEL_23; | |
1243 } | |
1244 v12 = 0; | |
1245 v13 = *(float *)(v14 + 20) == *((float *)v6 - 4); | |
1246 } | |
1247 if ( !(v13 | v12) ) | |
1248 goto LABEL_21; | |
1249 LABEL_23: | |
1250 if ( a1a ) | |
1251 { | |
1252 memcpy(&v8[*pOutNumVertices], v6 - 36, sizeof(v8[*pOutNumVertices])); | |
168 | 1253 pOutVertices[(*pOutNumVertices)++]._rhw = 1.0 / (*((float *)v6 - 6) + 0.0000001); |
0 | 1254 } |
1255 v5 = a1a; | |
1256 v6 += 48; | |
1257 --uNumInVertices; | |
1258 } | |
1259 while ( uNumInVertices ); | |
1260 } | |
1261 if ( (signed int)*pOutNumVertices < 3 ) | |
1262 *pOutNumVertices = 0; | |
1263 } | |
1264 } | |
1265 | |
1266 //----- (00436BB7) -------------------------------------------------------- | |
1267 void IndoorCameraD3D::Project(RenderVertexSoft *pVertices, unsigned int uNumVertices, char a4) | |
1268 { | |
1269 double v7; // st7@7 | |
1270 double v8; // st7@9 | |
1271 double v9; // st6@10 | |
1272 double v10; // st5@12 | |
1273 double v11; // st7@16 | |
1274 double v12; // st6@17 | |
1275 double v13; // st5@19 | |
1276 float uNumVerticesa; // [sp+14h] [bp+Ch]@13 | |
1277 float uNumVerticesb; // [sp+14h] [bp+Ch]@20 | |
1278 | |
1279 for (uint i = 0; i < uNumVertices; ++i) | |
1280 { | |
1281 if (byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1282 { | |
1283 v7 = 1.0 / pVertices[i].vWorldViewPosition.x; | |
1284 | |
1285 pVertices[i].vWorldViewProjX = pVertices[i].vWorldViewPosition.y * fov * v7 + screenCenterX; | |
693 | 1286 pVertices[i].vWorldViewProjY = (signed int)pViewport->uViewportBR_Y - (pVertices[i].vWorldViewPosition.z * fov * v7 + screenCenterY); |
0 | 1287 } |
1288 else | |
1289 { | |
1290 extern void _outdoor_project(RenderVertexSoft *v); | |
1291 _outdoor_project(pVertices + i); | |
1292 } | |
1293 | |
1294 if ( a4 ) | |
1295 { | |
96 | 1296 // __debugbreak(); |
693 | 1297 v8 = (double)(signed int)pViewport->uViewportBR_X; |
0 | 1298 if ( v8 >= pVertices[i].vWorldViewProjX ) |
1299 v9 = pVertices[i].vWorldViewProjX; | |
1300 else | |
1301 v9 = v8; | |
693 | 1302 v10 = (double)(signed int)pViewport->uViewportTL_X; |
0 | 1303 if ( v10 <= v9 ) |
1304 { | |
1305 if ( v8 >= pVertices[i].vWorldViewProjX) | |
1306 v8 = pVertices[i].vWorldViewProjX; | |
1307 } | |
1308 else | |
1309 { | |
1310 uNumVerticesa = v10; | |
1311 v8 = uNumVerticesa; | |
1312 } | |
1313 pVertices[i].vWorldViewProjX = v8; | |
693 | 1314 v11 = (double)(signed int)pViewport->uViewportBR_Y; |
0 | 1315 if ( v11 >= pVertices[i].vWorldViewProjY) |
1316 v12 = pVertices[i].vWorldViewProjY; | |
1317 else | |
1318 v12 = v11; | |
693 | 1319 v13 = (double)(signed int)pViewport->uViewportTL_Y; |
0 | 1320 if ( v13 <= v12 ) |
1321 { | |
1322 if ( v11 >= pVertices[i].vWorldViewProjY) | |
1323 v11 = pVertices[i].vWorldViewProjY; | |
1324 } | |
1325 else | |
1326 { | |
1327 uNumVerticesb = v13; | |
1328 v11 = uNumVerticesb; | |
1329 } | |
1330 pVertices[i].vWorldViewProjY = v11; | |
1331 } | |
1332 } | |
1333 } | |
1334 | |
1335 //----- (00436A9A) -------------------------------------------------------- | |
1336 void IndoorCameraD3D::Project(signed int x, signed int y, signed int z, int *a5, int *a6) | |
1337 { | |
1338 double v6; // ST00_8@2 | |
1339 //double v7; // ST08_8@2 | |
1340 //double v8; // ST00_8@2 | |
2334 | 1341 // signed __int64 v9; // qtt@3 |
1342 // int v10; // ST04_4@3 | |
0 | 1343 float a2a; // [sp+18h] [bp+8h]@2 |
1344 float a2b; // [sp+18h] [bp+8h]@2 | |
1345 | |
2154 | 1346 //if ( pRenderer->pRenderD3D ) |
0 | 1347 { |
1348 v6 = 1.0 / (double)x; | |
1349 a2a = (double)y * fov * v6 + screenCenterX; | |
1350 //v7 = a2a + 6.7553994e15; | |
1351 *a5 = floorf(a2a + 0.5f); | |
1352 a2b = (double)z * fov * v6 + screenCenterY; | |
1353 //v8 = a2b + 6.7553994e15; | |
693 | 1354 *a6 = pViewport->uViewportBR_Y - floorf(a2b + 0.5f); |
0 | 1355 } |
1641 | 1356 /*else |
0 | 1357 { |
1641 | 1358 LODWORD(v9) = pBLVRenderParams->fov_rad_fixpoint << 16; |
1359 HIDWORD(v9) = pBLVRenderParams->fov_rad_fixpoint >> 16; | |
0 | 1360 v10 = v9 / x; |
1641 | 1361 LODWORD(v9) = pBLVRenderParams->fov_rad_fixpoint << 16; |
1362 HIDWORD(v9) = pBLVRenderParams->fov_rad_fixpoint >> 16; | |
0 | 1363 *a5 = pBLVRenderParams->uViewportCenterX |
1364 - ((signed int)(((unsigned __int64)(v10 * (signed __int64)y) >> 16) + 32768) >> 16); | |
1365 *a6 = pBLVRenderParams->uViewportCenterY - ((signed int)(((unsigned __int64)(v9 / x * z) >> 16) + 32768) >> 16); | |
1641 | 1366 }*/ |
0 | 1367 } |
1368 | |
1369 //----- (00436A6D) -------------------------------------------------------- | |
1370 double IndoorCameraD3D::GetPolygonMinZ(RenderVertexSoft *pVertices, unsigned int uStripType) | |
1371 { | |
1372 unsigned int v3; // edx@1 | |
1373 double result; // st7@1 | |
1374 float *v5; // ecx@2 | |
1375 | |
1376 v3 = uStripType; | |
86 | 1377 result = 3.402823466385289e38; |
0 | 1378 if ( (signed int)uStripType > 0 ) |
1379 { | |
1380 v5 = &pVertices->vWorldPosition.z; | |
1381 do | |
1382 { | |
1383 if ( *v5 < result ) | |
1384 result = *v5; | |
1385 v5 += 12; | |
1386 --v3; | |
1387 } | |
1388 while ( v3 ); | |
1389 } | |
1390 return result; | |
1391 } | |
1392 | |
1393 //----- (00436A24) -------------------------------------------------------- | |
1394 struct IDirect3DTexture2 *IndoorCameraD3D::LoadTextureAndGetHardwarePtr(char *Str1) | |
1395 { | |
1396 return pBitmaps_LOD->pHardwareTextures[pBitmaps_LOD->LoadTexture(Str1)]; | |
1397 } | |
1398 | |
1399 //----- (00436A40) -------------------------------------------------------- | |
1400 double IndoorCameraD3D::GetPolygonMaxZ(RenderVertexSoft *pVertex, unsigned int uStripType) | |
1401 { | |
1402 double result; // st7@1 | |
1403 | |
1404 result = 1.1754944e-38; | |
2320 | 1405 for ( uint i = 0; i < uStripType; i++ ) |
0 | 1406 { |
2320 | 1407 if ( pVertex[i].vWorldPosition.z > result ) |
1408 result = pVertex[i].vWorldPosition.z; | |
0 | 1409 } |
1410 return result; | |
1642 | 1411 } |
1412 | |
1413 // -- new | |
1414 // merged from IndoorCamera::Initialize2 | |
1415 // and ODMRenderParams::RotationToInts | |
1416 // and BLVRenderParams::Reset | |
1417 void IndoorCameraD3D::CalculateRotations(int camera_rot_x, int camera_rot_y) | |
1418 { | |
1419 sRotationX = camera_rot_x; | |
1420 sRotationY = camera_rot_y; | |
1421 | |
1422 fRotationYSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationY / 2048.0); | |
1423 fRotationYCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationY / 2048.0); | |
1424 if (byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1425 { | |
1426 fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)-sRotationX / 2048.0); | |
1427 fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)-sRotationX / 2048.0); | |
1428 | |
1429 int_sine_y = stru_5C6E00->Sin( pGame->pIndoorCameraD3D->sRotationY); | |
1430 int_cosine_y = stru_5C6E00->Cos( pGame->pIndoorCameraD3D->sRotationY); | |
1431 int_sine_x = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX); | |
1432 int_cosine_x = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX); | |
1433 } | |
1434 else | |
1435 { | |
1436 fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationX / 2048.0); | |
1437 fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationX / 2048.0); | |
1438 | |
1439 int_sine_y = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY); | |
1440 int_cosine_y = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY); | |
1441 int_sine_x = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX); | |
1442 int_cosine_x = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX); | |
1443 } | |
0 | 1444 } |