annotate IndoorCameraD3D.cpp @ 151:a8f4a158e284

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