Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TITANIC: Change ship view and position even if not moved #997

Merged
merged 5 commits into from
Aug 22, 2017

Conversation

dafioram
Copy link
Contributor

The code was preventing the position and view from changing
when the distance between the current and new position for
a marked auto mover was zero. This happens if you lock the
2nd or 3rd star and then unlock and relock again.

It was prevented this with asserts and if statement checks
and I removed them all.

This section of code isn't doing any inverses based on the
reciprocal of the distance so there is no issue with allowing
transition speeds/distances of zero.

Fixes #10148.

The code was preventing the position and view from changing
when the distance between the current and new position for
a marked auto mover was zero. This happens if you lock the
2nd or 3rd star and then unlock and relock again.

It was prevented this with asserts and if statement checks
and I removed them all.

This section of code isn't doing any inverses based on the
reciprocal of the distance so theres no issue with allowing
transition speeds/distances of zero.

Fixes #10148.
@dafioram
Copy link
Contributor Author

I added a 2nd commit that prevents the awkward transition from happening for #9961. It was happening for large distances as now I just don't allow the lock to be attempted when it will happen.

For now it can be added as a todo to get the transitions to lock correctly for two stars when the distances are >1e8.

I will continue to work on the code, but that bug is now no longer visible, so it is minor now.

I have added a conditional to the code so that if the player
tries to lock onto the 2nd star and they are very far away, >1e8,
then the game will not allow the star to be locked.

This is a temporary workaround since if a distance of farther
then this is attempted then the view will be throw way off
and the stars will not be shown locking onto correctly.

I've also made the locking functions return booleans so I can
determine the success of the lockings.

This is a partial fix for #9961.
@dafioram
Copy link
Contributor Author

This is only a partial fix for #9961 since the not locking issue can happen for 3 stars, but it doesn't look as bad then.

Named some functions, made _speeds be an array instead of
a dynamic one.
@dafioram
Copy link
Contributor Author

Added some minor additions.

This variable controls the number of transitions the game goes
through when the mover is changing position. This reduces
several 31/32s from the code.
@dreammaster dreammaster merged commit 68d43a4 into scummvm:master Aug 22, 2017
@dafioram dafioram deleted the star_fix10148 branch September 3, 2017 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants