mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
KYRA: (LOL) - fix LoLEngine::updateCompass()
This commit is contained in:
parent
2e8f2ba822
commit
e53a2b18e9
@ -620,14 +620,14 @@ void LoLEngine::updateCompass() {
|
||||
if (_compassStep)
|
||||
_compassStep -= (((ABS(_compassStep) >> 4) + 2) * dir);
|
||||
|
||||
int16 d = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection;
|
||||
if (d <= -128)
|
||||
d += 256;
|
||||
if (d >= 128)
|
||||
d -= 256;
|
||||
int16 diff = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection;
|
||||
if (diff <= -128)
|
||||
diff += 256;
|
||||
if (diff >= 128)
|
||||
diff -= 256;
|
||||
|
||||
d >>= 2;
|
||||
_compassStep += d;
|
||||
diff >>= 2;
|
||||
_compassStep += diff;
|
||||
_compassStep = CLIP(_compassStep, -24, 24);
|
||||
_compassDirection += _compassStep;
|
||||
|
||||
@ -636,14 +636,9 @@ void LoLEngine::updateCompass() {
|
||||
if (_compassDirection > 255)
|
||||
_compassDirection -= 256;
|
||||
|
||||
if ((_compassDirection >> 6) == _currentDirection && _compassStep < 2) {
|
||||
int16 d2 = d >> 16;
|
||||
d ^= d2;
|
||||
d -= d2;
|
||||
if (d < 4) {
|
||||
_compassDirection = _currentDirection << 6;
|
||||
_compassStep = 0;
|
||||
}
|
||||
if (((((_compassDirection + 3) & 0xFD) >> 6) == _currentDirection) && (_compassStep < 2) && (ABS(diff) < 4)) {
|
||||
_compassDirection = _currentDirection << 6;
|
||||
_compassStep = 0;
|
||||
}
|
||||
|
||||
gui_drawCompass();
|
||||
|
Loading…
x
Reference in New Issue
Block a user