Mercurial > mm7
diff Outdoor.cpp @ 770:02bfc82f429c
Слияние
author | Ritor1 |
---|---|
date | Sat, 23 Mar 2013 09:26:07 +0600 |
parents | 5ba796adbf5e |
children | 7f1487b74571 cf2fbac6edc9 |
line wrap: on
line diff
--- a/Outdoor.cpp Sat Mar 23 09:25:31 2013 +0600 +++ b/Outdoor.cpp Sat Mar 23 09:26:07 2013 +0600 @@ -121,7 +121,7 @@ { v4 = WorldPosToGridCellZ(pParty->vPosition.y); v5 = WorldPosToGridCellX(pParty->vPosition.x); - pOutdoor->_47EF60(v5, v4, 1); + pOutdoor->UpdateDiscoveredArea(v5, v4, 1); } pGame->uFlags2 &= 0xFFFFFFFEu; if (pRenderer->pRenderD3D && pRenderer->bUsingSpecular) @@ -171,7 +171,7 @@ { if ( pParty->uCurrentHour < 0x14 ) { - pWeather->field_FA0 = 0; + pWeather->bNight = 0; v2 = 0.0; return v2 * 0.016666668; } @@ -183,13 +183,13 @@ } LABEL_9: v2 = 60.0; - pWeather->field_FA0 = 1; + pWeather->bNight = 1; return v2 * 0.016666668; } v1 = 0; v2 = 60.0 - (double)(60 * pParty->uCurrentHour + pParty->uCurrentMinute - 300); LABEL_4: - pWeather->field_FA0 = v1; + pWeather->bNight = v1; return v2 * 0.016666668; } @@ -2115,9 +2115,9 @@ //v108 = (int)".odm"; //v83 = strlen(pContainer); //strcpy((char *)v141 + v83, (const char *)v108); - memcpy(array_528, pSrc, 0x3C8); + memcpy(uUndiscoveredArea, pSrc, 0x3C8); //v84 = (const void *)(v74 + 968); - memcpy(array_8F0, pSrc + 0x3C8, 0x3C8); + memcpy(uDicovered_area, pSrc + 0x3C8, 0x3C8); pSrc += 2 * 0x3C8; //v85 = (char *)v84 + 968; @@ -2125,8 +2125,8 @@ if ( *(int *)thisa ) { - memcpy(array_528, Dst, 0x3C8u); - memcpy(array_8F0, Src, 0x3C8u); + memcpy(uUndiscoveredArea, Dst, 0x3C8u); + memcpy(uDicovered_area, Src, 0x3C8u); } //v25 = uNumBModels == 0; @@ -2594,7 +2594,7 @@ } //----- (0047EF60) -------------------------------------------------------- -int OutdoorLocation::_47EF60(int a2, int a3, int a4) +int OutdoorLocation::UpdateDiscoveredArea(int X_grid_pos, int Y_grid_poa, int a4) { int v4; // ecx@1 int v5; // edx@2 @@ -2614,14 +2614,14 @@ int i; // [sp+24h] [bp+Ch]@5 v18 = this; - v4 = a3 - 10; - if ( a3 - 10 < a3 + 10 ) + v4 = Y_grid_poa - 10; + if ( Y_grid_poa - 10 < Y_grid_poa + 10 ) { - v5 = v4 - a3; - v6 = 88 * (a3 - 30); - v7 = a2; - v19 = v4 - a3; - v17 = a3 + 10 - v4; + v5 = v4 - Y_grid_poa; + v6 = (Y_grid_poa - 30); + v7 = X_grid_pos; + v19 = v4 - Y_grid_poa; + v17 = Y_grid_poa + 10 - v4; while ( 1 ) { v8 = abs(v5); @@ -2634,14 +2634,13 @@ { v11 = abs(v10); v15 = v11 * v11 + v16; - if ( v15 <= 100 && v9 >= 20 && v9 <= 107 && v6 >= 0 && v6 <= 7656 ) + if ( v15 <= 100 && v9 >= 20 && v9 <= 107 && v6 >= 0 && v6 <= 87 ) { - v12 = (v6 + v9 - 20) >> 3; - v13 = 1 << (8 - (v6 + v9 - 20) % 8 - 1); - v18->array_8F0[v12] |= v13; + v13 = 1 << (7 - (v9 - 20) % 8); + v18->uDicovered_area[v6][(v9 - 20)/8] |= v13; if ( v15 <= 49 ) - v18->array_528[v12] |= v13; - v7 = a2; + v18->uUndiscoveredArea[v6][(v9 - 20)/8] |= v13; + v7 = X_grid_pos; } ++v9; ++i; @@ -2649,7 +2648,7 @@ break; } } - v6 += 88; + ++v6 ; ++v19; --v17; if ( !v17 ) @@ -2661,26 +2660,26 @@ } //----- (0047F04C) -------------------------------------------------------- -bool OutdoorLocation::_47F04C(signed int a2, signed int a3) +bool OutdoorLocation::_47F04C(signed int x_pos, signed int y_pos) { bool result; // eax@5 - if ( a2 < 0 || a2 >= 88 || a3 < 0 || a3 >= 88 ) + if ( x_pos < 0 || x_pos >= 88 || y_pos < 0 || y_pos >= 88 ) result = 0; else - result = (this->array_528[(a2 + 88 * a3) / 8] & (unsigned __int8)(1 << (7 - (a2 + 88 * a3) % 8))) != 0; + result = (uUndiscoveredArea[y_pos][x_pos/8] & (unsigned __int8)(1 << (7 - (x_pos) % 8))) != 0; return result; } //----- (0047F097) -------------------------------------------------------- -bool OutdoorLocation::_47F097(signed int a2, signed int a3) +bool OutdoorLocation::_47F097(signed int x_pos, signed int y_pos) { bool result; // eax@5 - if ( a2 < 0 || a2 >= 88 || a3 < 0 || a3 >= 88 ) + if ( x_pos < 0 || x_pos >= 88 || y_pos < 0 || y_pos >= 88 ) result = 0; else - result = (this->array_8F0[(a2 + 88 * a3) / 8] & (unsigned __int8)(1 << (7 - (a2 + 88 * a3) % 8))) != 0; + result = (uDicovered_area[y_pos][x_pos/8] & (unsigned __int8)(1 << (7 - (x_pos) % 8))) != 0; return result; }