-
Notifications
You must be signed in to change notification settings - Fork 194
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: Add separate Width/Height parameters for scaling pictures, Picture StringVar, Tint Variable #3180
Conversation
Added: - Separate Width and Height value as per .scale2 parameter in ManiacPatch 211010 - Set Height to Width when using picture effects (as per ManiacPatch) - Set both Width and Height to Magnify when using .scale parameter Bugfix: - Fix ManiacPatch picture rotation not fully working
Looking at the failed test, we'll need to compile liblcf using a modified fields_easyrpg file. |
The build failures are normal when depending on lcf changes. You added new easyrpg chunks here. Did you check how maniac patch stores it in the save file? If it isn't something annoying like storing it in some upper bits we usually try to be compatible to mp here. |
src/sprite_picture.cpp
Outdated
@@ -169,7 +181,9 @@ int Sprite_Picture::GetFrameWidth() const { | |||
const auto& data = pic.data; | |||
|
|||
auto& bitmap = GetBitmap(); | |||
assert(bitmap); | |||
if (!bitmap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use assert
for "this should never ever happen during normal execution otherwise it is a bug in the code".
Can you explain how you triggered this "impossible" assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Playing around with my test project, I can consistently crash the engine whenever I do the following in this order:
- We modify a X and Y variable
- We immediately move an anchored picture and set its coordinates to X and Y.
Even if we add an wait period between both commands, it still crashes.
If we invert these steps, it doesn't happen anymore, go figure.
Here's the test project if you want to play around with:
PictureTest-assert.zip
This is definitely something that needs more love. I did try to load saves between original RPG_RT and EasyRPG, it does prints about "unknown chunks" inside the save file. Inside my above test project, you can make an instant save file by pressing SHIFT. Here's the log I've posted on the bug tracker post:
|
While playing around, jumping between RPG_RT, saving, then reading the savefile using LCF2XML, I can determine the following things:
|
I'll recompile liblcf with the proper indexes, then I'll let you know. For instance, using the block 07 for both current_magnify and current_width_scale, since they're the same value internally. I would certainly keep magnify as it is for compatibility reasons. |
As per EasyRPG/liblcf#473, I've updated the chunk pointers. Now I can save and load between Maniacs and EasyRPG, and scaling is kept between the twos. |
Added the following: - Check if we're using a string variable with com.parameters[17] - Set the name parameter to the String Variable Fixed the following: - When using a String Var with ShowPicture, it no longers crash the game with picture ID -1
While testing, I found out the following things: - You cannot mix multiple Variable types for each parameters - When using Variables for Picture Tint, parameter 17 is set to 4096 (0x100), - When using Var Indexes for Picture Tint, parameter 17 is set to 8192 (0x200), - Before, parameters for red, green, blue and saturation were always constants. - Surprisingly this feature doesn't work with ShowStringPicture Added: - Variable and VarIndex support for Tinting using ShowPicture and MovePicture using bitfields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redid parts of the patch so fix some issues. Is now fine for me.
Jenkins: Test this please |
This commit allows for the use of separate Width/Height parameters for rendering pictures.
You can use this feature with ManiacPatch 211010 using the .scale2 parameter.
It also adds scaling support for "Maniac_ShowStringPic" and a quick fix for failed bitmap assertion.
EasyRPG-Scaling.mp4
Sister commit here: EasyRPG/liblcf#473
Added:
Fixed: