Mercurial > mm7
comparison Outdoor.cpp @ 638:ccf8b4815a1f
GetActorTintColor fixed
Outdoor sunlight works on terrain & bmodels (not sure about billboards though)
author | Nomad |
---|---|
date | Mon, 11 Mar 2013 21:43:26 +0200 |
parents | 71ecba604995 |
children | 7747161ea5b5 |
comparison
equal
deleted
inserted
replaced
637:d7b14091e434 | 638:ccf8b4815a1f |
---|---|
457 unsigned int OutdoorLocation::UpdateSunlightVectors() | 457 unsigned int OutdoorLocation::UpdateSunlightVectors() |
458 { | 458 { |
459 unsigned int result; // eax@1 | 459 unsigned int result; // eax@1 |
460 OutdoorLocation *v2; // esi@1 | 460 OutdoorLocation *v2; // esi@1 |
461 unsigned int v3; // edi@3 | 461 unsigned int v3; // edi@3 |
462 int v4; // ebx@3 | 462 //int v4; // ebx@3 |
463 int v5; // eax@3 | 463 int v5; // eax@3 |
464 int v6; // eax@3 | 464 //int v6; // eax@3 |
465 int v7; // ecx@3 | 465 //int v7; // ecx@3 |
466 double v8; // st7@4 | 466 double v8; // st7@4 |
467 | 467 |
468 result = pParty->uCurrentHour; | 468 result = pParty->uCurrentHour; |
469 v2 = this; | 469 v2 = this; |
470 if ( pParty->uCurrentHour >= 5 && pParty->uCurrentHour < 0x15 ) | 470 if ( pParty->uCurrentHour >= 5 && pParty->uCurrentHour < 21 ) |
471 { | 471 { |
472 v3 = pParty->uCurrentMinute + 60 * (pParty->uCurrentHour - 5); | 472 v3 = pParty->uCurrentMinute + 60 * (pParty->uCurrentHour - 5); |
473 v4 = (signed int)(v3 * stru_5C6E00->uIntegerPi) / 960; | 473 //v4 = (signed int)(v3 * stru_5C6E00->uIntegerPi) / 960; |
474 v5 = stru_5C6E00->Cos((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); | 474 v5 = stru_5C6E00->Cos((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); |
475 v2->field_D1C = 0; | 475 v2->inv_sunlight_y = 0; |
476 v2->field_D18 = v5; | 476 v2->inv_sunlight_x = v5; |
477 v6 = stru_5C6E00->Sin(v4); | 477 //v6 = stru_5C6E00->Sin(v4); |
478 v7 = v2->field_D18; | 478 //v7 = v2->field_D18; |
479 v2->field_D20 = v6; | 479 v2->inv_sunlight_z = stru_5C6E00->Sin((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); |
480 v2->vSunlight.x = -v7; | 480 v2->vSunlight.x = -v2->inv_sunlight_x; |
481 v2->vSunlight.y = -v2->field_D1C; | 481 v2->vSunlight.y = -v2->inv_sunlight_y; |
482 v2->vSunlight.z = -v6; | 482 v2->vSunlight.z = -v2->inv_sunlight_z; |
483 if ( (signed int)v3 >= 480 ) | 483 if ( (signed int)v3 >= 480 ) |
484 v8 = (double)(signed int)(960 - v3); | 484 v8 = (double)(signed int)(960 - v3); |
485 else | 485 else |
486 v8 = (double)(signed int)v3; | 486 v8 = (double)(signed int)v3; |
487 v2->field_CBC_terrain_triangles_shade_type = (signed __int64)(20.0 - v8 * 0.002083333333333333 * 20.0); | 487 v2->max_terrain_dimming_level = (signed __int64)(20.0 - v8 / 480.0 * 20.0); |
488 result = pParty->uCurrentMinute; | 488 result = pParty->uCurrentMinute; |
489 v2->uLastSunlightUpdateMinute = pParty->uCurrentMinute; | 489 v2->uLastSunlightUpdateMinute = pParty->uCurrentMinute; |
490 } | 490 } |
491 return result; | 491 return result; |
492 } | 492 } |