annotate Engine/Graphics/IndoorCameraD3D.cpp @ 2575:a76d408c5132 tip

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