Mercurial > might-and-magic-trilogy
diff Game.cpp @ 68:fdacbc653945
BLV render: first image
author | Nomad |
---|---|
date | Sat, 27 Oct 2012 19:23:06 +0200 |
parents | 5159d2e6f559 |
children | 8be5293b6b33 |
line wrap: on
line diff
--- a/Game.cpp Fri Oct 26 03:43:05 2012 +0200 +++ b/Game.cpp Sat Oct 27 19:23:06 2012 +0200 @@ -667,22 +667,15 @@ //----- (0044EDE4) -------------------------------------------------------- -bool Game::_44EDE4(BLVFace *pFace, int *a3) +bool Game::AlterGamma(BLVFace *pFace, unsigned int *pColor) { - bool result; // eax@1 - - result = (bool)pGame; - if ( pGame->uFlags2 & 2 && (result = (bool)pFace, pFace->uAttributes & 2) ) + if (pGame->uFlags2 & 2 && pFace->uAttributes & 2) { - result = sub_48A959(*a3, 1.0, this->_E28_timed_gamma_strength, -1.0); - *a3 = result; - LOBYTE(result) = 1; + *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0); + return true; } else - { - LOBYTE(result) = 0; - } - return result; + return false; } //----- (0044EE30) -------------------------------------------------------- @@ -690,7 +683,7 @@ { if (uFlags2 & 0x2 && a2->uAttributes & 0x02) { - *(int *)a3 = sub_48A959(*(int *)a3, 1.0, _E28_timed_gamma_strength, -1.0); + *(int *)a3 = ReplaceHSV(*(int *)a3, 1.0, fSaturation, -1.0); return true; } else @@ -763,12 +756,12 @@ v4 = (double)a4; a2a = v4; *a3 |= 2u; - a3a = (1.0 - this->_E28_timed_gamma_strength) * v4; + a3a = (1.0 - this->fSaturation) * v4; //v5 = a3a + 6.7553994e15; //if ( SLODWORD(v5) >= 0 ) if (floorf(a3a + 0.5f) >= 0 ) { - a3b = (1.0 - this->_E28_timed_gamma_strength) * a2a; + a3b = (1.0 - this->fSaturation) * a2a; //v7 = a3b + 6.7553994e15; //v6 = LODWORD(v7); v6 = floorf(a3b + 0.5f); @@ -779,12 +772,12 @@ } if ( a4 >= v6 ) { - a4a = (1.0 - _E28_timed_gamma_strength) * a2a; + a4a = (1.0 - fSaturation) * a2a; //v9 = a4a + 6.7553994e15; //if ( SLODWORD(v9) >= 0 ) if (floorf(a4a + 0.5f) >= 0) { - a4b = (1.0 - _E28_timed_gamma_strength) * a2a; + a4b = (1.0 - fSaturation) * a2a; //v10 = a4b + 6.7553994e15; //result = LODWORD(v10); result = floorf(a4b + 0.5f); @@ -843,11 +836,11 @@ v4 = (double)a4; v11 = v4; *a3 |= 2u; - v12 = (1.0 - this->_E28_timed_gamma_strength) * v4; + v12 = (1.0 - this->fSaturation) * v4; //v5 = v12 + 6.7553994e15; if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 ) { - v13 = (1.0 - this->_E28_timed_gamma_strength) * v11; + v13 = (1.0 - this->fSaturation) * v11; //v7 = v13 + 6.7553994e15; //v6 = LODWORD(v7); v6 = floorf(v13 + 0.5f); @@ -858,11 +851,11 @@ } if ( a4 >= v6 ) { - v14 = (1.0 - _E28_timed_gamma_strength) * v11; + v14 = (1.0 - fSaturation) * v11; //v9 = v14 + 6.7553994e15; if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 ) { - v15 = (1.0 - _E28_timed_gamma_strength) * v11; + v15 = (1.0 - fSaturation) * v11; //v10 = v15 + 6.7553994e15; //result = LODWORD(v10); result = floorf(v15 + 0.5f); @@ -1018,9 +1011,9 @@ v7 = 1.0; } if ( pRenderer->pRenderD3D ) - _E28_timed_gamma_strength = v7; + fSaturation = v7; else - _E28_timed_gamma_strength = (1.0 - 0.5) * v7 + 0.5; + fSaturation = (1.0 - 0.5) * v7 + 0.5; } //----- (0044EA17) --------------------------------------------------------