Maniacs Patch - Save Image command
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
- Added
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. - Registered the new Maniac event command (
Maniac_SaveImage, command ID 3026) in the interpreter's command dispatcher, allowing it to be invoked from events. - Declared the new command function in the
Game_Interpreterclass header (game_interpreter.h).
Supporting Changes
- Included the
cache.hheader ingame_interpreter.cppto support bitmap effect processing for dynamic image saving.
Could you create a simple test case for me that has these things in it:
- Save entire screen
- Save a single image (you can use
320_240.pngfrom the testgame) with an active spritesheet in all 4 combinations (with effects/without effects + opaque / non-opaque)
(btw wow static vs dynamic is such a awful way to name this. Why not apply effects))
To ensure this works when the save directory is redirected (e.g. web player or game inside a ZIP) FileFinder::OpenImage requires open_generic_with_fallback.
Also saving of a single picture looks pretty complicated. Will see if I can simplify this.
(Note to myself thinking about reusing Sprite functionality)
What the image saving appears to do is:
- When effects are applied its up to
BlitScreenInternbut instead of doing anEffectsBlitit does a normal Blit at0,0 - When no effects are applied it blits
bitmapinstead ofbitmap_effectsbut still uses the spritesheet (Problem: thats not supported by our Sprite code as the spritesheet is considered an "effect")