comparison Engine/Graphics/stru9.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 a902abdfc7f2
children
comparison
equal deleted inserted replaced
2561:98057834c9a0 2562:b8a56afc6ba1
239 } 239 }
240 240
241 //----- (00498737) -------------------------------------------------------- 241 //----- (00498737) --------------------------------------------------------
242 void stru9::AddVertex(struct VertexBuffer *pVertexBuffer, struct RenderVertexSoft *pVertex) 242 void stru9::AddVertex(struct VertexBuffer *pVertexBuffer, struct RenderVertexSoft *pVertex)
243 { 243 {
244 // __debugbreak(); 244 pVertexBuffer->pVertices[pVertexBuffer->uNumVertices].vWorldPosition.x = pVertex->vWorldPosition.x;
245 RenderVertexSoft *v3; // eax@1 245 pVertexBuffer->pVertices[pVertexBuffer->uNumVertices].vWorldPosition.y = pVertex->vWorldPosition.y;
246 246 pVertexBuffer->pVertices[pVertexBuffer->uNumVertices].vWorldPosition.z = pVertex->vWorldPosition.z;
247 v3 = &pVertexBuffer->pVertices[pVertexBuffer->uNumVertices]; 247 pVertexBuffer->pVertices[pVertexBuffer->uNumVertices].u = pVertex->u;
248 v3->vWorldPosition.x = pVertex->vWorldPosition.x; 248 pVertexBuffer->pVertices[pVertexBuffer->uNumVertices].v = pVertex->v;
249 v3->vWorldPosition.y = pVertex->vWorldPosition.y;
250 v3->vWorldPosition.z = pVertex->vWorldPosition.z;
251 v3->u = pVertex->u;
252 v3->v = pVertex->v;
253 ++pVertexBuffer->uNumVertices; 249 ++pVertexBuffer->uNumVertices;
254 } 250 }
255 251
256 //----- (00498774) -------------------------------------------------------- 252 //----- (00498774) --------------------------------------------------------
257 bool stru9::_498774(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4, struct RenderVertexSoft *a5) 253 bool stru9::_498774(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4, struct RenderVertexSoft *a5)
360 return !r1 && r2 == 1 || 356 return !r1 && r2 == 1 ||
361 r1 == 1 && !r2; 357 r1 == 1 && !r2;
362 } 358 }
363 359
364 //----- (004980B9) -------------------------------------------------------- 360 //----- (004980B9) --------------------------------------------------------
365 bool stru9::_4980B9(RenderVertexSoft *a1, unsigned int uNumVertices, float a3, float a4, float a5, RenderVertexSoft *pOutVertices, signed int *pOutNumVertices) 361 bool stru9::_4980B9(RenderVertexSoft *a1, unsigned int uNumVertices, float pNormalX, float pNormalY, float pNormalZ, RenderVertexSoft *pOutVertices, signed int *pOutNumVertices)
366 { 362 {
367 RenderVertexSoft *v12; // ecx@9 363 RenderVertexSoft *v12; // ecx@9
368 double v13; // st7@12 364 double v13; // st7@12
369 double v14; // st6@12 365 double v14; // st6@12
370 double v15; // st5@12 366 double v15; // st5@12
384 for (uint i = 0; i < uNumVertices; ++i) 380 for (uint i = 0; i < uNumVertices; ++i)
385 { 381 {
386 v12 = &a1[(i + 1) % uNumVertices]; 382 v12 = &a1[(i + 1) % uNumVertices];
387 if (a1[i].vWorldPosition.x != v12->vWorldPosition.x || 383 if (a1[i].vWorldPosition.x != v12->vWorldPosition.x ||
388 a1[i].vWorldPosition.y != v12->vWorldPosition.y || 384 a1[i].vWorldPosition.y != v12->vWorldPosition.y ||
389 a1[i].vWorldPosition.z!= v12->vWorldPosition.z) 385 a1[i].vWorldPosition.z != v12->vWorldPosition.z)
390 { 386 {
391 v13 = v12->vWorldPosition.x - a1[i].vWorldPosition.x; 387 v13 = v12->vWorldPosition.x - a1[i].vWorldPosition.x;
392 v14 = v12->vWorldPosition.y - a1[i].vWorldPosition.y; 388 v14 = v12->vWorldPosition.y - a1[i].vWorldPosition.y;
393 v15 = v12->vWorldPosition.z - a1[i].vWorldPosition.z; 389 v15 = v12->vWorldPosition.z - a1[i].vWorldPosition.z;
394 ++v25; 390 ++v25;
395 391
396 static_sub_4980B9_stru_AE3FE8.uNumVertices = 0; 392 static_sub_4980B9_stru_AE3FE8.uNumVertices = 0;
397 static_sub_4980B9_stru_AE4BEC.x = a4 * v15 - v14 * a5; 393 static_sub_4980B9_stru_AE4BEC.x = pNormalY * v15 - v14 * pNormalZ;
398 static_sub_4980B9_stru_AE4BEC.y = v13 * a5 - v15 * a3; 394 static_sub_4980B9_stru_AE4BEC.y = v13 * pNormalZ - v15 * pNormalX;
399 static_sub_4980B9_stru_AE4BEC.z = v14 * a3 - v13 * a4; 395 static_sub_4980B9_stru_AE4BEC.z = v14 * pNormalX - v13 * pNormalY;
400 if (*pOutNumVertices == 0) 396 if (*pOutNumVertices == 0)
401 return true; 397 return true;
402 398
403 for (uint j = 0; j < *pOutNumVertices; ++j) 399 for (uint j = 0; j < *pOutNumVertices; ++j)
404 { 400 {
422 _498774(&pOutVertices[*pOutNumVertices - 1], &pOutVertices[0], &a1[i], &static_sub_4980B9_stru_AE4BEC, &stru_AE4BFC) ) 418 _498774(&pOutVertices[*pOutNumVertices - 1], &pOutVertices[0], &a1[i], &static_sub_4980B9_stru_AE4BEC, &stru_AE4BFC) )
423 AddVertex(&static_sub_4980B9_stru_AE3FE8, &stru_AE4BFC); 419 AddVertex(&static_sub_4980B9_stru_AE3FE8, &stru_AE4BFC);
424 420
425 for (uint j = 0; j < static_sub_4980B9_stru_AE3FE8.uNumVertices; ++j) 421 for (uint j = 0; j < static_sub_4980B9_stru_AE3FE8.uNumVertices; ++j)
426 { 422 {
427 pOutVertices[j].vWorldPosition.y = static_sub_4980B9_stru_AE3FE8.pVertices[j].vWorldPosition.x; 423 pOutVertices[j].vWorldPosition.x = static_sub_4980B9_stru_AE3FE8.pVertices[j].vWorldPosition.x;
428 pOutVertices[j].vWorldPosition.y = static_sub_4980B9_stru_AE3FE8.pVertices[j].vWorldPosition.y; 424 pOutVertices[j].vWorldPosition.y = static_sub_4980B9_stru_AE3FE8.pVertices[j].vWorldPosition.y;
429 pOutVertices[j].vWorldPosition.z = static_sub_4980B9_stru_AE3FE8.pVertices[j].vWorldPosition.z; 425 pOutVertices[j].vWorldPosition.z = static_sub_4980B9_stru_AE3FE8.pVertices[j].vWorldPosition.z;
430 pOutVertices[j].u = static_sub_4980B9_stru_AE3FE8.pVertices[j].u; 426 pOutVertices[j].u = static_sub_4980B9_stru_AE3FE8.pVertices[j].u;
431 pOutVertices[j].v = static_sub_4980B9_stru_AE3FE8.pVertices[j].v; 427 pOutVertices[j].v = static_sub_4980B9_stru_AE3FE8.pVertices[j].v;
432 } 428 }