Mercurial > mm7
diff 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 |
line wrap: on
line diff
--- a/Outdoor.cpp Mon Mar 11 17:07:51 2013 +0200 +++ b/Outdoor.cpp Mon Mar 11 21:43:26 2013 +0200 @@ -459,32 +459,32 @@ unsigned int result; // eax@1 OutdoorLocation *v2; // esi@1 unsigned int v3; // edi@3 - int v4; // ebx@3 + //int v4; // ebx@3 int v5; // eax@3 - int v6; // eax@3 - int v7; // ecx@3 + //int v6; // eax@3 + //int v7; // ecx@3 double v8; // st7@4 result = pParty->uCurrentHour; v2 = this; - if ( pParty->uCurrentHour >= 5 && pParty->uCurrentHour < 0x15 ) + if ( pParty->uCurrentHour >= 5 && pParty->uCurrentHour < 21 ) { v3 = pParty->uCurrentMinute + 60 * (pParty->uCurrentHour - 5); - v4 = (signed int)(v3 * stru_5C6E00->uIntegerPi) / 960; + //v4 = (signed int)(v3 * stru_5C6E00->uIntegerPi) / 960; v5 = stru_5C6E00->Cos((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); - v2->field_D1C = 0; - v2->field_D18 = v5; - v6 = stru_5C6E00->Sin(v4); - v7 = v2->field_D18; - v2->field_D20 = v6; - v2->vSunlight.x = -v7; - v2->vSunlight.y = -v2->field_D1C; - v2->vSunlight.z = -v6; + v2->inv_sunlight_y = 0; + v2->inv_sunlight_x = v5; + //v6 = stru_5C6E00->Sin(v4); + //v7 = v2->field_D18; + v2->inv_sunlight_z = stru_5C6E00->Sin((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); + v2->vSunlight.x = -v2->inv_sunlight_x; + v2->vSunlight.y = -v2->inv_sunlight_y; + v2->vSunlight.z = -v2->inv_sunlight_z; if ( (signed int)v3 >= 480 ) v8 = (double)(signed int)(960 - v3); else v8 = (double)(signed int)v3; - v2->field_CBC_terrain_triangles_shade_type = (signed __int64)(20.0 - v8 * 0.002083333333333333 * 20.0); + v2->max_terrain_dimming_level = (signed __int64)(20.0 - v8 / 480.0 * 20.0); result = pParty->uCurrentMinute; v2->uLastSunlightUpdateMinute = pParty->uCurrentMinute; }