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

Maniac Patch : Fix String Vars with ShowPicture #3182

Closed
wants to merge 2 commits into from
Closed
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
22 changes: 21 additions & 1 deletion src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2820,14 +2820,26 @@ bool Game_Interpreter::CommandShowPicture(lcf::rpg::EventCommand const& com) { /

if (param_size > 16 && (Player::IsRPG2k3ECommands() || Player::IsPatchManiac())) {
// Handling of RPG2k3 1.12 chunks
pic_id = ValueOrVariable(com.parameters[17], pic_id);
if (com.parameters[17] >= 256 && Player::IsPatchManiac()) {
pic_id = ValueOrVariableBitfield(com.parameters[17], 0, pic_id);
params.name = ToString(CommandStringOrVariableBitfield(com, 17, 2, 30));
} else {
pic_id = ValueOrVariable(com.parameters[17], pic_id);
}
if (com.parameters[19] != 0) {
int var = 0;
if (Main_Data::game_variables->IsValid(com.parameters[19])) {
var = Main_Data::game_variables->Get(com.parameters[19]);
}
params.name = PicPointerPatch::ReplaceName(params.name, var, com.parameters[18]);
}
if (com.parameters[17] >= 4096 && Player::IsPatchManiac()) {
// Color tint using variables
params.red = ValueOrVariableBitfield(com.parameters[17], 3, params.red);
params.green = ValueOrVariableBitfield(com.parameters[17], 3, params.green);
params.blue = ValueOrVariableBitfield(com.parameters[17], 3, params.blue);
params.saturation = ValueOrVariableBitfield(com.parameters[17], 3, params.saturation);
}
params.magnify = ValueOrVariable(com.parameters[20], params.magnify);
params.top_trans = ValueOrVariable(com.parameters[21], params.top_trans);
if (com.parameters[22] > 0) {
Expand Down Expand Up @@ -2943,6 +2955,14 @@ bool Game_Interpreter::CommandMovePicture(lcf::rpg::EventCommand const& com) { /
// RPG2k and RPG2k3 1.10 do not support this option
params.bottom_trans = params.top_trans;

if (com.parameters[17] >= 4096 && Player::IsPatchManiac()) {
// Color tint using variables
params.red = ValueOrVariableBitfield(com.parameters[17], 3, params.red);
params.green = ValueOrVariableBitfield(com.parameters[17], 3, params.green);
params.blue = ValueOrVariableBitfield(com.parameters[17], 3, params.blue);
params.saturation = ValueOrVariableBitfield(com.parameters[17], 3, params.saturation);
}

if (Player::IsPatchManiac() && param_size > 16) {
int flags = com.parameters[16] >> 8;
int blend_mode = flags & 3;
Expand Down