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

Maniacs Feature - Remove scaling restrictions for pictures #3249

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2857,9 +2857,9 @@ bool Game_Interpreter::CommandShowPicture(lcf::rpg::EventCommand const& com) { /
}

params.magnify_width = ValueOrVariableBitfield(com.parameters[20], 0, params.magnify_width);
if (Player::IsPatchManiac() && com.parameters.size() > 31 && com.parameters[20] >= 16 && params.effect_mode == 0) {
if (Player::IsPatchManiac() && com.parameters.size() > 31 && com.parameters[20] >= 16) {
// The >= 16 check is needed because this bit is set when independent width/height scaling is used
// When using special effects on Maniacs, Height is set to Width
// Since version 240423, Maniacs supports width/height scaling for special effects pictures.
params.magnify_height = ValueOrVariableBitfield((com.parameters[20] >> 1), 1, com.parameters[31]);
} else {
params.magnify_height = params.magnify_width;
Expand Down Expand Up @@ -2984,9 +2984,9 @@ bool Game_Interpreter::CommandMovePicture(lcf::rpg::EventCommand const& com) { /
}

params.magnify_width = ValueOrVariableBitfield(com.parameters[20], 0, params.magnify_width);
if (Player::IsPatchManiac() && com.parameters.size() > 18 && com.parameters[20] >= 16 && params.effect_mode == 0) {
if (Player::IsPatchManiac() && com.parameters.size() > 18 && com.parameters[20] >= 16) {
// The >= 16 check is needed because this bit is set when independent width/height scaling is used
// When using special effects on Maniacs, Height is set to Width
// Since version 240423, Maniacs supports width/height scaling for special effects pictures.
params.magnify_height = ValueOrVariableBitfield((com.parameters[20] >> 1), 1, com.parameters[18]);
} else {
params.magnify_height = params.magnify_width;
Expand Down
4 changes: 4 additions & 0 deletions src/sprite_picture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ void Sprite_Picture::Draw(Bitmap& dst) {
SetFlipY((data.easyrpg_flip & lcf::rpg::SavePicture::EasyRpgFlip_y) == lcf::rpg::SavePicture::EasyRpgFlip_y);
SetBlendType(data.easyrpg_blend_mode);

// Don't draw anything if zoom is at zero, helps avoid a glitchy rotated sprite in the top left corner
if (GetZoomX() <= 0.0 || GetZoomY() <= 0.0) {
return;
}
Sprite::Draw(dst);
}

Expand Down
Loading