annotate DecalBuilder.cpp @ 2350:7c10dfb6d802

Finishing moving all known UI functions to their appropriate headers
author Grumpy7
date Wed, 09 Apr 2014 21:45:07 +0200
parents ddb803517a48
children f4af3b203f65
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2245
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
2 #include "DecalBuilder.h"
Ritor1
parents:
diff changeset
3 #include "Game.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 1980
diff changeset
4 #include "Timer.h"
0
Ritor1
parents:
diff changeset
5 #include "stru314.h"
Ritor1
parents:
diff changeset
6 #include "Outdoor.h"
Ritor1
parents:
diff changeset
7 #include "Log.h"
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9 #include "mm7_data.h"
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2125
diff changeset
10 #include "mm7_unsorted_subs.h"
0
Ritor1
parents:
diff changeset
11
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 920
diff changeset
12 #include "stru9.h"
0
Ritor1
parents:
diff changeset
13
1277
1803172dffd9 header stuff
Grumpy7
parents: 1122
diff changeset
14 #include "Outdoor_stuff.h"
2195
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
15 #include "OurMath.h"
0
Ritor1
parents:
diff changeset
16
Ritor1
parents:
diff changeset
17
Ritor1
parents:
diff changeset
18 struct DecalBuilder *pDecalBuilder = new DecalBuilder;
Ritor1
parents:
diff changeset
19 struct BloodsplatContainer *pBloodsplatContainer = new BloodsplatContainer;
Ritor1
parents:
diff changeset
20
Ritor1
parents:
diff changeset
21
Ritor1
parents:
diff changeset
22 //----- (0043B570) --------------------------------------------------------
Ritor1
parents:
diff changeset
23 double DecalBuilder_stru0::_43B570_get_color_mult_by_time()
Ritor1
parents:
diff changeset
24 {
Ritor1
parents:
diff changeset
25 double result; // st7@3
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27 if (field_1C_flags & 1)
Ritor1
parents:
diff changeset
28 {
Ritor1
parents:
diff changeset
29 if ((field_20_time - pEventTimer->Time() + 384) / 384.0 >= 0.0)
Ritor1
parents:
diff changeset
30 result = (field_20_time - pEventTimer->Time() + 384) / 384.0;
Ritor1
parents:
diff changeset
31 else
Ritor1
parents:
diff changeset
32 result = 0.0;
Ritor1
parents:
diff changeset
33 }
Ritor1
parents:
diff changeset
34 else
Ritor1
parents:
diff changeset
35 result = 1.0;
Ritor1
parents:
diff changeset
36 return result;
Ritor1
parents:
diff changeset
37 }
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39 //----- (0043B6EF) --------------------------------------------------------
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
40 void BloodsplatContainer::AddBloodsplat(float x, float y, float z, float radius, unsigned char r, unsigned char g, unsigned char b)
0
Ritor1
parents:
diff changeset
41 {
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
42 int i = this->uNumBloodsplats;
0
Ritor1
parents:
diff changeset
43 if ( this->uNumBloodsplats == 64 )
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
44 i = 0;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
45 this->std__vector_pBloodsplats[i].x = x;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
46 this->std__vector_pBloodsplats[i].y = y;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
47 this->std__vector_pBloodsplats[i].z = z;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
48 this->std__vector_pBloodsplats[i].radius = radius;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
49 this->std__vector_pBloodsplats[i].r = r;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
50 this->std__vector_pBloodsplats[i].g = g;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
51 this->std__vector_pBloodsplats[i].b = b;
2195
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
52 this->std__vector_pBloodsplats_size = min(this->std__vector_pBloodsplats_size + 1, 64);
0
Ritor1
parents:
diff changeset
53 }
Ritor1
parents:
diff changeset
54
Ritor1
parents:
diff changeset
55 //----- (0049B490) --------------------------------------------------------
2195
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
56 void DecalBuilder::AddBloodsplat(float x, float y, float z, float r, float g, float b, float radius, int a8, int a9)
0
Ritor1
parents:
diff changeset
57 {
Ritor1
parents:
diff changeset
58 //double v10; // ST1C_8@1
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
59 // char v11; // ST24_1@1
0
Ritor1
parents:
diff changeset
60 //double v12; // ST1C_8@1
Ritor1
parents:
diff changeset
61 //double v13; // ST1C_8@1
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
62 // int a7a; // [sp+40h] [bp+18h]@1
0
Ritor1
parents:
diff changeset
63 //float arg14a; // [sp+44h] [bp+1Ch]@1
Ritor1
parents:
diff changeset
64 //float arg14b; // [sp+44h] [bp+1Ch]@1
Ritor1
parents:
diff changeset
65 //float arg14c; // [sp+44h] [bp+1Ch]@1
Ritor1
parents:
diff changeset
66
Ritor1
parents:
diff changeset
67 /*arg14a = b * 255.0;
Ritor1
parents:
diff changeset
68 v10 = arg14a + 6.7553994e15;
Ritor1
parents:
diff changeset
69 v11 = LOBYTE(v10);
Ritor1
parents:
diff changeset
70 arg14b = g * 255.0;
Ritor1
parents:
diff changeset
71 v12 = arg14b + 6.7553994e15;
Ritor1
parents:
diff changeset
72 a7a = LODWORD(v12);
Ritor1
parents:
diff changeset
73 arg14c = r * 255.0;
Ritor1
parents:
diff changeset
74 v13 = arg14c + 6.7553994e15;*/
2195
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
75 pBloodsplatContainer->AddBloodsplat(x, y, z, radius,
0
Ritor1
parents:
diff changeset
76 //SLOBYTE(v13), a7a, v11);
2195
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
77 bankersRounding(r * 255.0f),
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
78 bankersRounding(g * 255.0f),
70b63fe6587c fixing a few bugs reported by PVS
Grumpy7
parents: 2155
diff changeset
79 bankersRounding(b * 255.0f));
0
Ritor1
parents:
diff changeset
80 }
Ritor1
parents:
diff changeset
81
Ritor1
parents:
diff changeset
82 //----- (0049B525) --------------------------------------------------------
Ritor1
parents:
diff changeset
83 void DecalBuilder::Reset(unsigned int bPreserveBloodsplats)
Ritor1
parents:
diff changeset
84 {
Ritor1
parents:
diff changeset
85 if ( !bPreserveBloodsplats )
Ritor1
parents:
diff changeset
86 {
Ritor1
parents:
diff changeset
87 pBloodsplatContainer->std__vector_pBloodsplats_size = 0;
Ritor1
parents:
diff changeset
88 pBloodsplatContainer->uNumBloodsplats = 0;
Ritor1
parents:
diff changeset
89 }
Ritor1
parents:
diff changeset
90 std__vector_pDecals_size = 0;
Ritor1
parents:
diff changeset
91 }
Ritor1
parents:
diff changeset
92
Ritor1
parents:
diff changeset
93 //----- (0049B540) --------------------------------------------------------
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 186
diff changeset
94 char DecalBuilder::ApplyDecals(int light_level, char a3, stru154 *a4, int a5, RenderVertexSoft *a6, IndoorCameraD3D_Vec4 *a7, char a8, unsigned int uSectorID)
0
Ritor1
parents:
diff changeset
95 {
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
96 //char *v9; // eax@3
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
97 //signed int v10; // ecx@3
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
98 //RenderVertexSoft *v11; // eax@10
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
99 //unsigned int v12; // edx@10
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
100 //RenderVertexSoft *v13; // esi@11
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
101 //RenderVertexSoft *v14; // edi@11
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
102 //char v15; // zf@11
0
Ritor1
parents:
diff changeset
103 stru154 *v16; // esi@12
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
104 //double v18; // st7@17
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
105 //double v19; // st6@17
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
106 //float v20; // eax@17
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
107 //Bloodsplat *v21; // esi@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
108 //int v22; // eax@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
109 //int v23; // ecx@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
110 //double v24; // st7@21
0
Ritor1
parents:
diff changeset
111 int v25; // ebx@21
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
112 //double v26; // st7@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
113 //int v27; // edi@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
114 //double v28; // st7@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
115 //float v29; // ST10_4@21
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
116 // int v30; // ST08_4@21
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
117 //DecalBuilder *v31; // esi@21
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
118 //int v32; // [sp+4h] [bp-44h]@18
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
119 //float v33; // [sp+8h] [bp-40h]@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
120 //stru314 *v34; // [sp+Ch] [bp-3Ch]@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
121 //float v35; // [sp+10h] [bp-38h]@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
122 //float v36; // [sp+14h] [bp-34h]@17
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
123 //int v37; // [sp+18h] [bp-30h]@17
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
124 //int a5a; // [sp+28h] [bp-20h]@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
125 //int v39; // [sp+2Ch] [bp-1Ch]@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
126 //int v40; // [sp+30h] [bp-18h]@21
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
127 //int v41; // [sp+34h] [bp-14h]@22
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
128 //int v42; // [sp+38h] [bp-10h]@21
0
Ritor1
parents:
diff changeset
129 int v43; // [sp+3Ch] [bp-Ch]@21
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
130 //DecalBuilder *thisa; // [sp+40h] [bp-8h]@1
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
131 //RenderVertexSoft *a11; // [sp+44h] [bp-4h]@8
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
132 // int a6a;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
133 //int *a6b;
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
134
0
Ritor1
parents:
diff changeset
135
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
136 // __debugbreak();
0
Ritor1
parents:
diff changeset
137
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
138 //auto a2 = light_level;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
139 //auto a9 = uSectorID;
0
Ritor1
parents:
diff changeset
140
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
141 //thisa = this;
0
Ritor1
parents:
diff changeset
142 if ( !a5 )
Ritor1
parents:
diff changeset
143 return 0;
Ritor1
parents:
diff changeset
144
Ritor1
parents:
diff changeset
145 static RenderVertexSoft static_AE4F90[64];
Ritor1
parents:
diff changeset
146 static bool __init_flag1 = false;
Ritor1
parents:
diff changeset
147 if (!__init_flag1)
Ritor1
parents:
diff changeset
148 {
Ritor1
parents:
diff changeset
149 __init_flag1 = true;
Ritor1
parents:
diff changeset
150
Ritor1
parents:
diff changeset
151 for (uint i = 0; i < 64; ++i)
Ritor1
parents:
diff changeset
152 static_AE4F90[i].flt_2C = 0.0f;
Ritor1
parents:
diff changeset
153 }
Ritor1
parents:
diff changeset
154
Ritor1
parents:
diff changeset
155 static stru314 static_AE4F60; // idb
Ritor1
parents:
diff changeset
156 /*static bool __init_flag2 = false;
Ritor1
parents:
diff changeset
157 if (!__init_flag2)
Ritor1
parents:
diff changeset
158 {
Ritor1
parents:
diff changeset
159 __init_flag2 = true;
Ritor1
parents:
diff changeset
160
Ritor1
parents:
diff changeset
161 stru314::stru314(&static_AE4F60);
Ritor1
parents:
diff changeset
162 }*/
Ritor1
parents:
diff changeset
163
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
164 //a11 = a6;
0
Ritor1
parents:
diff changeset
165 if ( a7 )
Ritor1
parents:
diff changeset
166 {
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
167 for(int i=0; i < a5;i++)
0
Ritor1
parents:
diff changeset
168 {
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
169 memcpy(&static_AE4F90[i], a6, 0x30u);
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
170 ++a6;
0
Ritor1
parents:
diff changeset
171 }
Ritor1
parents:
diff changeset
172 v16 = a4;
Ritor1
parents:
diff changeset
173 if ( pGame->pIndoorCameraD3D->_437376(a4, static_AE4F90, (unsigned int *)&a5) == 1 )
Ritor1
parents:
diff changeset
174 {
Ritor1
parents:
diff changeset
175 if ( !a5 )
Ritor1
parents:
diff changeset
176 return 0;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
177 a6 = static_AE4F90;
0
Ritor1
parents:
diff changeset
178 }
Ritor1
parents:
diff changeset
179 }
Ritor1
parents:
diff changeset
180 else
Ritor1
parents:
diff changeset
181 v16 = a4;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
182 //v18 = v16->face_plane.vNormal.z;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
183 //v19 = v16->face_plane.vNormal.y;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
184 //v20 = v16->face_plane.vNormal.x;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
185 //v37 = (int)&static_AE4F60.field_1C;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
186 static_AE4F60.field_4.y = v16->face_plane.vNormal.y;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
187 static_AE4F60.field_4.x = v16->face_plane.vNormal.x;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
188 //LODWORD(v36) = (DWORD)&static_AE4F60.field_10;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
189 static_AE4F60.field_4.z = v16->face_plane.vNormal.z;
0
Ritor1
parents:
diff changeset
190 static_AE4F60.dist = v16->face_plane.dist;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
191 if ( !pGame->pIndoorCameraD3D->GetFacetOrientation(v16->polygonType, &static_AE4F60.field_4,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
192 &static_AE4F60.field_10, &static_AE4F60.field_1C) )
0
Ritor1
parents:
diff changeset
193 MessageBoxW(nullptr, L"Error: Failed to get the facet orientation", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:101", 0);
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
194
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
195 if ( this->uNumDecals > 0 )
0
Ritor1
parents:
diff changeset
196 {
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
197 //a6b = this->std__vector_30B00C;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
198 for ( int i = 0; i < this->uNumDecals; ++i )
0
Ritor1
parents:
diff changeset
199 {
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
200 //v21 = &pBloodsplatContainer->std__vector_pBloodsplats[*a6b];
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
201 int point_light_level = _43F5C8_get_point_light_level_with_respect_to_lights(light_level, uSectorID,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
202 pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].x,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
203 pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].y,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
204 pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].z);
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
205 //v23 = pBloodsplatContainer->std__vector_pBloodsplats[*a6b].b;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
206 //v24 = pBloodsplatContainer->std__vector_pBloodsplats[*a6b].x;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
207 //v42 = v22;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
208 //BYTE3(v22) = 0;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
209 //*(short *)((char *)&v22 + 1) = pBloodsplatContainer->std__vector_pBloodsplats[*a6b].r;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
210 //LOBYTE(v22) = pBloodsplatContainer->std__vector_pBloodsplats[*a6b].g;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
211 v43 = pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].b |
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
212 ((unsigned int)pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].g << 8) |
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
213 ((unsigned int)pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].r << 16);
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
214 v25 = (signed __int64)pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].x;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
215 //v27 = (signed __int64)pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].y;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
216 //v37 = a8;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
217 //v40 = (signed __int64)pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].z;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
218 //v28 = pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].dot_dist;
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
219 //LODWORD(v36) = (uint32)a6;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
220 //a5a = v25;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
221 //v39 = v27;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
222 //LODWORD(v35) = a5;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
223 //v34 = &static_AE4F60;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
224 //v33 = v28;
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
225 //v32 = pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].b | (v22 << 8);
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
226 //v29 = pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].radius;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
227 //v30 = (int)v21;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
228 //v31 = thisa;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
229 if ( !this->_49B790_build_decal_geometry(point_light_level, a3,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
230 &pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]],
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
231 (int)&v25,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
232 pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].radius,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
233 v43,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
234 pBloodsplatContainer->std__vector_pBloodsplats[this->std__vector_30B00C[i]].dot_dist,
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
235 &static_AE4F60, a5, a6, a8) )
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
236 MessageBoxW(nullptr, L"Error: Failed to build decal geometry", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:114", 0);
0
Ritor1
parents:
diff changeset
237 }
Ritor1
parents:
diff changeset
238 }
Ritor1
parents:
diff changeset
239 return 1;
Ritor1
parents:
diff changeset
240 }
Ritor1
parents:
diff changeset
241
Ritor1
parents:
diff changeset
242 //----- (0049B790) --------------------------------------------------------
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
243 char DecalBuilder::_49B790_build_decal_geometry(int a2, char a3, Bloodsplat *a4, int a5, float a6, unsigned int uColorMultiplier, float a8, stru314 *a9, signed int a10, RenderVertexSoft *a11, char uClipFlags)
0
Ritor1
parents:
diff changeset
244 {
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
245 //DecalBuilder *v12; // esi@1
0
Ritor1
parents:
diff changeset
246 Decal *v13; // edi@2
2325
846e28e41fb4 for bloodsplat
Ritor1
parents: 2314
diff changeset
247 //int *v14; // eax@2
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
248 //double v15; // st7@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
249 //double v16; // st7@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
250 //int v17; // eax@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
251 //stru314 *v18; // ebx@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
252 //double v19; // st7@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
253 //double v20; // st7@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
254 //double v21; // st7@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
255 //double v22; // st6@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
256 //double v23; // st6@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
257 //double v24; // st5@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
258 //char *v25; // eax@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
259 //signed int v26; // ecx@4
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
260 //double v27; // st5@4
0
Ritor1
parents:
diff changeset
261 double v28; // st7@5
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
262 //double v29; // st7@6
0
Ritor1
parents:
diff changeset
263 char result; // al@6
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
264 // unsigned int *v31; // edi@7
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
265 // RenderVertexSoft *v32; // ebx@8
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
266 // std::string *v33; // ecx@15
0
Ritor1
parents:
diff changeset
267 int v34; // eax@19
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
268 // const char *v35; // [sp-Ch] [bp-2Ch]@15
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
269 // int v36; // [sp-8h] [bp-28h]@15
0
Ritor1
parents:
diff changeset
270 std::string v37; // [sp-4h] [bp-24h]@15
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
271 //float v38; // [sp+8h] [bp-18h]@6
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
272 //RenderVertexSoft *v39; // [sp+Ch] [bp-14h]@6
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
273 //unsigned int v40; // [sp+10h] [bp-10h]@6
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
274
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
275 //int a6a;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
276 //RenderVertexSoft *a8a;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
277 unsigned int a8b = 0;
0
Ritor1
parents:
diff changeset
278
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
279 //v12 = this;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
280 if ( a6 == 0.0 )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
281 return 1;
0
Ritor1
parents:
diff changeset
282 v13 = &this->std__vector_pDecals[this->field_308008];
2325
846e28e41fb4 for bloodsplat
Ritor1
parents: 2314
diff changeset
283 //v14 = &this->std__vector_pDecals[this->field_308008].field_C1C;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
284 this->std__vector_pDecals[this->field_308008].field_C18 = (DecalBuilder_stru0 *)a4;
2325
846e28e41fb4 for bloodsplat
Ritor1
parents: 2314
diff changeset
285 this->std__vector_pDecals[this->field_308008].field_C1C = 0;
0
Ritor1
parents:
diff changeset
286 if ( a3 & 2 )
2325
846e28e41fb4 for bloodsplat
Ritor1
parents: 2314
diff changeset
287 this->std__vector_pDecals[this->field_308008].field_C1C = 1;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
288 //v15 = a6 - a8;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
289 this->field_30C028 = a6 - a8;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
290 //v16 = sqrt((a6 + a6 - this->field_30C028) * this->field_30C028);
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
291 this->field_30C02C = sqrt((a6 + a6 - this->field_30C028) * this->field_30C028);
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
292 //v17 = a5;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
293 //v18 = a9;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
294 this->flt_30C030 = 1.0 - (a6 - this->field_30C02C) / a6;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
295 v13->field_C08 = (signed __int64)(a4->x - a8 * a9->field_4.x);
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
296 v13->field_C0A = (signed __int64)(a4->y - a8 * a9->field_4.y);
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
297 //v19 = a6;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
298 v13->field_C0C = (signed __int64)(a4->z - a8 * a9->field_4.z);
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
299 //v20 = a6 * this->flt_30C030;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
300 //a8a = v13->pVertices;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
301 this->field_30C034 = a6 * this->flt_30C030;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
302 this->field_30C010 = this->field_30C034 * a9->field_10.x;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
303 this->field_30C014 = this->field_30C034 * a9->field_10.y;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
304 this->field_30C018 = this->field_30C034 * a9->field_10.z;
2314
8e9be4fa33a8 for Bloodsplat
Ritor1
parents: 2264
diff changeset
305
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
306 this->field_30C01C = this->field_30C034 * a9->field_1C.x;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
307 this->field_30C020 = this->field_30C034 * a9->field_1C.y;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
308 this->field_30C024 = this->field_30C034 * a9->field_1C.z;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
309 //a6a = v13->field_C08;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
310 //v21 = (double)v13->field_C08;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
311 //v22 = (double)v13->field_C08 - this->field_30C01C;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
312 //a6a = v13->field_C0A;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
313 v13->pVertices[0].vWorldPosition.x = (double)v13->field_C08 - this->field_30C01C + this->field_30C010;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
314 v13->pVertices[0].vWorldPosition.y = (double)v13->field_C0A - this->field_30C020 + this->field_30C014;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
315 v13->pVertices[0].vWorldPosition.z = (double)v13->field_C0A - this->field_30C024 + this->field_30C018;
0
Ritor1
parents:
diff changeset
316 v13->pVertices[0].u = 0.0;
Ritor1
parents:
diff changeset
317 v13->pVertices[0].v = 0.0;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
318
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
319 v13->pVertices[1].vWorldPosition.x = (double)v13->field_C08 - this->field_30C01C - this->field_30C010;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
320 v13->pVertices[1].vWorldPosition.y = (double)v13->field_C0A - this->field_30C020 - this->field_30C014;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
321 v13->pVertices[1].vWorldPosition.z = (double)v13->field_C0A - this->field_30C024 - this->field_30C018;
0
Ritor1
parents:
diff changeset
322 v13->pVertices[1].u = 0.0;
Ritor1
parents:
diff changeset
323 v13->pVertices[1].v = 1.0;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
324
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
325 v13->pVertices[2].vWorldPosition.x = (double)v13->field_C08 + this->field_30C01C - this->field_30C010;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
326 v13->pVertices[2].vWorldPosition.y = (double)v13->field_C0A + this->field_30C020 - this->field_30C014;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
327 v13->pVertices[2].vWorldPosition.z = (double)v13->field_C0A + this->field_30C024 - this->field_30C018;
0
Ritor1
parents:
diff changeset
328 v13->pVertices[2].u = 1.0;
Ritor1
parents:
diff changeset
329 v13->pVertices[2].v = 1.0;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
330
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
331 v13->pVertices[3].vWorldPosition.x = (double)v13->field_C08 + this->field_30C01C + this->field_30C010;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
332 v13->pVertices[3].vWorldPosition.y = (double)v13->field_C0A + this->field_30C020 + this->field_30C014;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
333 v13->pVertices[3].vWorldPosition.z = (double)v13->field_C0A + this->field_30C024 + this->field_30C018;
0
Ritor1
parents:
diff changeset
334 v13->pVertices[3].u = 1.0;
Ritor1
parents:
diff changeset
335 v13->pVertices[3].v = 0.0;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
336
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
337 for ( uint i = 0; i < 4; ++i )
0
Ritor1
parents:
diff changeset
338 {
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
339 v28 = a9->field_4.x * v13->pVertices[i].vWorldPosition.x
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
340 + a9->field_4.y * v13->pVertices[i].vWorldPosition.y
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
341 + a9->field_4.z * v13->pVertices[i].vWorldPosition.z
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
342 + a9->dist;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
343 v13->pVertices[i].vWorldPosition.x = v13->pVertices[i].vWorldPosition.x - v28 * a9->field_4.x;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
344 v13->pVertices[i].vWorldPosition.y = v13->pVertices[i].vWorldPosition.y - v28 * a9->field_4.y;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
345 v13->pVertices[i].vWorldPosition.z = v13->pVertices[i].vWorldPosition.z - v28 * a9->field_4.z;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
346 //v25 += 48;
0
Ritor1
parents:
diff changeset
347 }
Ritor1
parents:
diff changeset
348 v13->uColorMultiplier = uColorMultiplier;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
349 //v40 = (unsigned int *)&v13->uNumVertices;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
350 //v39 = v13->pVertices;
0
Ritor1
parents:
diff changeset
351 v13->uNumVertices = 4;
Ritor1
parents:
diff changeset
352 v13->field_C14 = a2;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
353 //v29 = a9->field_4.z;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
354 //a6a = (unsigned int *)&v13->uNumVertices;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
355 //v38 = a9->field_4.z;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
356 result = pGame->pStru9Instance->_4980B9(a11, a10, a9->field_4.x, a9->field_4.y, a9->field_4.z, v13->pVertices, (unsigned int*)&v13->uNumVertices);
0
Ritor1
parents:
diff changeset
357 if ( result )
Ritor1
parents:
diff changeset
358 {
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
359 //v31 = a6a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
360 if ( !v13->uNumVertices )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
361 return 1;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
362 //v32 = a8a;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
363 //v40 = *a6a;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
364 //v39 = a8a;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
365 pGame->pIndoorCameraD3D->ViewTransform(v13->pVertices, (unsigned int)v13->uNumVertices);
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
366 //v40 = 0;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
367 pGame->pIndoorCameraD3D->Project(v13->pVertices, v13->uNumVertices, 0);
0
Ritor1
parents:
diff changeset
368 if ( !(uClipFlags & 1) )
Ritor1
parents:
diff changeset
369 {
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
370 ++this->field_308008;
0
Ritor1
parents:
diff changeset
371 v34 = 1024;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
372 if ( this->field_308008 == 1024 )
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
373 this->field_308008 = 0;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
374 if ( (signed int)(this->std__vector_pDecals_size + 1) <= 1024 )
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
375 v34 = this->std__vector_pDecals_size + 1;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
376 this->std__vector_pDecals_size = v34;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
377 return 1;
0
Ritor1
parents:
diff changeset
378 }
Ritor1
parents:
diff changeset
379 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
Ritor1
parents:
diff changeset
380 {
Ritor1
parents:
diff changeset
381 if ( uClipFlags & 2 )
Ritor1
parents:
diff changeset
382 {
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
383 //v40 = (int)&a8;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
384 //v39 = this->pVertices;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
385 //__debugbreak(); // warning C4700: uninitialized local variable 'v31' used
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
386 pGame->pIndoorCameraD3D->_436CDC_mess_with_lightmap__clipflag_2(v13->pVertices, v13->uNumVertices, this->pVertices, &a8b);
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
387 //v40 = (int)v31;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
388 //v39 = this->pVertices;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
389 pGame->pIndoorCameraD3D->_437143(a8b, v13->pVertices, this->pVertices, (unsigned int *)v13->uNumVertices);
0
Ritor1
parents:
diff changeset
390 }
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
391 else if ( uClipFlags & 4 )
0
Ritor1
parents:
diff changeset
392 {
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
393 //v40 = (int)&a8;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
394 //v39 = this->pVertices;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
395 pGame->pIndoorCameraD3D->_436F09_mess_with_lightmap__clipflag_4(v13->pVertices, v13->uNumVertices, this->pVertices, &a8b);
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
396 //v40 = (int)v31;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
397 //v39 = this->pVertices;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
398 pGame->pIndoorCameraD3D->_437143(a8b, v13->pVertices, this->pVertices, (unsigned int *)v13->uNumVertices);
0
Ritor1
parents:
diff changeset
399 }
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
400 else
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
401 MessageBoxA(nullptr, "Undefined clip flag specified", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:258", 0);
0
Ritor1
parents:
diff changeset
402 }
Ritor1
parents:
diff changeset
403 else
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
404 MessageBoxA(nullptr, "Lightpoly builder native indoor clipping not implemented", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:263", 0);
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
405 if ( a8b != 0 )
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
406 {
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
407 ++this->field_308008;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
408 v34 = 1024;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
409 if ( this->field_308008 == 1024 )
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
410 this->field_308008 = 0;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
411 if ( (signed int)(this->std__vector_pDecals_size + 1) <= 1024 )
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
412 v34 = this->std__vector_pDecals_size + 1;
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
413 this->std__vector_pDecals_size = v34;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
414 return 1;
2245
8817c398b792 for RasterLine2D
Ritor1
parents: 2212
diff changeset
415 }
0
Ritor1
parents:
diff changeset
416 result = 1;
Ritor1
parents:
diff changeset
417 }
Ritor1
parents:
diff changeset
418 return result;
Ritor1
parents:
diff changeset
419 }
Ritor1
parents:
diff changeset
420
Ritor1
parents:
diff changeset
421 //----- (0049BBBD) --------------------------------------------------------
Ritor1
parents:
diff changeset
422 bool DecalBuilder::ApplyBloodsplatDecals_IndoorFace(unsigned int uFaceID)
Ritor1
parents:
diff changeset
423 {
Ritor1
parents:
diff changeset
424 double v7; // st7@12
Ritor1
parents:
diff changeset
425
1079
81a30c2e3e0a DecalBuilder small error
zipi
parents: 1077
diff changeset
426 uNumDecals = 0;
0
Ritor1
parents:
diff changeset
427 if (!pBloodsplatContainer->std__vector_pBloodsplats_size)
Ritor1
parents:
diff changeset
428 return true;
Ritor1
parents:
diff changeset
429
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1637
diff changeset
430 BLVFace* pFace = &pIndoor->pFaces[uFaceID];
0
Ritor1
parents:
diff changeset
431
2092
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2044
diff changeset
432 if ( pFace->Indoor_sky() || pFace->Fluid() )
0
Ritor1
parents:
diff changeset
433 return true;
Ritor1
parents:
diff changeset
434 for (uint i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; ++i)
Ritor1
parents:
diff changeset
435 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1637
diff changeset
436 Bloodsplat* pBloodsplat = &pBloodsplatContainer->std__vector_pBloodsplats[i];
0
Ritor1
parents:
diff changeset
437 if (pFace->pBounding.x1 - pBloodsplat->radius < pBloodsplat->x &&
Ritor1
parents:
diff changeset
438 pFace->pBounding.x2 + pBloodsplat->radius > pBloodsplat->x &&
Ritor1
parents:
diff changeset
439 pFace->pBounding.y1 - pBloodsplat->radius < pBloodsplat->y &&
Ritor1
parents:
diff changeset
440 pFace->pBounding.y2 + pBloodsplat->radius > pBloodsplat->y &&
Ritor1
parents:
diff changeset
441 pFace->pBounding.z1 - pBloodsplat->radius < pBloodsplat->z &&
Ritor1
parents:
diff changeset
442 pFace->pBounding.z2 + pBloodsplat->radius > pBloodsplat->z)
Ritor1
parents:
diff changeset
443 {
Ritor1
parents:
diff changeset
444 v7 = pFace->pFacePlane.vNormal.z * pBloodsplat->z +
Ritor1
parents:
diff changeset
445 pFace->pFacePlane.vNormal.y * pBloodsplat->y +
Ritor1
parents:
diff changeset
446 pFace->pFacePlane.vNormal.x * pBloodsplat->x +
Ritor1
parents:
diff changeset
447 pFace->pFacePlane.dist;
Ritor1
parents:
diff changeset
448 if (v7 <= pBloodsplat->radius)
Ritor1
parents:
diff changeset
449 {
Ritor1
parents:
diff changeset
450 pBloodsplat->dot_dist = v7;
Ritor1
parents:
diff changeset
451 std__vector_30B00C[uNumDecals++] = i;
Ritor1
parents:
diff changeset
452 }
Ritor1
parents:
diff changeset
453 }
Ritor1
parents:
diff changeset
454 }
Ritor1
parents:
diff changeset
455
Ritor1
parents:
diff changeset
456 return true;
Ritor1
parents:
diff changeset
457 }
Ritor1
parents:
diff changeset
458
Ritor1
parents:
diff changeset
459 //----- (0049BCEB) --------------------------------------------------------
Ritor1
parents:
diff changeset
460 char DecalBuilder::ApplyDecals_OutdoorFace(ODMFace *pFace)
Ritor1
parents:
diff changeset
461 {
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
462 double v8; // st7@12
2264
Ritor1
parents: 2253
diff changeset
463 //unsigned int v10; // [sp+20h] [bp-1Ch]@1
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
464
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
465 Bloodsplat *pBloodsplat;
0
Ritor1
parents:
diff changeset
466
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
467 this->uNumDecals = 0;
2264
Ritor1
parents: 2253
diff changeset
468 //v10 = pBloodsplatContainer->std__vector_pBloodsplats_size;
2092
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2044
diff changeset
469 if ( !pFace->Indoor_sky() && !pFace->Fluid() )
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
470 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
471 for(int i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; i++ )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
472 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
473 pBloodsplat = &pBloodsplatContainer->std__vector_pBloodsplats[i];
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
474 if ( (double)pFace->pBoundingBox.x1 - pBloodsplat->radius < pBloodsplat->x &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
475 (double)pFace->pBoundingBox.x2 + pBloodsplat->radius > pBloodsplat->x &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
476 (double)pFace->pBoundingBox.y1 - pBloodsplat->radius < pBloodsplat->y &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
477 (double)pFace->pBoundingBox.y2 + pBloodsplat->radius > pBloodsplat->y &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
478 (double)pFace->pBoundingBox.z1 - pBloodsplat->radius < pBloodsplat->z &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
479 (double)pFace->pBoundingBox.z2 + pBloodsplat->radius > pBloodsplat->z )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
480 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
481 v8 = (double)((pFace->pFacePlane.dist
2125
ba3de1337989 house animations working
zipi
parents: 2092
diff changeset
482 + round_to_int(pBloodsplat->x) * pFace->pFacePlane.vNormal.x
ba3de1337989 house animations working
zipi
parents: 2092
diff changeset
483 + round_to_int(pBloodsplat->y) * pFace->pFacePlane.vNormal.y
ba3de1337989 house animations working
zipi
parents: 2092
diff changeset
484 + round_to_int(pBloodsplat->z) * pFace->pFacePlane.vNormal.z) >> 16);
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
485 if ( v8 <= pBloodsplat->radius )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
486 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
487 pBloodsplat->dot_dist = v8;
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
488 this->std__vector_30B00C[this->uNumDecals++] = i;
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
489 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
490 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
491 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
492 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
493 return 1;
0
Ritor1
parents:
diff changeset
494 }
Ritor1
parents:
diff changeset
495
Ritor1
parents:
diff changeset
496 //----- (0049BE8A) --------------------------------------------------------
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
497 bool DecalBuilder::_49BE8A(struct Polygon *a2, Vec3_float_ *_a3, float *a4, RenderVertexSoft *a5, unsigned int uStripType, char a7)
0
Ritor1
parents:
diff changeset
498 {
Ritor1
parents:
diff changeset
499 bool result; // eax@1
2264
Ritor1
parents: 2253
diff changeset
500 //RenderVertexSoft *v8; // edi@3
Ritor1
parents: 2253
diff changeset
501 //Vec3_float_ *v9; // ebx@3
Ritor1
parents: 2253
diff changeset
502 //Bloodsplat *v10; // esi@3
Ritor1
parents: 2253
diff changeset
503 //float v11; // eax@5
0
Ritor1
parents:
diff changeset
504 float v12; // eax@6
2264
Ritor1
parents: 2253
diff changeset
505 //double v13; // st7@13
0
Ritor1
parents:
diff changeset
506 double v14; // st7@19
2264
Ritor1
parents: 2253
diff changeset
507 //short v15; // eax@20
0
Ritor1
parents:
diff changeset
508 int v16; // eax@22
2264
Ritor1
parents: 2253
diff changeset
509 //int v17; // edx@24
Ritor1
parents: 2253
diff changeset
510 //DecalBuilder *v18; // eax@24
0
Ritor1
parents:
diff changeset
511 std::string v19; // [sp-18h] [bp-54h]@12
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
512 // const char *v20; // [sp-8h] [bp-44h]@12
2264
Ritor1
parents: 2253
diff changeset
513 //int v21; // [sp-4h] [bp-40h]@12
0
Ritor1
parents:
diff changeset
514 double v22; // [sp+Ch] [bp-30h]@19
Ritor1
parents:
diff changeset
515 unsigned int v23; // [sp+14h] [bp-28h]@1
2264
Ritor1
parents: 2253
diff changeset
516 //DecalBuilder *v24; // [sp+18h] [bp-24h]@1
Ritor1
parents: 2253
diff changeset
517 //int v25; // [sp+1Ch] [bp-20h]@19
0
Ritor1
parents:
diff changeset
518 float v26; // [sp+20h] [bp-1Ch]@12
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2325
diff changeset
519 // int v27; // [sp+24h] [bp-18h]@12
0
Ritor1
parents:
diff changeset
520 float v28; // [sp+28h] [bp-14h]@13
2264
Ritor1
parents: 2253
diff changeset
521 //float v29; // [sp+2Ch] [bp-10h]@7
0
Ritor1
parents:
diff changeset
522 float v30; // [sp+30h] [bp-Ch]@6
Ritor1
parents:
diff changeset
523 float v31; // [sp+34h] [bp-8h]@6
Ritor1
parents:
diff changeset
524 bool v32; // [sp+38h] [bp-4h]@2
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
525 float a3;
0
Ritor1
parents:
diff changeset
526
Ritor1
parents:
diff changeset
527 this->uNumDecals = 0;
1113
39eaa6b00141 something to bool cast (performance warning) mostly fixed
Grumpy7
parents: 1086
diff changeset
528 result = pBloodsplatContainer->std__vector_pBloodsplats_size != 0;
2264
Ritor1
parents: 2253
diff changeset
529 // v24 = this;
0
Ritor1
parents:
diff changeset
530 v23 = pBloodsplatContainer->std__vector_pBloodsplats_size;
Ritor1
parents:
diff changeset
531 if ( pBloodsplatContainer->std__vector_pBloodsplats_size )
Ritor1
parents:
diff changeset
532 {
2264
Ritor1
parents: 2253
diff changeset
533
0
Ritor1
parents:
diff changeset
534 if ( (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 )
Ritor1
parents:
diff changeset
535 {
2264
Ritor1
parents: 2253
diff changeset
536 //v8 = a5;
Ritor1
parents: 2253
diff changeset
537 //v9 = _a3;
Ritor1
parents: 2253
diff changeset
538 for ( v32 = 0; v32 < (signed int)v23; ++v32 )
0
Ritor1
parents:
diff changeset
539 {
2264
Ritor1
parents: 2253
diff changeset
540 if ( uStripType == 4 )
Ritor1
parents: 2253
diff changeset
541 {
Ritor1
parents: 2253
diff changeset
542 a3 = a5->vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
543 //v11 = v8[3].vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
544 v31 = a5[3].vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
545 v30 = a5[1].vWorldPosition.y;
Ritor1
parents: 2253
diff changeset
546 v12 = a5->vWorldPosition.y;
Ritor1
parents: 2253
diff changeset
547 //v29 = v12;
Ritor1
parents: 2253
diff changeset
548 }
Ritor1
parents: 2253
diff changeset
549 else if ( uStripType == 3 )
0
Ritor1
parents:
diff changeset
550 {
Ritor1
parents:
diff changeset
551 if ( a7 )
Ritor1
parents:
diff changeset
552 {
2264
Ritor1
parents: 2253
diff changeset
553 a3 = a5->vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
554 v31 = a5[2].vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
555 v30 = a5[1].vWorldPosition.y;
Ritor1
parents: 2253
diff changeset
556 v12 = a5[2].vWorldPosition.y;
Ritor1
parents: 2253
diff changeset
557 //v29 = v12;
0
Ritor1
parents:
diff changeset
558 }
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
559 else
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
560 {
2264
Ritor1
parents: 2253
diff changeset
561 a3 = a5[1].vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
562 //v11 = v8[2].vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
563 v31 = a5[2].vWorldPosition.x;
Ritor1
parents: 2253
diff changeset
564 v30 = a5[1].vWorldPosition.y;
Ritor1
parents: 2253
diff changeset
565 v12 = a5->vWorldPosition.y;
Ritor1
parents: 2253
diff changeset
566 //v29 = v12;
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
567 }
0
Ritor1
parents:
diff changeset
568 }
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
569 else
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
570 MessageBoxW(nullptr, L"Uknown strip type detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:434", 0);
2264
Ritor1
parents: 2253
diff changeset
571 //v21 = uStripType;
Ritor1
parents: 2253
diff changeset
572 //v13 = pGame->pIndoorCameraD3D->GetPolygonMinZ(v8, uStripType);
Ritor1
parents: 2253
diff changeset
573 //v21 = uStripType;
Ritor1
parents: 2253
diff changeset
574 v28 = pGame->pIndoorCameraD3D->GetPolygonMinZ(a5, uStripType);
Ritor1
parents: 2253
diff changeset
575 v26 = pGame->pIndoorCameraD3D->GetPolygonMaxZ(a5, uStripType);
Ritor1
parents: 2253
diff changeset
576 if ( a3 - pBloodsplatContainer->std__vector_pBloodsplats[v32].radius < pBloodsplatContainer->std__vector_pBloodsplats[v32].x &&
Ritor1
parents: 2253
diff changeset
577 v31 + pBloodsplatContainer->std__vector_pBloodsplats[v32].radius > pBloodsplatContainer->std__vector_pBloodsplats[v32].x &&
Ritor1
parents: 2253
diff changeset
578 v30 - pBloodsplatContainer->std__vector_pBloodsplats[v32].radius < pBloodsplatContainer->std__vector_pBloodsplats[v32].y &&
Ritor1
parents: 2253
diff changeset
579 v12 + pBloodsplatContainer->std__vector_pBloodsplats[v32].radius > pBloodsplatContainer->std__vector_pBloodsplats[v32].y &&
Ritor1
parents: 2253
diff changeset
580 v28 - pBloodsplatContainer->std__vector_pBloodsplats[v32].radius < pBloodsplatContainer->std__vector_pBloodsplats[v32].z &&
Ritor1
parents: 2253
diff changeset
581 v26 + pBloodsplatContainer->std__vector_pBloodsplats[v32].radius > pBloodsplatContainer->std__vector_pBloodsplats[v32].z )
0
Ritor1
parents:
diff changeset
582 {
2264
Ritor1
parents: 2253
diff changeset
583 Vec3_float_::NegDot(&a5->vWorldPosition, _a3, a4);
Ritor1
parents: 2253
diff changeset
584 v26 = _a3->y * pBloodsplatContainer->std__vector_pBloodsplats[v32].y
Ritor1
parents: 2253
diff changeset
585 + _a3->z * pBloodsplatContainer->std__vector_pBloodsplats[v32].z
Ritor1
parents: 2253
diff changeset
586 + _a3->x * pBloodsplatContainer->std__vector_pBloodsplats[v32].x
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
587 + *a4;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
588 v22 = v26 + 6.7553994e15;
2264
Ritor1
parents: 2253
diff changeset
589 //v25 = LODWORD(v22);
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
590 v14 = (double)SLODWORD(v22);
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
591 v28 = v14;
2264
Ritor1
parents: 2253
diff changeset
592 if ( v14 <= pBloodsplatContainer->std__vector_pBloodsplats[v32].radius )
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
593 {
2264
Ritor1
parents: 2253
diff changeset
594 //v15 = a2->flags;
2212
e18200fcfb50 LoadTextureFromLOD
Ritor1
parents: 2195
diff changeset
595 if ( a2->flags & 2 || a2->flags & 0x100 )
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
596 {
2264
Ritor1
parents: 2253
diff changeset
597 v16 = pBloodsplatContainer->std__vector_pBloodsplats[v32].field_1C;
Ritor1
parents: 2253
diff changeset
598 if ( !(pBloodsplatContainer->std__vector_pBloodsplats[v32].field_1C & 1) )
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
599 {
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
600 LOBYTE(v16) = v16 | 1;
2264
Ritor1
parents: 2253
diff changeset
601 pBloodsplatContainer->std__vector_pBloodsplats[v32].field_1C = v16;
Ritor1
parents: 2253
diff changeset
602 pBloodsplatContainer->std__vector_pBloodsplats[v32].field_20 = pEventTimer->Time();
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
603 }
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
604 }
2264
Ritor1
parents: 2253
diff changeset
605 //v17 = v32;
Ritor1
parents: 2253
diff changeset
606 pBloodsplatContainer->std__vector_pBloodsplats[v32].dot_dist = LODWORD(v28);
Ritor1
parents: 2253
diff changeset
607 //v18 = this;
Ritor1
parents: 2253
diff changeset
608 this->std__vector_30B00C[this->uNumDecals] = v32;
Ritor1
parents: 2253
diff changeset
609 ++this->uNumDecals;
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
610 }
0
Ritor1
parents:
diff changeset
611 }
2264
Ritor1
parents: 2253
diff changeset
612 //++v32;
Ritor1
parents: 2253
diff changeset
613 //++v10;
0
Ritor1
parents:
diff changeset
614 result = v32;
Ritor1
parents:
diff changeset
615 }
Ritor1
parents:
diff changeset
616 }
Ritor1
parents:
diff changeset
617 }
Ritor1
parents:
diff changeset
618 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
619 return result;
Ritor1
parents:
diff changeset
620 }
Ritor1
parents:
diff changeset
621
Ritor1
parents:
diff changeset
622
Ritor1
parents:
diff changeset
623 //----- (0049C2CD) --------------------------------------------------------
Ritor1
parents:
diff changeset
624 void DecalBuilder::DrawDecals(float z_bias)
Ritor1
parents:
diff changeset
625 {
Ritor1
parents:
diff changeset
626 for (uint i = 0; i < std__vector_pDecals_size; ++i)
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2152
diff changeset
627 pRenderer->DrawDecal(std__vector_pDecals + i, z_bias);
0
Ritor1
parents:
diff changeset
628 }
Ritor1
parents:
diff changeset
629
Ritor1
parents:
diff changeset
630 //----- (0049C304) --------------------------------------------------------
Ritor1
parents:
diff changeset
631 void DecalBuilder::DrawBloodsplats()
Ritor1
parents:
diff changeset
632 {
Ritor1
parents:
diff changeset
633 if (!std__vector_pDecals_size)
Ritor1
parents:
diff changeset
634 return;
Ritor1
parents:
diff changeset
635
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2152
diff changeset
636 pRenderer->BeginDecals();
0
Ritor1
parents:
diff changeset
637
Ritor1
parents:
diff changeset
638 DrawDecals(0.00039999999);
Ritor1
parents:
diff changeset
639
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2152
diff changeset
640 pRenderer->EndDecals();
0
Ritor1
parents:
diff changeset
641 }
Ritor1
parents:
diff changeset
642
Ritor1
parents:
diff changeset
643 //----- (0049C550) --------------------------------------------------------
Ritor1
parents:
diff changeset
644 void DecalBuilder::DrawDecalDebugOutlines()
Ritor1
parents:
diff changeset
645 {
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
646 for(int i = 0; i < std__vector_pDecals_size; i++)
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
647 pGame->pIndoorCameraD3D->debug_outline_sw(std__vector_pDecals[i].pVertices, std__vector_pDecals[i].uNumVertices, 0xC86400u, 0.0);
0
Ritor1
parents:
diff changeset
648 }
Ritor1
parents:
diff changeset
649
Ritor1
parents:
diff changeset
650 //----- (0040E4C2) --------------------------------------------------------
Ritor1
parents:
diff changeset
651 void Decal::Decal_base_ctor()
Ritor1
parents:
diff changeset
652 {
Ritor1
parents:
diff changeset
653 uNumVertices = -1;
Ritor1
parents:
diff changeset
654 for (uint i = 0; i < 64; ++i)
Ritor1
parents:
diff changeset
655 pVertices[i].flt_2C = 0.0f;
Ritor1
parents:
diff changeset
656 }