Conversation
…reground interpreter has been processed (Fix EasyRPG#2432 / EasyRPG#2932)
…'t be shown when screen shaking is applied (Fix EasyRPG#2607)
…n might create unnecessarily expensive copy
…ter the resource has been moved
… not scrolling horizontally
Member
|
About the panorama clearing. There is already code that does the same for the wide-screen hack (for the same reason). Maybe can be reused? https://github.com/EasyRPG/Player/blob/master/src/screen.cpp |
Ghabry
reviewed
Jun 28, 2025
Member
|
Only want to check the screenshake fix, the rest looks good to me |
Member
|
The clearing code for the Plane also runs when the rendering is inside the bounds. E.g. this code in "Test AB Blocks" in our TestGame: Even for the "in-bounds" areas the parallax is rendered black while shaking. |
Member
|
Solved the math: diff --git a/src/plane.cpp b/src/plane.cpp
index 28b176457..d4c9806cd 100644
--- a/src/plane.cpp
+++ b/src/plane.cpp
@@ -84,20 +84,26 @@ void Plane::Draw(Bitmap& dst) {
dst_rect.x = bg_x;
dst_rect.width = bg_width;
+ if (Game_Map::GetDisplayX() / 16 + Player::screen_width > Game_Map::GetTilesX() * TILE_SIZE) {
+ // Do not draw out of bounds to the right
+ dst_rect.width -= (Game_Map::GetDisplayX() / 16 + Player::screen_width) - (Game_Map::GetTilesX() * TILE_SIZE);
+ }
+
// Correct the offset if the top-left corner moved.
offset_x = shake_x + bg_x;
}
src_y += shake_y;
dst.TiledBlit(src_x + offset_x, src_y, source->GetRect(), *source, dst_rect, 255);
+
if (!Game_Map::LoopHorizontal()) {
- if (offset_x < 0) {
- auto clear_rect = Rect(dst.GetRect().x, dst.GetRect().y, abs(offset_x), dst.GetRect().height);
+ // Clear out of bounds map area visible during shake
+ if (offset_x < 0 && src_x + offset_x < 0) {
+ auto clear_rect = Rect(dst.GetRect().x, dst.GetRect().y, -offset_x, dst.GetRect().height);
dst.ClearRect(clear_rect);
- } else if (offset_x > 0) {
- auto clear_rect = Rect(dst.GetRect().width - offset_x, dst.GetRect().y, offset_x, dst.GetRect().height);
+ } else if (dst_rect.width < Player::screen_width) {
+ auto clear_rect = Rect(dst_rect.width, dst.GetRect().y, Player::screen_width - dst_rect.width, dst.GetRect().height);
dst.ClearRect(clear_rect);
}
}
}
- |
Ghabry
approved these changes
Dec 14, 2025
Member
Ghabry
left a comment
There was a problem hiding this comment.
manually applied my suggested patch due to author not responding (and to get this nice PR in)
carstene1ns
reviewed
Jan 6, 2026
carstene1ns
approved these changes
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few fixes for minor visual glitches in the EasyRPG Player.
(As well as some other fixes for warnings MSVC spat out)
#2432 / #2932 - Face state not emulated correctly for Message Processing in Parallel events because of the global state of game_system
I added another "hacky flag" in Window_Message (See the FIXME there..) to indicate that a text was pushed in the current frame & renamed an existing one ("close_finished_this_frame").
The initial creation of the window contents has been moved from "StartMessageProcessing" to the Update method. Restructuring the code this way allows us to delay this part of the setup, until the main interpreter scripts have been handled.
I modified Cherry's test project a bit, to also verify that the substitution of variables in the message contents behaves the same:
faceset-parallel.zip
It might make sense to combine all these boolean flags in Window_Message into some enum field (with descriptive names to improve readability), that describes the current state of the window & just remove the "FIXME" comment. Trying to restructure all the code as suggested there would be a major headache & just break other stuff along the way... 🤔
This should also fix some other MessageBox issues that are caused by race conditions between interpreter instances. Have to dig up the issue numbers..#3412 - Incorrect positioning of timer overlay
I already went into detail in the comments of this issue.
#2607 - Parallax background graphics would be rendered on the outside area of the screen when ShakeScreen is applied
While a ShakeScreen effect is active, the area outside of the screen boundaries should not be drawn on.
EasyRPG uses a TiledBlit here, effectively repeating the bitmap everywhere. Could maybe be improved, but I just clear the overdrawn areas afterwards, to emulate RPG_RT behavior.