Skip to content

Map: initialize screen width and height on SetupCommon#3328

Merged
Ghabry merged 1 commit intoEasyRPG:masterfrom
torahappy:patch-map-init
Jan 14, 2025
Merged

Map: initialize screen width and height on SetupCommon#3328
Ghabry merged 1 commit intoEasyRPG:masterfrom
torahappy:patch-map-init

Conversation

@torahappy
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.

@torahappy torahappy changed the title Map: initialize screen width and height on Init() Map: initialize screen width and height on SetupCommon Jan 13, 2025
@ghost ghost 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
4 checks passed
@torahappy torahappy 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.

2 participants