| 2878 | } |
| 2879 | |
| 2880 | bool Game_Interpreter::CommandMovePicture(lcf::rpg::EventCommand const& com) { // code 11120 |
| 2881 | // Older versions of RPG_RT block pictures when message active. |
| 2882 | if (!Player::IsEnglish() && !Player::IsPatchUnlockPics() && Game_Message::IsMessageActive()) { |
| 2883 | return false; |
| 2884 | } |
| 2885 | |
| 2886 | int pic_id = com.parameters[0]; |
| 2887 | |
| 2888 | Game_Pictures::MoveParams params; |
| 2889 | // Maniac Patch uses the upper bits for X/Y origin, mask it away |
| 2890 | int pos_mode = ManiacBitmask(com.parameters[1], 0xFF); |
| 2891 | params.position_x = ValueOrVariable(pos_mode, com.parameters[2]); |
| 2892 | params.position_y = ValueOrVariable(pos_mode, com.parameters[3]); |
| 2893 | params.magnify_width = com.parameters[5]; |
| 2894 | params.magnify_height = params.magnify_width; |
| 2895 | params.top_trans = com.parameters[6]; |
| 2896 | params.red = com.parameters[8]; |
| 2897 | params.green = com.parameters[9]; |
| 2898 | params.blue = com.parameters[10]; |
| 2899 | params.saturation = com.parameters[11]; |
| 2900 | params.effect_mode = com.parameters[12]; |
| 2901 | params.effect_power = com.parameters[13]; |
| 2902 | params.duration = com.parameters[14]; |
| 2903 | |
| 2904 | struct { |
| 2905 | bool wait = false; |
| 2906 | // Starting from here are Maniac Extensions |
| 2907 | // TODO: The extensions are not implemented |
| 2908 | bool relative = false; // new position is relative to current |
| 2909 | // when true these values preserve the values from a previous Show/MovePicture call |
| 2910 | bool preserve_tone = false; |
| 2911 | bool preserve_effect_mode = false; |
| 2912 | bool preserve_blend_mode = false; |
| 2913 | bool preserve_flip = false; |
| 2914 | bool preserve_duration = false; |
| 2915 | // Coordinates consider the scaled picture (when the origin is not centered) |
| 2916 | bool position_scaled = false; |
| 2917 | } options; |
| 2918 | |
| 2919 | if (Player::IsPatchManiac()) { |
| 2920 | int opts = com.parameters[15]; |
| 2921 | options.wait = (opts & (1 << 0)) > 0; |
| 2922 | options.relative = (opts & (1 << 1)) > 0; |
| 2923 | options.preserve_tone = (opts & (1 << 2)) > 0; |
| 2924 | options.preserve_effect_mode = (opts & (1 << 3)) > 0; |
| 2925 | options.preserve_blend_mode = (opts & (1 << 4)) > 0; |
| 2926 | options.preserve_flip = (opts & (1 << 5)) > 0; |
| 2927 | options.preserve_duration = (opts & (1 << 6)) > 0; |
| 2928 | // Bit 7 is unused |
| 2929 | options.position_scaled = (opts & (1 << 8)) > 0; |
| 2930 | } else { |
| 2931 | options.wait = com.parameters[15] != 0; |
| 2932 | } |
| 2933 | |
| 2934 | size_t param_size = com.parameters.size(); |
| 2935 | |
| 2936 | if (Player::IsRPG2k() || Player::IsRPG2k3E() || Player::IsPatchManiac()) { |
| 2937 | if (param_size > 17 && (Player::IsRPG2k3ECommands() || Player::IsPatchManiac())) { |
nothing calls this directly
no test coverage detected