Maniacs Patch - SetPicturePixel Command + GetPictureInfo Update#3501
Maniacs Patch - SetPicturePixel Command + GetPictureInfo Update#3501jetrotal wants to merge 11 commits into
Conversation
|
Also supporting game Info pixels, test map: |
Adds support for extracting raw pixel data from pictures, including window-type pictures with forced refresh. Optimizes out-of-bounds handling to preserve variable values and ensures only 32-bit bitmaps are processed. Existing logic for info types 0, 1, and 2 remains unchanged.
Added support for the 'Pixel Info' option in the CommandManiacGetGameInfo function. This captures a screen region, extracts pixel data as packed AARRGGBB values, and stores them in game variables, matching Maniacs behavior. Out-of-bounds pixels are skipped, and alpha is forced to opaque.
Implements the CommandManiacSetPicturePixel function to allow direct pixel manipulation of game pictures via event commands. Handles bitmap uniqueness, format conversion, and window picture detachment to ensure safe editing. Updates command dispatch logic and header declaration.
4aeebe0 to
1f6990f
Compare
|
Imo that's a good base but (while testing) I will try to optimize this for max performance. I read discussions in various RPG Maker chatrooms about the performance of these pixel operations in Maniacs so lets make this fast. You cannot know this but the function Should be faster to convert the entire relevant picture area in one go via Pixman to the format the Var Array wants and then memcpy it from/to the Variable array. But will also have to bench this :). |
|
There is one edge-case I probably cannot fix: Reading from transparent pixel. E.g. Actor1 has a green background which becomes transparent. When reading now such a transparent pixel:
Premultiplied alpha is pretty standard when doing graphic processing so most libraries use it (including pixman). |
1f6990f to
55307fd
Compare
55307fd to
54f7ce3
Compare
54f7ce3 to
9f285c6
Compare
9f285c6 to
2440552
Compare
Ghabry
left a comment
There was a problem hiding this comment.
To the surprise of noone there was no feedback from the community or the examples were such a brainfck that they needed 10 other features we dont support yet.
So the only two options we have are:
- Keep this in limbo forever
- yolo merge and then wait for people complaining in a few days because they found a bug in the feature
Not touching big endian as this would require further testing. Has the same base performance as ABGR so is okay to use. Makes Masked Blit much faster (see EasyRPG#3497), Pixman fast path probably? Also is the format used by Maniacs so the pixel operations are faster
Most compatible with what Maniacs is doing At least we can load Maniacs images but Maniacs shows nothing
Otherwise an old version of the Picture will be loaded next time ShowPicture is used
2440552 to
d71fd26
Compare
I could try to find time during the week to test the commands if needed, once I'm done working on some other stuffs. Is the SetPicturePixel command the one called About lacking feedback from the community on such pull requests, I think there are several things:
If I had suggestions on what could be done to improve that, I think calls for testers could potentially be done:
Perhaps having a tag for pull requests looking for testers could also be a thing, if it can help. |
Another one that must come in pairs:
SetPicturePixel Command
Implements the CommandManiacSetPicturePixel function to allow direct pixel manipulation of game pictures via event commands. Handles bitmap uniqueness, format conversion, and window picture detachment to ensure safe editing. Updates command dispatch logic and header declaration.
Update - GetPictureInfo (pixel data extraction)
Adds support for extracting raw pixel data from pictures, including window-type pictures with forced refresh. Optimizes out-of-bounds handling to preserve variable values and ensures only 32-bit bitmaps are processed. Existing logic for info types 0, 1, and 2 remains unchanged.
TODO:
Save persistenceI assumed some opacity changes between maniacs and easyRPG were due to out of bounds color picking. But I was wrong, someone smarter than me could help me with that.
Map0003.zip