Conversation
Implements the CommandManiacSaveImage function, allowing saving of screen or picture images to disk
There was a problem hiding this comment.
Pull request overview
This PR implements the CommandManiacSaveImage function for the Maniac Patch, enabling event commands to save either the current screen or a specified picture to disk as a PNG file. The implementation supports dynamic rendering effects (color tone, flash, flip) and an option to force opaque pixels.
Key Changes
- Added
CommandManiacSaveImagehandler that supports saving screen captures or individual picture images with optional dynamic effects and opacity modifications - Registered the new Maniac event command (ID 3026) in the command dispatcher
- Included
cache.hheader to enable bitmap effect processing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/game_interpreter.h | Declares the new CommandManiacSaveImage method in the Game_Interpreter class |
| src/game_interpreter.cpp | Implements the save image command with screen/picture capture, dynamic effects application, opacity handling, and PNG file writing; registers command 3026 in the dispatcher; includes cache.h for bitmap effects |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Could you create a simple test case for me that has these things in it:
(btw wow To ensure this works when the save directory is redirected (e.g. web player or game inside a ZIP) Also saving of a single picture looks pretty complicated. Will see if I can simplify this. |
…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.
|
Test cases + both output from maniacs and ours provide. |
|
(Note to myself thinking about reusing Sprite functionality) What the image saving appears to do is:
|
…d_file_with_fallback Removed the find file function as was unused
Now matches exactly what Maniacs is saving
a472015 to
035e141
Compare
Ghabry
left a comment
There was a problem hiding this comment.
simplified the logic in the command and implemented RGBA saving. Matches now exactly what Maniacs does
Implements the CommandManiacSaveImage function, allowing saving of screen or picture images to disk with options for dynamic effects and opacity. Registers the new command in ExecuteCommand and updates the header file with its declaration.
Maniac Patch: Image Saving Support
CommandManiacSaveImagetoGame_Interpreter, which enables saving either the current screen or a specified picture to a PNG file. The command supports dynamic mode (applying color tone, flash, flip effects) and an option to force opaque pixels.Maniac_SaveImage, command ID 3026) in the interpreter's command dispatcher, allowing it to be invoked from events.Game_Interpreterclass header (game_interpreter.h).Supporting Changes
cache.hheader ingame_interpreter.cppto support bitmap effect processing for dynamic image saving.