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

Map: initialize screen width and height on SetupCommon #3328

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

aidatorajiro
Copy link
Contributor

fixes #3327.
(i don't know how this patch interferes with #3293, but Init() is called only after reset, so not a very destructing change i guess)

@Ghabry
Copy link
Member

Ghabry commented Jan 7, 2025

I think I deleted this because I assumed Setup is always called 🤔. Have to check the control flow 😅. Thanks

@Ghabry Ghabry added this to the 0.8.1 milestone Jan 8, 2025
@Ghabry
Copy link
Member

Ghabry commented Jan 10, 2025

@aidatorajiro I checked this now and Setup is indeed not called when loading from a save (only SetupFromSave is).

Can you try deleting the

screen_width = (Player::screen_width / 16.0) * SCREEN_TILE_SIZE;
screen_height = (Player::screen_height / 16.0) * SCREEN_TILE_SIZE;

from Init and Setup and instead add these lines at the beginning of SetupCommon.

@aidatorajiro aidatorajiro changed the title Map: initialize screen width and height on Init() Map: initialize screen width and height on SetupCommon Jan 13, 2025
@fdelapena fdelapena added the Maps Map content related. For map events please use event/interpreter instead label Jan 13, 2025
Otherwise the initialization is not applied when loading a Savegame

Fix EasyRPG#3327
Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squashed all commits into one as the intermediate commits were unnecessary here. Otherwise no changes from my side.

@Ghabry Ghabry merged commit 1c411e3 into EasyRPG:master Jan 14, 2025
14 checks passed
@aidatorajiro aidatorajiro deleted the patch-map-init branch January 14, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maps Map content related. For map events please use event/interpreter instead
Development

Successfully merging this pull request may close these issues.

The background might become out of sync with the foreground after loading.
3 participants