X Tutup
Skip to content

ASYLUM: Fix crash for game menu#6385

Merged
antoniou79 merged 2 commits intoscummvm:masterfrom
antoniou79:asylumImprovedFixMenuScreenEyesCrash
Jan 8, 2025
Merged

ASYLUM: Fix crash for game menu#6385
antoniou79 merged 2 commits intoscummvm:masterfrom
antoniou79:asylumImprovedFixMenuScreenEyesCrash

Conversation

@antoniou79
Copy link
Contributor

And also clean up code and fix eyes movement to match original

This fix was proposed by @eriktorbjorn in a previous PR #6383 (now closed in favor of this one).

This prevents an overflow for int32 in Actor::getAngle() for the calculation of the "index" variable value, which would happen (before) when diffY would be >= 0x800000 (ie. 2^23) and was multiplied by 256 (ie. 2^8). This, in the context of the game's main menu would happen when moving the cursor to the top part of the screen.

The code in getAngle() is also cleaned up to be more readable.

An additional fix for the values of angleTable03[] is included, since previously it was populated by wrong hex values. What seems to have happened here was that the decimal values were wrongly entered as hex values by putting the "0x" prefix on the literal.

This is a potential fix for bug ticket: https://bugs.scummvm.org/ticket/15658

And also clean up code and fix eyes movement to match original

This fix was proposed by eriktorbjorn in a previous PR scummvm#6383 (now closed in favor of this one).

This prevents an overflow for int32 in Actor::getAngle() for the calculation of the "index" variable value, which would happen (before) when diffY would be >= 0x800000 (ie. 2^23) and was multiplied by 256 (ie. 2^8). This, in the context of the game's main menu would happen when moving the cursor to the top part of the screen.

The code in getAngle() is also cleaned up to be more readable.

An additional fix for the values of angleTable03[] is included, since previously it was populated by wrong hex values. What seems to have happened here was that the decimal values were wrongly entered as hex values by putting the "0x" prefix on the literal.

This is a potential fix for bug ticket: https://bugs.scummvm.org/ticket/15658
@eriktorbjorn
Copy link
Member

Appears to work fine. (Of course, I am slightly biased.)

The angle unit is in degrees
@antoniou79 antoniou79 merged commit f17eb99 into scummvm:master Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup