comparison LightmapBuilder.cpp @ 2316:25f771e528f0

Draw terrain
author Ritor1
date Wed, 19 Mar 2014 17:30:14 +0600
parents 90f56da08d76
children a59892f99d31
comparison
equal deleted inserted replaced
2315:58be29479e75 2316:25f771e528f0
238 238
239 //v44 = &v11->uNumVertices; 239 //v44 = &v11->uNumVertices;
240 if (!v11->uNumVertices) 240 if (!v11->uNumVertices)
241 return true; 241 return true;
242 242
243 v45 = _45C6D6(uNumVertices, a9, v11); 243 v45 = _45C6D6(uNumVertices, a9, v11);//освещён ли фейс(есть ошибка)
244 if ( v45 != uNumVertices && v45 > 0 ) 244 if ( v45 != uNumVertices && v45 > 0 )
245 _45C4B9(uNumVertices, a9, v11); 245 _45C4B9(uNumVertices, a9, v11);
246 //v59 = v11->uNumVertices; 246 //v59 = v11->uNumVertices;
247 //v46 = (RenderVertexSoft *)pLightmapVertices_; 247 //v46 = (RenderVertexSoft *)pLightmapVertices_;
248 pGame->pIndoorCameraD3D->ViewTransform(v11->pVertices, v11->uNumVertices); 248 pGame->pIndoorCameraD3D->ViewTransform(v11->pVertices, v11->uNumVertices);
330 double v15; // st6@18 330 double v15; // st6@18
331 double v16; // st6@21 331 double v16; // st6@21
332 double v17; // st6@24 332 double v17; // st6@24
333 signed int v18; // edx@33 333 signed int v18; // edx@33
334 int v20; // [sp+4h] [bp-1Ch]@3 334 int v20; // [sp+4h] [bp-1Ch]@3
335 int v21; // [sp+8h] [bp-18h]@8 335 //int v21; // [sp+8h] [bp-18h]@8
336 float v22; // [sp+Ch] [bp-14h]@23 336 float v22; // [sp+Ch] [bp-14h]@23
337 float v23; // [sp+10h] [bp-10h]@20 337 float v23; // [sp+10h] [bp-10h]@20
338 int v24; // [sp+14h] [bp-Ch]@1 338 int v24; // [sp+14h] [bp-Ch]@1
339 RenderVertexSoft *v25; // [sp+18h] [bp-8h]@2 339 RenderVertexSoft *v25; // [sp+18h] [bp-8h]@2
340 char v26; // [sp+1Eh] [bp-2h]@17 340 char v26; // [sp+1Eh] [bp-2h]@17
341 char v27; // [sp+1Fh] [bp-1h]@17 341 char v27; // [sp+1Fh] [bp-1h]@17
342
343 __debugbreak();//Ritor1: needed cleaning
342 344
343 v4 = pLightmap; 345 v4 = pLightmap;
344 v5 = 0; 346 v5 = 0;
345 v6 = pLightmap->uNumVertices; 347 v6 = pLightmap->uNumVertices;
346 v24 = 0; 348 v24 = 0;
355 v9 = &v4->pVertices[v8]; 357 v9 = &v4->pVertices[v8];
356 if ( v7->vWorldPosition.x != v9->vWorldPosition.x 358 if ( v7->vWorldPosition.x != v9->vWorldPosition.x
357 || v7->vWorldPosition.y != v4->pVertices[v8].vWorldPosition.y 359 || v7->vWorldPosition.y != v4->pVertices[v8].vWorldPosition.y
358 || v7->vWorldPosition.z != v4->pVertices[v8].vWorldPosition.z ) 360 || v7->vWorldPosition.z != v4->pVertices[v8].vWorldPosition.z )
359 { 361 {
360 v10 = 0; 362 //v10 = 0;
361 if ( a2 > 0 ) 363 if ( a2 > 0 )
362 { 364 {
363 v11 = (char *)&a3->vWorldPosition.z; 365 //v11 = (char *)&a3->vWorldPosition.z;
364 do 366 for ( v10 = 1; v10 <= a2; ++v10 )
365 { 367 {
366 v21 = v10 + 1; 368 //v21 = v10 + 1;
367 v12 = &a3[(v10 + 1) % a2]; 369 v12 = &a3[v10 % a2];
368 if ( (*((float *)v11 - 2) != v12->vWorldPosition.x 370 if ((a3[v10].vWorldPosition.x != v12->vWorldPosition.x
369 || *((float *)v11 - 1) != v12->vWorldPosition.y 371 || a3[v10].vWorldPosition.y != v12->vWorldPosition.y || a3[v10].vWorldPosition.z != v12->vWorldPosition.z)
370 || *(float *)v11 != v12->vWorldPosition.z) 372 && v7->vWorldPosition.x == a3[v10].vWorldPosition.x
371 && v7->vWorldPosition.x == *((float *)v11 - 2) 373 && v7->vWorldPosition.y == a3[v10].vWorldPosition.y && v7->vWorldPosition.z == a3[v10].vWorldPosition.z
372 && v7->vWorldPosition.y == *((float *)v11 - 1)
373 && v7->vWorldPosition.z == *(float *)v11
374 && (v9->vWorldPosition.x != v12->vWorldPosition.x 374 && (v9->vWorldPosition.x != v12->vWorldPosition.x
375 || v9->vWorldPosition.y != v12->vWorldPosition.y 375 || v9->vWorldPosition.y != v12->vWorldPosition.y || v9->vWorldPosition.z != v12->vWorldPosition.z) )
376 || v9->vWorldPosition.z != v12->vWorldPosition.z) )
377 { 376 {
378 v13 = 0; 377 v13 = 0;
379 v14 = 0; 378 v14 = 0;
380 v27 = 0; 379 v27 = 0;
381 v26 = 0; 380 v26 = 0;
382 if ( v9->vWorldPosition.x <= (double)v12->vWorldPosition.x ) 381 if ( v9->vWorldPosition.x <= (double)v12->vWorldPosition.x )
383 v15 = v12->vWorldPosition.x - v9->vWorldPosition.x; 382 v15 = v12->vWorldPosition.x - v9->vWorldPosition.x;
384 else 383 else
385 v15 = v9->vWorldPosition.x - v12->vWorldPosition.x; 384 v15 = v9->vWorldPosition.x - v12->vWorldPosition.x;
386 v23 = v15; 385 v23 = v15;
386
387 if ( v9->vWorldPosition.y <= (double)v12->vWorldPosition.y ) 387 if ( v9->vWorldPosition.y <= (double)v12->vWorldPosition.y )
388 v16 = v12->vWorldPosition.y - v9->vWorldPosition.y; 388 v16 = v12->vWorldPosition.y - v9->vWorldPosition.y;
389 else 389 else
390 v16 = v9->vWorldPosition.y - v12->vWorldPosition.y; 390 v16 = v9->vWorldPosition.y - v12->vWorldPosition.y;
391 v22 = v16; 391 v22 = v16;
392
392 if ( v9->vWorldPosition.z <= (double)v12->vWorldPosition.z ) 393 if ( v9->vWorldPosition.z <= (double)v12->vWorldPosition.z )
393 v17 = v12->vWorldPosition.z - v9->vWorldPosition.z; 394 v17 = v12->vWorldPosition.z - v9->vWorldPosition.z;
394 else 395 else
395 v17 = v9->vWorldPosition.z - v12->vWorldPosition.z; 396 v17 = v9->vWorldPosition.z - v12->vWorldPosition.z;
396 if ( v23 < 1.0 ) 397 if ( v23 < 1.0 )
429 if ( v18 > 0 ) 430 if ( v18 > 0 )
430 ++v24; 431 ++v24;
431 } 432 }
432 v7 = v25; 433 v7 = v25;
433 } 434 }
434 ++v10; 435 //++v10;
435 v11 += 48; 436 //v11 += 48;
436 } 437 }
437 while ( v21 < a2 ); 438 //while ( v21 < a2 );
438 v4 = pLightmap; 439 v4 = pLightmap;
439 } 440 }
440 } 441 }
441 v5 = v20; 442 v5 = v20;
442 v6 = v4->uNumVertices; 443 v6 = v4->uNumVertices;
484 v11 = pLightmap->pVertices[i].vWorldPosition.z <= (double)a3[j].vWorldPosition.z 485 v11 = pLightmap->pVertices[i].vWorldPosition.z <= (double)a3[j].vWorldPosition.z
485 ? a3[j].vWorldPosition.z - pLightmap->pVertices[i].vWorldPosition.z 486 ? a3[j].vWorldPosition.z - pLightmap->pVertices[i].vWorldPosition.z
486 : pLightmap->pVertices[i].vWorldPosition.z - a3[j].vWorldPosition.z; 487 : pLightmap->pVertices[i].vWorldPosition.z - a3[j].vWorldPosition.z;
487 if ( v11 < 2.0 ) 488 if ( v11 < 2.0 )
488 { 489 {
489 v12 = v9 + v11 + v10; 490 v12 = v9 + v11 + v10;//Ritor1: Ошибка: В ИДА сюда заходит в данже рядом с факелом, а у нас нет, причину не нашёл
490 if ( v12 < v16 ) 491 if ( v12 < v16 )
491 { 492 {
492 v16 = v12; 493 v16 = v12;
493 v6 = j; 494 v6 = j;
494 } 495 }
609 Vec3_float_ v16; // ST00_12@5 610 Vec3_float_ v16; // ST00_12@5
610 double v17; // st7@5 611 double v17; // st7@5
611 int a5; // [sp+2Ch] [bp-1Ch]@1 612 int a5; // [sp+2Ch] [bp-1Ch]@1
612 float v19; // [sp+30h] [bp-18h]@1 613 float v19; // [sp+30h] [bp-18h]@1
613 float v20; // [sp+34h] [bp-14h]@1 614 float v20; // [sp+34h] [bp-14h]@1
614 LightmapBuilder *thisa; // [sp+38h] [bp-10h]@1 615 //LightmapBuilder *thisa; // [sp+38h] [bp-10h]@1
615 int v22; // [sp+3Ch] [bp-Ch]@1 616 int v22; // [sp+3Ch] [bp-Ch]@1
616 int *j; // [sp+40h] [bp-8h]@3 617 int *j; // [sp+40h] [bp-8h]@3
617 int i; // [sp+44h] [bp-4h]@1 618 int i; // [sp+44h] [bp-4h]@1
618 int a3a; // [sp+58h] [bp+10h]@2 619 int a3a; // [sp+58h] [bp+10h]@2
619 620
621 __debugbreak();//Ritor1: needed cleaning
622
620 *(float *)&a5 = 0.0; 623 *(float *)&a5 = 0.0;
621 v19 = 0.0; 624 v19 = 0.0;
622 thisa = this; 625 //thisa = this;
623 v20 = 0.0; 626 v20 = 0.0;
624 result = _45CBD4(a3, a4, dword_69B010.data(), &v22); 627 result = _45CBD4(a3, a4, dword_69B010.data(), &v22);
625 for ( i = 0; i < v22; result = i ) 628 for ( i = 0; i < v22; result = i )
626 { 629 {
627 v6 = a2; 630 v6 = a2;