Player icon indicating copy to clipboard operation
Player copied to clipboard

Maniacs Patch - Save Image command

Open jetrotal opened this issue 1 month ago • 2 comments

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 CommandManiacSaveImage to Game_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_Interpreter class header (game_interpreter.h).

Supporting Changes

  • Included the cache.h header in game_interpreter.cpp to support bitmap effect processing for dynamic image saving.

jetrotal avatar Dec 04 '25 17:12 jetrotal

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.png from 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.

Ghabry avatar Dec 07 '25 14:12 Ghabry

Map0002.zip

Test cases + both output from maniacs and ours provide.

jetrotal avatar Dec 07 '25 16:12 jetrotal

(Note to myself thinking about reusing Sprite functionality)

What the image saving appears to do is:

  • When effects are applied its up to BlitScreenIntern but instead of doing an EffectsBlit it does a normal Blit at 0,0
  • When no effects are applied it blits bitmap instead of bitmap_effects but still uses the spritesheet (Problem: thats not supported by our Sprite code as the spritesheet is considered an "effect")

Ghabry avatar Dec 15 '25 11:12 Ghabry