Skip to content

Conversation

@jetrotal
Copy link
Contributor

@jetrotal jetrotal commented Dec 7, 2025

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 persistence
  • Few Quirks that I could not figure out, e.g.:
    I 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

@jetrotal
Copy link
Contributor Author

jetrotal commented Dec 9, 2025

Also supporting game Info pixels, test map:
Map0003.zip

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.
@jetrotal jetrotal force-pushed the maniacs/drawPictureCommand branch from 4aeebe0 to 1f6990f Compare December 10, 2025 02:17
@Ghabry
Copy link
Member

Ghabry commented Jan 8, 2026

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 uint32_to_rgba performs surprisingly bad (during benchmarking) and I don't really know why as in the end it does the same as a bit shift (I have an improved version locally and it still runs worse for reasons unknown)

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 :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants