Maniacs Patch - SetPicturePixel Command + GetPictureInfo Update#3501
Maniacs Patch - SetPicturePixel Command + GetPictureInfo Update#3501jetrotal wants to merge 17 commits intoEasyRPG:masterfrom
Conversation
Implements the CommandManiacSaveImage function, allowing saving of screen or picture images to disk
…d fallback on loading image Better handle opaque and effects flags Added support for cropping spritesheet frames Updated FileFinder to use open_generic_with_fallback for image loading.
|
Also supporting game Info pixels, test map: |
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 :). |
…d_file_with_fallback Removed the find file function as was unused
Now matches exactly what Maniacs is saving
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.
…ading of screen and pictures with it
|
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). |
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
1f6990f to
55307fd
Compare
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