gbdev / rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color

Home Page:https://rgbds.gbdev.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: RGBGFX auto-named output to a different directory than input

Rangi42 opened this issue · comments

The -A -P -Q -T RGBGFX flags make it automatically pick a filename for the output attrmap, palette, palmap, and tilemap, based on the filename of the input image.

This request is for two new flags:

  1. A -O flag to automatically pick a filename for the output image (the extension would be .2bpp or .1bpp depending on -d)
  2. A --prefix flag that would set a common directory prefix for all output files, including the -O output image.

For example:

rgbgfx -AOT -p res/palette.pal -q exception.palmap --prefix res sub/dir/title.png

This would output five files:

  • res/title.2bpp
  • res/title.attrmap
  • res/palette.pal
  • exception.palmap
  • res/title.tilemap

Details to note:

  • The specified prefix replaces whatever subdirectories the input image was in.
  • The prefix does not apply to explicitly specified output filenames, only to automatically generated ones.

Both -P and -p are taken, so they can't be short flags for --prefix. I'd propose -F or -X.

Alternative proposal 2: don't add a --prefix flag, just add a -O flag. This flag would not take a parameter, but would change the behavior of -APQT to be based off the output filename, not the input.

For example:

rgbgfx -AT -o res/bar.2bpp gfx/foo.png

This currently creates gfx/foo.attrmap, gfx/foo.tilemap, and res/bar.2bpp.

But:

rgbgfx -O -AT -o res/bar.2bpp gfx/foo.png

This would create res/bar.attrmap, res/bar.tilemap, and res/bar.2bpp.

Note that this would mean you can only get the alternative-prefix functionality by specifying an output image. So you can't just generate, say, an auto-named palette in res/ from an image in gfx/; you have to explicitly specify the palette name. This seems acceptable, since it would be a rare use case and has the explicitly-specified workaround.

For a long option, @ISSOtm proposes --group-outputs.

Blocked by #1235 since that PR changes a lot of auto-output-handling code.