Skip to content

Commit

Permalink
Merge pull request #3249 from ToolMan2k/PictureScaling
Browse files Browse the repository at this point in the history
Maniacs Feature - Remove scaling restrictions for pictures
  • Loading branch information
Ghabry authored Sep 2, 2024
2 parents 2c06256 + 7d0401b commit 8c269b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2732,9 +2732,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 @@ -2859,9 +2859,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

0 comments on commit 8c269b9

Please sign in to comment.