comparison Engine/Graphics/DecalBuilder.cpp @ 2562:b8a56afc6ba1

new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
author Ritor1
date Sun, 17 May 2015 22:42:13 +0600
parents b6140dfeac27
children f2f2595fe308
comparison
equal deleted inserted replaced
2561:98057834c9a0 2562:b8a56afc6ba1
149 v16 = a4; 149 v16 = a4;
150 //v18 = v16->face_plane.vNormal.z; 150 //v18 = v16->face_plane.vNormal.z;
151 //v19 = v16->face_plane.vNormal.y; 151 //v19 = v16->face_plane.vNormal.y;
152 //v20 = v16->face_plane.vNormal.x; 152 //v20 = v16->face_plane.vNormal.x;
153 //v37 = (int)&static_AE4F60.field_1C; 153 //v37 = (int)&static_AE4F60.field_1C;
154 static_AE4F60.field_4.y = v16->face_plane.vNormal.y; 154 static_AE4F60.Normal.y = v16->face_plane.vNormal.y;
155 static_AE4F60.field_4.x = v16->face_plane.vNormal.x; 155 static_AE4F60.Normal.x = v16->face_plane.vNormal.x;
156 //LODWORD(v36) = (DWORD)&static_AE4F60.field_10; 156 //LODWORD(v36) = (DWORD)&static_AE4F60.field_10;
157 static_AE4F60.field_4.z = v16->face_plane.vNormal.z; 157 static_AE4F60.Normal.z = v16->face_plane.vNormal.z;
158 static_AE4F60.dist = v16->face_plane.dist; 158 static_AE4F60.dist = v16->face_plane.dist;
159 if ( !pIndoorCameraD3D->GetFacetOrientation(v16->polygonType, &static_AE4F60.field_4, 159 if ( !pIndoorCameraD3D->GetFacetOrientation(v16->polygonType, &static_AE4F60.Normal,
160 &static_AE4F60.field_10, &static_AE4F60.field_1C) ) 160 &static_AE4F60.field_10, &static_AE4F60.field_1C) )
161 MessageBoxW(nullptr, L"Error: Failed to get the facet orientation", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:101", 0); 161 MessageBoxW(nullptr, L"Error: Failed to get the facet orientation", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:101", 0);
162 162
163 if ( this->uNumDecals > 0 ) 163 if ( this->uNumDecals > 0 )
164 { 164 {
227 this->std__vector_pDecals[this->field_308008].field_C1C = 1; 227 this->std__vector_pDecals[this->field_308008].field_C1C = 1;
228 this->field_30C028 = a6 - a8; 228 this->field_30C028 = a6 - a8;
229 this->field_30C02C = sqrt((a6 + a6 - this->field_30C028) * this->field_30C028); 229 this->field_30C02C = sqrt((a6 + a6 - this->field_30C028) * this->field_30C028);
230 230
231 this->flt_30C030 = 1.0 - (a6 - this->field_30C02C) / a6; 231 this->flt_30C030 = 1.0 - (a6 - this->field_30C02C) / a6;
232 decal->field_C08 = (signed __int64)(blood->x - a8 * a9->field_4.x); 232 decal->field_C08 = (signed __int64)(blood->x - a8 * a9->Normal.x);
233 decal->field_C0A = (signed __int64)(blood->y - a8 * a9->field_4.y); 233 decal->field_C0A = (signed __int64)(blood->y - a8 * a9->Normal.y);
234 decal->field_C0C = (signed __int64)(blood->z - a8 * a9->field_4.z); 234 decal->field_C0C = (signed __int64)(blood->z - a8 * a9->Normal.z);
235 235
236 this->field_30C034 = a6 * this->flt_30C030; 236 this->field_30C034 = a6 * this->flt_30C030;
237 this->field_30C010 = this->field_30C034 * a9->field_10.x; 237 this->field_30C010 = this->field_30C034 * a9->field_10.x;
238 this->field_30C014 = this->field_30C034 * a9->field_10.y; 238 this->field_30C014 = this->field_30C034 * a9->field_10.y;
239 this->field_30C018 = this->field_30C034 * a9->field_10.z; 239 this->field_30C018 = this->field_30C034 * a9->field_10.z;
266 decal->pVertices[3].u = 1.0; 266 decal->pVertices[3].u = 1.0;
267 decal->pVertices[3].v = 0.0; 267 decal->pVertices[3].v = 0.0;
268 268
269 for ( uint i = 0; i < 4; ++i ) 269 for ( uint i = 0; i < 4; ++i )
270 { 270 {
271 v28 = a9->field_4.x * decal->pVertices[i].vWorldPosition.x 271 v28 = a9->Normal.x * decal->pVertices[i].vWorldPosition.x
272 + a9->field_4.y * decal->pVertices[i].vWorldPosition.y 272 + a9->Normal.y * decal->pVertices[i].vWorldPosition.y
273 + a9->field_4.z * decal->pVertices[i].vWorldPosition.z 273 + a9->Normal.z * decal->pVertices[i].vWorldPosition.z
274 + a9->dist; 274 + a9->dist;
275 decal->pVertices[i].vWorldPosition.x = decal->pVertices[i].vWorldPosition.x - v28 * a9->field_4.x; 275 decal->pVertices[i].vWorldPosition.x = decal->pVertices[i].vWorldPosition.x - v28 * a9->Normal.x;
276 decal->pVertices[i].vWorldPosition.y = decal->pVertices[i].vWorldPosition.y - v28 * a9->field_4.y; 276 decal->pVertices[i].vWorldPosition.y = decal->pVertices[i].vWorldPosition.y - v28 * a9->Normal.y;
277 decal->pVertices[i].vWorldPosition.z = decal->pVertices[i].vWorldPosition.z - v28 * a9->field_4.z; 277 decal->pVertices[i].vWorldPosition.z = decal->pVertices[i].vWorldPosition.z - v28 * a9->Normal.z;
278 } 278 }
279 decal->uColorMultiplier = uColorMultiplier; 279 decal->uColorMultiplier = uColorMultiplier;
280 decal->uNumVertices = 4; 280 decal->uNumVertices = 4;
281 decal->field_C14 = a2; 281 decal->field_C14 = a2;
282 result = pEngine->pStru9Instance->_4980B9(a11, a10, a9->field_4.x, a9->field_4.y, a9->field_4.z, decal->pVertices, (signed int*)&decal->uNumVertices); 282 result = pEngine->pStru9Instance->_4980B9(a11, a10, a9->Normal.x, a9->Normal.y, a9->Normal.z, decal->pVertices, (signed int*)&decal->uNumVertices);
283 if ( result ) 283 if ( result )
284 { 284 {
285 if ( !decal->uNumVertices ) 285 if ( !decal->uNumVertices )
286 return 1; 286 return 1;
287 287
300 } 300 }
301 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) 301 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
302 { 302 {
303 if ( uClipFlags & 2 ) 303 if ( uClipFlags & 2 )
304 { 304 {
305 pIndoorCameraD3D->_436CDC_mess_with_lightmap__clipflag_2(decal->pVertices, decal->uNumVertices, this->pVertices, &a8b); 305 pIndoorCameraD3D->LightmapNeerClip(decal->pVertices, decal->uNumVertices, this->pVertices, &a8b);
306 pIndoorCameraD3D->_437143(a8b, decal->pVertices, this->pVertices, (signed int *)&decal->uNumVertices); 306 pIndoorCameraD3D->_437143(a8b, decal->pVertices, this->pVertices, (signed int *)&decal->uNumVertices);
307 } 307 }
308 else if ( uClipFlags & 4 ) 308 else if ( uClipFlags & 4 )
309 { 309 {
310 pIndoorCameraD3D->_436F09_mess_with_lightmap__clipflag_4(decal->pVertices, decal->uNumVertices, this->pVertices, &a8b); 310 pIndoorCameraD3D->LightmapFarClip(decal->pVertices, decal->uNumVertices, this->pVertices, &a8b);
311 pIndoorCameraD3D->_437143(a8b, decal->pVertices, this->pVertices, (signed int *)&decal->uNumVertices); 311 pIndoorCameraD3D->_437143(a8b, decal->pVertices, this->pVertices, (signed int *)&decal->uNumVertices);
312 } 312 }
313 else 313 else
314 MessageBoxA(nullptr, "Undefined clip flag specified", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:258", 0); 314 MessageBoxA(nullptr, "Undefined clip flag specified", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:258", 0);
315 } 315 }