comparison mm7_3.cpp @ 767:45615cacad31

Fog fixed
author Nomad
date Sat, 23 Mar 2013 21:11:15 +0200
parents e0914a9bc424
children 67b77b052ef3
comparison
equal deleted inserted replaced
766:a464d28566a6 767:45615cacad31
6685 } 6685 }
6686 else 6686 else
6687 { 6687 {
6688 v4 = (MapInfo *)thisa; 6688 v4 = (MapInfo *)thisa;
6689 } 6689 }
6690 day_attrib &= 0xFFFFFFFEu; 6690 day_attrib &= ~DAY_ATTRIB_FOG;
6691 dword_6BE13C_uCurrentlyLoadedLocationID = v2; 6691 dword_6BE13C_uCurrentlyLoadedLocationID = v2;
6692 pOutdoor->Initialize( 6692 pOutdoor->Initialize(
6693 pFilename, 6693 pFilename,
6694 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1, 6694 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
6695 v3, 6695 v3,
6824 v18 = a2; 6824 v18 = a2;
6825 if ( pParty->armageddon_timer ) 6825 if ( pParty->armageddon_timer )
6826 return PaletteManager::Get(a2); 6826 return PaletteManager::Get(a2);
6827 if ( !pWeather->bNight ) 6827 if ( !pWeather->bNight )
6828 { 6828 {
6829 if ( day_attrib & 1 ) 6829 if (day_attrib & DAY_ATTRIB_FOG)
6830 { 6830 {
6831 v14 = day_fogrange_1 << 16; 6831 v14 = day_fogrange_1 << 16;
6832 if ( a3 >= day_fogrange_1 << 16 ) 6832 if ( a3 >= day_fogrange_1 << 16 )
6833 { 6833 {
6834 if ( a3 <= day_fogrange_2 << 16 ) 6834 if ( a3 <= day_fogrange_2 << 16 )
6957 v10 = pWeather->bNight; 6957 v10 = pWeather->bNight;
6958 if ( bUnderwater == 1 ) 6958 if ( bUnderwater == 1 )
6959 v10 = 0; 6959 v10 = 0;
6960 if ( !v10 ) 6960 if ( !v10 )
6961 { 6961 {
6962 if ( !(day_attrib & 1) && !bUnderwater ) 6962 if ( !(day_attrib & DAY_ATTRIB_FOG) && !bUnderwater )
6963 { 6963 {
6964 v14 = a5; 6964 v14 = a5;
6965 v15 = a6; 6965 v15 = a6;
6966 if ( !v9 ) 6966 if ( !v9 )
6967 { 6967 {
7232 signed __int64 v1; // qax@5 7232 signed __int64 v1; // qax@5
7233 int v2; // eax@6 7233 int v2; // eax@6
7234 7234
7235 if ( bUnderwater ) 7235 if ( bUnderwater )
7236 { 7236 {
7237 result = 0xFF258F5Cu; 7237 result = 0xFF258F5C;
7238 } 7238 }
7239 else 7239 else
7240 { 7240 {
7241 if ( day_attrib & 1 ) 7241 if (day_attrib & DAY_ATTRIB_FOG)
7242 { 7242 {
7243 if ( pWeather->bNight ) 7243 if ( pWeather->bNight ) // night-time fog
7244 { 7244 {
7245 __debugbreak(); // decompilation can be inaccurate, please send savegame to Nomad 7245 __debugbreak(); // decompilation can be inaccurate, please send savegame to Nomad
7246 v2 = -(pWeather->bNight != 1); 7246 v2 = -(pWeather->bNight != 1);
7247 result = (v2 & 0xE0E0E1) - 0xE0E0E1; 7247 result = (v2 & 0xE0E0E1) - 0xE0E0E1;
7248 } 7248 }
7251 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0); 7251 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0);
7252 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8); 7252 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8);
7253 } 7253 }
7254 } 7254 }
7255 else 7255 else
7256 { 7256 return 0;
7257 result = 0;
7258 }
7259 } 7257 }
7260 return result; 7258 return result;
7261 } 7259 }
7262 // 6BE030: using guessed type int day_attrib; 7260 // 6BE030: using guessed type int day_attrib;
7263 // 6BE3C4: using guessed type char bUnderwater; 7261 // 6BE3C4: using guessed type char bUnderwater;
7276 double v12; // ST08_8@17 7274 double v12; // ST08_8@17
7277 7275
7278 v3 = pWeather->bNight; 7276 v3 = pWeather->bNight;
7279 if ( bUnderwater == 1 ) 7277 if ( bUnderwater == 1 )
7280 v3 = 0; 7278 v3 = 0;
7281 if ( pParty->armageddon_timer || !(day_attrib & 1) && !bUnderwater ) 7279 if ( pParty->armageddon_timer || !(day_attrib & DAY_ATTRIB_FOG) && !bUnderwater )
7282 return 0xFF000000; 7280 return 0xFF000000;
7283 if ( v3 ) 7281 if ( v3 )
7284 { 7282 {
7285 v5 = (double)day_fogrange_1; 7283 v5 = (double)day_fogrange_1;
7286 v6 = 216; 7284 v6 = 216;