annotate IndoorCameraD3D.cpp @ 1036:7f8be9f9769e

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